/* ── Base ───────────────────────────────────────────────────── */
html {
  /* Keep the 16px root on mobile too — a 14px root shrank every rem-based
     label below legible size (some down to ~10px) on phones. */
  font-size: 16px;
  position: relative;
  min-height: 100%;
  scroll-padding-top: 80px; /* anchor targets clear the fixed header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin-bottom: 0;
  overflow-x: hidden; /* Prevent horizontal scroll from any element overflowing */
  -webkit-tap-highlight-color: transparent;
}

/* Visible keyboard focus everywhere (mouse clicks stay clean) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* iOS Safari zooms the page when a focused field is < 16px */
@media (max-width: 767px) {
  input:not([type="checkbox"]):not([type="radio"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Prevent scroll when mobile drawer is open */
body.drawer-open {
  overflow: hidden;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ── Navbar Brand ───────────────────────────────────────────── */
.navbar-brand-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.navbar-brand-logo:hover {
  opacity: 0.85;
}

/* ── Desktop Nav Links ──────────────────────────────────────── */
.nav-links {
  gap: 4px;
}

.nav-link-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
  position: relative;
}

.nav-link-item:hover {
  color: var(--color-text-main);
  background: transparent;
}

.nav-link-item.active {
  color: var(--color-text-main);
  background: transparent;
  font-weight: 600;
}

/* Remove the old gradient active indicator */
.nav-link-item.active::after {
  display: none;
}

[data-theme="light"] .nav-link-item.active {
  color: var(--color-text-main);
  background: transparent;
}

/* ── Mobile Drawer Overlay ──────────────────────────────────── */
#mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1099;
  cursor: pointer;
  opacity: 0;
  transition: opacity 300ms ease;
}

#mobile-drawer-overlay.show {
  display: block;
  opacity: 1;
}

/* ── Mobile Drawer ──────────────────────────────────────────── */
#mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  height: 100dvh;
  width: min(340px, 88vw);
  background: var(--color-surface-white);
  border-left: 1px solid var(--color-border);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), visibility 300ms;
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.12);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0;
  padding-inline: 1.25rem 1rem;
  border-bottom: 1px solid var(--color-border);
  min-height: 64px;
  margin: 0;
  flex-shrink: 0;
}

.mobile-drawer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
}

.mobile-nav-links {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 1rem 0.75rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 1rem;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  color: var(--color-text-main);
  text-decoration: none;
  font-family: 'Space Grotesk', var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
  position: relative;
}

.mobile-nav-link:hover {
  color: var(--color-text-main);
  background: var(--color-surface-soft);
}

.mobile-nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.mobile-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.mobile-drawer-footer .hero-btn-primary {
  min-height: 48px;
}

.mobile-lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.mobile-lang-switch:hover {
  background: var(--color-surface-soft);
  color: var(--color-text-main);
}

/* Language pill in the header */
.nav-lang-switch {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 12px;
  min-height: 38px;
  gap: 6px;
  color: var(--color-text-main);
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb-wrapper {
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
}

[data-theme="light"] .breadcrumb-wrapper {
  background: rgba(248, 250, 252, 0.8);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item a {
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.breadcrumb-item a:hover {
  color: var(--color-primary);
}

.breadcrumb-item span[aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumb-sep {
  font-size: 0.6rem;
  color: var(--color-text-muted);
}

/* ── Footer — Minimal editorial ─────────────────────────────── */
.site-footer {
  background: var(--color-surface-white);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-built {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-built a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-built a:hover {
  color: var(--color-primary);
}

@media (max-width: 575px) {
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ── Utility ────────────────────────────────────────────────── */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.w-100 { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  #mobile-drawer {
    transition: none !important;
  }
  #mobile-drawer-overlay {
    transition: none !important;
  }
}
/* ── Skip link (visible only on keyboard focus) ─────────────── */
.skip-nav:focus {
  position: fixed !important;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 10001;
  padding: 10px 18px;
  background: var(--color-text-main);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

/* ── Footer links — comfortable tap targets ─────────────────── */
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-inline-end: -10px;
}

.footer-links .footer-built {
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
}

.footer-links .footer-built:hover {
  background: var(--color-surface-soft);
}

@media (max-width: 767px) {
  .footer-links {
    margin-inline: -10px;
  }
}

/* ── Mobile tap-target sizing for small inline links ────────── */
@media (max-width: 767px) {
  .ed-link-arrow,
  .pf-back-link,
  a.ed-contact-value {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .nav-lang-switch {
    min-height: 40px;
  }
}
