/* ============================================================
   YZTD · Chrome: header, megamenu, mobile nav, footer.
   Shared across every page (partials/header.html, footer.html).
   → Next.js: SiteHeader.tsx (client) + SiteFooter.tsx.
   ============================================================ */

/* reserve the bar height on inner pages so the injected sticky header doesn't
   shift content down ~72px on chrome-ready (CLS). The home variant is fixed
   (overlays the hero), so it must NOT reserve flow space. */
[data-include="header"][data-variant="inner"] { display: block; min-height: var(--header-h); }

/* ---------- HEADER ---------- */
.yz-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-header);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.yz-header.is-solid {
  background: rgba(246,248,252,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--mist);
}
/* inner-page variant: always solid dark bar. sticky (occupies layout
   space) so the dark identity band below starts right after it · unlike
   the home variant which is fixed and overlays the hero. */
.yz-header.is-inner {
  position: sticky;
  background: rgba(11,18,48,.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--line-dark);
}
.yz-header__bar {
  max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

/* logo cross-fade (white over hero → royal on scroll) */
.yz-logo { position: relative; height: 34px; flex-shrink: 0; }
.yz-logo img { height: 34px; width: auto; display: block; transition: opacity .35s ease; }
.yz-logo .yz-logo-royal { position: absolute; left: 0; top: 0; opacity: 0; }
.yz-header.is-solid .yz-logo-white { opacity: 0; }
.yz-header.is-solid .yz-logo-royal { opacity: 1; }
/* inner pages keep the white logo */
.yz-header.is-inner .yz-logo-white { opacity: 1; }
.yz-header.is-inner .yz-logo-royal { opacity: 0; }

/* nav */
.yz-nav { display: flex; align-items: center; gap: 2px; }
.yz-navitem {
  position: relative; display: inline-flex; align-items: center;
  font-size: 14.5px; font-weight: 500; padding: 8px 14px; border-radius: 6px;
  color: var(--on-dark); opacity: .82;
  transition: opacity .2s ease, color .35s ease;
}
.yz-navitem:hover { opacity: 1; }
.yz-header.is-solid .yz-navitem { color: var(--text); }
.yz-header.is-inner .yz-navitem { color: var(--on-dark-mute); }
.yz-header.is-inner .yz-navitem.is-active { color: #fff; opacity: 1; }
.yz-caret { display: inline-block; margin-left: 6px; opacity: .5; transition: transform .22s ease, opacity .22s ease; }
.yz-navitem:hover .yz-caret { transform: rotate(180deg); opacity: .9; }

/* right cluster */
.yz-header__right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.yz-lang { display: flex; align-items: center; gap: 5px; font-family: var(--f-label); font-size: 12.5px; color: var(--on-dark); transition: color .35s ease; }
.yz-header.is-solid .yz-lang { color: var(--text); }
.yz-lang b { font-weight: 600; }
.yz-lang .yz-lang-sep { opacity: .4; }
.yz-lang .yz-lang-off { opacity: .55; }

.yz-menu-btn {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 1px solid var(--on-dark-line); border-radius: var(--r-sm);
  background: transparent; cursor: pointer; color: var(--on-dark); font-size: 20px; line-height: 1;
  transition: color .35s ease, border-color .35s ease;
}
.yz-header.is-solid .yz-menu-btn { border-color: var(--mist); color: var(--text); }

/* ---------- MEGAMENU ---------- */
.yz-mega {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  background: var(--white); border-top: 1px solid var(--mist);
  box-shadow: var(--shadow-nav);
  display: none; animation: yzMegaIn .2s ease;
}
.yz-mega.is-open { display: block; }
.yz-mega__inner {
  max-width: var(--shell); margin: 0 auto; padding: 40px var(--gutter) 46px;
  display: grid; grid-template-columns: 0.82fr 1.6fr; gap: 56px; align-items: start;
}
.yz-mega__feature { border-right: 1px solid var(--mist); padding-right: 40px; }
.yz-mega__feature .yz-eyebrow { font-size: 11.5px; margin-bottom: 16px; }
.yz-mega__title {
  font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; line-height: 1.16;
  letter-spacing: -0.02em; margin: 0 0 12px; color: var(--ink); text-wrap: balance;
}
.yz-mega__text { font-size: .95rem; line-height: 1.55; color: var(--text-mute); margin: 0 0 20px; }
.yz-mega__cta { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--royal); transition: gap .2s ease; }
.yz-mega__cta:hover { gap: 12px; }

.yz-mega__committees { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 24px; }
.yz-mega__committee {
  display: flex; align-items: center; gap: 11px; padding: 11px 8px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500; color: var(--ink); transition: background .18s ease, color .18s ease;
}
.yz-mega__committee:hover { background: var(--paper); color: var(--royal); }
.yz-diamond-sm { flex-shrink: 0; width: 8px; height: 8px; background: var(--sky); transform: rotate(45deg); border-radius: 1px; }

.yz-mega__children { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.yz-mega__child { display: block; padding: 14px 16px; border-radius: var(--r-md); transition: background .18s ease; }
.yz-mega__child:hover { background: var(--paper); }
.yz-mega__child-t { font-family: var(--f-display); font-weight: 600; font-size: 1.02rem; color: var(--ink); letter-spacing: -0.01em; }
.yz-mega__child-d { font-size: 13px; line-height: 1.45; color: var(--text-mute); margin-top: 4px; }

/* ---------- MOBILE NAV ---------- */
.yz-mobile-nav {
  display: none; background: var(--ink); border-top: 1px solid var(--line-dark);
  padding: 6px var(--gutter) 18px; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.yz-mobile-nav.is-open { display: block; }
.yz-mobile-nav__item { border-bottom: 1px solid var(--line-dark); padding: 8px 0; }
.yz-mobile-nav__link { display: block; padding: 9px 2px; font-family: var(--f-display); font-size: 17px; font-weight: 600; color: #fff; }
.yz-mobile-nav__chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 2px 6px; }
.yz-mobile-nav__chip { font-family: var(--f-label); font-size: 11.5px; color: var(--sky); background: var(--sky-wash); padding: 5px 9px; border-radius: 6px; }
.yz-mobile-nav__children { display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 4px; }
.yz-mobile-nav__child { padding: 7px 2px; font-size: 14.5px; color: var(--on-dark-mute); transition: color .2s ease; }
.yz-mobile-nav__child:hover { color: #fff; }

/* ---------- FOOTER ---------- */
.yz-footer { background: var(--ink); color: var(--on-dark); border-top: 1px solid var(--line-dark); }
.yz-footer__inner { max-width: var(--shell); margin: 0 auto; padding: clamp(56px, 7vw, 84px) var(--gutter) 0; }
.yz-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.yz-footer__logo { height: 34px; width: auto; margin-bottom: 20px; }
.yz-footer__mission { font-size: 14.5px; line-height: 1.65; color: var(--on-dark-mute); margin: 0 0 18px; max-width: 34ch; }
.yz-footer__mail { display: inline-block; font-size: 14.5px; color: var(--sky); margin-bottom: 24px; transition: color .2s ease; }
.yz-footer__mail:hover { color: #fff; }

.yz-social { display: flex; gap: 10px; }
.yz-social a {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--line-dark); border-radius: var(--r-sm); color: var(--on-dark-mute);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.yz-social a:hover { border-color: var(--sky); color: #fff; background: var(--sky-wash); }

.yz-footer__col-title { font-family: var(--f-label); font-size: var(--fs-label-sm); letter-spacing: .12em; text-transform: uppercase; color: var(--sky); margin-bottom: 18px; }
.yz-footer__links { display: flex; flex-direction: column; gap: 11px; }
.yz-footer__links a { font-size: 14.5px; color: var(--on-dark-mute); transition: color .2s ease; }
.yz-footer__links a:hover { color: #fff; }

.yz-footer__aaai { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 30px 0; border-top: 1px solid var(--line-dark); }
.yz-footer__aaai img { height: 38px; width: auto; flex-shrink: 0; }
.yz-footer__aaai-divider { width: 1px; height: 34px; background: var(--line-dark); }
.yz-footer__aaai-label { font-family: var(--f-label); font-size: var(--fs-label-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--sky); }
.yz-footer__aaai-name { font-size: 14px; line-height: 1.5; color: var(--on-dark-mute); max-width: 54ch; }

.yz-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px 0 36px; border-top: 1px solid var(--line-dark); }
.yz-footer__copy { font-family: var(--f-label); font-size: 12px; letter-spacing: .03em; color: var(--on-dark-mute); }
.yz-footer__legal { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-family: var(--f-label); font-size: 12px; color: var(--on-dark-mute); }
.yz-footer__legal a { transition: color .2s ease; }
.yz-footer__legal a:hover { color: #fff; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .yz-nav { display: none; }
  .yz-menu-btn { display: inline-flex; }
  .yz-mega { display: none !important; } /* megamenu is desktop-only */
  .yz-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  /* declutter the bar so logo + CTA + hamburger fit (was overflowing,
     pushing the hamburger off-screen / causing 42px horizontal scroll) */
  .yz-header__bar { gap: 14px; }
  .yz-lang { display: none; } /* decorative TR/EN; EN not yet implemented */
  .yz-logo, .yz-logo img { height: 30px; }
  .yz-header__right { gap: 10px; }
}
/* very small phones: drop the header CTA too (Üyelik stays reachable via the menu) */
@media (max-width: 342px) {
  .yz-header__right > .yz-btn--primary { display: none; }
}
@media (max-width: 560px) {
  .yz-footer__grid { grid-template-columns: 1fr; }
  .yz-footer__bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* touch targets on small screens (min 44px) */
@media (max-width: 768px) {
  .yz-social a { width: 44px; height: 44px; }
  .yz-mobile-nav__link { padding: 12px 2px; }
  .yz-mobile-nav__child { padding: 12px 2px; }
}
