/* ─── Estilos compartidos: reset, nav, ticker, botones, footer, fade-up ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:      #F9F7F4;
  --bg2:     #F1EDE7;
  --bg3:     #E8E2DA;
  --navy:    #1B1F3B;
  --navy2:   #252A4E;
  --gold:    #96793F;
  --gold2:   #C9AA7C;
  --mid:     #43403A;
  --light:   #837A6D;
  --line:    rgba(27,31,59,0.1);
  --line2:   rgba(27,31,59,0.06);
}

/* Base 17px: escala toda la tipografía del sitio (todo está en rem) */
html { scroll-behavior: smooth; font-size: 106.25%; }
body {
  background: var(--bg);
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--navy2); color: #fff; }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--gold); }
a { color: inherit; text-decoration: none; }

/* ─── SKIP LINK (accesibilidad teclado) ─── */
.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 999;
  background: var(--navy); color: #fff; padding: .8rem 1.4rem;
  font-family: 'DM Sans', sans-serif; font-size: .75rem; font-weight: 600;
  text-decoration: none; transition: top .25s;
}
.skip-link:focus { top: 1rem; }

/* ─── FEEDBACK TÁCTIL EN BOTONES/LINKS ─── */
.btn-primary:active, .btn-gold:active, .nav-cta:active, .cta-wa-btn:active,
.nf-btn:active, .pag-btn:active, .citacion-copy:active { transform: scale(.97); }
.btn-primary, .btn-gold, .nav-cta, .cta-wa-btn { transition: background .3s, transform .12s; }

/* ─── BARRA DE PROGRESO DE LECTURA ─── */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--gold); z-index: 300;
  transition: width .1s linear;
}

/* ─── VOLVER ARRIBA ─── */
.back-to-top {
  position: fixed; bottom: 2rem; left: 2rem; z-index: 190;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: rgba(255,255,255,.85);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(27,31,59,.25);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .3s, transform .3s, visibility .3s, background .3s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--gold); color: #fff; }
.back-to-top svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .back-to-top { bottom: 1.2rem; left: 1.2rem; width: 40px; height: 40px; }
}

/* ─── FOCO ACCESIBLE ─── */
a:focus-visible,
button:focus-visible,
.filter-btn:focus-visible,
.nav-burger:focus-visible {
  outline: 1.5px solid var(--gold2);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ─── MOVIMIENTO REDUCIDO ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .fu { opacity: 1; transform: none; }
}

/* ─── WA FLOAT ─── */
.wa-float {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 24px rgba(37,211,102,.3);
  transition: transform .3s, box-shadow .3s;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 6px 32px rgba(37,211,102,.4); }
.wa-float svg { width: 26px; height: 26px; }

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 4rem;
  background: var(--navy);
  transition: box-shadow .4s;
}
nav.solid {
  box-shadow: 0 2px 20px rgba(27,31,59,.15);
}
.nav-logo {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  font-family: 'DM Sans', sans-serif;
  line-height: 1; gap: .22rem;
  transition: opacity .3s;
}
.nav-logo:hover { opacity: .82; }
.logo-name {
  font-size: 1.55rem; font-weight: 500; letter-spacing: .06em;
  color: #fff;
}
.logo-tag {
  font-size: .5rem; font-weight: 600; letter-spacing: .32em;
  text-transform: uppercase; color: var(--gold2);
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  font-size: .68rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: rgba(255,255,255,.8);
  transition: color .3s;
  position: relative; padding-bottom: .15rem;
  white-space: nowrap;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 1px; background: var(--gold2);
  transition: width .35s ease;
}
.nav-links a:hover { color: var(--gold2); }
.nav-links a:hover::after { width: 100%; }
.nav-cta {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--gold); color: #fff;
  padding: .6rem 1.5rem;
  transition: background .3s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--gold2); }
.nav-cta svg { width: 13px; height: 13px; }

