/* ==========================================================================
   Manzanero & Asociados · Estudio Legal
   Sección: Temas Selectos de Derecho (Biblioteca Jurídica)
   Mobile-First · Estático · Accesible · Sin dependencias
   ========================================================================== */

:root {
  --guinda: #5C1026;
  --guinda-deep: #470D1F;
  --guinda-soft: #7A1F3B;
  --guinda-tint: #F5D7DE;
  --guinda-wash: #EBC0CB;
  --gold: #C5A059;
  --gold-dark: #9E7D3B;
  --gold-light: #F7F2E7;
  --paper: #FFFFFF;
  --paper-ivory: #FAF8F5;
  --paper-warm: #F4EFEB;
  --ink: #2B2625;
  --ink-light: #4A4443;
  --muted: #6B6564;
  --line: #E8E2DC;
  --line-dark: #D4CCC4;
  --focus: #8E2A47;
  --white: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --shadow-sm: 0 2px 8px rgba(71, 13, 31, 0.05);
  --shadow-card: 0 4px 16px rgba(71, 13, 31, 0.06);
  --shadow-hover: 0 10px 28px rgba(71, 13, 31, 0.12);
  --font-display:  Arial Narrow, Franklin Gothic Medium, Haettenschweiler, Arial Black, Impact, sans-serif;
  --font-serif: Georgia, Iowan Old Style, Palatino Linotype, Times New Roman, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  --maxw: 70rem; /* 1120px */
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 0.6em; }
h1, h2 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 700; line-height: 1.35; }
h4 { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.35rem; }
li { margin-bottom: 0.4em; }
a { color: var(--guinda); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--guinda-deep); }
address { font-style: normal; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- Accesibilidad ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3.5rem; z-index: 200;
  background: var(--guinda); color: #fff; padding: 0.65rem 1rem;
  border-radius: 0 0 8px 8px; font-weight: 600; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

/* ---------- Layout & Contenedores ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.section--ivory { background: var(--paper-ivory); }
.section--paper { background: var(--paper-warm); }

/* ---------- Cabecera de Sitio ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap;
  max-width: var(--maxw); margin: 0 auto; padding: 0.65rem 1.25rem; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--ink); flex-shrink: 0; white-space: nowrap;
}
.brand img { height: 3rem; width: auto; display: block; }
.brand-name {
  font-family: var(--font-serif); color: var(--guinda); font-size: 1.05rem; font-weight: 700; line-height: 1.15; white-space: nowrap;
}
.brand-sub {
  display: block; font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.nav-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: 2px solid var(--guinda);
  color: var(--guinda); font-weight: 600; font-size: 0.95rem; padding: 0.55rem 0.9rem; border-radius: 8px; cursor: pointer; flex-shrink: 0;
}
.nav-toggle[aria-expanded="true"] { background: var(--guinda); color: #fff; }
.nav-toggle span:last-child { display: none; }

.main-nav {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 0.5rem 1.25rem 1.25rem; box-shadow: var(--shadow);
}
.main-nav.is-open, .main-nav.open { display: block; }
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.nav-list li + li { border-top: 1px solid var(--line); }
.nav-list a {
  display: block; padding: 0.85rem 0.25rem; color: var(--guinda); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 1rem;
}
.nav-list a:hover { color: var(--guinda); }
.nav-list a[aria-current=page] {
  color: var(--guinda); box-shadow: inset 3px 0 0 var(--guinda); padding-left: 0.75rem;
}
.nav-cta {
  display: inline-flex; width: 100%; justify-content: center; text-align: center; margin-top: 1rem; white-space: nowrap;
}

@media (min-width: 64rem) {
  .nav-toggle { display: none; }
  .nav-toggle span:last-child { display: inline; }
  .main-nav {
    display: flex !important; width: auto; position: static !important;
    background: transparent; border: 0 !important; padding: 0 !important; box-shadow: none !important;
    align-items: center; gap: clamp(0.75rem, 1.4vw, 1.4rem); flex-shrink: 0; flex-wrap: nowrap;
  }
  .nav-list {
    flex-direction: row; align-items: center; gap: clamp(0.45rem, 1vw, 1.25rem); flex-wrap: nowrap;
  }
  .nav-list li + li { border-top: 0; }
  .nav-list a {
    padding: 0.5rem 0.15rem; font-size: clamp(0.84rem, 0.92vw, 0.95rem); white-space: nowrap;
  }
  .nav-list a[aria-current=page] {
    box-shadow: inset 0 -3px 0 var(--guinda); padding-left: 0.15rem; background: transparent; color: var(--guinda);
  }
  .nav-cta {
    margin-top: 0; width: auto; font-size: clamp(0.82rem, 0.88vw, 0.92rem);
    padding: clamp(0.55rem, 0.75vw, 0.75rem) clamp(0.85rem, 1.1vw, 1.35rem);
    min-height: 2.6rem; white-space: nowrap; flex-shrink: 0;
  }
}

/* ---------- Botones Generales ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; line-height: 1;
  padding: 0.8rem 1.4rem; border-radius: var(--radius-full); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: all 0.18s ease;
  min-height: 2.75rem;
}
.btn--primary { background: var(--guinda); color: #fff; }
.btn--primary:hover { background: var(--guinda-deep); color: #fff; text-decoration: none; }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: var(--gold-dark); color: #fff; text-decoration: none; }
.btn--outline {
  background: transparent; border-color: var(--guinda); color: var(--guinda);
}
.btn--outline:hover {
  background: var(--guinda); color: #fff; text-decoration: none;
}
.btn--outline-subtle {
  background: #fff; border-color: var(--line-dark); color: var(--ink);
}
.btn--outline-subtle:hover {
  border-color: var(--guinda); color: var(--guinda); text-decoration: none;
  background: var(--paper-ivory);
}

/* ---------- Hero Borgoña (Biblioteca Jurídica) ---------- */
.hero-library {
  background: var(--guinda);
  color: #fff;
  padding: 3.5rem 0 3rem;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--gold);
}
.hero-library::before {
  content: ";
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 80% 20%, rgba(197, 160, 89, 0.12), transparent 50%),
              linear-gradient(180deg, rgba(71, 13, 31, 0.4) 0%, transparent 100%);
  pointer-events: none;
}
.hero-library-inner { position: relative; z-index: 2; max-width: 52rem; }
.library-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.5);
  color: var(--gold-light);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; padding: 0.35rem 0.85rem; border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}
