/* Fuentes alojadas en la propia web (Special Elite, Apache 2.0; Courier Prime, OFL) */
@font-face { font-family: 'Special Elite'; src: url('fonts/special-elite-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('fonts/courier-prime-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('fonts/courier-prime-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('fonts/courier-prime-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --ink: #1a1612;
  --paper: #f0ead8;
  --aged: #c8b89a;
  --red: #8b1a1a;
  --fade: #7a6e5f;
  --stamp: #8b1a1a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Courier Prime', monospace;
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
  z-index: 10;
}

.container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.masthead {
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  padding: 2.5rem 0;
  margin-bottom: 3rem;
  text-align: center;
}

.imprint-mark {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--fade);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.imprint-name {
  font-family: 'Special Elite', cursive;
  font-size: clamp(3.2rem, 10vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.imprint-logo {
  max-width: 420px;
  width: 90%;
  height: auto;
  display: block;
  margin: 0.5rem auto;
}

.imprint-tagline {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 1.2rem;
  border-top: 1px solid var(--aged);
  padding-top: 1rem;
  display: inline-block;
}

.intro {
  font-size: 0.92rem;
  line-height: 1.85;
  margin-bottom: 3.5rem;
  text-align: center;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.intro p + p { margin-top: 0.8rem; }

.serie {
  border: 1.5px solid var(--ink);
  background: rgba(255,255,255,0.35);
  padding: 2.2rem 1.6rem 2rem;
  margin-bottom: 3rem;
  text-align: center;
}

.serie-mark {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--fade);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.serie-name {
  font-family: 'Special Elite', cursive;
  font-weight: 400;
  font-size: clamp(2.1rem, 7vw, 2.9rem);
  line-height: 1.05;
  margin-bottom: 1.1rem;
}

.serie-lead {
  font-size: 0.9rem;
  line-height: 1.75;
  max-width: 520px;
  margin: 0 auto 1.6rem;
}

.serie-hebras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: left;
  margin-bottom: 1.6rem;
}

.hebra {
  border-left: 3px solid var(--red);
  padding: 0.2rem 0 0.2rem 0.9rem;
}

.hebra-label {
  display: block;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.hebra p {
  font-size: 0.84rem;
  line-height: 1.65;
}

.serie-motto {
  font-family: 'Special Elite', cursive;
  font-size: 1.05rem;
  border-top: 1px solid var(--aged);
  padding-top: 1.2rem;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--fade);
  text-transform: uppercase;
}
.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--aged);
}

.expediente {
  border: 1.5px solid var(--ink);
  background: rgba(255,255,255,0.35);
  padding: 1.8rem 1.6rem;
  margin-bottom: 1.6rem;
  position: relative;
}

.expediente-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--aged);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fade);
  gap: 1rem;
}

.exp-number { font-weight: 700; color: var(--ink); }

.exp-status {
  border: 1.5px solid var(--ink);
  padding: 0.25rem 0.7rem;
  color: var(--ink);
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}
.exp-status.published {
  background: var(--red);
  color: var(--paper);
  border-color: var(--red);
}
.exp-status.preparing { color: var(--stamp); border-color: var(--stamp); }
.exp-status.classified { color: var(--fade); border-color: var(--fade); border-style: dashed; }

.exp-title {
  font-family: 'Special Elite', cursive;
  font-size: 1.7rem;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.exp-subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--fade);
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.exp-subtitle + .exp-author { margin-top: -0.7rem; }

.exp-author {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
}

.exp-synopsis {
  font-size: 0.88rem;
  line-height: 1.75;
  margin-bottom: 1.2rem;
}
.exp-synopsis p + p { margin-top: 0.6rem; }

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.3rem;
}
.tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--aged);
  padding: 0.18rem 0.5rem;
  color: var(--fade);
}

.exp-cta {
  display: inline-block;
  background: var(--red);
  color: var(--paper);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.15s;
  border: none;
}
.exp-cta:hover { background: var(--ink); }

