/*
 * Diseño único de los reportajes de Onda Nipona.
 * Lo usa src/server/views/pages/article.ejs. Los reportajes no llevan CSS propio:
 * cualquier cambio de diseño se hace aquí y vale para todos.
 */
:root {
  --ink:       #0E1E2A;
  --ink-soft:  #1C2E3C;
  --paper:     #F5F0E8;
  --red:       #CE1E4C;
  --red-dark:  #A8123A;
  --red-deep:  #7D0B2A;
  --gold:      #C9963A;
  --gold-light:#E8C97A;
  --grey:      #5A6570;
  --grey-light:#D2D6D0;
  --white:     #FDFAF4;
  --accent:    #1E3A5F;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-kanji:   'Shippori Mincho', serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-mono:    'IBM Plex Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.75;
  overflow-x: clip;
}

/* ── HEADER / NAV ── */
.site-header {
  background: var(--ink);
  border-bottom: 2px solid var(--red);
  padding: 0 40px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.site-logo {
  font-family: var(--font-kanji);
  font-weight: 800;
  font-size: 19px;
  color: var(--paper);
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.site-logo img { width: 30px; height: 30px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
.site-nav {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey-light);
  display: flex; gap: 15px;
}

/* ── COVER ── */
.cover {
  background: var(--ink);
  padding: 80px 0 0;
  position: relative;
  overflow: hidden;
}
.cover-bg {
  position: absolute; inset: 0;
  /* La imagen la pone la plantilla desde la ficha (coverImage.src) */
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center center;
  opacity: 0.45;
  pointer-events: none;
}
/* Encuadre del fondo: coverImage.focus de la ficha */
.cover-bg--right { background-position: right center; }
.cover-bg--top { background-position: center top; }
.cover-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,30,42,0.2) 0%, rgba(14,30,42,0.75) 100%);
}
.cover-deco {
  position: absolute;
  right: 60px; top: 60px;
  font-family: var(--font-kanji);
  font-size: 180px;
  font-weight: 800;
  color: rgba(255,255,255,0.05);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 2;
}

.cover-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 40px 72px;
  position: relative;
  z-index: 2;
}

.cover-section {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.cover-section::before {
  content: '';
  display: block; width: 24px; height: 1px;
  background: var(--red);
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  color: var(--paper);
  line-height: 1.08;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.cover-title em {
  font-style: italic;
  color: var(--gold);
}

.cover-deck {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 300;
  color: rgba(245,240,232,0.72);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 52px;
}

.cover-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.cover-meta-item { display: flex; flex-direction: column; gap: 4px; }
.cover-meta-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.35);
}
.cover-meta-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(245,240,232,0.75);
}
.cover-meta-value.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(206,30,76,0.28);
  color: var(--gold-light);
  padding: 3px 8px;
  letter-spacing: 0.1em;
}

.cover-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--red-dark));
}

/* ── READING PROGRESS ── */
.progress-bar {
  position: fixed;
  top: 54px; left: 0;
  height: 2px;
  background: var(--red);
  z-index: 99;
  transition: width 0.1s;
  width: 0%;
}

/* ── ARTICLE BODY ── */
.article-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 72px 40px 100px;
}

.article-body > p:first-of-type::first-letter {
  font-family: var(--font-kanji);
  font-size: 5.5em;
  font-weight: 800;
  float: left;
  line-height: 0.75;
  margin: 6px 14px 0 0;
  color: var(--red);
}

.article-body p {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.article-body p strong {
  font-weight: 600;
  color: var(--ink);
}

/* Enlaces del cuerpo: color del texto con subrayado carmín; nunca el azul del navegador. */
.article-body a,
.reverb-section a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color .15s, text-decoration-color .15s;
}
.article-body a:hover,
.article-body a:focus-visible {
  color: var(--red-dark);
  text-decoration-thickness: 2px;
}
/* Sobre fondo oscuro (data-box, reverberaciones), subrayado en oro. */
.data-box a,
.reverb-section a { text-decoration-color: var(--gold); }
.data-box a:hover, .data-box a:focus-visible,
.reverb-section a:hover, .reverb-section a:focus-visible {
  color: var(--gold-light);
  text-decoration-thickness: 2px;
}
.article-body a:focus-visible,
.reverb-section a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── SECCIONES ── */
.section-break {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 60px 0 44px;
}
.section-break-num {
  font-family: var(--font-kanji);
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
  opacity: 0.55;
  flex-shrink: 0;
}
.section-break-line {
  flex: 1 0 40px; /* la raya nunca desaparece del todo */
  height: 1px;
  background: var(--grey-light);
}
.section-break-title {
  font-weight: 400; /* es un <h2>: sin la negrita por defecto */
  line-height: 1.3;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--grey);
  flex: 0 1 auto; /* puede encoger: los títulos largos parten línea en vez de salirse */
  min-width: 0;
  max-width: 80%;
}

