/* ==========================================================================
   Header + mega menu (loaded after style.css). Used with assets/js/header-client.js
   Menu structure lives in includes/header.php.
   ========================================================================== */
:root { --header-h: 84px; --mega-w: 1200px; }

.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: #fff; color: var(--ink); border-bottom: 1px solid #e6e9ee; transition: background .3s, color .3s, border-color .3s; }
.header-light main { padding-top: var(--header-h); }
.header-overlay .site-header:not(.is-scrolled):not(.is-open):not(.has-search):not(.has-mega) { background: transparent; color: #fff; border-color: transparent; }
.site-header__inner { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* Logo: transparent mark with the tagline underneath, spanning the logo width */
.brand { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 90px; }
.brand img { width: 100%; height: auto; }
.brand__tag { display: block; width: 100%; height: auto; overflow: visible; }
/* Tagline under the logo: white while the header sits transparent over the hero, black once the header is white */
.brand__tag text { font-family: var(--font-body); font-weight: 700; font-size: 6.6px; fill: #000; transition: fill .3s; }
.header-overlay .site-header:not(.is-scrolled):not(.is-open):not(.has-search):not(.has-mega) .brand__tag text { fill: #fff; }

.site-nav { flex: 1; display: flex; justify-content: center; }
.nav-list { display: flex; align-items: stretch; gap: 2px; }
.nav-item { display: flex; align-items: center; }
.nav-link { position: relative; display: flex; align-items: center; height: var(--header-h); padding: 0 13px; font-size: .9375rem; font-weight: 600; white-space: nowrap; transition: color .2s; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .22s; }
.nav-item.is-open > .nav-link, .nav-link.is-active, .nav-link:hover { color: var(--orange-text); }
.header-overlay .site-header:not(.is-scrolled):not(.is-open):not(.has-search):not(.has-mega) .nav-link { color: #fff; }
.header-overlay .site-header:not(.is-scrolled):not(.is-open):not(.has-search):not(.has-mega) .nav-link:hover { color: #fff; }
.nav-item.is-open > .nav-link::after, .nav-link.is-active::after, .nav-link:hover::after { transform: scaleX(1); }
.nav-link:focus-visible, .nav-caret:focus-visible, .mega a:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }

/* Caret: visible next to menu links on desktop, so click/touch can open the menu too */
.nav-caret { display: block; position: relative; width: 22px; height: 44px; margin-left: -8px; border: 0; background: none; color: inherit; cursor: pointer; }
.nav-caret::before { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-50%, -70%) rotate(45deg); transition: transform .2s; }
.nav-item.is-open > .nav-caret::before { transform: translate(-50%, -30%) rotate(-135deg); }

/* Mega panel: full width, directly below the header */
.mega { position: absolute; left: 0; right: 0; top: 100%; background: #fff; color: var(--ink); box-shadow: 0 24px 48px rgba(10, 30, 60, .16); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s; overflow: hidden; }
.nav-item.is-open > .mega { opacity: 1; visibility: visible; transform: none; }
.mega__inner { max-width: calc(var(--mega-w) + 2 * var(--gutter)); margin-inline: auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.mega--links .mega__inner { grid-template-columns: minmax(0, 1fr); padding-block: 28px 32px; }

/* Left column: introduction (neutral panel, no blue) */
.mega__intro { background: #f3f5f8; color: var(--ink); padding: 32px 36px 36px; margin-left: calc(-1 * var(--gutter)); padding-left: var(--gutter); position: relative; box-shadow: -100vw 0 0 #f3f5f8; }
.mega__title { display: inline-block; color: var(--ink); font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: 12px; }
.mega__title:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.mega__intro p { font-size: var(--text-small); line-height: 1.65; max-width: 380px; color: var(--body); }
.mega__more { display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; font-weight: 600; font-size: var(--text-small); color: var(--blue); }
.mega__more .arw { color: var(--blue); }

/* Right column: links, each with a thin circled arrow that slides on hover */
.mega__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; align-content: start; padding: 24px 0 28px 44px; }
.mega--links .mega__links { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
.mega__links a { position: relative; display: block; padding: 12px 44px 12px 0; border-bottom: 1px solid #edf0f4; color: var(--ink); }
.mega__links a .arw { position: absolute; right: 0; top: 50%; margin-top: -14px; color: var(--ink); }
.mega__links a:hover .mega__label { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.mega__label { display: block; font-weight: 600; font-size: var(--text-body); line-height: 1.3; }
.mega__desc { display: block; margin-top: 2px; font-size: .8125rem; line-height: 1.45; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.site-header__tools { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.search-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 0; padding: 0; background: none; color: inherit; cursor: pointer; border-radius: 50%; }
.search-toggle:hover { background: rgba(127, 127, 127, .15); }
.search-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 0; background: none; color: inherit; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, opacity .25s; }
.site-header.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-search { background: #fff; border-top: 1px solid #ececec; box-shadow: 0 18px 40px rgba(0, 0, 0, .12); color: var(--ink); }
.site-search__inner { max-width: calc(760px + 2 * var(--gutter)); margin-inline: auto; padding: 20px var(--gutter) 24px; }
.site-search input { width: 100%; height: 52px; padding: 0 18px; border: 2px solid #e3e3e3; border-radius: 12px; font-size: var(--text-body); outline: 0; }
.site-search input:focus { border-color: var(--orange); }
.site-search__results { margin-top: 12px; max-height: 50vh; overflow: auto; }
.site-search__results li a { display: block; padding: 12px 6px; border-bottom: 1px solid #eee; }
.site-search__results li a:hover, .site-search__results li a:focus { background: #fff6ee; }
.site-search__results b { display: block; font-weight: 600; }
.site-search__results small { color: var(--orange-text); font-weight: 600; margin-right: 8px; }
.site-search__results span { color: var(--body); font-size: var(--text-small); }
.site-search__empty { padding: 12px 6px; color: var(--body); }

/* Tablet + mobile: full-screen menu panel ----------------------------------- */
.menu-top, .menu-close, .menu-bottom { display: none; }
.menu-actions { display: flex; align-items: center; gap: 2px; }
body.menu-open { overflow: hidden; }
@media (max-width: 1100px) {
  :root { --header-h: 72px; }
  .nav-toggle { display: flex; }
  /* Slide-in panel: the header stays put; the menu slides in from the right, directly below it */
  .site-nav { display: flex; position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); z-index: 60; flex-direction: column; justify-content: flex-start; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 clamp(24px, 7vw, 56px); background: #fff; color: var(--ink); border: 0; border-top: 1px solid #e6e9ee; box-shadow: -12px 0 32px rgba(0, 0, 0, .08); transform: translateX(100%); visibility: hidden; pointer-events: none; transition: transform .38s cubic-bezier(.22, .8, .24, 1), visibility 0s linear .38s; will-change: transform; }
  .site-header.is-open .site-nav { transform: none; visibility: visible; pointer-events: auto; transition: transform .38s cubic-bezier(.22, .8, .24, 1), visibility 0s; }

  /* Logo at the very top-left, search + X at the very top-right (edge to edge) */
  .menu-top { display: none !important; align-items: center; justify-content: space-between; margin-inline: calc(-1 * clamp(24px, 7vw, 56px)); padding: max(10px, env(safe-area-inset-top, 0px)) 14px 0 16px; flex: none; }
  .menu-actions { margin-right: -6px; }
  .menu-top .brand { width: clamp(72px, 12vh, 104px); }
  .menu-search { display: grid; place-items: center; width: 46px; height: 46px; margin: 0; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .menu-search svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .menu-close { display: grid; place-items: center; width: 46px; height: 46px; margin: 0; flex: none; padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; }
  .menu-close svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

  .nav-list { flex-direction: column; justify-content: center; gap: 0; margin-top: 0; padding-top: 8px; flex: 1 1 auto; min-height: 0; }
  .nav-item { flex-wrap: wrap; align-items: center; border: 0; }
  .nav-link, .header-overlay .site-header .nav-link { flex: 1; height: auto; padding: clamp(7px, 1.9vh, 14px) 0; font-size: clamp(1.05rem, min(5vw, 3.4vh), 1.6rem); font-weight: 400; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
  .nav-link::after { display: none; }
  .nav-item.is-open > .nav-link, .nav-link.is-active, .nav-link:hover { color: var(--blue); }

  /* Chevron at the right of each row: points right, turns down when the row is open */
  .nav-caret { width: 44px; height: clamp(36px, 7vh, 52px); margin: 0 -12px 0 0; }
  .nav-caret::before { width: 11px; height: 11px; border-width: 2px; transform: translate(-65%, -50%) rotate(-45deg); }
  .nav-item.is-open > .nav-caret::before { transform: translate(-50%, -65%) rotate(45deg); }

  .mega { display: none; position: static; flex: 0 0 100%; box-shadow: none; border: 0; opacity: 1; visibility: visible; transform: none; overflow: visible; }
  .nav-item.is-open > .mega { display: block; }
  .mega__inner, .mega--links .mega__inner { display: block; padding: 0 0 6px; }
  .mega__intro { display: none; }
  .mega__links, .mega--links .mega__links { grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 0 0 2px 2px; }
  .mega__links a { padding: clamp(4px, 1vh, 8px) 0; border: 0; font-size: clamp(.85rem, 2.3vh, .98rem); line-height: 1.25; color: var(--body); }
  .mega__links a .arw, .mega__desc { display: none; }
  .mega__label { font-weight: 500; }

  .menu-bottom { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 0; flex: none; padding: clamp(10px, 2.5vh, 24px) 0 calc(clamp(12px, 2.5vh, 24px) + env(safe-area-inset-bottom, 0px)); }
  .menu-lang { padding: 2px 20px; border-inline: 2px solid var(--ink); font-size: 1rem; line-height: 1.2; }
  .menu-social { gap: 22px; padding: clamp(6px, 1.2vh, 10px) 24px; border: 1.5px solid var(--ink); border-radius: 18px; }
}
@media (max-height: 560px) and (max-width: 1100px) {
  .menu-bottom { padding-top: 6px; }
  .nav-link, .header-overlay .site-header .nav-link { padding: 4px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav { transition: none !important; }
  .mega, .nav-link::after, .nav-caret::before { transition: none; }
}
