/* =========================================================================
   Guess the City — landmark pages
   -------------------------------------------------------------------------
   An atlas, not a travel blog. The reference these pages compete against is
   the listicle, so the answer is not more colour: it is the authority of a
   well-set gazetteer. Warm paper, deep ink, and one accent — the verdigris
   that copper turns after a century outdoors.

   The layout is a three-track grid so photographs can break out past the
   text measure while prose stays at a readable width. Nothing else breaks
   the grid, which is what makes the plates land.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,900;1,9..144,400&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;1,6..72,400&family=Archivo:wght@400;500;700&display=swap');

:root {
  --paper:      #f6f2e9;
  --paper-warm: #efe9dc;
  --ink:        #1b1913;
  --ink-soft:   #4a463b;
  --ink-faint:  #7d776a;
  --rule:       #d5cdba;
  --patina:     #2c5d52;
  --patina-lit: #3d8272;
  --ochre:      #a9762f;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  --display: 'Fraunces', Georgia, serif;
  --body:    'Newsreader', Georgia, serif;
  --label:   'Archivo', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #14140f;
    --paper-warm: #1b1a14;
    --ink:        #ece6d8;
    --ink-soft:   #b8b1a1;
    --ink-faint:  #8a8474;
    --rule:       #35322a;
    --patina:     #6fae9d;
    --patina-lit: #8ec9b7;
    --ochre:      #d0a25e;
  }
}
:root[data-theme="dark"] {
  --paper:      #14140f;
  --paper-warm: #1b1a14;
  --ink:        #ece6d8;
  --ink-soft:   #b8b1a1;
  --ink-faint:  #8a8474;
  --rule:       #35322a;
  --patina:     #6fae9d;
  --patina-lit: #8ec9b7;
  --ochre:      #d0a25e;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.5vw + 0.95rem, 1.1875rem);
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  /* A faint horizon wash: paper is never flat. */
  background-image: radial-gradient(120% 60% at 50% 0%,
                    var(--paper-warm) 0%, transparent 70%);
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- header */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem var(--gutter);
}
.site-logo {
  font-family: var(--label);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-logo:hover { color: var(--patina); }

/* ------------------------------------------------------------------ grid */

main {
  display: grid;
  grid-template-columns:
    minmax(var(--gutter), 1fr)
    minmax(0, var(--measure))
    minmax(var(--gutter), 1fr);
  padding-bottom: 5rem;
}
main > * { grid-column: 2; }

article { display: contents; }
article > * { grid-column: 2; }

/* A landmark spans the page and re-declares the tracks, so its photograph can
   break out while its prose stays in the measure. Setting grid-column on the
   image alone does nothing: the image is not a grid item of `main`. */
/* The tracks are repeated literally rather than held in a custom property:
   a nested var() inside grid-template-columns is invalid at computed-value
   time in practice, which silently collapses the whole grid to one column. */
.landmark {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns:
    minmax(var(--gutter), 1fr)
    minmax(0, var(--measure))
    minmax(var(--gutter), 1fr);
}
.landmark > * { grid-column: 2; }

.landmark img,
.plate {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 68rem);
  margin: 1.5rem 0 0.9rem;
}

/* ------------------------------------------------------------ typography */

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 2.4rem 0 0.5rem;
  text-wrap: balance;
}

h2 {
  font-family: var(--label);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 3.5rem 0 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 0.15rem;
  text-wrap: balance;
}

p { margin: 0 0 1.05em; }
strong { font-weight: 600; }
em { font-style: italic; }

a { color: var(--patina); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ochre); }

/* ----------------------------------------------------------- breadcrumbs */

.breadcrumbs {
  font-family: var(--label);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2rem;
}
.breadcrumbs a { color: var(--ink-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--patina); text-decoration: underline; }

/* --------------------------------------------------------------- tagline */

.tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.35;
  color: var(--ink-soft);
  max-width: 30rem;
  margin: 0 0 2rem;
  text-wrap: pretty;
}

/* -------------------------------------------------------------- landmark */

.landmark {
  margin: 3rem 0 0;
  /* Staggered reveal on load. One orchestrated moment, not scattered fidgets. */
  animation: rise 620ms cubic-bezier(.2,.7,.3,1) both;
}
.landmark:nth-of-type(1) { animation-delay: 40ms; }
.landmark:nth-of-type(2) { animation-delay: 90ms; }
.landmark:nth-of-type(3) { animation-delay: 140ms; }
.landmark:nth-of-type(n+4) { animation-delay: 180ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .landmark { animation: none; }
}

.landmark img {
  display: block;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(0,0,0,.55);
}

/* The data line: year and architect, set as a rule-bounded label. */
.facts {
  font-family: var(--label);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
  padding-top: 0.35rem;
}

/* The field that teaches recognition. It earns the emphasis: it is what
   makes a reader better at the game on the next round. */
.recognition {
  font-family: var(--body);
  font-style: italic;
  font-size: 1.12em;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--patina);
  padding-left: 1.05rem;
  margin: 0 0 1.2rem;
  text-wrap: pretty;
}

.trivia {
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  border-top: 1px solid var(--rule);
}
.trivia li {
  position: relative;
  padding: 0.62rem 0 0.62rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95em;
  color: var(--ink-soft);
}
.trivia li::before {
  content: '§';
  position: absolute;
  left: 0;
  top: 0.62rem;
  color: var(--ochre);
  font-family: var(--display);
}

/* Attribution. Small, but never absent — the licence requires it. */
.credit {
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  margin: 0;
}

