/* ============================================================
   Guess the Painter — Phase 6: Artists / Movements / Leaderboard
   redesign-sections.css
   Scoped under .gtp (design tokens already on :root via tokens.css)
   ============================================================ */

/* ---- Shared screen shell ---- */
.gtp-section-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--paper);
  overflow: hidden;
  /* Section pages don't load styles.css, so the browser's default 8px body
     margin was never reset — it shifted everything right and pushed the page
     ~8px wider than the screen on mobile. Reset it here. */
  margin: 0;
}

/* ---- Shared top-bar (re-used from home, kept in sync) ---- */
.gtp-section-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  background: var(--paper);
  z-index: 20;
}
.gtp-section-topbar .gtp-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}
.gtp-section-topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.gtp-section-topnav a,
.gtp-section-topnav button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.04em;
  transition: color 180ms;
}
.gtp-section-topnav a:hover,
.gtp-section-topnav button:hover {
  color: var(--ink);
}
.gtp-section-topnav a.active,
.gtp-section-topnav button.active {
  color: var(--ink);
  border-bottom: 2px solid var(--ochre);
  padding-bottom: 3px;
}
.gtp-section-back-btn {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  letter-spacing: 0.04em;
  transition: color 180ms;
}
.gtp-section-back-btn:hover { color: var(--ink); }

/* ---- Page header ---- */
.gtp-section-header {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding: 40px 56px 28px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
  align-items: end;
}
.gtp-section-header-left {}
.gtp-section-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ochre-deep);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.gtp-section-h1 {
  font-family: var(--serif);
  font-size: 60px;
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--ink);
}
.gtp-section-lede {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0;
  max-width: 520px;
}
.gtp-section-header-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ---- Scrollable body ---- */
.gtp-section-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 56px 56px;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   6.1 ARTISTS PAGE
   ============================================================ */
#screen-artists-redesign .gtp-section-body {
  padding-top: 0;
}

/* Search bar */
.gtp-artists-search-form {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}
.gtp-artists-search-input {
  flex: 1;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--rule);
  border-right: none;
  border-radius: 2px 0 0 2px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms;
}
.gtp-artists-search-input:focus {
  border-color: var(--ochre);
}
.gtp-artists-search-btn {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  border-radius: 0 2px 2px 0;
  transition: background 180ms;
  white-space: nowrap;
}
.gtp-artists-search-btn:hover {
  background: var(--ochre-deep);
}
.gtp-artists-not-found {
  margin-top: 8px;
  padding: 9px 12px;
  background: rgba(168, 54, 42, 0.07);
  border-left: 3px solid var(--red);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0 2px 2px 0;
}
.gtp-artists-not-found strong { color: var(--red); }
.gtp-artists-not-found-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-4);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.gtp-artists-not-found-dismiss:hover { color: var(--ink); }

/* Movement section */
.gtp-movement-section {
  padding-top: 32px;
}
.gtp-movement-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}
.gtp-movement-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  font-style: italic;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.gtp-movement-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}

/* Artist grid */
.gtp-artists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px 24px;
}

/* Artist card */
.gtp-artist-card {
  cursor: pointer;
  position: relative;
  padding: 6px;
  margin: -6px;
  border-radius: 4px;
  background: transparent;
  transition: background 320ms, box-shadow 320ms;
  text-decoration: none;
  color: inherit;
  display: block;
}
.gtp-artist-card:hover .gtp-artist-hero {
  box-shadow: var(--shadow-card);
}
.gtp-artist-card.gtp-match {
  background: var(--paper-2);
  box-shadow: 0 0 0 2px var(--ochre);
  animation: gtp-match-fade 1.5s ease forwards;
}
@keyframes gtp-match-fade {
  0%   { box-shadow: 0 0 0 2px var(--ochre); background: var(--paper-2); }
  70%  { box-shadow: 0 0 0 2px var(--ochre); background: var(--paper-2); }
  100% { box-shadow: none; background: transparent; }
}

.gtp-artist-hero {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 2px;
  background: var(--paper-2);
  transition: box-shadow 200ms;
  position: relative;
}
.gtp-artist-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gtp-artist-hero-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--paper);
  letter-spacing: 0.1em;
}

