/* LD — Revista Cultural — May 2026 */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,opsz,wght@0,8..144,400..600;1,8..144,400..600&family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap');

/* ─── Tokens ─── */
:root {
  --white:  #F8F7F4;
  --ink:    #0F0F0E;
  --accent: #B83229;
  --smoke:  #787672;
  --light:  #EEECEA;
  --border: #D4D2CE;

  --fd: 'Fraunces', Georgia, serif;
  --fb: 'EB Garamond', Georgia, serif;

  --t-2xs: clamp(.62rem,  .57rem + .25vw, .72rem);
  --t-xs:  clamp(.78rem,  .72rem + .30vw, .88rem);
  --t-sm:  clamp(.93rem,  .86rem + .35vw, 1.03rem);
  --t-md:  clamp(1.06rem, .98rem + .40vw, 1.20rem);
  --t-lg:  clamp(1.28rem, 1.05rem + 1.15vw, 1.80rem);
  --t-xl:  clamp(1.65rem, 1.20rem + 2.25vw, 2.70rem);
  --t-2xl: clamp(2.20rem, 1.40rem + 4.00vw, 4.50rem);
  --t-logo:clamp(3.00rem, 2.00rem + 5.00vw, 7.00rem);

  --sp-2xs: clamp(.28rem, .22rem + .30vw, .44rem);
  --sp-xs:  clamp(.55rem, .44rem + .55vw, .85rem);
  --sp-s:   clamp(.90rem, .72rem + .90vw, 1.40rem);
  --sp-m:   clamp(1.40rem, 1.05rem + 1.75vw, 2.20rem);
  --sp-l:   clamp(2.00rem, 1.40rem + 3.00vw, 3.60rem);
  --sp-xl:  clamp(3.20rem, 2.00rem + 6.00vw, 6.50rem);

  --wide:  960px;
  --prose: 68ch;
  --gutter: clamp(1.20rem, 5vw, 3.50rem);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

/* ─── Base ─── */
html { font-size: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--fb);
  font-size: var(--t-md);
  font-optical-sizing: auto;
  font-feature-settings: 'kern' 1, 'liga' 1, 'onum' 1;
  background: var(--white);
  color: var(--ink);
  line-height: 1.78;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection { background: rgba(184, 50, 41, .14); }
a { color: inherit; text-decoration: none; }

/* ════════════════════════════════════════
   MASTHEAD
════════════════════════════════════════ */
.site-header {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-s) var(--gutter);
}

.masthead {
  max-width: var(--wide);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--sp-m);
}

.masthead-nav { display: flex; gap: var(--sp-m); }
.masthead-nav--right { justify-content: flex-end; }

.masthead-nav a {
  font-size: var(--t-2xs);
  font-variant: small-caps;
  letter-spacing: .22em;
  color: var(--smoke);
  transition: color .2s;
}
.masthead-nav a:hover { color: var(--ink); }

.site-title {
  font-family: var(--fd);
  font-size: var(--t-logo);
  font-weight: 200;
  font-optical-sizing: auto;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  color: var(--ink);
  transition: color .2s;
}
.site-title:hover { color: var(--accent); }

/* ─── Main ─── */
main {
  flex: 1;
  max-width: var(--wide);
  width: 100%;
  margin-inline: auto;
  padding: var(--sp-xl) var(--gutter);
}

/* ════════════════════════════════════════
   SECTION LABEL
════════════════════════════════════════ */
.section-label {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  margin-bottom: var(--sp-l);
}

.section-label span {
  font-size: var(--t-2xs);
  font-variant: small-caps;
  letter-spacing: .22em;
  color: var(--smoke);
  white-space: nowrap;
}

.section-label::before,
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ════════════════════════════════════════
   FEATURED POST
════════════════════════════════════════ */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  align-items: center;
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-xl);
  position: relative;
}

.post-featured--no-image {
  grid-template-columns: 1fr;
  text-align: left;
}

.post-featured__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--light);
}

.post-featured__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.post-featured:hover .post-featured__image img {
  transform: scale(1.03);
}

.post-featured__kicker {
  display: block;
  font-size: var(--t-2xs);
  font-style: italic;
  color: var(--smoke);
  margin-bottom: var(--sp-xs);
  letter-spacing: .04em;
}

.post-featured__title {
  font-family: var(--fd);
  font-size: var(--t-2xl);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.05;
  text-wrap: balance;
  margin-bottom: var(--sp-s);
  transition: color .2s;
}

.post-featured:hover .post-featured__title { color: var(--accent); }

.post-featured__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.post-featured__excerpt {
  font-size: var(--t-sm);
  color: var(--smoke);
  line-height: 1.65;
  max-width: 42ch;
}

/* ════════════════════════════════════════
   POST GRID (entradas 2-4)
════════════════════════════════════════ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-m);
  margin-bottom: var(--sp-xl);
}

.post-card {
  position: relative;
  border-top: 2px solid var(--border);
  padding-top: var(--sp-s);
  transition: border-top-color .2s;
}

.post-card:hover { border-top-color: var(--accent); }

.post-card__thumb {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--light);
  margin-bottom: var(--sp-s);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.post-card:hover .post-card__thumb img { transform: scale(1.04); }

.post-card__date {
  display: block;
  font-size: var(--t-2xs);
  font-style: italic;
  color: var(--smoke);
  margin-bottom: var(--sp-2xs);
}

.post-card__title {
  font-family: var(--fd);
  font-size: var(--t-lg);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.18;
  text-wrap: balance;
  transition: color .2s;
}

.post-card:hover .post-card__title { color: var(--accent); }

.post-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* ════════════════════════════════════════
   ARCHIVO (entradas 5+)
════════════════════════════════════════ */
.post-archive { list-style: none; }

