/* ==========================================================
   Gilberto Tejeda Salazar — estilo editorial clásico
   Mobile-first
   ========================================================== */

/* ---------- Fuentes autohospedadas ---------- */
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-display-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

/* ---------- Variables ---------- */
:root {
  --tinta: #141A24;
  --tinta-profunda: #0E131B;
  --papel: #F3EEE4;
  --pergamino: #E7DFD0;
  --vino: #6B1E26;
  --oro: #C9A564;
  --oro-filete: #B08C4F;
  --sepia: #5E554A;
  --texto: #221E19;

  --f-titulos: "Playfair Display", "Didot", Georgia, "Times New Roman", serif;
  --f-texto: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  --ancho: 1240px;
  --gutter: 20px;
  --nav-alto: 72px;
  --sombra-libro:
    0 1px 2px rgba(14, 19, 27, .18),
    0 6px 12px -4px rgba(14, 19, 27, .25),
    0 18px 32px -12px rgba(14, 19, 27, .45);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-alto);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: clamp(19px, 17.4px + .35vw, 21px);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-titulos); font-weight: 400; line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; }

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.seccion { padding-block: clamp(64px, 9vw, 120px); }
.oscuro { background: var(--tinta); color: var(--papel); }
.pergamino { background: var(--pergamino); }

.salto {
  position: absolute; left: -9999px; top: 0;
  background: var(--oro); color: var(--tinta); padding: 12px 18px; z-index: 100;
}
.salto:focus { left: 12px; top: 12px; }

/* ---------- Tipografía editorial ---------- */
.etiqueta {
  font-family: var(--f-texto);
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .28em;
  color: var(--vino);
  margin-bottom: 1.1rem;
}
.oscuro .etiqueta { color: var(--oro); }

.titulo-seccion {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  margin-bottom: 1.25rem;
}
.titulo-seccion em { font-style: italic; }

.secundario { color: var(--sepia); }
.oscuro .secundario { color: rgba(243, 238, 228, .72); }

.centrado { text-align: center; }

/* Ornamento línea–rombo–línea */
.ornamento {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 132px;
  margin: 1.5rem 0;
  color: var(--oro-filete);
}
.oscuro .ornamento { color: var(--oro); }
.ornamento::before, .ornamento::after {
  content: ""; flex: 1; height: 1px; background: currentColor;
}
.ornamento span {
  width: 7px; height: 7px; transform: rotate(45deg);
  border: 1px solid currentColor; flex: none;
}
.centrado .ornamento, .ornamento.centrado { margin-inline: auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: .85em 1.6em;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--f-texto);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: .2em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-oro { background: var(--oro); color: var(--tinta); border-color: var(--oro); }
.btn-oro:hover { background: #d8b980; border-color: #d8b980; }

.btn-contorno { border-color: var(--oro); color: var(--oro); background: transparent; }
.btn-contorno:hover { background: var(--oro); color: var(--tinta); }

.btn-vino { background: var(--vino); color: var(--papel); border-color: var(--vino); }
.btn-vino:hover { background: #561820; border-color: #561820; }

.btn-linea { border-color: var(--texto); color: var(--texto); background: transparent; }
.btn-linea:hover { background: var(--texto); color: var(--papel); }

.botones { display: flex; flex-direction: column; gap: 14px; margin-top: 2rem; }

/* Íconos inline */
.icono {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--tinta);
  color: var(--papel);
  border-bottom: 1px solid rgba(201, 165, 100, .22);
}
.nav .contenedor {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--nav-alto);
}
.marca { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.marca-nombre { font-family: var(--f-titulos); font-size: 1.12rem; color: var(--papel); }
.marca-sub {
  font-size: .6rem; letter-spacing: .36em; text-transform: uppercase;
  color: var(--oro); margin-top: 5px;
}

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-right: -10px;
  background: none; border: 0; color: var(--oro); cursor: pointer;
}
.nav-toggle .icono { width: 26px; height: 26px; }
.nav-toggle .cerrar { display: none; }
.nav-toggle[aria-expanded="true"] .abrir { display: none; }
.nav-toggle[aria-expanded="true"] .cerrar { display: block; }

