/* ============================================================
   Guess the Painter — Redesign 2026-05 · Home page styles
   Scope: everything under .gtp-home (which sits inside .gtp).
   Coexists with the legacy styles.css — does NOT touch its rules.
   ============================================================ */

/* ----- Base wrapper ----- */
.gtp-home {
  /* The legacy #screen-home is position:absolute; top/left:0; width/height:100%,
     so .gtp-home is sized by its parent. We still want to span 100% height. */
  flex: 1;
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  position: relative;
}
/* Ensure #screen-home keeps a paper background while .active animation runs */
#screen-home.active { background: var(--paper); }

/* ----- Top bar ----- */
.gtp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 56px;
  border-bottom: 1px solid var(--ochre);
  border-bottom-color: rgba(184,137,58,0.55);
  gap: 24px;
}
.gtp-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.gtp-brand-lockup {
  height: 28px;
  width: auto;
  display: block;
}

/* Three-frame brandmark + wordmark (museum hall idea, from handoff primitives) */
.gtp-brand-3box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.gtp-brand-3box-svg {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}
.gtp-brand-3box-wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  font-style: italic;
}
/* Legacy — kept so old references don't break, but now unused */
.gtp-brand-monogram {
  height: 32px;
  width: 32px;
  display: block;
  flex-shrink: 0;
}
.gtp-brand-wordmark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
  white-space: nowrap;
}
/* Legacy alias kept for any stray reference */
.gtp-brand-logo {
  height: 36px;
  width: 36px;
  display: block;
}
/* ============================================================
   TOPNAV — every item is a fixed-height (34px) flex box, vertically
   centered. Equal box heights + content centered within each box is
   the only way to guarantee the nav-link text and the lang-toggle
   text land on the exact same horizontal axis, regardless of border,
   padding or the flag emoji's line box.
   ============================================================ */
.gtp-topnav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.gtp-topnav a,
.gtp-topnav button.gtp-topnav-link {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: color 160ms;
}
.gtp-topnav a:hover,
.gtp-topnav button.gtp-topnav-link:hover { color: var(--ochre-deep); }

/* Re-skin the legacy .home-lang-selector inside the new top bar so the JS keeps working. */
.gtp-home .home-lang-selector {
  position: relative;
  /* Cancel the legacy styles.css rule `.home-lang-selector { position:absolute;
     top:1rem; right:1rem }` — we override `position` but the stray top:1rem was
     still shoving the relative box 16px down, breaking the vertical alignment. */
  top: 0 !important;
  right: auto !important;
  display: inline-flex;
  align-items: center;
  height: 34px;            /* same box height as the nav links */
}
.gtp-home .home-lang-selector .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;            /* fixed height — content centers within it */
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0 12px;         /* horizontal only; vertical centering via height */
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1;
  transition: border-color 160ms, color 160ms;
}
.gtp-home .home-lang-selector .lang-toggle:hover {
  border-color: var(--ochre);
  color: var(--ochre-deep);
}
/* Each span is itself a centered flex cell with line-height 1 so the flag
   emoji can't stretch the button's line box and shift "EN" off-axis. */
.gtp-home .home-lang-selector .lang-toggle > span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.gtp-home .home-lang-selector .lang-toggle .lang-flag { font-size: 14px; }
.gtp-home .home-lang-selector .lang-caret { font-size: 10px; opacity: 0.6; margin-left: 2px; }
.gtp-home .home-lang-selector .lang-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow-card);
  padding: 4px 0;
  display: none;
  z-index: 30;
}
.gtp-home .home-lang-selector.open .lang-menu { display: block; }
.gtp-home .home-lang-selector .lang-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}
.gtp-home .home-lang-selector .lang-opt.active { background: var(--paper-2); }
.gtp-home .home-lang-selector .lang-opt:hover { background: var(--paper-2); }

/* Mobile burger button (hidden on desktop) */
.gtp-burger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: var(--paper-2);
  border: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

