/* Header module (shared across pages) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap');

header{
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  box-shadow: none;
}

header::before, header::after{
  content: none !important;
  box-shadow: none !important;
  filter: none !important;
  background: none !important;
}


/* ===== Desktop alignment: brand left, menu group right ===== */
header{
  display: flex;
  align-items: center;
}
header .logo{
  flex: 0 0 auto;
  margin-right: 0;
}
header .site-nav{
  margin-left: auto;
}
header nav ul{
  justify-content: flex-end;
  flex-wrap: nowrap;
}


header .logo{
  gap: 10px;
}

header .logo .logo-img{
  width: 34px;
  height: 34px;
}

header .logo h1{
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
}

header nav ul{
  gap: 28px;
}

header nav li{
  margin: 0;
}

header nav a{
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: none;
  text-shadow: none;
  filter: none;
}

header nav a:hover{
  box-shadow: none;
  text-shadow: none;
  filter: none;
  opacity: 0.9;
}

/* Make the active pill clearer WITHOUT layout shift (use outline, not border) */
header nav a.active{
  background: rgba(255,255,255,0.12);
  outline: 1px solid rgba(255,255,255,0.35);
  outline-offset: 0px;
  box-shadow: none;
}
/* If any underline style exists elsewhere, disable it (active uses pill) */
header nav a.active::after{
  display: none !important;
}

@media (max-width: 820px){
  header nav ul{ gap: 18px; }
}



/* ===== Flicker reduction for injected header (safe) =====
   - Only hides header while JS is actively injecting (html.cck-header-loading)
   - Prevents a visible "pop" between pages
*/
#site-header{ opacity: 1; }
html.cck-header-loading #site-header{ opacity: 0; }
#site-header.loaded{ opacity: 1; transition: opacity .12s ease; }


/* ===== Home-only micro-shift fix ===== */
/* Ensure Home never changes metrics when becoming active */
header nav a[href$="index.html"],
header nav a[href$="/"]{
  font-weight: 600;
  line-height: 1;
}

/* Neutralize any leftover border on Home and keep pill via outline */
header nav a[href$="index.html"].active,
header nav a[href$="/"].active{
  border: 0 !important;
  outline: 1px solid rgba(255,255,255,0.35);
  outline-offset: 0;
}


/* ===== Mobile hamburger menu (desktop unchanged) ===== */
header .nav-toggle{
  display:none;
  border:0;
  background: transparent;
  padding: 10px;
  margin-left:auto;
  cursor:pointer;
  border-radius: 10px;
}
header .nav-toggle span{
  display:block;
  width: 26px;
  height: 2px;
  margin: 6px 0;
  background: rgba(255,255,255,0.92);
  border-radius: 2px;
}
header .site-nav{ display:block; }

@media (max-width: 820px){
  header{
    position: relative;
    display:flex;
    align-items:center;
    flex-wrap: wrap;
    gap: 10px;
    padding-right: 52px; /* room for the toggle */
  }

  header .logo{
    flex: 1 1 auto;
    min-width: 0;
  }

  header .logo h1{
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    white-space: normal;
  }

  header .nav-toggle{
    display:inline-flex;
    flex-direction:column;
    justify-content:center;
    position: absolute;
    right: 12px;
    top: 12px;
  }

  /* Mobile nav becomes an in-flow panel (doesn't cover the page) */
  header .site-nav{
    display:none;
    position: static;
    width: 100%;
    margin-top: 8px;
    background: rgba(0,8,20,0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
    overflow: hidden;
  }

  header.nav-open .site-nav{ display:block; }

  header nav ul{
    display:flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px;
    margin: 0;
    max-height: 60vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure header stays above page content */
  #site-header{ position: relative; z-index: 10000; }
}
