/*
 * Web pública — Editorial Constructores del Saber E.I.R.L.
 * Tema "Tipos móviles" (mismo que el ERP, ver CLAUDE.md §5):
 * imprenta antigua con tipos de madera — papel crema, tinta negra, acento bermellón.
 * Fuentes servidas localmente desde /fonts (licencia SIL OFL).
 */

/* ───────────── Fuentes ───────────── */

@font-face { font-family: 'Alfa Slab One'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/alfa-slab-one-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/libre-caslon-text-400.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/libre-caslon-text-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Libre Caslon Text'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/libre-caslon-text-700.woff2') format('woff2'); }

/* ───────────── Tokens ───────────── */

:root {
  --tinta: #1E1B18;
  --papel: #F1E7D6;
  --papel-claro: #FBF6EC;
  --papel-logo: #F2E8D8;
  --crema-texto: #F4ECDF;
  --bermellon: #C93B2A;
  --bermellon-oscuro: #A9301F;
  --sepia-suave: #C9BBA3;
  --filete-punteado: #8A7F70;
  --logo-gris: #5E5245;
  --logo-rojo: #E8473A;        /* solo logo */
  --verde-azulado: #0E7C7B;

  --fuente-titulos: 'Alfa Slab One', Georgia, serif;
  --fuente-texto: 'Libre Caslon Text', Georgia, serif;

  --max: 1180px;
}

/* ───────────── Base ───────────── */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  background: linear-gradient(180deg, #F7F0E3 0%, #F1E7D6 50%, #EBDFCB 100%) fixed;
  background-color: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--fuente-titulos); font-weight: 400; line-height: 1.08; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--bermellon); outline-offset: 3px; }
.seccion-tinta :focus-visible { outline-color: var(--crema-texto); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
@media (max-width: 600px) { .wrap { padding: 0 18px; } }

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--tinta); color: var(--crema-texto); padding: 10px 16px;
}
.saltar:focus { top: 12px; }

/* Versalitas espaciadas (etiquetas, cabeceras de tabla) */
.versalitas, .antetitulo, .tarjeta-num, .tabla thead th, dt {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.antetitulo { color: var(--bermellon); font-size: 18px; }

/* ───────────── Botones ───────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  font-family: var(--fuente-titulos); font-size: 15px; letter-spacing: 0.06em;
  text-transform: uppercase; text-decoration: none;
  border: 0; border-radius: 0; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
/* Primario: bermellón con borde doble crema interior */
.btn-primario {
  background: var(--bermellon); color: var(--crema-texto);
  box-shadow: inset 0 0 0 3px var(--bermellon), inset 0 0 0 4.5px var(--crema-texto);
}
.btn-primario:hover { background: var(--bermellon-oscuro); box-shadow: inset 0 0 0 3px var(--bermellon-oscuro), inset 0 0 0 4.5px var(--crema-texto); }
.btn-secundario { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--tinta); }
.btn-secundario:hover { background: var(--tinta); color: var(--crema-texto); }

/* ───────────── Intro ───────────── */