/* ─── DROPDOWN "SERVICIOS" (desktop) ─── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: rgba(255,255,255,.8);
  background: none; border: none; cursor: pointer; padding: 0 0 .15rem;
  transition: color .3s;
}
.nav-dropdown-trigger svg { width: 10px; height: 10px; transition: transform .25s; }
.nav-dropdown-trigger:hover { color: var(--gold2); }
.nav-dropdown.open .nav-dropdown-trigger,
.nav-dropdown:hover .nav-dropdown-trigger { color: var(--gold2); }
.nav-dropdown.open .nav-dropdown-trigger svg,
.nav-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-panel {
  /* pt-top actúa como "puente" invisible: sin hueco entre el botón y el
     panel, el :hover del padre no se corta al bajar el mouse */
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  min-width: 190px; padding-top: .9rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, visibility 0s .18s;
  z-index: 150;
}
.nav-dropdown.open .nav-dropdown-panel,
.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .18s ease, visibility 0s;
}
.nav-dropdown-panel-inner {
  background: var(--navy2); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
  display: flex; flex-direction: column; padding: .5rem;
}
.nav-dropdown-panel a {
  font-family: 'DM Sans', sans-serif;
  font-size: .74rem; font-weight: 500; letter-spacing: .04em;
  text-transform: none; color: rgba(255,255,255,.75);
  padding: .65rem .9rem; white-space: nowrap; transition: background .2s, color .2s;
}
.nav-dropdown-panel a:hover { background: rgba(201,170,124,.1); color: var(--gold2); }

/* ─── ACORDEÓN "SERVICIOS" (menú móvil) ─── */
.nav-mobile-accordion { display: flex; flex-direction: column; }
.nav-mobile-accordion-trigger {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem; font-weight: 400; letter-spacing: .01em;
  color: rgba(255,255,255,.75); background: none; border: none;
  cursor: pointer; padding: 0; text-align: left;
}
.nav-mobile-accordion-trigger svg { width: 18px; height: 18px; transition: transform .25s; flex-shrink: 0; }
.nav-mobile-accordion.open .nav-mobile-accordion-trigger svg { transform: rotate(180deg); }
.nav-mobile-accordion-panel {
  display: flex; flex-direction: column; gap: .9rem;
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, margin-top .3s ease;
}
.nav-mobile-accordion.open .nav-mobile-accordion-panel {
  max-height: 260px; margin-top: 1rem;
}
.nav-mobile-accordion-panel a {
  font-size: 1.05rem; color: rgba(255,255,255,.55); padding-left: .5rem;
}

/* ─── MENÚ HAMBURGUESA (mobile) ─── */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 34px; height: 34px;
  background: transparent; border: none; cursor: pointer; padding: 0;
  z-index: 110;
}
.nav-burger span {
  display: block; width: 100%; height: 2px; background: #fff;
  transition: transform .3s, opacity .3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 105;
  background: var(--navy);
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: 1.3rem; padding: 6rem 2.5rem 3rem;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateY(-12px); opacity: 0; visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility 0s .3s;
}
.nav-mobile.open {
  transform: translateY(0); opacity: 1; visibility: visible;
  transition: opacity .3s ease, transform .3s ease, visibility 0s;
}
.nav-mobile a {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.5rem; font-weight: 400; letter-spacing: .01em;
  color: rgba(255,255,255,.75); transition: color .3s;
  flex-shrink: 0;
}
.nav-mobile a:hover { color: var(--gold2); }

.nav-mobile-close {
  position: absolute; top: 1.4rem; right: 1.6rem; z-index: 120;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%; cursor: pointer; padding: 0;
}
.nav-mobile-close span {
  position: absolute; width: 16px; height: 1.5px; background: #fff;
  transition: background .3s;
}
.nav-mobile-close span:nth-child(1) { transform: rotate(45deg); }
.nav-mobile-close span:nth-child(2) { transform: rotate(-45deg); }
.nav-mobile-close:hover { border-color: var(--gold2); }
.nav-mobile-close:hover span { background: var(--gold2); }

/* ─── BOTONES ─── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--gold); color: #fff;
  padding: .9rem 2.2rem; transition: background .3s;
}
.btn-primary:hover { background: var(--gold2); }
.btn-primary svg { width: 14px; height: 14px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .65rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding-bottom: .2rem; transition: color .3s, border-color .3s;
}
.btn-ghost:hover { color: var(--gold2); border-color: var(--gold2); }
.btn-gold {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold); color: #fff;
  padding: .9rem 2rem; flex-shrink: 0; transition: background .3s;
}
.btn-gold:hover { background: var(--gold2); }
.btn-gold svg { width: 14px; height: 14px; }

/* ─── SECTION LABEL / TITLE (compartidos entre páginas) ─── */
.section-label {
  font-size: .6rem; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: .7rem;
}
.section-label::before { content: ''; width: 20px; height: 1.5px; background: var(--gold); }
.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(2.1rem, 3.3vw, 3.3rem);
  font-weight: 700; letter-spacing: -.01em; line-height: 1.08; margin-top: 1rem;
}
.section-title em { font-style: normal; color: var(--gold); }

