/* ============================================================
   PASSPORT GATEWAY — Shared Navbar
   Extends the original site-header design (cream bg, Playfair brand)
   adding nav links and a mobile hamburger. Visual identity unchanged.
   ============================================================ */

:root {
  --nav-height: 80px;
}

/* Sticky wrapper — sticky on the header so the nav never exits its own parent */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Base nav — cream bg + subtle gold circle pattern ──────── */
.site-nav {
  background-color: rgba(247, 244, 236, 0.95);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23C9A24A' stroke-width='1.5' opacity='0.13'><circle cx='0' cy='70' r='70'/><circle cx='70' cy='0' r='70'/><circle cx='140' cy='70' r='70'/><circle cx='70' cy='140' r='70'/><circle cx='70' cy='70' r='70'/></g></svg>");
  background-size: 140px 140px;
  background-position: top left;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(201, 162, 74, 0.18);
}

/* ── Inner flex row ────────────────────────────────────────── */
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-3);
  min-height: var(--nav-height);
}

/* ── Brand — restored: 56px logo + Playfair + sub-text ─────── */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  display: block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-brand:hover .nav-logo {
  transform: translateY(-1px);
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.nav-brand-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--color-navy);
}

.nav-brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 700;
}

/* ── Menu wrapper ──────────────────────────────────────────── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

/* ── Page navigation links (editorial style) ───────────────── */
.nav-page-btns {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.nav-btn-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.nav-page-btn:hover {
  color: var(--color-navy);
}

.nav-page-btn:hover .nav-btn-icon {
  opacity: 1;
}

.nav-page-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Active page — gold text + gold underline */
.nav-page-btn--active {
  color: var(--color-gold) !important;
  border-bottom-color: var(--color-gold);
  font-weight: 600;
}

.nav-page-btn--active .nav-btn-icon {
  opacity: 1;
}

/* ── Nav link lists ────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--color-navy);
}

.nav-link:focus-visible {
  color: var(--color-navy);
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.nav-link.is-active {
  color: var(--color-gold);
  font-weight: 600;
}

/* ── Circle separator ──────────────────────────────────────── */
.nav-sep {
  font-size: 7px;
  color: var(--color-gold);
  opacity: 0.7;
  flex-shrink: 0;
  user-select: none;
}

/* ── Language switch — restored original white pill style ───── */
.site-nav .lang-switch {
  display: inline-flex;
  background: var(--color-white);
  border: 1px solid rgba(27, 42, 91, 0.15);
  border-radius: var(--radius-pill);
  padding: 3px;
  flex-shrink: 0;
}

.site-nav .lang-switch button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav .lang-switch button.active,
.site-nav .lang-switch button[aria-pressed="true"] {
  background: var(--color-navy);
  color: var(--color-text-on-dark);
}

.site-nav .lang-switch button:not([aria-pressed="true"]):hover {
  color: var(--color-navy);
}

.site-nav .lang-switch button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ── Hamburger — navy lines on cream bg ────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 7px;
  background: transparent;
  border: 1px solid rgba(27, 42, 91, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-navy);
  border-radius: 1px;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ── Scroll offset for sticky nav ──────────────────────────── */
section[id] {
  scroll-margin-top: var(--nav-height);
}

/* ── Backdrop fade-in keyframe ──────────────────────────────── */
@keyframes nav-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Mobile drawer — in <body>, hidden on desktop ──────────── */
.nav-drawer {
  display: none;
}

/* ── Mobile (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu   { display: none; }

  /* Right-slide drawer — body-level element, slides in from the right */
  .nav-drawer {
    display: flex;
    position: fixed;
    top: 80px;
    right: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    flex-direction: column;
    padding: 28px 20px 28px;
    overflow-y: auto;
    overflow-x: hidden;

    background-color: #F7F4EC;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23C9A24A' stroke-width='1.5' opacity='0.13'><circle cx='0' cy='70' r='70'/><circle cx='70' cy='0' r='70'/><circle cx='140' cy='70' r='70'/><circle cx='70' cy='140' r='70'/><circle cx='70' cy='70' r='70'/></g></svg>");
    background-size: 140px 140px;
    border-left: 1px solid rgba(201, 162, 74, 0.25);
    box-shadow: -8px 0 40px rgba(10, 15, 34, 0.2);
    z-index: 300;

    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.3s;
  }

  .nav-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
  }

  /* Section label above links */
  .nav-drawer .nav-page-btns::before {
    content: "Menu";
    display: block;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    padding: 0 14px 16px;
  }

  /* Nav links block */
  .nav-drawer .nav-page-btns {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(201, 162, 74, 0.2);
  }

  /* Each nav link row */
  .nav-drawer .nav-page-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #4A5568;
    border: none;
    border-bottom: none;
    border-radius: 10px;
    white-space: normal;
    background: transparent;
    transition: background 0.15s ease, color 0.15s ease;
  }

  /* Gold left-edge accent on active link */
  .nav-drawer .nav-page-btn::after {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    background: #C9A24A;
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .nav-drawer .nav-page-btn:hover {
    background: rgba(27, 42, 91, 0.05);
    color: #1B2A5B;
  }

  .nav-drawer .nav-page-btn--active {
    color: #C9A24A !important;
    background: rgba(201, 162, 74, 0.09);
    font-weight: 600;
    border-bottom: none;
  }

  .nav-drawer .nav-page-btn--active::after {
    opacity: 1;
  }

  .nav-drawer .nav-btn-icon {
    flex-shrink: 0;
    opacity: 0.65;
    width: 17px;
    height: 17px;
  }

  .nav-drawer .nav-page-btn--active .nav-btn-icon,
  .nav-drawer .nav-page-btn:hover .nav-btn-icon {
    opacity: 1;
  }

  /* Language switch — full-width segmented control with label */
  .nav-drawer .lang-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  /* "Language / Idioma" eyebrow via pseudo-element */
  .nav-drawer .lang-switch::before {
    content: "Language / Idioma";
    flex-basis: 100%;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(201, 162, 74, 0.85);
    margin-bottom: 4px;
    padding-left: 2px;
  }

  .nav-drawer .lang-switch button {
    flex: 1;
    padding: 11px 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 10px;
    border: 1px solid rgba(201, 162, 74, 0.22);
    cursor: pointer;
    background: transparent;
    color: #6B7280;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .nav-drawer .lang-switch button[aria-pressed="true"] {
    background: #1B2A5B;
    color: #F7F4EC;
    border-color: #1B2A5B;
    box-shadow: 0 2px 8px rgba(10, 15, 34, 0.18);
  }

  .nav-drawer .lang-switch button:not([aria-pressed="true"]):hover {
    background: rgba(201, 162, 74, 0.08);
    color: #1B2A5B;
    border-color: rgba(201, 162, 74, 0.35);
  }

  /* Backdrop */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 34, 0.45);
    z-index: 200;
    animation: nav-backdrop-in 0.22s ease forwards;
  }
}

/* ── Very small screens: scale down brand text instead of hiding ─ */
@media (max-width: 400px) {
  .nav-brand-text strong { font-size: 0.88rem; }
  .nav-brand-sub { font-size: 0.6rem; letter-spacing: 0.12em; }
  .nav-logo { width: 40px; height: 40px; }
}