.exp-cta.disabled {
  background: transparent;
  color: var(--fade);
  border: 1.5px dashed var(--fade);
  cursor: not-allowed;
  pointer-events: none;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.expediente.classified {
  background: rgba(255,255,255,0.18);
  border-style: solid;
  border-color: var(--aged);
}
.expediente.classified .expediente-header {
  border-bottom-color: rgba(200,184,154,0.4);
}
.expediente.classified .exp-title {
  color: var(--aged);
  font-size: 1.7rem;
  letter-spacing: 0.05em;
}

.redact {
  display: inline-block;
  background: var(--ink);
  color: var(--ink);
  padding: 0 0.2rem;
  user-select: none;
  font-size: 0.7em;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.subscribe-block {
  margin-top: 3.5rem;
  padding: 2rem 1.6rem;
  border: 1.5px solid var(--ink);
  background: rgba(26, 22, 18, 0.04);
  text-align: center;
}

.subscribe-block h3 {
  font-family: 'Special Elite', cursive;
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.subscribe-block .lead {
  font-size: 0.86rem;
  line-height: 1.7;
  margin-bottom: 1.4rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.form-row {
  display: flex;
  border: 1.5px solid var(--ink);
  background: white;
  margin-bottom: 0.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.form-row input[type="email"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-family: 'Courier Prime', monospace;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
  min-width: 0;
}

.form-row input::placeholder { color: var(--aged); }

.form-row button {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 0.75rem 1.2rem;
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.form-row button:hover { background: var(--red); }
.form-row button:disabled { opacity: 0.5; cursor: wait; }

.form-note {
  font-size: 0.7rem;
  color: var(--fade);
  letter-spacing: 0.05em;
}


.redes {
  margin-top: 3.5rem;
  border: 1.5px solid var(--aged);
  padding: 1.8rem 1.6rem;
  background: rgba(255,255,255,0.2);
}

.redes-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--aged);
}

.redes-title {
  font-family: 'Special Elite', cursive;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.redes-ref {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--fade);
  text-transform: uppercase;
}

.redes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.red-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1.5px solid var(--ink);
  padding: 0.85rem 1.1rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.red-link:hover {
  background: var(--ink);
  color: var(--paper);
}

.red-icon-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.red-icon-wrap svg {
  width: 100%;
  height: 100%;
  transition: fill 0.15s;
}

.red-link-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.red-link-name {
  font-weight: 700;
  font-size: 0.78rem;
}

.red-link-handle {
  font-size: 0.62rem;
  color: var(--fade);
  letter-spacing: 0.08em;
  font-weight: 400;
}

.red-link:hover .red-link-handle {
  color: var(--aged);
}

.red-link-new {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--red);
  color: var(--paper);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  padding: 0.1rem 0.3rem;
  line-height: 1.4;
}

.red-link.soon {
  border-color: var(--aged);
  border-style: dashed;
  color: var(--aged);
  pointer-events: none;
  opacity: 0.45;
}

.red-link.soon .red-link-handle { color: var(--aged); }

.file-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--aged);
  border-bottom: 3px double var(--ink);
  padding: 0.8rem 0;
  margin-top: 3rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--fade);
  text-transform: uppercase;
}

.container { animation: fadein 0.8s ease both; }
@keyframes fadein { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* Portada en la ficha */
.exp-body {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.exp-cover { display: block; }
.exp-cover img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(26, 22, 18, 0.18);
}
.exp-cover.placeholder {
  aspect-ratio: 1747 / 2801;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(26, 22, 18, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.5rem;
  text-align: center;
  overflow: hidden;
}
.ph-series {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--aged);
}
.ph-stamp {
  font-family: 'Special Elite', cursive;
  font-size: 0.95rem;
  line-height: 1.15;
  border: 2px solid var(--paper);
  padding: 0.35rem 0.5rem;
  transform: rotate(-7deg);
  opacity: 0.9;
}
.ph-author {
  font-family: 'Special Elite', cursive;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* Formulario */
.sr-only, .hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.form-row input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--red); }
.form-row.done { opacity: 0.45; pointer-events: none; }
.form-msg { font-size: 0.85rem; line-height: 1.6; font-weight: 700; min-height: 0; margin: 0.4rem auto 0.6rem; max-width: 480px; }
.form-msg:empty { display: none; }
.form-msg.error { color: var(--red); }
.form-note { max-width: 480px; margin: 0.6rem auto 0; line-height: 1.6; }
.form-note a, .file-footer a { color: inherit; }

