/* La Mesa Española — design system */
:root {
  --bg: #f6f1e7;
  --paper: #fbf7ef;
  --ink: #1d1611;
  --muted: #6b5a48;
  --terracotta: #b8492a;
  --terracotta-deep: #8a3319;
  --ochre: #c98a2b;
  --olive: #5d6b3a;
  --line: #d9cdb6;
  --shadow: 0 30px 60px -30px rgba(80, 45, 20, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--terracotta-deep); text-decoration: none; border-bottom: 1px solid rgba(138,51,25,0.25); transition: color .2s, border-color .2s; }
a:hover { color: var(--terracotta); border-color: var(--terracotta); }

h1, h2, h3, h4, .display, .eyebrow-serif {
  font-family: "Cormorant Garamond", "Garamond", "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); line-height: 1.02; font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.15; margin-top: 2.5em; margin-bottom: 0.6em; }
h3 { font-size: 1.4rem; line-height: 1.3; margin-top: 1.8em; margin-bottom: 0.4em; }
p { margin-bottom: 1.1em; }
p + p { text-indent: 0; }

.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
}

/* ---------- Layout ---------- */
.site {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--ink);
  border: none;
}
.brand span { color: var(--terracotta); }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-links a {
  color: var(--muted);
  border: none;
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--terracotta); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
  padding: 70px 0 80px;
  border-bottom: 1px solid var(--line);
}
.hero-text .eyebrow { margin-bottom: 18px; display: inline-block; }
.hero-text h1 { margin-bottom: 22px; }
.hero-text .lede {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
  max-width: 30em;
}
.hero-meta {
  margin-top: 32px;
  display: flex;
  gap: 26px;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-img {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-img img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 50px; }
  .hero-img img { aspect-ratio: 4/3; }
}

/* ---------- Article ---------- */
.article {
  display: grid;
  grid-template-columns: minmax(0, 680px) 1fr;
  gap: 80px;
  padding: 70px 0 60px;
}
.article-body { max-width: 680px; }
.article-body p:first-of-type::first-letter {
  font-family: "Cormorant Garamond", serif;
  font-size: 4.6rem;
  float: left;
  line-height: 0.9;
  padding: 8px 12px 0 0;
  color: var(--terracotta);
  font-weight: 500;
}
.article-body p { color: #2a211a; }
.article-body figure { margin: 38px 0; }
.article-body figure img { border-radius: 2px; box-shadow: var(--shadow); }
.article-body figcaption {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.pull {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.9rem;
  line-height: 1.3;
  color: var(--terracotta-deep);
  border-left: 3px solid var(--terracotta);
  padding: 4px 0 4px 24px;
  margin: 38px 0;
  font-style: italic;
}

/* ---------- Callout boxes ---------- */
.callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 30px;
  margin: 36px 0;
  position: relative;
}
.callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--terracotta);
}
.callout .eyebrow { display: block; margin-bottom: 10px; }
.callout h4 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 14px;
}
.callout ul { padding-left: 1.1em; }
.callout li { margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

.callout.olive::before { background: var(--olive); }
.callout.olive .eyebrow { color: var(--olive); }
.callout.ochre::before { background: var(--ochre); }
.callout.ochre .eyebrow { color: var(--ochre); }

/* ---------- Sidebar ---------- */
.aside {
  position: sticky;
  top: 30px;
  align-self: start;
  font-size: 0.92rem;
}
.aside-block { padding: 22px 0; border-top: 1px solid var(--line); }
.aside-block:first-child { border-top: none; padding-top: 0; }
.aside h5 {
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 12px;
}
.aside ol { list-style: none; counter-reset: chap; }
.aside ol li {
  counter-increment: chap;
  padding: 7px 0;
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 0.92rem;
}
.aside ol li::before {
  content: counter(chap, decimal-leading-zero);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--terracotta);
  font-size: 0.95rem;
  min-width: 28px;
}
.aside ol li a { color: var(--ink); border: none; }
.aside ol li a:hover { color: var(--terracotta); }
.aside ol li.current a { color: var(--terracotta); font-style: italic; }

@media (max-width: 980px) {
  .article { grid-template-columns: 1fr; gap: 40px; padding: 40px 0; }
  .aside { position: static; }
}

/* ---------- Footer nav ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.pager a {
  border: none;
  display: block;
  padding: 18px 0;
}
.pager .label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.pager .title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  color: var(--ink);
}
.pager a:hover .title { color: var(--terracotta); }
.pager .next { text-align: right; }

footer.site-footer {
  margin-top: 60px;
  padding: 40px 0 50px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
footer.site-footer .brand { display: block; margin-bottom: 8px; font-size: 1.6rem; }

/* ---------- Index page grid ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 30px;
  padding: 60px 0 30px;
}
.chap-card {
  border: none;
  display: block;
  color: var(--ink);
}
.chap-card .thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.chap-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s ease;
}
.chap-card:hover .thumb img { transform: scale(1.04); }
.chap-card .num {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--terracotta);
  font-size: 0.95rem;
}
.chap-card h3 {
  font-size: 1.5rem;
  margin: 4px 0 6px;
}
.chap-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
@media (max-width: 880px) {
  .chapter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .chapter-grid { grid-template-columns: 1fr; }
}
