/* ============================================================
   HEADER — Terra Design Studio
   Logo left · Hamburger right · Fullscreen orange overlay (frea style)
   ============================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;           /* sits above the overlay (z-index 150) */
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition:
    background  var(--dur-base) var(--ease),
    box-shadow  var(--dur-base) var(--ease),
    border-bottom-color var(--dur-base) var(--ease);
  border-bottom: 1px solid transparent;
}

/* Transparent over dark / hero sections — JS drives background + color via scroll */
.site-header--transparent {
  background: transparent;
  color: var(--clr-white);
  /* Remove background/color/border from CSS transition — scroll handler sets these directly */
  transition: box-shadow var(--dur-fast) var(--ease);
}

/* Solid on scroll */
.site-header--solid,
.site-header.is-scrolled {
  background: var(--clr-bg);
  color: var(--clr-fg);
  border-bottom-color: var(--clr-border);
  box-shadow: var(--shadow-sm);
}

/* When overlay is open: header floats above orange — keep everything white */
.site-header.nav-is-open {
  background: transparent !important;
  border-bottom-color: transparent !important;
  box-shadow: none !important;
  color: var(--clr-white) !important;
}

/* Logo on orange overlay — invert to full white */
.site-header.nav-is-open .site-header__logo-img {
  filter: brightness(0) invert(1);
}

/* ── Inner ────────────────────────────────────────────────── */
.site-header__inner {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Logo ─────────────────────────────────────────────────── */
.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: opacity var(--dur-base) var(--ease);
}
.site-header__logo:hover { opacity: 0.85; }

.site-header__logo-img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: filter var(--dur-base) var(--ease);
}
@media (max-width: 600px) {
  .site-header__logo-img { height: 32px; }
}

/* ── Desktop CTA (hidden — lives in overlay) ─────────────── */
.site-header__cta { display: none; }

/* ── Hamburger — always visible ──────────────────────────── */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 6px;
  color: inherit;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
  border: 1.5px solid transparent;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition:
    transform var(--dur-base) var(--ease),
    opacity  var(--dur-base) var(--ease);
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.45);
}
.nav-toggle[aria-expanded="true"]:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════
   FULLSCREEN NAV OVERLAY  (frea.com.tr style, orange bg)
   ══════════════════════════════════════════════════════════ */

.site-nav {
  position: fixed;
  inset: 0;
  background: var(--clr-accent);   /* #F07820 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: calc(var(--header-h) + var(--sp-8)) var(--gutter) var(--sp-12);
}

.site-nav.is-open {
  pointer-events: auto;
  opacity: 1;
}

/* ── Links grid: 3 columns × 2 rows ──────────────────────── */
.nav__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-10) var(--sp-16);
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
  width: 100%;
  max-width: 800px;
}

/* Each link: text + static dash below */
.nav__link {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: var(--fw-bold);
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: -0.02em;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  transition: color 0.2s ease;
  white-space: nowrap;
}

/* Static short dash — always visible */
.nav__link::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: rgba(255, 255, 255, 0.38);
  flex-shrink: 0;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.nav__link:hover {
  color: #ffffff;
}
.nav__link:hover::after {
  width: 52px;
  background: rgba(255, 255, 255, 0.9);
}
.nav__link.is-active {
  color: #ffffff;
}
.nav__link.is-active::after {
  width: 40px;
  background: rgba(255, 255, 255, 0.9);
}

/* "Gratis gesprek" item — italic to distinguish */
.nav__link--cta {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}
.nav__link--cta::after {
  background: rgba(255, 255, 255, 0.25);
}
.nav__link--cta:hover {
  color: #ffffff;
}
.nav__link--cta:hover::after {
  background: rgba(255, 255, 255, 0.7);
}

/* ── Overlay close button (injected by JS) ────────────────── */
.nav-close {
  position: absolute;
  top: calc(var(--header-h) / 2);
  right: var(--gutter);
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  color: var(--clr-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.nav-close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
}

/* ── Social icons row ─────────────────────────────────────── */
.nav-overlay__social {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav-overlay__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-overlay__social-link:hover {
  color: #ffffff;
  transform: scale(1.12);
}

/* ── Project detail pages: always-white header over dark hero ─ */
.site-header--project .site-header__logo-img {
  filter: brightness(0) invert(1);
}

/* Once hero scrolls away, switch to solid dark header */
.site-header--project.past-hero {
  background: var(--clr-bg) !important;
  color: var(--clr-fg) !important;
  border-bottom-color: var(--clr-border) !important;
  box-shadow: var(--shadow-sm) !important;
}
.site-header--project.past-hero .site-header__logo-img {
  filter: none;
}

/* ── Responsive: 2-col on mobile ─────────────────────────── */
@media (max-width: 680px) {
  .nav__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-8) var(--sp-10);
    max-width: 460px;
  }
  .nav__link {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
    white-space: normal;
  }
  .nav__link--cta {
    font-size: clamp(1.4rem, 5vw, 1.75rem);
  }
}
