/* Vinistory — parchment & claret. */
:root {
  --ink: #2b2320;
  --paper: #faf7f2;
  --accent: #7a1f2b;
  --muted: #6d6259;
  --rule: #e4dcd1;
  --band: #f2ead9;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}
.site-header, main, .site-footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-size: 1.3rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--accent);
  font-variant: small-caps;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  align-items: baseline;
}
.site-nav a {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav .lang-link {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.15rem 0.55rem;
  font-size: 0.85rem;
}
.site-nav .lang-link:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 {
  font-size: 2.1rem;
  line-height: 1.18;
  margin: 1.6rem 0 0.6rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.3;
  margin: 2.6rem 0 0.8rem;
}
.era {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  margin: 2.2rem 0 0;
}
.lede {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 0.4rem;
}
article > p:first-of-type { margin-top: 1.6rem; }
blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 1.4rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.hero { padding: 2.6rem 0 1.4rem; border-bottom: 1px solid var(--rule); }
.hero-sub { margin: 0.8rem 0 0; font-size: 1.12rem; line-height: 1.6; color: var(--muted); }
.home-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 3rem;
}
.featured-grid, .explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.featured-card, .explore-card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
}
.featured-card:hover, .explore-card:hover { border-color: var(--accent); }
.featured-card .era { margin: 0 0 0.35rem; display: block; }
.featured-card strong { font-size: 1.08rem; line-height: 1.3; display: block; }
.featured-card:hover strong, .explore-card:hover strong { color: var(--accent); }
.featured-card p, .explore-card p {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}
.explore-card { background: var(--band); border-color: #e0d5bf; }
.explore-card strong { font-size: 1rem; }
.timeline { margin: 1.8rem 0 0.6rem; overflow-x: auto; }
.timeline-svg { width: 100%; min-width: 700px; height: auto; display: block; }
.hero h1 { font-size: 1.9rem; font-weight: normal; margin: 0; }
.era-group h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
}
.article-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.article-list li { margin-bottom: 1.5rem; }
.article-list a {
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.article-list a:hover strong { color: var(--accent); }
.article-list p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.98rem; }
.sources {
  border-top: 1px solid var(--rule);
  margin-top: 3.2rem;
  padding-top: 0.4rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.sources h2 { font-size: 1rem; margin-top: 1.2rem; color: var(--ink); }
.sources ol { padding-left: 1.3rem; }
.site-footer {
  margin-top: 4.5rem;
  padding-top: 1.1rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.root-splash main { text-align: center; padding-top: 18vh; }
.root-splash h1 {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.root-splash p { font-size: 1.1rem; }
img, video, svg { max-width: 100%; height: auto; }
figure { margin: 2.4rem 0; }
figure.chart {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1rem 0.6rem;
  overflow-x: auto;
}
figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
}
/* AI-generated media: the "AI reconstruction" label is written in the visible
   figcaption text (a CSS-only label would be invisible to crawlers/no-CSS). */
figure.ai-reconstruction video {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #000;
}
table { border-collapse: collapse; width: 100%; margin: 1.8rem 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--rule); padding: 0.45rem 0.7rem; text-align: left; }
th { background: var(--band); }
/* /map page */
.map-app {
  width: min(96vw, 74rem);
  margin-left: calc(50% - min(48vw, 37rem));
}
.era-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.4rem 0 0.8rem;
}
.era-tab {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  text-decoration: none;
  line-height: 1.25;
  background: #fff;
}
.era-tab-name { display: block; font-size: 0.88rem; color: var(--ink); }
.era-tab-years { display: block; font-size: 0.72rem; color: var(--muted); }
.era-tab.active { border-color: var(--accent); background: var(--accent); }
.era-tab.active .era-tab-name, .era-tab.active .era-tab-years { color: #fff; }
.map-canvas {
  height: min(72vh, 620px);
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #e8e4dc;
}
.map-noscript { padding: 2rem; text-align: center; color: var(--muted); }
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.6rem 0.2rem;
}
.legend-item i, .popup-wine i {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.map-marker {
  width: 10px; height: 10px;
  background: var(--ink);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}
.marker-label {
  position: absolute;
  left: 12px; top: -4px;
  white-space: nowrap;
  font: 11px Georgia, serif;
  color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  pointer-events: none;
}
.annotation-label {
  font: italic 11px Georgia, serif;
  color: var(--muted);
  background: rgba(250, 247, 242, 0.85);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
}
.maplibregl-popup-content {
  font-family: Georgia, serif;
  color: var(--ink);
  padding: 0.7rem 0.9rem;
}
.maplibregl-popup-content p { margin: 0.35rem 0 0; font-size: 0.85rem; }
.popup-vol { color: var(--muted); }
.era-sections { margin-top: 1.6rem; }
/* All era narratives are rendered and visible by default (no-JS + indexing);
   map.js adds .js to show only the active era. */
.era-sections.js .era-section { display: none; }
.era-sections.js .era-section.active { display: block; }
.key-dates { list-style: none; padding: 0; font-size: 0.95rem; }
.key-dates li { margin: 0.3rem 0; }
.era-years { font-weight: normal; color: var(--muted); font-size: 1rem; }
.map-credit { font-size: 0.85rem; color: var(--muted); margin-top: 2rem; }

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  body { font-size: 1rem; }
}