/* Páginas interiores */
.page-head {
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  padding: 1.4rem 0;
  margin-bottom: 2.5rem;
  text-align: center;
}
.page-logo { width: 220px; max-width: 70%; height: auto; }
.legal { font-size: 0.9rem; line-height: 1.75; }
.legal h1 { font-family: 'Special Elite', cursive; font-weight: 400; font-size: 2rem; line-height: 1.1; margin-bottom: 0.3rem; }
.legal h2 {
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  margin: 1.8rem 0 0.4rem; padding-top: 1rem; border-top: 1px solid var(--aged);
}
.legal p + p { margin-top: 0.7rem; }
.legal a { color: var(--red); }
.legal-date { font-size: 0.75rem; color: var(--fade); letter-spacing: 0.08em; }
.legal-back { margin-top: 2.2rem !important; }

/* Página del caso */
.lang-switch .back-home { margin-right: auto; letter-spacing: 0.15em; }
.case-head {
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  padding: 2.4rem 0 2.2rem;
  margin-bottom: 3rem;
  text-align: center;
}
.case-kicker { font-size: 0.7rem; letter-spacing: 0.22em; color: var(--fade); text-transform: uppercase; margin-bottom: 0.8rem; }
.case-title { font-family: 'Special Elite', cursive; font-weight: 400; font-size: clamp(2.3rem, 8vw, 3.6rem); line-height: 1.02; margin-bottom: 1.2rem; }
.case-lead { font-size: 0.95rem; line-height: 1.8; max-width: 580px; margin: 0 auto; }
.case-sec { margin-bottom: 3rem; }
.case-text p, .case-text-p { font-size: 0.92rem; line-height: 1.85; }
.case-text p + p { margin-top: 0.9rem; }
.case-crono { list-style: none; border-left: 2px solid var(--red); padding-left: 1.3rem; }
.case-crono li { position: relative; font-size: 0.9rem; line-height: 1.6; padding: 0.35rem 0; }
.case-crono li::before { content: ''; position: absolute; left: -1.72rem; top: 0.75rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--red); }
.case-crono .t { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 0.4rem; }
.case-docs { display: grid; grid-template-columns: 0.75fr 1.4fr 1.25fr; gap: 1rem; align-items: start; }
.case-docs figure img { display: block; width: 100%; height: auto; border: 1px solid var(--ink); }
.case-docs figcaption, .case-note { font-size: 0.72rem; line-height: 1.5; color: var(--fade); margin-top: 0.5rem; }
.case-note a { color: inherit; }
.case-map { margin: 1rem auto 0; max-width: 560px; border: 1px solid var(--ink); }
.case-map svg { display: block; width: 100%; height: auto; }
.case-map svg text { font-family: 'Courier Prime', monospace; }
.case-q { list-style: none; counter-reset: q; }
.case-q li { counter-increment: q; position: relative; padding: 0.8rem 0 0.8rem 2.8rem; border-top: 1px solid var(--aged); font-size: 0.92rem; line-height: 1.6; }
.case-q li:last-child { border-bottom: 1px solid var(--aged); }
.case-q li::before { content: counter(q, decimal-leading-zero); position: absolute; left: 0; top: 0.65rem; font-family: 'Special Elite', cursive; font-size: 1.3rem; color: var(--red); }
.yt { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border: 1px solid var(--ink); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-play { position: absolute; inset: 0; width: 100%; background: transparent; border: 0; color: var(--paper); font-family: 'Special Elite', cursive; font-size: 1.3rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; }
.yt-icon { width: 4rem; height: 4rem; border: 2px solid var(--paper); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; padding-left: 0.3rem; }
.yt-play:hover .yt-icon { background: var(--red); border-color: var(--red); }
.case-book-ser { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fade); font-weight: 700; margin-bottom: 0.3rem; }
.exp-link { display: inline-block; margin-top: 0.9rem; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }

/* Selector de idioma */
.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  color: var(--aged);
}
.lang-switch a { color: var(--fade); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* Botón secundario */
.exp-cta.secondary {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.exp-cta.secondary:hover { background: var(--ink); color: var(--paper); }

@media (max-width: 520px) {
  .file-footer { flex-direction: column; gap: 0.3rem; text-align: center; }
  .form-row { flex-direction: column; }
  .form-row button { width: 100%; }
  .expediente { padding: 1.4rem 1.1rem; }
  .expediente-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .serie { padding: 1.8rem 1.1rem 1.6rem; }
  .serie-hebras { grid-template-columns: 1fr; }
  .exp-body { grid-template-columns: 1fr; gap: 1.2rem; }
  .exp-cover { width: 160px; }
  .case-docs { grid-template-columns: 1fr; }
  .case-docs figure:first-child img { max-width: 220px; }
}