/* ----- Hero ----- */
/* FIX 6 — centered inner wrapper */
.gtp-hero {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}
.gtp-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 48px 56px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.gtp-hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}
.gtp-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ochre-deep);
  text-transform: uppercase;
  margin-bottom: 24px;
}
/* FIX B — H1 now contains real logo.svg as visual; text is screen-reader only */
.gtp-h1 {
  margin: 0;
  padding: 0;
  display: block;
}
.gtp-h1-logo {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}
.gtp-h1-srtext {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
/* Legacy — kept for safety but no longer rendered */
.gtp-h1-em {
  display: block;
  font-style: italic;
  color: var(--ochre-deep);
}
/* FIX 7 — lede width per prototype */
.gtp-lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 480px;
  margin: 28px 0 0;
}
.gtp-cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
  flex-wrap: wrap;
}
/* FIX 2 — black CTA per prototype */
.gtp-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 18px 32px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 200ms, transform 160ms, box-shadow 160ms;
}
.gtp-cta-primary:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-deep);
}
.gtp-cta-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}
.gtp-cta-arrow { font-family: var(--mono); font-weight: 400; }
.gtp-cta-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* ----- Painting collage (desktop) — 6-tile overlapping stack ----- */
.gtp-hero-collage {
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 560px;
  overflow: visible;
}

.gtp-collage-stack {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 600px;
  margin-left: auto;
}
.gtp-collage-stack .gtp-tile {
  position: absolute;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--paper-2);
}
.gtp-collage-stack .gtp-tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Positioning + rotations — overlap intentional */
.gtp-tile-1 { top: 0;    left: 0;    width: 200px; height: 260px; transform: rotate(-4deg); z-index: 3; }
.gtp-tile-2 { top: 30px; left: 180px; width: 240px; height: 300px; transform: rotate(2deg);  z-index: 5; box-shadow: var(--shadow-deep); }
.gtp-tile-3 { top: 10px; right: 0;   width: 200px; height: 260px; transform: rotate(3deg);  z-index: 2; }
.gtp-tile-4 { top: 300px; left: 20px; width: 220px; height: 270px; transform: rotate(-2deg); z-index: 4; }
.gtp-tile-5 { top: 340px; left: 210px; width: 200px; height: 240px; transform: rotate(1deg);  z-index: 6; box-shadow: var(--shadow-deep); }
.gtp-tile-6 { top: 320px; right: 10px; width: 180px; height: 230px; transform: rotate(-3deg); z-index: 3; }

/* Suppress the old 3-frame rules (safety) */
.gtp-frame { display: none !important; }
/* FIX 4 — hide hall label */
.gtp-hall-label { display: none !important; }

/* ----- Bottom nav (mobile only) ----- */
.gtp-bottomnav {
  display: none;
  justify-content: space-around;
  padding: 18px 24px;
  border-top: 1px solid var(--rule);
}
.gtp-bottomnav a,
.gtp-bottomnav button {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}

/* ----- Footer band ----- */
/* FIX 7 — new slim footer band per spec */
.gtp-footer-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 56px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
/* Keep the old .gtp-footer rule for legacy compatibility */
.gtp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 56px;
  border-top: 1px solid var(--ochre);
  border-top-color: rgba(184,137,58,0.55);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.gtp-footer-mid {
  flex: 1;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--ink-4);
  font-family: var(--mono);
}
.gtp-footer-langs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.14em;
}
.gtp-footer-lang-link {
  color: inherit;
  text-decoration: none;
  padding: 2px 4px;
  transition: color 160ms ease, border-bottom-color 160ms ease;
  border-bottom: 1px solid transparent;
}
.gtp-footer-lang-link:hover {
  color: var(--ink);
  border-bottom-color: var(--ochre);
}
.gtp-footer-lang-link.is-current {
  color: var(--ink);
}
.gtp-footer-lang-sep {
  opacity: 0.4;
  user-select: none;
}

