/* ─────────────────────────────────────────────────────────────────
   Public site header (.ab-header). One slim bar: logo, main links,
   then the account group (language, share, log in, sign up).
   Loaded last on public pages, so it overrides main.css / abvents.css.
   ───────────────────────────────────────────────────────────────── */
:root { --hdr-h: 74px; --hdr-h-scrolled: 64px; --hdr-bg: rgba(10, 20, 36, .94); }

.ab-header { background: transparent; }
.ab-header .branding {
  position: relative;
  min-height: var(--hdr-h);
  padding: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  transition: min-height .25s ease, box-shadow .25s ease;
}
/* The frosted surface lives on a layer behind the bar: a backdrop-filter on the bar
   itself would trap the fixed-position mobile drawer inside the bar's 64px */
.ab-header .branding::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--hdr-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  transition: background .25s ease;
}
.ab-header .branding > .container { position: relative; z-index: 1; }
.scrolled .ab-header .branding {
  min-height: var(--hdr-h-scrolled);
  box-shadow: 0 10px 30px rgba(6, 12, 24, .28);
}
.scrolled .ab-header .branding::before { background: rgba(10, 20, 36, .95); }

/* Header type: the site's sans-serif, not the theme's slab nav font */
.ab-header .navmenu a,
.ab-header .navmenu a:focus { font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* Logo lockup */
.ab-header .logo { gap: 10px; text-decoration: none; }
.ab-header .logo img { width: 34px; height: 34px; margin: 0; max-height: none; }
.ab-header .logo .sitename {
  font-family: 'Cinzel', serif; font-size: 21px; font-weight: 600; color: #fff;
  letter-spacing: .14em; line-height: 1;
}

/* ── Desktop ─────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  .ab-header .navmenu { flex: 1; margin-left: 28px; }
  .ab-header .navmenu > ul { display: flex; align-items: center; gap: 2px; width: 100%; }
  .ab-header .navmenu > ul > li.nav-spacer { flex: 1; order: 10; }

  /* Main links: soft pill on hover, accent bar under the current page */
  .ab-header .navmenu > ul > li > a,
  .ab-header .navmenu > ul > li > a:focus {
    position: relative;
    padding: 9px 13px !important;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .78) !important;
    opacity: 1;
    transition: color .2s, background .2s;
  }
  .ab-header .navmenu > ul > li > a:hover,
  .ab-header .navmenu > ul > li.dropdown:hover > a {
    color: #fff !important;
    background: rgba(255, 255, 255, .07);
  }
  .ab-header .navmenu > ul > li > a.active,
  .ab-header .navmenu > ul > li.active-parent > a { color: #fff !important; }
  .ab-header .navmenu > ul > li > a.active::after,
  .ab-header .navmenu > ul > li.active-parent > a::after {
    content: ""; position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
    width: 18px; height: 3px; border-radius: 3px; background: var(--accent-color, #e07844);
  }
  .ab-header .navmenu li:last-child a { padding-right: 13px; }

  /* Account group, in this order after the spacer */
  .ab-header .navmenu > ul > li.ab-nav-lang   { order: 11; padding: 0 6px 0 14px; margin-left: 4px; border-left: 1px solid rgba(255,255,255,.12); }
  .ab-header .navmenu > ul > li#share-nav-item { order: 12; }
  .ab-header .navmenu > ul > li#auth-dropdown  { order: 13; }
  .ab-header .navmenu > ul > li#login-link     { order: 14; }
  .ab-header .navmenu > ul > li#register-link  { order: 15; margin-left: 4px; }

  /* Share: round icon button */
  .ab-header #share-nav-item a.nav-share {
    width: 38px; height: 38px; padding: 0 !important; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,.07); color: #fff !important;
  }
  .ab-header #share-nav-item a.nav-share span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ab-header #share-nav-item a.nav-share i { font-size: 15px; margin: 0; }
  .ab-header #share-nav-item a.nav-share:hover { background: rgba(255,255,255,.14); }
  .ab-header #share-nav-item a.nav-share::after { display: none; }

  /* Log in: quiet text link; Sign up: the one bright button */
  .ab-header a.nav-login { font-weight: 600 !important; color: #fff !important; }
  .ab-header a.nav-login.active::after { display: none; }
  .ab-header .navmenu a.btn-register {
    padding: 10px 20px !important;
    border-radius: 999px;
    font-weight: 600;
    color: #fff !important;
    background: linear-gradient(135deg, #ea8a55, #d4652f);
    box-shadow: 0 6px 18px rgba(224, 120, 68, .35);
  }
  .ab-header .navmenu a.btn-register:hover { background: linear-gradient(135deg, #e07844, #c2581f); color: #fff !important; }
  .ab-header .navmenu a.btn-register.active::after { display: none; }

  /* Signed in: account pill */
  .ab-header a.nav-account { gap: 8px; background: rgba(255,255,255,.07); border-radius: 999px !important; padding: 7px 14px 7px 8px !important; }
  .ab-header a.nav-account > i.bi-person-circle { font-size: 22px; margin: 0; color: #f2c98f; }
  .ab-header a.nav-account span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

  /* Dropdown panels */
  .ab-header .navmenu .dropdown ul {
    left: 0; top: calc(100% + 14px); min-width: 230px; padding: 8px;
    background: #fff; border-radius: 14px; border: 1px solid rgba(15, 26, 46, .06);
    box-shadow: 0 22px 50px rgba(6, 12, 24, .22);
  }
  .ab-header .navmenu .dropdown:hover > ul { top: calc(100% + 6px); }
  .ab-header .navmenu #auth-dropdown ul { left: auto; right: 0; }
  .ab-header .navmenu .dropdown ul li { min-width: 0; }
  .ab-header .navmenu .dropdown ul a,
  .ab-header .navmenu .dropdown ul a:focus {
    justify-content: flex-start; gap: 12px; padding: 10px 12px !important; border-radius: 10px;
    font-size: 14.5px; color: #291812 !important;
  }
  .ab-header .navmenu .dropdown ul a i { font-size: 16px; margin: 0; line-height: 1; color: var(--accent-color, #e07844); }
  .ab-header .navmenu .dropdown ul a:hover,
  .ab-header .navmenu .dropdown ul a.active { background: #fbf1ea; color: #c2581f !important; }
  /* Invisible bridge so the menu doesn't close crossing the gap */
  .ab-header .navmenu .dropdown > ul::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
}

/* Narrow desktops: tighten so everything fits on one line */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .ab-header .navmenu { margin-left: 18px; }
  .ab-header .navmenu > ul > li > a,
  .ab-header .navmenu > ul > li > a:focus { padding: 9px 9px !important; font-size: 14px; }
  .ab-header .logo .sitename { font-size: 19px; }
}

/* ── Tablet and phone: logo + menu button, links in a side drawer ── */
@media (max-width: 1199.98px) {
  .ab-header .branding { min-height: 64px; }
  .ab-header .navmenu > ul > li.nav-spacer { display: none; }
  .ab-header .mobile-nav-toggle {
    width: 42px; height: 42px; margin: 0; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff !important; background: rgba(255,255,255,.08);
  }
  .mobile-nav-active .ab-header .mobile-nav-toggle { background: #fff; color: var(--accent-color, #e07844) !important; top: 11px; right: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
  .mobile-nav-active .ab-header .navmenu > ul { padding-top: 76px; }
  .mobile-nav-active .ab-header .navmenu .dropdown ul a { display: flex !important; gap: 10px; justify-content: flex-start; }
  .mobile-nav-active .ab-header .navmenu .dropdown ul a i { color: var(--accent-color, #e07844); }
  .mobile-nav-active .ab-header #share-nav-item a.nav-share { display: flex !important; gap: 10px; justify-content: flex-start; }
  .mobile-nav-active .ab-header a.nav-account { display: flex !important; gap: 10px; }
  .ab-header .logo .sitename { font-size: 18px; }
  .ab-header .logo img { width: 30px; height: 30px; }

  /* Drawer: "More" keeps its arrow on the same row */
  .mobile-nav-active .ab-header .navmenu .dropdown > a { display: flex !important; align-items: center; justify-content: space-between; }
  .mobile-nav-active .ab-header .navmenu .dropdown > a .toggle-dropdown { margin-left: auto; }
  .mobile-nav-active .ab-header .navmenu .dropdown > ul { margin: 0 0 6px 12px; padding: 4px 0; box-shadow: none; border-left: 2px solid #f3e4da; border-radius: 0; }

  .mobile-nav-active .ab-header .navmenu a.btn-register { color: #fff !important; font-size: 15px; font-weight: 600; background: linear-gradient(135deg, #ea8a55, #d4652f); border-radius: 12px; }

  /* Drawer: language switch as a clean two-option pill */
  .mobile-nav-active .ab-header li.ab-nav-lang { padding: 10px 12px; }
  .mobile-nav-active .ab-header .ab-lang-toggle { background: #f4eee9 !important; border: 1px solid #eadfd6 !important; padding: 4px; gap: 4px; border-radius: 999px; }
  .mobile-nav-active .ab-header .ab-lang-btn {
    width: auto !important; height: auto !important; min-width: 56px; padding: 8px 16px !important;
    border-radius: 999px !important; font-size: 13px !important; line-height: 1 !important;
    background: transparent !important; color: #6b5f59 !important;
  }
  .mobile-nav-active .ab-header .ab-lang-btn.active { background: var(--accent-color, #e07844) !important; color: #fff !important; }
}
/* Small phones: keep the ABVENTS wordmark, just a little tighter */
@media (max-width: 380px) {
  .ab-header .logo { gap: 8px; }
  .ab-header .logo .sitename { font-size: 16px; letter-spacing: .1em; }
  .ab-header .logo img { width: 28px; height: 28px; }
}

/* ── The bar is shorter than the old two-row header: pull content up ── */
.page-title { padding-top: 136px; }
.auth-split-row { margin-top: var(--hdr-h); min-height: calc(100vh - var(--hdr-h)); }
.invitations-page section.pd-hero,
.contributions-page section.pd-hero { padding-top: 140px; }
@media (max-width: 1199.98px) {
  .page-title { padding-top: 116px; }
  .auth-split-row { margin-top: 64px; min-height: calc(100vh - 64px); }
}
@media (max-width: 991.98px) {
  .invitations-page section.pd-hero,
  .contributions-page section.pd-hero { padding-top: 112px; }
}
@media (max-width: 575.98px) {
  .invitations-page section.pd-hero,
  .contributions-page section.pd-hero { padding-top: 100px !important; }
}
