/* ==========================================================================
   Header & Footer — landing page variants
   ========================================================================== */

/* --- Header --- */

.site-header {
  /* Header floats top-left of the viewport at 12px from both edges, fixed
     on scroll. Same anchor on every breakpoint — single canonical chrome,
     no responsive position swaps. */
  position: fixed;
  top: var(--space-12);
  left: var(--space-12);
  z-index: 100;
  padding: 0;
  background-color: transparent;
}

.site-header-inner {
  /* Container hugs its children — no width:100%. The header is a fixed
     pill row, not a full-bleed band. The .header-pill component below
     provides the actual chrome. */
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   .header-pill — single component for every header variant.
   Used by the production .site-header AND the showcase pages/header/
   variants (Compact dark/white, Full dark/white). Layout is identical;
   theme modifier (--dark/--white) flips surface tint, optional
   .header-pill-links child adds nav.
   Specs: Figma 8577:5657 (Compact dark) and 8573:5345 (Full dark).
   ========================================================================== */

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: 4px;
  border-radius: var(--radius-rounded);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.header-pill--dark {
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--color-white);
}
.header-pill--white {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--color-black);
}

/* Logo — Figma 8577:5657 / 8573:5345 / 8577:5682 / 8573:5382 all spec
   the Logo block with pl: 12 / pr: 0 / pt-pb ≈ 6 (centers the 26-px
   SVG vertically in the 40-px pill row). The visual gap between the
   logo and the next item is supplied by .header-pill { gap: 8 } — no
   right padding on the logo itself, otherwise the spacing reads as
   ~20 (12 logo-pr + 8 pill-gap) while burger ↔ button stays at 8,
   which is what the user spotted as uneven. */
.header-pill-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 40px;
  padding-left: 12px;
  border-radius: var(--radius-rounded);
  text-decoration: none;
  flex: 0 0 auto;
}
.header-pill-logo img {
  width: 120px;
  height: 26px;
  object-fit: contain;
}
/* Hover: swap the img source via CSS `content: url(...)`. Same element,
   identical layout box, so the new wordmark lands at exactly the same
   pixels as the calm one — no overlay misalignment, no halo, no manual
   position math. Browser support: Chrome / Safari / Firefox / Edge all
   honour `content: url()` on <img>. Excluded for Variant E (brand chip)
   whose hover lives on the chip surface, not the wordmark. */
.header-pill-logo:not(.header-pill-logo--brand):hover img {
  content: url('/assets/brand/playgama/Playgama_purple.svg');
}

/* Nav-links — each link is a 40 px-tall pill. Gap 4 px. */
.header-pill-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.header-pill-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-rounded);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}

/* Burger icon — masked from /assets/icons/system/burger-24.svg.
   Renders in currentColor → tracks the parent .header-pill's text colour.
   Always white on .--dark, always black on .--white. */
.menu-btn-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  mask-image: url('/assets/icons/system/burger-24.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url('/assets/icons/system/burger-24.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

/* Burger inside a .header-pill is Ghost — strip the production .menu-btn
   surface so the pill's tint is the only chrome. Size 40 × 40 per Figma. */
.header-pill .menu-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: inherit;
  transition: background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}

/* Hover behaviour per theme. */
.header-pill--dark .header-pill-links a:hover,
.header-pill--dark .menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.header-pill--white .menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--color-purple-400);
}
.header-pill--white .header-pill-links a:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--color-purple-400);
}

/* Logo hover — purple overlay rendered via .header-pill-logo::before
   above; the underlying calm img stays in place. No theme-specific
   rule needed since the overlay uses the shipped purple asset. */

/* Mobile (≤ 780 px): every variant collapses to Compact — nav-links
   hidden, surface + tints kept. */
@media (max-width: 780px) {
  .header-pill-links { display: none; }
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 200px;
  justify-content: flex-end;
}

.header-nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  height: 24px;
  border-radius: var(--radius-8);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--color-black);
  text-decoration: none;
  transition: opacity var(--duration-base) var(--ease-out);
}

.header-nav-chip:hover {
  opacity: 0.85;
}

/* Mobile menu button */
.header-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: none;
  border: none;
  cursor: pointer;
}

.header-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
}

@media (max-width: 780px) {
  .header-menu-btn { display: flex; }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: none;
    flex-direction: column;
    gap: 8px;
    padding: var(--space-16);
    background-color: var(--bg-surface);
  }

  .header-nav.is-open { display: flex; }

  .header-nav-chip {
    height: 40px;
    font-size: 14px;
    border-radius: var(--radius-12);
  }
}

/* --- Footer — from Figma 3325:3643 --- */

.site-footer {
  padding: var(--space-48) 0 var(--space-64);
}

/* Divider hairline */
.footer-divider {
  height: 1px;
  background-color: var(--border-default);
}

/* Top nav row (between two dividers) */
.footer-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.footer-top-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
}

.footer-top-nav a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
  flex: 1;
}

.footer-top-nav a:hover {
  /* Purple-400 brand on light, purple-500 themed (rgb 170,118,255) on
     dark — --accent-purple-hover encodes both. */
  color: var(--accent-purple-hover);
}

/* Main link grid — 5 columns */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-24);
  margin-bottom: var(--space-32);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.footer-col a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-out);
}

.footer-col a:hover {
  color: var(--accent-purple-hover);
}

/* Social icons row —
   Uses a masked <span> inside each link so the icon paints in an exact
   semantic token (--text-secondary calm, --color-purple-400 hover). This
   sidesteps the inaccuracy of filter-based white→purple tinting and works
   symmetrically in both themes. Each link carries the icon URL via an
   inline `--icon` custom property. */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  margin-bottom: var(--space-24);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.footer-social-icon {
  display: block;
  width: 24px;
  height: 24px;
  background-color: var(--text-secondary);
  mask-image: var(--icon);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: var(--icon);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  transition: background-color var(--duration-base) var(--ease-out);
}

.footer-social-link:hover .footer-social-icon {
  background-color: var(--accent-purple-hover);
}

/* Language switcher — layout only; pills themselves are the .lang-pill
   design-system component (shared/css/forms.css). */
.footer-lang {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  margin-bottom: var(--space-24);
}

/* Copyright */
.footer-copyright {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-tertiary);
}

/* --- Footer responsive --- */

@media (max-width: 780px) {
  .footer-top-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-24) var(--space-32);
  }
}

@media (max-width: 480px) {
  .footer-top-nav {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16) var(--space-24);
  }
}