/* ─── FOOTER ─── */
footer {
  background: var(--navy); padding: 2rem 4rem;
  display: flex; align-items: center; justify-content: space-between;
}
.f-logo { font-family: 'DM Sans', sans-serif; font-size: 1.15rem; color: rgba(255,255,255,.55); }
.f-logo em { font-style: italic; color: var(--gold2); }
.f-copy { font-size: .64rem; font-weight: 500; letter-spacing: .06em; color: rgba(255,255,255,.42); }
.f-links { display: flex; gap: 1.8rem; }
.f-links a {
  font-size: .64rem; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.55); transition: color .3s;
}
.f-links a:hover { color: var(--gold2); }

/* ─── FADE UP ─── */
.fu { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; }
.fu.vis { opacity: 1; transform: translateY(0); }

/* ─── MOBILE / TABLET ─── */
/* El menú pasa a hamburguesa antes de que los links no entren en una línea */
@media (max-width: 1280px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}
@media (max-width: 900px) {
  nav { padding: 1rem 1.5rem; }
  footer { flex-direction: column; gap: 1.2rem; padding: 2rem 1.5rem; text-align: center; }
  .f-links { justify-content: center; flex-wrap: wrap; gap: 1.2rem; }
}

/* ─── LEGIBILIDAD GLOBAL (v5) ─────────────────────────────────
   Pisa los tamaños chicos definidos en los <style> de cada página.
   Objetivo: texto de lectura ≥16px, contraste AA, jerarquía clara. */

/* Cuerpo de artículos del blog y detalle de novedad */
.art-body p,
.nov-body p {
  font-size: 1rem !important;
  line-height: 1.9 !important;
}
.art-body li {
  font-size: .97rem !important;
  line-height: 1.85 !important;
}
.art-body h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.05rem) !important;
  line-height: 1.25 !important;
}
.art-body h3 { font-size: 1.25rem !important; }

/* Intro y meta sobre fondo navy */
.art-intro { color: rgba(255,255,255,.78) !important; font-size: clamp(1.1rem, 1.9vw, 1.35rem) !important; }
.art-meta { color: rgba(255,255,255,.6) !important; font-size: .74rem !important; }

/* Listado de jurisprudencia */
.nov-titulo { font-size: 1.45rem !important; line-height: 1.3 !important; }
.nov-texto { font-size: .95rem !important; line-height: 1.85 !important; }
.nov-fuente { font-size: .68rem !important; letter-spacing: .08em !important; }
.nov-date { font-size: .7rem !important; }
.nov-sub { color: rgba(255,255,255,.72) !important; font-size: .95rem !important; }

/* CTA inline sobre fondo navy: el color de .art-body p le ganaba por
   especificidad y el texto quedaba oscuro sobre oscuro (ilegible) */
.cta-inline-text,
.art-body .cta-inline-text,
.art-body .cta-inline p,
.nov-body .cta-inline p {
  color: rgba(255,255,255,.9) !important;
  font-size: 1.25rem !important;
  line-height: 1.5 !important;
}

/* Cajas destacadas */
.highlight,
.fallo-box p,
.nov-fuente-box {
  font-size: .95rem !important;
  line-height: 1.85 !important;
}
.paso-list .paso-text { font-size: .95rem !important; line-height: 1.85 !important; }
.citacion-text { font-size: .88rem !important; }

/* Buscador y filtros de jurisprudencia */
.search-input { font-size: .92rem !important; }
.nf-btn { font-size: .66rem !important; padding: .5rem 1.1rem !important; }

/* Autor */
.author-bio, .author-info p { font-size: .85rem !important; line-height: 1.75 !important; }

/* Tiras de credibilidad */
.cred-item, .auth-item { font-size: .76rem !important; }