.gtp-artist-info {
  margin-top: 10px;
}
.gtp-artist-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.gtp-artist-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  line-height: 1.2;
}
.gtp-artist-country {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.14em;
  flex-shrink: 0;
}
.gtp-artist-life {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.gtp-artist-paintings-link {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ochre-deep);
  text-decoration: none;
  transition: color 180ms;
}
.gtp-artist-paintings-link:hover { color: var(--ochre); }

/* ============================================================
   6.2 MOVEMENTS PAGE
   ============================================================ */
.gtp-movements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.gtp-movement-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.gtp-movement-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--ink);
}

/* Hero image block: fixed 240px tall. Background-image set inline from the
   representative painting. ::before adds a soft top→bottom dark gradient so the
   ordinal + period read against any source image; ::after tints with the
   movement accent (multiply blend) so each card still has its colour identity. */
.gtp-movement-card-visual {
  width: 100%;
  height: 240px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: var(--ink-2);
}
.gtp-movement-card-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10, 9, 8, 0.20) 0%,
      rgba(10, 9, 8, 0.05) 35%,
      rgba(10, 9, 8, 0.65) 100%);
  pointer-events: none;
}
.gtp-movement-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--movement-accent, transparent);
  mix-blend-mode: multiply;
  opacity: 0.30;
  pointer-events: none;
}
.gtp-movement-card-ordinal {
  position: absolute;
  top: 10px;
  left: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(245, 240, 230, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 3;
}
.gtp-movement-card-span {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(245, 240, 230, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 3;
}
.gtp-movement-card-caption {
  padding: 22px 24px;
  background: var(--paper);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.gtp-movement-card-caption-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 8px;
}
.gtp-movement-card-blurb {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  flex: 1;
}
.gtp-movement-card-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

/* Timeline — SVG-based */
.gtp-movements-timeline {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.gtp-timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gtp-timeline-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ochre-deep);
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}
.gtp-timeline-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  margin: 0;
  color: var(--ink);
}
.gtp-timeline-range {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}
.gtp-timeline-svg {
  display: block;
  width: 100%;
  height: 180px;
  overflow: visible;
}

/* ============================================================
   6.3 LEADERBOARD PAGE
   ============================================================ */
#screen-leaderboard-redesign .gtp-section-body {
  display: flex;
  justify-content: center;
}
.gtp-lb-content {
  width: 100%;
  max-width: 720px;
}

/* Filter chips */
.gtp-lb-chips {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.gtp-lb-chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
  border-radius: 2px;
  cursor: pointer;
  transition: background 180ms, color 180ms, border-color 180ms;
}
.gtp-lb-chip:hover {
  border-color: var(--ink-4);
  color: var(--ink-2);
}
.gtp-lb-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.gtp-lb-chip.disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* Table */
.gtp-lb-table-header {
  display: grid;
  grid-template-columns: 80px 1fr 160px;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}
.gtp-lb-table-header span:last-child { text-align: right; }

.gtp-lb-row {
  display: grid;
  grid-template-columns: 80px 1fr 160px;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
  transition: background 180ms;
}
.gtp-lb-row.you {
  background: var(--paper-2);
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px;
  padding-right: 24px;
}
.gtp-lb-empty {
  padding: 32px 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-3);
  font-style: italic;
  text-align: center;
}

.gtp-lb-rank {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.gtp-lb-rank.top3 {
  color: var(--ochre-deep);
  font-style: italic;
}
.gtp-lb-rank.rest {
  color: var(--ink-3);
  font-style: normal;
}
.gtp-lb-player {
  font-family: var(--serif);
  font-size: 24px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.gtp-lb-player.you-player {
  font-style: italic;
  font-weight: 500;
}
.gtp-lb-you-chip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ochre-deep);
  border: 1px solid var(--ochre);
  padding: 1px 5px;
  border-radius: 2px;
  line-height: 1.4;
}
.gtp-lb-count {
  text-align: right;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.gtp-lb-row.you .gtp-lb-count { color: var(--ink); }

.gtp-lb-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: center;
}
.gtp-lb-action-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 180ms, color 180ms;
}
/* Same scheme as the game-over screen: primary = ink filled, ghost = outline
   (transparent bg, ink border + ink text, fills on hover). */
