/* Estilo «Hemeroteca», encima de app.css (que da estructura y valores base).
   Sobrio y legible: papel cálido sin texturas, mancheta y titulares en Playfair
   Display (900) y Source Serif 4 (700), y la interfaz en sans. Las fuentes se
   sirven desde el sitio. */

/* Playfair Display 900 (OFL, ver fonts/OFL-playfair-display.txt), latin y latin-ext. */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/playfair-display-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../fonts/playfair-display-900-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  --c-bg: #F7F4EE; --c-surface: #FCFAF6; --c-surface-2: #EDE8DE; --c-border: #DCD5C8;
  --c-rule: #1C1A17; --c-text: #1C1A17; --c-text-2: #555048; --c-accent: #9E1B1F;
  --c-title-hover: color-mix(in srgb, var(--c-accent) 30%, var(--c-text));
  --font-display: "Playfair Display", "Source Serif 4", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #17150F; --c-surface: #1E1B16; --c-surface-2: #2A261F; --c-border: #3A352C;
    --c-rule: #ECE6DA; --c-text: #ECE6DA; --c-text-2: #ADA596; --c-accent: #E58B6F;
  }
}

/* ---------- cabecera: mancheta centrada, fecha entre «orejas» ---------- */

.masthead { border-bottom: 1px solid var(--c-rule); }
.masthead .wrap {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  padding-block: 18px 12px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.today {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-serif);
  font-variant: small-caps;
  letter-spacing: .1em;
  font-size: .85rem;
}
.today::before, .today::after {
  content: "";
  width: clamp(24px, 8vw, 90px);
  border-top: 1px solid var(--c-border-strong);
}
@media (max-width: 599px) { .today { display: none; } }

/* ---------- pestañas: sans, sin adornos; la activa en el color de acento ---------- */

.tabs { border-bottom: 1px solid var(--c-border); }
.tabs .wrap { justify-content: safe center; }
.tabs a, .tabs .tab-papers, .tab-add { font-weight: 500; }
.tabs a[aria-current="page"], .tabs .tab-papers[aria-current="page"] {
  box-shadow: none;
  color: var(--c-accent);
}
@media (hover: hover) {
  .tabs a:hover, .tabs .tab-papers:hover,
  .tabs a[aria-current="page"]:hover, .tabs .tab-papers[aria-current="page"]:hover { box-shadow: none; }
}

/* ---------- titulares: Source Serif 4 con cuerpo ---------- */

.opening { border-bottom: 0; }
.opening-title, .card-title, .paper-lead-title, .paper-card-title, .paper-row-title,
.opinion-title, .headline-link, .search-list a {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--c-text);
}
.opening-title, .paper-lead-title { line-height: 1.12; letter-spacing: -0.012em; }
.card-title, .opinion-title { line-height: 1.22; }

/* Al pasar: granate casi negro y una línea fina que se dibuja despacio. */
.card-title a, .opening-title a, .other-headlines a, .paper-lead-title a, .paper-card-title a, .paper-row-title a, .opinion-title a {
  --underline: color-mix(in srgb, var(--c-text) 10%, transparent);
  background: linear-gradient(var(--underline), var(--underline)) 0 98% / 0 1px no-repeat;
  transition: background-size 700ms ease, color 400ms ease;
}
.card-title a:hover, .opening-title a:hover, .other-headlines a:hover,
.paper-lead-title a:hover, .paper-card-title a:hover, .paper-row-title a:hover,
.opinion-title a:hover {
  text-decoration: none;
  background-size: 100% 1px;
  color: var(--c-title-hover);
}

/* Entradillas: texto oscuro, justificado y con guiones. */
.opening-summary, .card-summary, .paper-lead-sum, .opinion-summary {
  color: color-mix(in srgb, var(--c-text) 82%, var(--c-bg));
  text-align: justify;
  hyphens: auto;
}

/* ---------- tarjetas y portada ---------- */

.card { border-top: 1px solid var(--c-border); padding-top: var(--sp-5); }
.card-stack { gap: 0; }
.card-stack > .card + .card { border-top: 1px solid var(--c-border); }
.other-headlines li, .headlines li, .paper-item, .search-list li { border-top: 1px solid var(--c-border); }

.chip {
  background: none;
  border: 1px solid var(--c-border);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-2);
}
.chip:hover { border-color: var(--c-border-strong); color: var(--c-text); }

/* ---------- detalles generales ---------- */

::selection { background: color-mix(in srgb, var(--c-accent) 20%, transparent); }
mark { background: linear-gradient(transparent 55%, var(--c-mark) 55%); }

/* Títulos de página: serif con cuerpo y un filete fino debajo. */
.title-row h1, .archive > h1, .search-page h1, .paper-title, .settings h1, .detail h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.012em;
}
.title-row, .archive > h1, .search-page h1, .paper-title {
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-5);
}

/* ---------- panel de periódicos ---------- */

.papers { background: var(--c-surface); border-left: 1px solid var(--c-border); }
.papers-group { color: var(--c-accent); }
.paper-name { font-family: var(--font-serif); font-size: 1rem; }
.paper-row.is-active { background: color-mix(in srgb, var(--c-accent) 7%, var(--c-surface)); }
.paper-row.is-active .paper-name { font-weight: 600; color: var(--c-accent); }

/* ---------- opinión ---------- */

.opinion-signature { color: var(--c-accent); font-weight: 600; }

/* ---------- archivo: calendario ---------- */

.calendar-head h2, .archive-detail h2 { font-family: var(--font-serif); font-weight: 700; }
.calendar-day[aria-pressed="true"],
.calendar-day[aria-pressed="true"]:hover { background: var(--c-accent); color: var(--c-surface); }
.archive-slot { border-radius: 0; }

/* ---------- resumen: lectura cómoda, textos justificados ---------- */

.digest { max-width: none; }
.digest-section { color: var(--c-text-2); }
.digest-num { font-family: var(--font-sans); font-size: .875rem; line-height: 2; color: var(--c-accent); }
.digest-item { padding-block: var(--sp-5); }
.digest-text {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-text);
  text-align: left;
  hyphens: manual;
}
.digest-articles {
  max-width: 72ch;
  margin-top: var(--sp-4);
  padding-left: var(--sp-4);
  border-left: 2px solid var(--c-border);
}
.digest-articles li + li { margin-top: var(--sp-4); }
.digest-articles a { font-family: var(--font-serif); font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.digest-article-source { margin-bottom: 2px; }
.digest-article-summary {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--c-text) 82%, var(--c-bg));
  text-align: justify;
  hyphens: auto;
}

/* ---------- avisos flotantes y diálogos ---------- */

.why-tip, dialog {
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 0;
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, .3);
}