.hero-library h1 {
  color: #FFFFFF; font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  margin-bottom: 0.8rem; letter-spacing: 0.03em;
}
.hero-library .lead {
  color: #F7EAEF; font-size: 1.15rem; line-height: 1.6;
  margin-bottom: 0; max-width: 46rem;
}

/* ---------- Barra de Búsqueda y Filtros ---------- */
.filter-bar-container {
  margin-top: -1.75rem;
  position: relative;
  z-index: 10;
  margin-bottom: 2.5rem;
}
.filter-bar {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.search-wrapper {
  position: relative;
  flex: 1;
}
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; width: 18px; height: 18px;
}
.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  background: var(--paper-ivory);
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--guinda);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px var(--guinda-tint);
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-right: 0.25rem;
}
.pill-btn {
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  color: var(--ink-light);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-btn:hover {
  border-color: var(--guinda-soft);
  color: var(--guinda);
  background: #FFFFFF;
}
.pill-btn.is-active {
  background: var(--guinda);
  border-color: var(--guinda);
  color: #FFFFFF;
}
.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sort-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.sort-select {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sort-select:hover {
  border-color: var(--guinda-soft);
  background: #FFFFFF;
}
.sort-select:focus {
  outline: none;
  border-color: var(--guinda);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px var(--guinda-tint);
}
.filter-status {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

@media (min-width: 768px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
    padding: 1.25rem 1.5rem;
  }
  .search-wrapper { max-width: 22rem; }
  .filter-pills { flex: 1; justify-content: flex-start; }
}

/* ---------- Cuadrícula de Tarjetas Documentales ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}
@media (min-width: 768px) {
  .doc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.doc-card {
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-top: 4px solid var(--guinda);
  border-radius: var(--radius-sm);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-top-color 0.2s ease;
  position: relative;
}
.doc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-top-color: var(--gold);
}
.doc-card-header { margin-bottom: 1.25rem; }
.doc-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.badge-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--guinda-tint);
  color: var(--guinda-deep);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}
.badge-materia {
  font-size: 0.75rem;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid var(--line-dark);
  color: var(--ink-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}
.doc-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.5rem 0 0.75rem;
}
.doc-card-title a {
  color: var(--ink);
  text-decoration: none;
}
.doc-card-title a:hover {
  color: var(--guinda);
  text-decoration: underline;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.doc-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.doc-meta-icon { width: 14px; height: 14px; color: var(--gold-dark); }
.doc-card-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-light);
  margin-bottom: 1.75rem;
  flex-grow: 1;
}
.doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-top: auto;
}
.btn-card-read {
  background: var(--guinda);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s ease;
}
.btn-card-read:hover {
  background: var(--guinda-deep);
  color: #fff;
  text-decoration: none;
}
.btn-card-download {
  background: #FFFFFF;
  border: 1px solid var(--line-dark);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-card-download:hover {
  border-color: var(--guinda);
  color: var(--guinda);
  background: var(--paper-warm);
  text-decoration: none;
}

/* ---------- Vista Individual de Documento ---------- */
.article-nav-bar {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper-ivory);
  margin-bottom: 2.5rem;
}
.article-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .article-nav-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--guinda);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.back-btn:hover {
  color: var(--guinda-deep);
  text-decoration: underline;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--guinda);
  text-decoration: underline;
}
.breadcrumb-sep {
  color: var(--line-dark);
  font-size: 0.8rem;
}
.breadcrumb-current {
  color: var(--guinda);
  font-weight: 600;
}