.gtp-lb-action-btn.primary {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
}
.gtp-lb-action-btn.primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}
.gtp-lb-action-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.gtp-lb-action-btn.ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
  .gtp-section-header {
    grid-template-columns: 1fr;
    padding: 28px 32px 20px;
    gap: 20px;
  }
  .gtp-section-h1 { font-size: 44px; }
  .gtp-section-body { padding: 20px 32px 40px; }
  .gtp-section-topbar { padding: 14px 24px; }
  .gtp-movements-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .gtp-artists-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .gtp-lb-chips { justify-content: flex-start; }
  #screen-leaderboard-redesign .gtp-section-body { padding-left: 24px; padding-right: 24px; }
  .gtp-lb-row.you { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 719px) {
  .gtp-section-topbar { padding: 12px 18px; }
  .gtp-section-topnav { gap: 16px; }
  .gtp-section-topnav a, .gtp-section-topnav button { font-size: 12px; }
  .gtp-section-header { padding: 20px 18px 16px; }
  .gtp-section-h1 { font-size: 32px; }
  .gtp-section-body { padding: 16px 18px 32px; }
  .gtp-artists-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .gtp-movements-grid { grid-template-columns: 1fr; }
  .gtp-movement-card-visual { height: 140px; }
  .gtp-lb-table-header, .gtp-lb-row {
    grid-template-columns: 56px 1fr 80px;
    gap: 12px;
  }
  .gtp-lb-rank { font-size: 26px; }
  .gtp-lb-player { font-size: 18px; }
  .gtp-lb-count { font-size: 16px; }
  .gtp-lb-row.you { margin-left: -10px; margin-right: -10px; padding-left: 10px; padding-right: 10px; }
}

/* ============================================================
   MOVEMENTS PAGE — SEO intro
   ============================================================ */
.gtp-movements-seo-intro {
  max-width: 760px;
  margin: 0 0 36px;
  padding: 28px 32px;
  background: var(--paper-2);
  border-left: 4px solid var(--ochre);
  border-radius: 2px;
}
.gtp-movements-seo-h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
  line-height: 1.15;
}
.gtp-movements-seo-p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.gtp-movements-seo-p:last-child {
  margin-bottom: 0;
}
@media (max-width: 720px) {
  .gtp-movements-seo-intro { padding: 22px 22px; }
  .gtp-movements-seo-h2 { font-size: 24px; }
  .gtp-movements-seo-p { font-size: 16px; }
}

/* ============================================================
   LANG SELECTOR on section pages (static — no toggle JS).
   The home rules are scoped to .gtp-home, so here the menu showed all
   languages at once and the toggle was unstyled. Mirror the home look
   and open the menu on hover / focus-within (works without JS).
   ============================================================ */
.gtp-section-screen .home-lang-selector,
body.gtp-section-screen .home-lang-selector {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
}
.gtp-section-screen .home-lang-selector .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 0 12px;
  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-section-screen .home-lang-selector .lang-toggle:hover { border-color: var(--ochre); color: var(--ochre-deep); }
.gtp-section-screen .home-lang-selector .lang-toggle > span { display: inline-flex; align-items: center; line-height: 1; }
.gtp-section-screen .home-lang-selector .lang-flag { font-size: 14px; }
.gtp-section-screen .home-lang-selector .lang-caret { font-size: 10px; opacity: 0.6; margin-left: 2px; }
/* Hide the menu by default; open on hover or keyboard focus */
.gtp-section-screen .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-section-screen .home-lang-selector:hover .lang-menu,
.gtp-section-screen .home-lang-selector:focus-within .lang-menu,
.gtp-section-screen .home-lang-selector.open .lang-menu { display: block; }
.gtp-section-screen .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-section-screen .home-lang-selector .lang-opt:hover,
.gtp-section-screen .home-lang-selector .lang-opt.active { background: var(--paper-2); }

/* ============================================================
   PHONE (≤600px) — section listing topbar.
   These pages share the home's .gtp-topbar but have NO burger, so
   instead of hiding the nav we let the bar WRAP: brand centered on
   row 1, nav (links + language pill) centered on row 2. This stops
   the topbar forcing the page wider than the phone screen (it was
   rendering ~613px wide and looked zoomed-out).
   ============================================================ */
@media (max-width: 600px) {
  .gtp-section-screen .gtp-topbar {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
    column-gap: 16px;
    padding: 12px 16px;
  }
  .gtp-section-screen .gtp-topbar .gtp-brand {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
  }
  .gtp-section-screen .gtp-topnav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 18px;
    font-size: 13px;
  }
}