.post-archive__item {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: var(--sp-s);
  align-items: baseline;
  padding-block: var(--sp-xs);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.post-archive__item:first-child { border-top: 1px solid var(--border); }

.post-archive__date {
  font-size: var(--t-xs);
  font-style: italic;
  color: var(--smoke);
  letter-spacing: .02em;
}

.post-archive__title {
  font-family: var(--fd);
  font-size: var(--t-md);
  font-weight: 400;
  line-height: 1.3;
  transition: color .2s;
}

.post-archive__item:hover .post-archive__title { color: var(--accent); }

.post-archive__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* ════════════════════════════════════════
   POST PAGE
════════════════════════════════════════ */
.reading-bar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 1000;
  animation: reading-progress linear both;
  animation-timeline: scroll(root block);
}
@keyframes reading-progress { to { transform: scaleX(1); } }

.post-header {
  max-width: var(--prose);
  margin-bottom: var(--sp-l);
  padding-bottom: var(--sp-m);
  border-bottom: 1px solid var(--border);
}

.post-header__date {
  display: block;
  font-size: var(--t-2xs);
  font-style: italic;
  color: var(--smoke);
  margin-bottom: var(--sp-s);
}

.post-header__title {
  font-family: var(--fd);
  font-size: var(--t-2xl);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.06;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.post-body {
  max-width: var(--prose);
  font-size: var(--t-md);
  line-height: 1.85;
}

.post-body p { margin-bottom: 1.4em; }
.post-body p:last-child { margin-bottom: 0; }

.post-body > p:first-of-type::first-letter {
  font-family: var(--fd);
  font-size: 4.2em;
  font-weight: 200;
  font-optical-sizing: auto;
  float: left;
  line-height: .74;
  margin: .07em .10em 0 0;
  color: var(--accent);
}

.post-body figure + p::first-letter {
  font-size: inherit; float: none; margin: 0;
  color: inherit; line-height: inherit;
  font-family: inherit; font-weight: inherit;
}

.post-body strong { font-weight: 600; }
.post-body em { font-style: italic; }

.post-body h2 {
  font-family: var(--fd);
  font-size: var(--t-xl);
  font-weight: 400;
  font-optical-sizing: auto;
  margin: 2.5em 0 .7em;
  line-height: 1.15;
  text-wrap: balance;
}
.post-body h3 {
  font-family: var(--fd);
  font-size: var(--t-lg);
  font-weight: 400;
  font-optical-sizing: auto;
  margin: 2em 0 .6em;
}

.post-body blockquote {
  margin: var(--sp-l) 0;
  padding: var(--sp-xs) var(--sp-m);
  border-left: 2px solid var(--accent);
  background: var(--light);
}
.post-body blockquote p { margin: 0; font-style: italic; }
.post-body blockquote p::first-letter {
  font-size: inherit; float: none; margin: 0;
  color: inherit; line-height: inherit;
}

.post-body figure { margin-block: var(--sp-l); }
.post-body figure img { width: 100%; }
.post-body figure figcaption {
  font-size: var(--t-xs);
  color: var(--smoke);
  font-style: italic;
  text-align: center;
  margin-top: var(--sp-2xs);
}
.post-body img { margin-block: var(--sp-l); width: 100%; }

.post-body ul, .post-body ol { margin: .8em 0 1.4em 1.5em; }
.post-body li { margin-bottom: .35em; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-body a:hover { opacity: .72; }

.post-nav {
  max-width: var(--prose);
  margin-top: var(--sp-xl);
  padding-top: var(--sp-s);
  border-top: 1px solid var(--border);
}

.back-link {
  font-size: var(--t-2xs);
  font-variant: small-caps;
  letter-spacing: .18em;
  color: var(--smoke);
  transition: color .2s;
}
.back-link::before { content: '← '; }
.back-link:hover { color: var(--ink); }

/* ─── Page (Sobre) ─── */
.page-header {
  max-width: var(--prose);
  margin-bottom: var(--sp-l);
  padding-bottom: var(--sp-m);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--fd);
  font-size: var(--t-xl);
  font-weight: 400;
  font-optical-sizing: auto;
}
.page-body {
  max-width: var(--prose);
  font-size: var(--t-md);
  line-height: 1.85;
}
.page-body p { margin-bottom: 1.35em; }
.page-body p:last-child { margin-bottom: 0; }
.page-body figure { margin-block: var(--sp-l); }
.page-body figure img { width: 100%; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-s) var(--gutter);
}
.site-footer p {
  max-width: var(--wide);
  margin-inline: auto;
  font-size: var(--t-2xs);
  font-style: italic;
  color: var(--smoke);
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .post-archive__item { grid-template-columns: 1fr; gap: var(--sp-2xs); }
  .post-archive__date { margin-bottom: 0; }
}

@media (max-width: 480px) {
  .masthead { grid-template-columns: 1fr; text-align: center; }
  .masthead-nav { justify-content: center; }
  .post-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .reading-bar { display: none; }
}