/* ----- Burger menu overlay (mobile) ----- */
.gtp-burger-menu {
  position: absolute;
  top: 60px;
  right: 16px;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 25;
}
.gtp-burger-menu[hidden] { display: none; }
.gtp-burger-menu a,
.gtp-burger-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.gtp-burger-menu a:hover,
.gtp-burger-menu button:hover { background: var(--paper-2); }
/* Language row inside the burger menu — flags on one line, divider above */
.gtp-burger-langs {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.gtp-burger-menu .gtp-burger-langs a {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* ----- Legacy actions container (kept in DOM, hidden, JS hooks rely on IDs) ----- */
.gtp-legacy-actions { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet — collapse to single column hero but keep desktop top bar */
@media (max-width: 1023px) {
  .gtp-topbar { padding: 18px 32px; }
  .gtp-hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 56px 32px 40px;
  }
  .gtp-hero-collage { max-width: 480px; }
  .gtp-footer { padding: 16px 32px; }
  .gtp-footer-band { padding: 16px 32px; }
}

/* Mobile — full restructuring */
@media (max-width: 767px) {
  .gtp-topbar { padding: 14px 20px; border-bottom-color: rgba(184,137,58,0.4); }
  .gtp-brand-wordmark { font-size: 17px; }
  .gtp-brand-monogram { height: 24px; width: 24px; }
  .gtp-brand-logo { height: 24px; }
  /* Hide the desktop nav on mobile — HOME ONLY (body has no .gtp-section-screen).
     Scoped so it never hides the nav on section pages, which share .gtp-topbar
     but have no burger. The body:not() prefix (0,3,1) also beats the later
     unconditional `.gtp-topnav { display:flex }` (0,1,0) that kept it visible.
     On the home the burger + bottom-nav + footer langs take over. */
  body:not(.gtp-section-screen) .gtp-topbar .gtp-topnav { display: none; }
  body:not(.gtp-section-screen) .gtp-burger { display: inline-flex; }
  /* Mobile home top bar = brandmark icon + burger only. Drop the wordmark
     so the bar stays minimal; sections live inside the burger. */
  .gtp-brand-3box-wordmark { display: none; }

  .gtp-hero-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 20px 24px 0;
  }
  .gtp-hero-text { max-width: none; }
  .gtp-eyebrow { font-size: 10px; margin-bottom: 8px; }
  .gtp-h1-logo { max-width: 320px; }
  .gtp-lede { font-size: 17px; margin-top: 12px; }

  /* Mobile collage — a single tidy row of 3 paintings (the 2-row grid forced
     scrolling). Compact enough that the whole home fits without scrolling. */
  .gtp-hero-collage { max-width: 100%; margin: 18px auto 0; }
  .gtp-collage-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 100%;
    height: auto;
    margin: 0;
  }
  .gtp-collage-stack .gtp-tile {
    position: static;
    width: auto;
    height: auto;
    aspect-ratio: 3 / 4;
    top: auto; left: auto; right: auto;
    transform: none;   /* drop the rotations on mobile */
  }
  /* Show only the first three; keep the home short on phones */
  .gtp-collage-stack .gtp-tile-4,
  .gtp-collage-stack .gtp-tile-5,
  .gtp-collage-stack .gtp-tile-6 { display: none; }

  .gtp-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 22px 0 0;
    padding: 0 24px;
  }
  .gtp-cta-primary { width: 100%; justify-content: center; padding: 18px; font-size: 14px; letter-spacing: 0.06em; }
  .gtp-cta-sub { text-align: center; font-size: 11px; letter-spacing: 0.12em; }

  /* Section links live in the burger on mobile — hide the bottom row so the
     home stays focused on playing. */
  .gtp-bottomnav { display: none; }
  .gtp-footer {
    flex-direction: column;
    gap: 6px;
    padding: 14px 24px 20px;
    font-size: 9px;
  }
  .gtp-footer-band {
    flex-direction: column;
    gap: 6px;
    padding: 14px 24px 20px;
    font-size: 9px;
  }
  .gtp-footer-mid { order: 3; }
}

/* ============================================================
   FIX C — Bigger black CTA (overrides .gtp button reset in tokens.css
   which has specificity 0,1,1 and zeroes out background/border)
   ============================================================ */
.gtp .gtp-cta-row .gtp-cta-primary,
.gtp button.gtp-cta-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  background-color: #1c1a17 !important;
  color: #faf6ec !important;
  border: 0 !important;
  padding: 18px 44px !important;
  border-radius: 8px !important;
  font-family: var(--sans) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  min-width: 240px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(28,26,23,0.12) !important;
}
.gtp .gtp-cta-row .gtp-cta-primary:hover,
.gtp button.gtp-cta-primary:hover {
  background-color: #2b2724 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(28,26,23,0.16) !important;
  border-radius: 8px !important;
}

/* ============================================================
   FIX D — Language selector alignment: visually level with nav links
   ============================================================ */
.gtp-topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.gtp-topnav a,
.gtp-topnav button.gtp-topnav-link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 8px 0;
}
.gtp-home .home-lang-selector .lang-toggle {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 8px 12px;
}

/* Tiny italic credit in the footer band */
.gtp-footer-credit {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
