/* Diari del Vi — editorial, wine-themed, mobile-first */
:root {
  --paper: #f4efe4;
  --paper-deep: #ebe3d4;
  --card: #fffbf5;
  --ink: #2c1810;
  --ink-soft: #5c4338;
  --wine: #6e1f2c;
  --wine-deep: #4a1520;
  --wine-soft: #8f3a48;
  --gold: #b8945f;
  --gold-pale: #d9c7a3;
  --rule: #d2c3ae;
  --focus: #6e1f2c;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at top, #faf6ee 0%, var(--paper) 55%, var(--paper-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.7;
  font-optical-sizing: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--wine-deep);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.site-header {
  text-align: center;
  padding: 2.4rem 1.25rem 1.6rem;
  border-bottom: 1px solid var(--gold-pale);
}
.site-kicker {
  display: block;
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.38em;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 0.55rem;
}
.site-title {
  font-family: "Cormorant Garamond", Palatino, "Palatino Linotype", serif;
  font-weight: 500;
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--wine-deep);
}
.site-title a {
  color: inherit;
  text-decoration: none;
}
.site-title a:hover { color: var(--wine); }
.site-tagline {
  margin: 0.55rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.wrap {
  max-width: 42.5rem;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.edition-kicker {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--wine);
  margin: 2.4rem 0 0.35rem;
}
.edition-date {
  font-family: "Cormorant Garamond", Palatino, serif;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 500;
  margin: 0 0 0.35rem;
  color: var(--ink);
  line-height: 1.25;
}
.edition-permalink {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  margin: 0 0 2rem;
}
.edition-permalink a {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
.edition-permalink a:hover { border-color: var(--wine); }

nav.toc {
  background: var(--card);
  border: 1px solid var(--gold-pale);
  border-left: 3px solid var(--wine);
  padding: 0.85rem 1.1rem;
  margin: 0 0 2.25rem;
}
nav.toc ol {
  margin: 0;
  padding: 0 0 0 1.15rem;
}
nav.toc li { margin: 0.2rem 0; }
nav.toc a {
  color: var(--wine-deep);
  text-decoration: none;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.95rem;
}
nav.toc a:hover { text-decoration: underline; }

.news-section { margin: 2.4rem 0; }
.news-section > h2 {
  font-family: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.45rem;
  margin: 0 0 1.3rem;
}

article.item { margin: 0 0 1.85rem; }
article.item h3 {
  font-family: "Cormorant Garamond", Palatino, serif;
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.28;
  margin: 0 0 0.4rem;
  color: var(--wine-deep);
}
article.item p { margin: 0 0 0.45rem; }

a.source {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.92rem;
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}
a.source:hover,
a.source:focus {
  color: var(--wine-deep);
  border-color: var(--wine);
}

.caption {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: -0.4rem 0 1rem;
}

.events { list-style: none; padding: 0; margin: 0; }
.events > li {
  margin: 0 0 1.15rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--gold-pale);
}
.events .lead { font-weight: 600; color: var(--wine-deep); }
.events .sub { margin: 0.4rem 0 0 0.2rem; padding: 0 0 0 1.1rem; }
.events .sub li { margin: 0.25rem 0; }
.event-links { display: inline; }
.event-links a {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.95em;
}
.event-links a:hover { border-color: var(--wine); }
.event-links .sep { color: var(--ink-soft); margin: 0 0.15rem; }

.note {
  margin: 1.5rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
}

.archive {
  margin-top: 3.25rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--gold-pale);
}
.archive h2 {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 0.9rem;
}
.archive ul { list-style: none; padding: 0; margin: 0; }
.archive li {
  border-bottom: 1px solid var(--paper-deep);
}
.archive a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  color: var(--ink);
  text-decoration: none;
  font-family: "Cormorant Garamond", Palatino, serif;
  font-size: 1.25rem;
}
.archive a:hover { color: var(--wine); }
.archive a .when {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.88rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.archive a.current { font-weight: 600; color: var(--wine-deep); }

.site-footer {
  text-align: center;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--gold-pale);
  color: var(--ink-soft);
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.85rem;
}
.site-footer a { color: var(--wine); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.not-found {
  text-align: center;
  padding: 4rem 1.25rem;
}
.not-found h1 {
  font-family: "Cormorant Garamond", Palatino, serif;
  font-weight: 500;
  font-size: 2.2rem;
  color: var(--wine-deep);
  margin: 0 0 0.6rem;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  body { font-size: 1.06rem; }
  article.item h3 { font-size: 1.28rem; }
  .archive a { flex-direction: column; gap: 0.15rem; padding: 0.85rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .site-header, .archive, .site-footer, nav.toc { break-inside: avoid; }
  a.source, .event-links a { color: inherit; border-bottom: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #555; }
}

.group-title {
  font-family: "Cormorant Garamond", Palatino, serif;
  font-size: 1.35rem;
  font-weight: 500;
  margin: 1.4rem 0 0.7rem;
  color: var(--ink);
}
