/* Ficha de documento (reciente e histórico). Solo previsualización.
   Base compartida: single-articulo.css (migas, aside, contenido, compartir, relacionados) y single-comunicado-nota.css (.art-facts, .art-pdf). */

.art-facts--doc { --kind: #7a5210; }
.art-facts--historico { --kind: #8f3b24; }

/* Cabecera: documento reciente (arena) / histórico (papel, terracota) */
.doc-hero { --kind: #7a5210; background-color: #f4ede0; background-image: repeating-linear-gradient(0deg, rgba(120,90,40,.04) 0 1px, transparent 1px 5px); border-bottom: 1px solid #eadfc7; }
.doc-hero--historico { --kind: #8f3b24; background-image: none; background: linear-gradient(160deg, #f6ecd6, #ead8b4); border-bottom-color: #dcc79f; }
.doc-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: center; padding-block: 64px 68px; }
.doc-hero .pub-chip { margin-bottom: 24px; }
.doc-hero h1 { max-width: 760px; font-size: clamp(40px, 5vw, 70px); line-height: 1; }
.doc-hero h1 em { color: var(--kind); }
.doc-dek { max-width: 620px; margin: 22px 0 0; color: #4d4636; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.4; }
.doc-year { display: block; margin-bottom: 6px; color: var(--kind); font-family: var(--serif); font-size: clamp(64px, 8vw, 116px); font-weight: 500; line-height: .9; letter-spacing: -.07em; }
.doc-stats { display: flex; flex-wrap: wrap; margin: 30px 0 0; padding: 0; }
.doc-stats div { padding: 0 24px; border-left: 1px solid rgba(90,70,30,.28); }
.doc-stats div:first-child { padding-left: 0; border-left: 0; }
.doc-stats dt { margin-bottom: 4px; color: var(--kind); font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.doc-stats dd { margin: 0; color: var(--ink); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.doc-btn { display: inline-flex; align-items: center; gap: 10px; padding: 15px 22px; border: 0; border-radius: 3px; color: #fff; background: var(--kind); cursor: pointer; font: 700 16px var(--sans); transition: transform .2s ease, box-shadow .2s ease; }
.doc-btn:hover, .doc-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(60,40,10,.22); }
.doc-btn svg { width: 20px; height: 20px; }
.doc-btn--ghost { color: var(--kind); background: transparent; box-shadow: inset 0 0 0 1.5px var(--kind); }
.doc-btn--ghost:hover, .doc-btn--ghost:focus-visible { box-shadow: inset 0 0 0 1.5px var(--kind), 0 8px 18px rgba(60,40,10,.12); }

/* Portada tipo PDF (dibujada en CSS) */
.doc-cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: min(270px, 100%); aspect-ratio: 3 / 4; margin-inline: auto; padding: 26px 24px 0; overflow: hidden; background: #fff; border-top: 10px solid var(--green); box-shadow: 14px 18px 0 rgba(120,80,30,.14), 0 26px 50px rgba(60,40,10,.2); transform: rotate(3deg); }
.doc-cover img { display: block; width: 118px; }
.doc-cover b { display: block; color: var(--ink); font-family: var(--serif); font-size: 27px; line-height: 1.05; letter-spacing: -.04em; }
.doc-cover strong { display: block; margin-top: 6px; color: var(--green); font-family: var(--serif); font-size: 70px; font-weight: 500; line-height: .9; letter-spacing: -.07em; }
.doc-cover i { display: block; height: 22px; margin: 0 -24px; background: linear-gradient(90deg, var(--green) 0 50%, var(--blue) 50% 78%, #f0b17b 78%); }

/* Papel escaneado (histórico) */
.doc-scan-wrap { width: min(290px, 100%); margin-inline: auto; filter: drop-shadow(8px 12px 0 rgba(120,80,30,.16)) drop-shadow(0 22px 30px rgba(60,40,10,.18)); transform: rotate(-3deg); }
.doc-scan { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(145deg, #f4e7cd, #dcc79f); border: 1px solid #cdb78b; clip-path: polygon(0 0, calc(100% - 36px) 0, 100% 36px, 100% 100%, 0 100%); }
.doc-scan::before { content: ""; position: absolute; top: 34px; left: 28px; right: 70px; height: 12px; background: rgba(110,70,30,.38); box-shadow: 0 22px 0 -2px rgba(110,70,30,.2); }
.doc-scan::after { content: ""; position: absolute; top: 96px; left: 28px; right: 28px; bottom: 34px; background: repeating-linear-gradient(180deg, rgba(110,80,40,.3) 0 2px, transparent 2px 13px); }
.doc-scan-stamp { position: absolute; z-index: 1; right: 26px; bottom: 44px; display: grid; place-items: center; width: 86px; height: 86px; border: 3px solid rgba(164,69,42,.6); border-radius: 50%; color: rgba(164,69,42,.8); font-family: var(--serif); font-size: 21px; font-weight: 600; transform: rotate(-14deg); }
.doc-scan-tag { position: absolute; z-index: 1; left: 0; bottom: 18px; padding: 5px 12px; color: #fff; background: #8f3b24; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* Cuerpo */
.art-content .doc-lead-label { margin: 0 0 4px; color: var(--kind, #7a5210); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.art-content .doc-toc { margin: 0 0 28px; padding-left: 0; list-style: none; counter-reset: sec; }
.doc-toc li { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 13px 0; border-bottom: 1px solid #eadfc7; font-size: 17px; }
.doc-toc li::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); flex: none; width: 30px; color: #7a5210; font-family: var(--serif); font-size: 19px; }
.doc-toc .dots { flex: 1; min-width: 20px; border-bottom: 2px dotted #cdbf9f; transform: translateY(-4px); }
.doc-toc b { color: #6b6252; font-weight: 600; font-variant-numeric: tabular-nums; }
.doc-cite { margin: 0 0 24px; padding: 18px 20px; border-left: 4px solid #7a5210; background: #f4ede0; font-size: 16px; line-height: 1.5; }
.doc-cite p { margin: 0 0 12px; }
.doc-cite button { padding: 7px 13px; border: 1px solid #cdbf9f; border-radius: 999px; color: #7a5210; background: #fff; cursor: pointer; font: 700 13px var(--sans); }
.doc-cite button:hover { color: #fff; background: #7a5210; border-color: #7a5210; }
.doc-ocr { margin: 8px 0 24px; border: 1px solid #dcc79f; background: #fbf7ec; }
.doc-ocr summary { padding: 16px 20px; color: #8f3b24; cursor: pointer; font-size: 15px; font-weight: 700; }
.doc-ocr summary:hover { background: #f6ecd6; }
.doc-ocr div { padding: 4px 22px 22px; color: #4a4030; font-family: "Courier New", monospace; font-size: 14px; line-height: 1.65; }
.doc-ocr p { margin: 0 0 14px; }

/* Línea de tiempo en contexto (histórico) */
.art-content .tl { margin: 4px 0 28px; padding: 4px 4px 12px; list-style: none; }
.art-content .tl-item { margin: 0; }
.art-content .tl-item::before { box-shadow: 0 0 0 5px #fff; }
.art-content .tl a { color: inherit; text-decoration: none; }
.art-content .tl-title { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.art-content .tl-item.is-current::before { box-shadow: 0 0 0 5px #fff, 0 0 0 8px rgba(164,69,42,.35); }
.art-content .tl-item.is-current .tl-year { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (max-width: 960px) {
  .doc-hero-grid { grid-template-columns: 1fr; gap: 44px; padding-block: 48px 56px; }
  .doc-cover, .doc-scan-wrap { width: min(230px, 70%); margin-inline: 0; }
}
@media (max-width: 640px) {
  .doc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .doc-stats div, .doc-stats div:first-child { padding: 0 16px; border-left: 1px solid rgba(90,70,30,.28); }
  .doc-stats div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .doc-stats dd { font-size: 16px; }
  .doc-btn { width: 100%; justify-content: center; }
  .doc-toc li { font-size: 16px; }
}