.menu {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--tinta);
  border-bottom: 1px solid rgba(201, 165, 100, .22);
  padding: 8px var(--gutter) 24px;
}
.menu.abierto { display: block; }
.menu ul { display: flex; flex-direction: column; }
.menu a:not(.btn) {
  display: flex; align-items: center; min-height: 52px;
  text-decoration: none; text-transform: uppercase;
  font-size: .8rem; letter-spacing: .22em;
  border-bottom: 1px solid rgba(243, 238, 228, .08);
}
.menu a:not(.btn):hover { color: var(--oro); }
.menu .btn { margin-top: 18px; width: 100%; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(56px, 8vw, 112px) clamp(72px, 9vw, 128px); overflow: hidden; }
.hero .contenedor { display: grid; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -.005em;
}
.hero h1 em { font-style: italic; color: var(--oro); }
.hero-texto { max-width: 34em; color: rgba(243, 238, 228, .82); }

/* Portadas en abanico */
.abanico {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  margin-inline: auto;
}
.abanico img {
  position: absolute;
  top: 50%; left: 50%;
  width: 46%;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .7), 0 4px 10px rgba(0, 0, 0, .35);
}
.abanico .izq { transform: translate(-102%, -46%) rotate(-8deg); }
.abanico .der { transform: translate(2%, -46%) rotate(8deg); }
.abanico .centro {
  width: 54%;
  transform: translate(-50%, -50%);
  z-index: 2;
  outline: 1px solid var(--oro);
  outline-offset: 8px;
}

/* ---------- Franja de trayectoria ---------- */
.trayectoria { background: var(--papel); border-bottom: 1px solid rgba(176, 140, 79, .35); }
.trayectoria ul { display: grid; grid-template-columns: 1fr; }
.trayectoria li {
  text-align: center;
  padding: 32px 12px;
  border-bottom: 1px solid rgba(176, 140, 79, .35);
}
.trayectoria li:last-child { border-bottom: 0; }
.cifra {
  display: block;
  font-family: var(--f-titulos);
  font-size: clamp(2.1rem, 1.6rem + 1.8vw, 2.9rem);
  line-height: 1.1;
  color: var(--vino);
}
.cifra-texto { font-size: 1.55rem; }
.cifra-desc {
  display: block; margin-top: .55rem;
  font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--sepia);
}

/* ---------- Novedad ---------- */
.novedad .contenedor { display: grid; gap: 48px; align-items: center; }
.novedad-portada {
  background: var(--pergamino);
  padding: clamp(36px, 7vw, 72px);
  display: flex; justify-content: center;
}
.novedad-portada img { width: min(100%, 300px); box-shadow: var(--sombra-libro); }
.novedad .titulo-seccion { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem); }
.destacado {
  margin: 1.8rem 0;
  padding: 1.1rem 0;
  border-block: 1px solid var(--oro-filete);
  font-style: italic;
  font-size: 1.12em;
  line-height: 1.5;
  color: var(--vino);
}
.ficha {
  margin-top: 1.6rem;
  font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sepia);
}

/* ---------- Obras ---------- */
.obras-cabecera { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.obras-cabecera .ornamento { margin-inline: auto; }
.cuadricula {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 18px;
}
.libro { display: flex; flex-direction: column; }
.portada {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  margin-bottom: 1.1rem;
  box-shadow: var(--sombra-libro);
  background: var(--tinta);
  transition: transform .25s ease, box-shadow .25s ease;
}
.portada img { width: 100%; height: 100%; object-fit: cover; }
/* lomo: leve sombra y brillo en el borde izquierdo, como un libro real */
.portada::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, .22) 0, rgba(255, 255, 255, .14) 1.5%, rgba(0, 0, 0, .06) 3.5%, transparent 7%);
}
.portada:hover { transform: translateY(-4px); }
.libro-genero {
  font-size: .64rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
  color: var(--vino); margin-bottom: .4rem;
}
.libro-titulo { font-size: 1.12rem; line-height: 1.25; margin-bottom: .45rem; }
.libro-sinopsis { font-size: .9em; line-height: 1.45; color: var(--sepia); margin: 0; }

/* ---------- Cita ---------- */
.cita { background: var(--vino); color: var(--papel); text-align: center; }
.cita blockquote { margin: 0 auto; max-width: 900px; }
.cita .icono-cita { width: 44px; height: 44px; color: var(--oro); margin: 0 auto 1.6rem; }
.cita p {
  font-family: var(--f-titulos);
  font-style: italic;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.8rem);
  line-height: 1.3;
  margin-bottom: 1.6rem;
}
.cita cite {
  font-style: normal;
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--oro);
}