/* ── PULLQUOTE ── */
.pullquote {
  border-left: 3px solid var(--red);
  margin: 48px 0;
  padding: 4px 0 4px 32px;
}
.pullquote p {
  font-family: var(--font-display) !important;
  font-style: italic !important;
  font-size: 26px !important;
  line-height: 1.35 !important;
  color: var(--ink) !important;
  font-weight: 400 !important;
  margin-bottom: 14px !important;
}
.pullquote p::first-letter { all: unset; }
.pullquote cite {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ── DATO DESTACADO ── */
.data-box {
  background: var(--ink);
  padding: 36px 40px;
  margin: 48px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  border-left: 4px solid var(--red);
}
.data-box-num {
  font-family: var(--font-kanji);
  font-size: 52px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  white-space: nowrap;
}
.data-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  margin-bottom: 8px;
}
.data-box-text {
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  font-weight: 300 !important;
  color: rgba(245,240,232,0.78) !important;
  line-height: 1.6 !important;
  margin: 0 !important;
}
.data-box-label { color: rgba(245,240,232,0.55) !important; }
.data-box-text::first-letter { all: unset; }

/* ── CONTEXTO JAPÓN ── */
.context-box {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-top: 3px solid var(--accent);
  padding: 32px 36px;
  margin: 48px 0;
}
.context-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.context-box h4 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 12px;
  font-style: italic;
}
.context-box p {
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  color: var(--grey) !important;
  margin-bottom: 0 !important;
}
.context-box p::first-letter { all: unset; }

/* ── ESPAÑA BOX ── */
.spain-box {
  background: #FBF4E6;
  border: 1px solid #E8D5B8;
  border-left: 4px solid var(--gold);
  padding: 28px 32px;
  margin: 48px 0;
}
.spain-box-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.spain-box p {
  font-family: var(--font-body) !important;
  font-size: 16px !important;
  color: var(--ink) !important;
  line-height: 1.65 !important;
  margin: 0 !important;
  font-weight: 300 !important;
}
.spain-box p::first-letter { all: unset !important; }

/* ── SEPARADOR ORNAMENTAL ── */
.ornament {
  text-align: center;
  margin: 48px 0;
  font-family: var(--font-kanji);
  font-size: 16px;
  color: var(--red);
  opacity: 0.45;
  letter-spacing: 0.6em;
}

/* ── REVERBERACIONES ── */
.reverb-section {
  background: var(--ink);
  margin: 60px -40px;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.reverb-section::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("/brand/wave-strip.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.10;
  pointer-events: none;
}
.reverb-section > * { position: relative; z-index: 2; }
.reverb-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 24px;
}
.reverb-title {
  font-weight: 400; /* es un <h2> */
  line-height: inherit;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--paper);
  margin-bottom: 24px;
}
.reverb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}
.reverb-item {
  border-left: 2px solid rgba(206,30,76,0.45);
  padding-left: 16px;
}
.reverb-item-name {
  font-family: var(--font-kanji);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}
.reverb-item-desc {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: rgba(245,240,232,0.55);
  line-height: 1.55;
}

/* ── CONCLUSIÓN ── */
.conclusion {
  border-top: 1px solid var(--grey-light);
  margin-top: 60px;
  padding-top: 52px;
}
.conclusion p {
  font-style: italic;
  color: var(--grey) !important;
  font-size: 18px !important;
}

@media (max-width: 700px) {
  .article-wrap { padding: 48px 24px 80px; }
  .cover-inner { padding: 0 24px 56px; }
  .reverb-grid { grid-template-columns: 1fr; }
  .reverb-section { margin: 60px -24px; padding: 40px 24px; }
  .data-box { grid-template-columns: 1fr; }
  .article-body > p:first-of-type::first-letter { font-size: 4em; }
  .cover-deco { font-size: 120px; right: 24px; top: 32px; }
}
@media (max-width: 480px) {
  .site-header { padding: 0 16px; }
  .site-logo { font-size: 16px; gap: 8px; }
  .site-logo img { width: 26px; height: 26px; }
  .site-nav { font-size: 9px; gap: 10px; letter-spacing: 0.12em; }
  .cover { padding: 56px 0 0; }
  .cover-inner { padding: 0 20px 44px; }
  .cover-section { font-size: 9px; letter-spacing: 0.25em; margin-bottom: 20px; }
  .cover-deco { font-size: 100px; right: 16px; top: 24px; }
  .cover-title { font-size: 34px; line-height: 1.12; margin-bottom: 20px; }
  .cover-deck { font-size: 17px; line-height: 1.55; margin-bottom: 32px; }
  .cover-meta { gap: 18px; padding-top: 24px; }
  .article-wrap { padding: 40px 20px 56px; }
  .article-body p { font-size: 17px; line-height: 1.7; }
  .article-body > p:first-of-type::first-letter { font-size: 3.2em; }
  .section-break { margin: 40px 0 28px; gap: 12px; }
  .section-break-title { font-size: 17px; }
  .data-box { padding: 24px 22px; margin: 32px 0; gap: 14px; }
  .data-box-num { font-size: 38px; }
  .data-box-label { font-size: 8px; letter-spacing: 0.25em; }
  .pullquote { margin: 32px 0; padding: 4px 0 4px 18px; }
  .pullquote p { font-size: 20px !important; line-height: 1.3 !important; }
  .context-box { padding: 22px 22px; margin: 32px 0; }
  .context-box h4 { font-size: 17px; }
  .context-box p { font-size: 15px !important; }
  .spain-box { padding: 22px 22px; margin: 32px 0; }
  .spain-box p { font-size: 15px !important; }
  .reverb-section { margin: 48px -20px; padding: 32px 20px; }
  .reverb-item-name { font-size: 16px; }
  .reverb-item-desc { font-size: 14px; }
}