/* ----------------------------------------------- country page city cards */

.city-block {
  border-top: 1px solid var(--rule);
  padding: 1.4rem 0 1.2rem;
}
.city-block h3 { margin-bottom: 0.3rem; }
.city-block h3 a { color: var(--ink); text-decoration: none; }
.city-block h3 a:hover { color: var(--patina); }
.city-block .tagline {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  max-width: none;
}
.city-block p:last-child {
  font-family: var(--label);
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* ------------------------------------------------------------ hub indexes */

.index-grid,
.index-list {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 0;
}
.index-grid {
  columns: 2 11rem;
  column-gap: 2rem;
}
.index-grid li {
  break-inside: avoid;
  padding: 0.28rem 0;
}
.index-grid a {
  font-family: var(--label);
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.index-grid a:hover {
  color: var(--patina);
  border-bottom-color: var(--patina);
}

.index-list li {
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0;
  display: grid;
  gap: 0.15rem;
}
.index-list a {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}
.index-list a:hover { color: var(--patina); }
.index-list .tagline {
  font-family: var(--body);
  font-style: normal;
  font-size: 0.92rem;
  color: var(--ink-faint);
  margin: 0;
  max-width: none;
}

/* -------------------------------------------------------------- related */

.related p {
  font-family: var(--label);
  font-size: 0.9rem;
  margin-top: 1.1rem;
}

/* ---------------------------------------------------------------- the CTA */

.play-cta {
  margin: 4rem 0 0;
  padding: 0;
}
.play-cta a {
  display: block;
  background: var(--patina);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  padding: 1.5rem 1.75rem;
  border-radius: 2px;
  transition: background 180ms ease, transform 180ms ease;
}
.play-cta a:hover {
  background: var(--patina-lit);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.6rem var(--gutter) 3rem;
  font-family: var(--label);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-faint); }
.site-footer a:hover { color: var(--patina); }

/* Wide screens: let the plates breathe further. */
@media (min-width: 72rem) {
  :root { --measure: 38rem; }
}

/* ---- credits table ------------------------------------------------------
   592 rows, so it is a table and not prose. Scrolls inside its own box: the
   page body never scrolls sideways. */
.table-wrap { overflow-x: auto; margin: 2rem 0; }
table.credits {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--label);
  font-size: .82rem;
}
table.credits th, table.credits td {
  text-align: left;
  padding: .45rem .9rem .45rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.credits th {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  position: sticky;
  top: 0;
  background: var(--paper);
}
table.credits td:nth-child(3) { white-space: normal; max-width: 22rem; }

/* ---- header nav and the route into the game -----------------------------
   These pages exist to be found in a search and then to lead somewhere. The
   header carried only the wordmark, so a reader arriving from Google at
   /landmarks/rome/ had no way to the game at all — which made the whole SEO
   layer a dead end with good typography.

   The link is deliberately not a big coloured button. These pages earn trust
   by reading like a reference, and a reference that shouts at you stops being
   one; the verdigris rule and the arrow are enough to be found. */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 3vw, 1.6rem);
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-nav a { color: var(--ink-faint); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.site-play {
  color: var(--patina);
  border-bottom: 2px solid var(--patina);
  padding-bottom: 2px;
  font-weight: 700;
}
.site-nav a.site-play:hover { color: var(--patina-lit); border-color: var(--patina-lit); }

.site-cta-line { margin-bottom: 0.9rem; }
.site-cta-line .site-play {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--patina);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.site-cta-line .site-play:hover { color: var(--patina-lit); border-color: var(--patina-lit); }

/* ---- admin dashboard ----------------------------------------------------
   Scanned, not read. So the summary comes before the detail, and every number
   gets a bar beside it: "3 of 4" is a fact you have to think about, and a bar
   three-quarters full is one you do not. */
.adm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.6rem;
  margin: 2rem 0;
}
.adm-card {
  padding: 0.9rem 0.8rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-align: center;
}
.adm-card.adm-lead { border-color: var(--patina); }
.adm-value {
  display: block;
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.adm-card.adm-lead .adm-value { color: var(--patina); }
.adm-label {
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

table.adm-table { border-collapse: collapse; width: 100%; font-family: var(--label); font-size: 0.82rem; }
table.adm-table th, table.adm-table td {
  text-align: left;
  padding: 0.45rem 0.9rem 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}
table.adm-table th {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
table.adm-table td.adm-n { text-align: right; font-variant-numeric: tabular-nums; width: 5rem; }
table.adm-table td:last-child { width: 45%; }

.adm-bar { display: block; height: 6px; background: var(--rule); border-radius: 1px; overflow: hidden; }
.adm-bar-fill { display: block; height: 100%; background: var(--patina); }

/* ---- style hub grid ---------------------------------------------------- */
ul.style-grid {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem;
}
ul.style-grid a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
}
ul.style-grid a:hover { border-color: var(--patina); }
ul.style-grid strong { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
ul.style-grid span {
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Reports panel on /admin. The button is deliberately plain: this page is a
   workbench, not a product, and a styled call-to-action here would imply the
   numbers carry further than one browser's storage. */
.adm-note {
  font-family: var(--label);
  font-size: 0.78rem;
  color: var(--ink-faint);
  border-left: 2px solid var(--rule);
  padding-left: 0.8rem;
  margin: 1rem 0;
}
.adm-btn {
  font-family: var(--label);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.45rem 0.8rem;
  margin-right: 0.4rem;
  cursor: pointer;
}
.adm-btn:hover { border-color: var(--patina); color: var(--patina); }