/* ---------- El autor ---------- */
.autor .contenedor { display: grid; gap: 48px; align-items: center; }
.marco {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--oro-filete);
  width: min(100%, 460px);
  margin-inline: auto;
}
.marco img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.autor-texto p { max-width: 36em; }

/* ---------- Contacto ---------- */
.contacto .contenedor { display: grid; gap: 48px; }
.contacto h2 { max-width: 14em; }
.tarjetas { display: grid; gap: 16px; }
.tarjeta {
  display: flex; align-items: center; gap: 18px;
  min-height: 48px;
  padding: 22px 24px;
  border: 1px solid rgba(243, 238, 228, .16);
  text-decoration: none;
  transition: border-color .2s ease, background-color .2s ease;
}
.tarjeta:hover { border-color: var(--oro); background: rgba(201, 165, 100, .06); }
.tarjeta .icono { width: 28px; height: 28px; color: var(--oro); flex: none; }
.tarjeta-oro { border-color: var(--oro); }
.tarjeta-etq {
  display: block; margin-bottom: 4px;
  font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--oro);
}
.tarjeta-dato { display: block; font-size: 1.05rem; overflow-wrap: anywhere; }
.redes { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 4px; }
.redes .btn { width: 100%; }

/* ---------- Footer ---------- */
.pie {
  background: var(--tinta-profunda);
  color: rgba(243, 238, 228, .7);
  border-top: 1px solid var(--oro);
  padding-block: 48px;
  text-align: center;
}
.pie-nombre { font-family: var(--f-titulos); font-size: 1.4rem; color: var(--papel); margin-bottom: 1rem; }
.pie-redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin-bottom: 1.2rem; }
.pie-redes a {
  display: inline-flex; align-items: center; min-height: 48px;
  color: var(--oro); text-decoration: none;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
}
.pie-redes a:hover { color: var(--papel); }
.pie small { display: block; font-size: .8rem; letter-spacing: .08em; }

/* ---------- WhatsApp flotante ---------- */
.wa-flotante {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--oro); color: var(--tinta);
  box-shadow: 0 8px 22px -6px rgba(14, 19, 27, .55);
  transition: background-color .2s ease;
}
.wa-flotante:hover { background: #d8b980; }
.wa-flotante .icono { width: 28px; height: 28px; stroke-width: 1.5; }

/* ==========================================================
   Breakpoints
   ========================================================== */
@media (min-width: 600px) {
  :root { --gutter: 32px; }
  .botones { flex-direction: row; flex-wrap: wrap; }
  .trayectoria ul { grid-template-columns: repeat(2, 1fr); }
  .trayectoria li:nth-child(odd) { border-right: 1px solid rgba(176, 140, 79, .35); }
  .trayectoria li:nth-child(n+3) { border-bottom: 0; }
  .cuadricula { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; }
  .redes { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  :root { --gutter: 40px; --nav-alto: 84px; }

  .nav-toggle { display: none; }
  .menu {
    display: block; position: static; padding: 0; border: 0; background: none;
  }
  .menu ul { flex-direction: row; align-items: center; gap: 36px; }
  .menu a:not(.btn) { min-height: 48px; border: 0; font-size: .74rem; }
  .menu .btn { margin: 0 0 0 4px; width: auto; }
  .marca-nombre { font-size: 1.3rem; }

  .hero .contenedor { grid-template-columns: 1.08fr 1fr; gap: 64px; }
  .abanico { width: 100%; max-width: 520px; }

  .trayectoria ul { grid-template-columns: repeat(4, 1fr); }
  .trayectoria li { padding: 44px 16px; border-bottom: 0; }
  .trayectoria li:nth-child(odd) { border-right: 0; }
  .trayectoria li + li { border-left: 1px solid rgba(176, 140, 79, .35); }

  .novedad .contenedor { grid-template-columns: 1fr 1.1fr; gap: 80px; }
  .cuadricula { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 64px 40px; }
  .autor .contenedor { grid-template-columns: .85fr 1fr; gap: 88px; }
  .contacto .contenedor { grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
  .wa-flotante { right: 28px; bottom: 28px; width: 60px; height: 60px; }
}