/* Encabezado Editorial del Artículo */
.article-header {
  max-width: 52rem;
  margin-bottom: 2.5rem;
}
.article-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.article-header h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 1rem;
}
.article-subtitle {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-light);
  font-weight: 400;
  margin-bottom: 1.5rem;
}
.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
.article-author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink);
}

/* Recuadro «En síntesis» */
.synthesis-box {
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-left: 4px solid var(--guinda);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 3rem;
  box-shadow: var(--shadow-sm);
}
.synthesis-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--guinda);
  margin-bottom: 1rem;
}
.synthesis-icon {
  width: 20px; height: 20px; color: var(--gold);
}
.synthesis-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.synthesis-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
}
.synthesis-list li:last-child { margin-bottom: 0; }
.synthesis-list li::before {
  content: ";
  position: absolute;
  left: 0.25rem;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

/* Disposición Editorial en 2 Columnas */
.editorial-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
@media (min-width: 992px) {
  .editorial-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}

/* Cuerpo Editorial de Texto */
.editorial-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink);
}
.editorial-body h2 {
  font-size: 1.6rem;
  color: var(--guinda-deep);
  margin-top: 3rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 6rem;
}
.editorial-body h3 {
  font-size: 1.25rem;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 6rem;
}
.editorial-body p {
  margin-bottom: 1.4rem;
}
.editorial-body ul, .editorial-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.editorial-body li {
  margin-bottom: 0.6rem;
}
.editorial-body blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--paper-ivory);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-light);
}
.stat-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin: 2rem 0;
}
.stat-highlight-item {
  flex: 1;
  min-width: 140px;
}
.stat-highlight-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--guinda);
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-highlight-label {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Firma de Autor / Despacho */
.author-signature {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 3rem 0;
}
.author-avatar-seal {
  width: 54px; height: 54px;
  background: var(--guinda);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
  flex-shrink: 0;
}
.author-info h4 { margin: 0 0 0.2rem; font-size: 1.1rem; color: var(--guinda-deep); }
.author-info p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* Aviso Legal */
.legal-disclaimer {
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.legal-icon {
  width: 20px; height: 20px; color: var(--gold-dark); flex-shrink: 0; margin-top: 2px;
}

/* Barra Lateral Sticky (Índice y Descarga) */
.editorial-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sidebar-widget {
  background: var(--paper-ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.sidebar-widget h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--guinda);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toc-link {
  display: block;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-light);
  text-decoration: none;
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.15s ease;
}
.toc-link:hover {
  color: var(--guinda);
  background: #FFFFFF;
  border-left-color: var(--gold);
}
.toc-link.is-active {
  color: var(--guinda-deep);
  font-weight: 700;
  background: #FFFFFF;
  border-left-color: var(--guinda);
}

.download-widget {
  background: var(--guinda-deep);
  color: #fff;
  border: 1px solid var(--guinda);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
}
.download-widget h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.download-widget p {
  color: var(--guinda-tint);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.btn-download-primary {
  width: 100%;
  background: var(--gold);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}
.btn-download-primary:hover {
  background: var(--gold-dark);
  color: #fff;
  text-decoration: none;
}

/* ---------- Pie de Página Institucional ---------- */
.site-footer {
  background: var(--guinda-deep);
  color: #E8D9DE;
  padding: 3.5rem 0 1.5rem;
  border-top: 3px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
.footer-brand img { width: 140px; height: auto; margin-bottom: 1rem; }
.footer-brand p { font-size: 0.9rem; color: #D4C3CA; line-height: 1.6; }
.footer-brand a { color: var(--gold-light); }
.site-footer h3 {
  color: #FFFFFF; font-family: var(--font-display); font-size: 1.1rem;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem;
}
.footer-nav { list-style: none; padding: 0; margin: 0; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a { color: #E8D9DE; text-decoration: none; font-size: 0.9rem; }
.footer-nav a:hover { color: #FFFFFF; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.85rem;
  color: #BCA8B0;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Studio Link / Footer Ponciano Studio Widget */
.studio-link {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.25rem;
  min-height: 44px; max-width: 100%; padding: 0.5rem 0;
  font-family: var(--font-sans); font-size: 0.85rem; line-height: 1.5;
  color: var(--guinda-tint); text-decoration: none;
}
.studio-link strong { font-weight: 700; }
.studio-link:hover { color: var(--guinda-wash); text-decoration: underline; }
.studio-link:focus-visible, .footer-bottom .privacy-link:focus-visible {
  outline: 3px solid var(--guinda-tint); outline-offset: 3px; border-radius: 2px;
}
.footer-bottom .privacy-link {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0.5rem 0; max-width: 100%; line-height: 1.5;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Botón flotante WhatsApp y Volver Arriba */
.whatsapp-float {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
  background: #25D366; color: #FFFFFF; width: 52px; height: 52px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2); transition: transform 0.2s ease;
  text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.08); color: #FFFFFF; }
.back-top {
  position: fixed; right: 1.25rem; bottom: 5rem; z-index: 90;
  background: var(--guinda); color: #fff; width: 44px; height: 44px;
  border-radius: 50%; border: 0; display: none; align-items: center;
  justify-content: center; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: all 0.2s ease;
}
.back-top.is-visible { display: flex; }
.back-top:hover { background: var(--guinda-deep); }

/* La marca puede envolver para dejar espacio al control del menú. */
@media (max-width: 63.99rem) {
  .brand { min-width: 0; flex-shrink: 1; white-space: normal; }
  .brand img { flex-shrink: 0; }
  .brand-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .brand-sub { white-space: normal; }
  .nav-list a, .nav-cta { white-space: normal; }
}

/* Los contenidos largos pueden envolver sin ampliar las pistas de la rejilla. */
.footer-grid > * { min-width: 0; }
.site-footer { overflow-wrap: anywhere; }

.doc-grid > *, .editorial-layout > * { min-width: 0; overflow-wrap: anywhere; }
.btn-card-read, .btn-card-download, .btn-download-primary {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}

main { overflow-wrap: anywhere; }
.sort-select { min-width: 0; max-width: 100%; }