#intro {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: 28px;
  background: var(--papel-logo);
  transition: opacity .6s ease, visibility .6s ease;
}
#intro.fin { opacity: 0; visibility: hidden; }
body.intro-activa { overflow: hidden; }
.intro-icono { width: clamp(96px, 18vw, 170px); height: auto; flex: none; }
.engranaje { transform-origin: 95px 90px; animation: girar 1.6s cubic-bezier(.5, 0, .3, 1) .2s 1 both; }
@keyframes girar { from { transform: rotate(-180deg); } to { transform: rotate(0); } }
.intro-texto { font-size: clamp(9px, 1.6vw, 15px); animation: aparecer .8s ease .6s both; }
@keyframes aparecer { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { #intro { flex-direction: column; } }

/* ───────────── Logo (ícono SVG + texto HTML, proporciones del lienzo 1080×320) ───────────── */
/* Todo se escala con font-size: 1em ≈ 10px de la referencia. */

.logo { display: inline-flex; align-items: center; gap: 1.9em; text-decoration: none; font-size: 6px; }
.logo img { width: 9.5em; height: 9.5em; flex: none; }
.logo-texto { display: flex; flex-direction: column; justify-content: space-between; height: 9.5em; white-space: nowrap; }
.intro-texto.logo-texto { height: 19em; font-size: clamp(5px, 1vw, 9px); }
.intro-texto .logo-editorial { font-size: 2.6em; }
.intro-texto .logo-nombre, .intro-texto .logo-saber { font-size: 7em; }
.intro-texto .logo-eirl { font-size: 0.54em; }
.logo-editorial { font-family: var(--fuente-texto); font-size: 1.3em; line-height: 1; letter-spacing: 0.34em; color: var(--logo-gris); }
.logo-nombre { font-family: var(--fuente-titulos); font-size: 3.5em; line-height: 0.95; color: var(--tinta); }
.logo-saber { font-family: var(--fuente-titulos); font-size: 3.5em; line-height: 0.95; color: var(--logo-rojo); }
.logo-eirl { font-size: 0.54em; letter-spacing: 0.02em; color: var(--verde-azulado); }

/* ───────────── Cabecera ───────────── */

.cabecera { position: sticky; top: 0; z-index: 50; background: var(--papel-logo); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 12px; }
.menu { display: flex; gap: 26px; }
.menu a { text-decoration: none; font-weight: 700; font-size: 16px; padding: 10px 0; position: relative; }
.menu a::after { content: ''; position: absolute; left: 0; bottom: 4px; width: 0; height: 2px; background: var(--bermellon); transition: width .2s ease; }
.menu a:hover::after { width: 100%; }
.romano { font-family: var(--fuente-titulos); color: var(--logo-gris); font-weight: 400; margin-right: 2px; }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.menu-boton {
  display: none; width: 48px; height: 48px; padding: 11px;
  background: transparent; color: var(--tinta); border: 1.5px solid var(--tinta); cursor: pointer;
}
/* Filete doble: línea gruesa 5px + fina 1.5px */
.filete-doble { height: 10px; border-top: 5px solid var(--tinta); border-bottom: 1.5px solid var(--tinta); }

@media (max-width: 1020px) {
  .menu-boton { display: block; }
  .menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 28px 18px;
    background: var(--tinta);
  }
  .menu.abierto { display: flex; }
  .menu a { color: var(--crema-texto); padding: 12px 0; border-bottom: 1px dashed var(--filete-punteado); }
  .menu a:last-child { border-bottom: 0; }
  .menu .romano { color: var(--sepia-suave); display: inline-block; min-width: 2.2em; }
}
@media (max-width: 560px) {
  .nav-cta .btn { display: none; }
  .logo { font-size: 5px; }
}

/* ───────────── Portada ───────────── */

.portada { padding: 80px 0 96px; }
.portada-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.portada h1 { font-size: clamp(38px, 5.4vw, 66px); margin: 14px 0 22px; }
.portada h1 em { font-style: normal; color: var(--bermellon); }
.entradilla { font-size: 19px; max-width: 34em; }
.botones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.portada-visual { position: relative; }
.portada-visual .sello { position: absolute; right: -8px; bottom: -26px; }
@media (max-width: 900px) {
  .portada { padding: 48px 0 72px; }
  .portada-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* Sello: mayúsculas, borde 2px, rotado -4° */
.sello {
  display: inline-block; padding: 6px 14px;
  font-family: var(--fuente-titulos); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bermellon); background: var(--papel-claro);
  border: 2px solid var(--bermellon); outline: 1px solid var(--bermellon); outline-offset: 2px;
  transform: rotate(-4deg);
}

/* Pliego con marcas de corte de imprenta */
.pliego { position: relative; border: 1.5px solid var(--tinta); background: var(--papel-claro); padding: 10px; }
.cm { position: absolute; width: 16px; height: 16px; border-color: var(--tinta); }
.cm-si { top: -10px; left: -10px; border-top: 1.5px solid; border-left: 1.5px solid; }
.cm-sd { top: -10px; right: -10px; border-top: 1.5px solid; border-right: 1.5px solid; }
.cm-ii { bottom: -10px; left: -10px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.cm-id { bottom: -10px; right: -10px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

/* ───────────── Secciones ───────────── */

.seccion { padding: 88px 0; }
.seccion-clara { background: rgb(251 246 236 / 0.6); border-block: 1.5px solid var(--tinta); }
.seccion-tinta { background: var(--tinta); color: var(--crema-texto); }
.seccion-tinta .antetitulo { color: var(--sepia-suave); }
@media (max-width: 600px) { .seccion { padding: 64px 0; } }

/* Título entre filetes dobles con viñetas ❧ */
.titulo-seccion { text-align: center; max-width: 860px; margin: 0 auto 52px; }
.titulo-seccion > p:last-child:not(.antetitulo) { max-width: 40em; margin: 18px auto 0; }
.filetes {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 10px; padding: 16px 0;
  border-top: 5px solid currentColor; border-bottom: 5px solid currentColor;
  position: relative;
}
.filetes::before, .filetes::after { content: ''; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; }
.filetes::before { top: 3px; }
.filetes::after { bottom: 3px; }
.filetes > span { font-size: 26px; color: var(--bermellon); flex: none; }
.seccion-tinta .filetes > span { color: var(--sepia-suave); }
.filetes h2 { font-size: clamp(26px, 3.6vw, 40px); }

/* Tarjetas: borde 1.5px tinta */
.tarjeta { background: var(--papel-claro); color: var(--tinta); border: 1.5px solid var(--tinta); padding: 30px; }
.tarjeta h3 { font-size: 24px; margin: 6px 0 12px; }
.tarjeta-num { color: var(--bermellon); font-size: 17px; }
.tarjeta ul { margin-top: 16px; }
.tarjeta li { padding: 9px 0 9px 26px; border-top: 1.5px dotted var(--filete-punteado); position: relative; }
.tarjeta li::before { content: '❧'; position: absolute; left: 0; color: var(--bermellon); }
/* Tarjeta destacada: borde + outline doble bermellón */
.tarjeta-destacada { border-color: var(--bermellon); outline: 1.5px solid var(--bermellon); outline-offset: 4px; }

.rejilla-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.rejilla-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
@media (max-width: 960px) { .rejilla-3, .rejilla-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .rejilla-2, .rejilla-3 { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .rejilla-4 { grid-template-columns: 1fr; } }

/* ───────────── Tabla de servicios ───────────── */

.tabla { width: 100%; border-collapse: collapse; background: var(--papel-claro); border: 1.5px solid var(--tinta); }
.tabla thead th { background: var(--tinta); color: var(--crema-texto); text-align: left; padding: 12px 18px; font-size: 16px; }
.tabla td, .tabla tbody th { padding: 16px 18px; vertical-align: top; text-align: left; border-top: 1.5px dotted var(--filete-punteado); }
.tabla tbody th { font-family: var(--fuente-titulos); font-weight: 400; font-size: 19px; white-space: nowrap; }
.tabla .clave { font-family: var(--fuente-titulos); color: var(--bermellon); width: 1%; white-space: nowrap; }
@media (max-width: 680px) {
  .tabla thead { display: none; }
  .tabla tr { display: grid; grid-template-columns: auto 1fr; border-top: 1.5px dotted var(--filete-punteado); padding: 14px 16px; column-gap: 14px; }
  .tabla tbody tr:first-child { border-top: 0; }
  .tabla td, .tabla tbody th { border: 0; padding: 0; white-space: normal; }
  .tabla tbody td:last-child { grid-column: 1 / -1; margin-top: 6px; }
}

/* ───────────── Portafolio ───────────── */

.pieza .pliego { border-color: var(--sepia-suave); background: var(--papel-logo); padding: 8px; }
.pieza .cm { border-color: var(--sepia-suave); }
.pieza figcaption { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.pieza .versalitas { color: var(--sepia-suave); font-size: 15px; }
.pieza strong { font-weight: 700; }

/* ───────────── Proceso: numerales romanos ───────────── */

.pasos { counter-reset: paso; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 1.5px solid var(--tinta); background: var(--papel-claro); }
.pasos li { counter-increment: paso; padding: 26px 22px; border-left: 1.5px dotted var(--filete-punteado); }
.pasos li:first-child { border-left: 0; }
.pasos li::before { content: counter(paso, upper-roman) '.'; display: block; font-family: var(--fuente-titulos); font-size: 40px; line-height: 1; color: var(--bermellon); margin-bottom: 14px; }
.pasos h3 { font-size: 20px; margin-bottom: 8px; }
@media (max-width: 960px) {
  .pasos { grid-template-columns: 1fr; }
  .pasos li { border-left: 0; border-top: 1.5px dotted var(--filete-punteado); display: grid; grid-template-columns: 70px 1fr; column-gap: 12px; }
  .pasos li:first-child { border-top: 0; }
  .pasos li::before { grid-row: span 2; margin: 0; }
}

/* ───────────── Contacto ───────────── */

.contacto-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .contacto-grid { grid-template-columns: 1fr; } }
.ficha dl div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-top: 1.5px dotted var(--filete-punteado); }
.ficha dt { color: var(--logo-gris); }
.ficha dd { overflow-wrap: break-word; min-width: 0; }
.ficha a { color: var(--bermellon); font-weight: 700; }

.formulario { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.formulario label { font-weight: 700; margin-top: 10px; }
.formulario input, .formulario textarea {
  font: inherit; color: var(--tinta);
  background: #FFFDF8; border: 1.5px solid var(--tinta); border-radius: 0;
  padding: 12px 14px; min-height: 48px;
}
.formulario textarea { resize: vertical; }
.formulario input::placeholder, .formulario textarea::placeholder { color: #776B5C; }
.formulario .btn { align-self: flex-start; margin-top: 18px; }
.nota { font-style: italic; font-size: 15px; color: var(--logo-gris); margin-top: 8px; }

/* ───────────── Pie ───────────── */

.pie { background: var(--tinta); color: var(--sepia-suave); border-top: 1.5px solid var(--filete-punteado); padding: 34px 0; }
.pie-fila { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.marca-tipografica { display: flex; flex-direction: column; line-height: 1.1; }
.marca-editorial { font-size: 12px; letter-spacing: 0.34em; }
.marca-nombre { font-family: var(--fuente-titulos); font-size: 22px; color: var(--crema-texto); }
.pie p { font-size: 15px; }

/* ───────────── WhatsApp flotante ───────────── */

.wa-flotante {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 58px; height: 58px; display: grid; place-items: center;
  background: var(--bermellon); color: var(--crema-texto); border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--bermellon), inset 0 0 0 4.5px var(--crema-texto), 0 6px 16px rgb(30 27 24 / 0.3);
  transition: transform .15s ease;
}
.wa-flotante:hover { transform: scale(1.06); }
.wa-flotante svg { width: 28px; height: 28px; }

/* ───────────── Movimiento reducido ───────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
