/* ============================================================
   BIBLIOTECA JURÍDICA — biblioteca.css
   Extiende styles.css | Tokens: --navy, --gold2, --ink, --muted
============================================================ */

/* ============================================================
   BREADCRUMB
============================================================ */
.breadcrumb-wrap {
  padding: 88px 0 0;
  /* compensa el header fixed de 80px */
  background: var(--bg-warm);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  transition: color .18s;
}

.breadcrumb a:hover {
  color: var(--gold2);
}

.breadcrumb span:last-child {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================================
   HERO BIBLIOTECA
============================================================ */
.bib-hero {
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
  min-height: 380px;
}

/* Imagen de fondo hero */
.bib-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/biblioteca-hero.png') center/cover no-repeat;
  opacity: .18;
  pointer-events: none;
  z-index: 0;
}

.bib-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

/* Columna izquierda */
.bib-hero-left h1 {
  font-size: 52px;
  line-height: 1.05;
  font-weight: 900;
  margin: 0 0 16px;
  color: #fff;
  letter-spacing: -.02em;
}

.bib-hero-left h1 .accent {
  color: var(--gold2);
}

.bib-hero-desc {
  font-size: 17px;
  color: rgba(255, 255, 255, .80);
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 420px;
}

.bib-benefits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bib-benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  font-weight: 500;
}

.bib-benefit-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bib-benefit-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--gold2);
}

/* Columna derecha — card de búsqueda */
.bib-search-card {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bib-search-label {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 14px;
}

.bib-search-input-wrap {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, .95);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
}

.bib-search-input-wrap input {
  flex: 1;
  padding: 14px 18px;
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}

.bib-search-input-wrap input::placeholder {
  color: #9aa3b8;
}

.bib-search-btn {
  padding: 0 18px;
  background: var(--navy);
  border: none;
  cursor: pointer;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.bib-search-btn:hover {
  background: var(--gold);
}

.bib-search-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.bib-popular {
  margin-top: 18px;
}

.bib-popular-label {
  font-size: 12px;
  color: rgba(255, 255, 255, .60);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pop-tag {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .90);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.pop-tag:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* ============================================================
   CATEGORY TABS
============================================================ */
.bib-categories {
  background: var(--bg-cream);
  border-bottom: 2px solid var(--bg-sand);
  position: sticky;
  top: 80px;
  z-index: 50;
}

.cat-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 22px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color .2s, border-color .2s;
}

.cat-tab svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cat-tab:hover {
  color: var(--ink);
}

.cat-tab.active {
  color: var(--gold2);
  border-bottom-color: var(--gold2);
}

/* ============================================================
   ARTICLES SECTION
============================================================ */
.bib-articles {
  padding: 52px 0 48px;
  background: var(--bg-warm);
}

.bib-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.bib-section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -.01em;
}

.bib-ver-todo {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold2);
  transition: opacity .2s;
}

.bib-ver-todo:hover {
  opacity: .75;
}

/* Grid de artículos */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.article-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(7, 22, 51, .07);
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(7, 22, 51, .14);
}

.article-card-img {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.article-card-img-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card-img-bg svg {
  width: 52px;
  height: 52px;
  opacity: .22;
  fill: #fff;
}

.article-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, .40);
  backdrop-filter: blur(6px);
}

.article-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-body h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.35;
}

.article-card-body p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.article-leer-mas {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold2);
  transition: gap .15s;
}

.article-leer-mas:hover {
  gap: 8px;
}

/* Estado vacío */
.no-results {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
  font-size: 15px;
}

/* Categoría → colores de card */
.cat-color-civil {
  background: linear-gradient(135deg, #00163f, #1b3272);
}

.cat-color-penal {
  background: linear-gradient(135deg, #160020, #2d0040);
}

.cat-color-laboral {
  background: linear-gradient(135deg, #003d40, #00163f);
}

.cat-color-familiar {
  background: linear-gradient(135deg, #1a0040, #2b006b);
}

.cat-color-administrativo {
  background: linear-gradient(135deg, #001630, #003060);
}

/* ============================================================
   GUIDES SECTION
============================================================ */
.bib-guides {
  padding: 48px 0;
  background: var(--bg-cream);
}

.guides-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--bg-sand);
  border-radius: 12px;
  padding: 18px 16px;
  transition: box-shadow .2s, border-color .2s;
}

.guide-card:hover {
  box-shadow: 0 6px 24px rgba(7, 22, 51, .10);
  border-color: var(--gold2);
}

.guide-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-pdf-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #fff1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-pdf-icon svg {
  width: 22px;
  height: 22px;
  fill: #e53935;
}

.guide-type {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}

.guide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eef0f5;
}

.guide-size {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.guide-dl-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
}

.guide-dl-btn:hover {
  background: var(--gold2);
  transform: translateY(-2px);
}

.guide-dl-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* ============================================================
   ANDREA CTA BANNER
============================================================ */
.bib-andrea {
  padding: 48px 0;
  background: var(--bg-warm);
}

.bib-andrea-inner {
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 36px 48px;
  position: relative;
}

.bib-andrea-img {
  width: 130px;
  height: 160px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .30);
}

.bib-andrea-text {
  flex: 1;
}

.bib-andrea-text h2 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}

.bib-andrea-text p {
  color: rgba(255, 255, 255, .75);
  font-size: 15px;
  margin: 0;
}

/* ============================================================
   LEGAL DISCLAIMER
============================================================ */
.bib-disclaimer {
  padding: 0 0 36px;
  background: var(--bg-warm);
}

.disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-left: 4px solid var(--gold2);
  border-radius: 12px;
  padding: 20px 24px;
}

.disclaimer-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.disclaimer-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold);
  fill: none;
}

.disclaimer-box strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.disclaimer-box p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   BOTTOM CTA
============================================================ */
.bib-cta-bottom {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  padding: 52px 0;
  position: relative;
  overflow: hidden;
}

.bib-cta-bottom::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .15;
  pointer-events: none;
}

.bib-cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.bib-cta-inner h2 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.bib-cta-inner p {
  color: var(--gold2);
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.bib-cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-outline-white {
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .40);
  background: rgba(255, 255, 255, .06);
  border-radius: 9px;
  padding: 13px 22px;
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: background .2s, transform .2s;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, .12);
  transform: translateY(-2px);
}

/* ============================================================
   ARTICLE PAGE — articulo.html
============================================================ */
.art-page {
  padding-top: 80px;
}

.art-breadcrumb-wrap {
  background: var(--bg-warm);
  padding: 10px 0;
}

.art-hero {
  padding: 52px 0 0;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%);
  color: var(--white);
}

.art-hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 52px;
  align-items: end;
}

.art-category-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--white);
  margin-bottom: 18px;
}

.art-hero h1 {
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  margin: 0 0 14px;
  color: #fff;
}

.art-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, .60);
  margin-bottom: 28px;
}

.art-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.art-hero-img-wrap {
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  height: 300px;
}

.art-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.art-body-wrap {
  background: var(--bg-cream);
  padding: 52px 0 64px;
}

.art-body-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 52px;
  align-items: start;
}

.art-content {
  font-size: 16px;
  line-height: 1.75;
  color: #2a3550;
}

.art-content h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 36px 0 14px;
}

.art-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 10px;
}

.art-content p {
  margin: 0 0 18px;
}

.art-content ul {
  padding-left: 22px;
  margin: 0 0 18px;
}

.art-content ul li {
  margin-bottom: 8px;
}

/* ── Estilos editoriales del artículo (.article-content) ── */
.article-content {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.85;
  color: #2a3550;
  max-width: 720px;
}

.article-content p {
  margin: 0 0 20px;
}

.article-content h2 {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy, #00163f);
  margin: 40px 0 20px;
}

.article-content h3 {
  font-family: 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy, #00163f);
  margin: 32px 0 16px;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
  margin: 0 0 20px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--gold, #c9963a);
  padding: 12px 24px;
  margin: 24px 0;
  font-style: italic;
  background-color: rgba(201, 150, 58, 0.04);
  color: #4a5568;
}

.article-content a {
  color: var(--gold, #c9963a);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.article-content a:hover {
  color: var(--navy, #00163f);
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--border-light, #e2e8f0);
  margin: 40px 0;
}

/* ── Bloques destacados (Opcionales) ── */
.article-content .info-box,
.article-content .warning-box,
.article-content .tip-box {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  font-size: 16px;
  line-height: 1.6;
}

.article-content .info-box {
  background-color: #f0f7ff;
  border-left: 4px solid #3b82f6;
  color: #1e3a8a;
}

.article-content .warning-box {
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}

.article-content .tip-box {
  background-color: #f0fdf4;
  border-left: 4px solid #10b981;
  color: #064e3b;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .article-content {
    font-size: 16px;
    line-height: 1.75;
    padding: 0 4px;
  }
  .article-content h2 {
    font-size: 21px;
    margin: 30px 0 15px;
  }
  .article-content h3 {
    font-size: 17px;
    margin: 24px 0 12px;
  }
  .article-content a {
    word-break: break-all;
  }
}

/* Sidebar */
.art-cta-card {
  background: linear-gradient(135deg, var(--navy), var(--navy2));
  border-radius: 16px;
  padding: 28px 24px;
  color: var(--white);
  position: sticky;
  top: 100px;
  margin-bottom: 24px;
}

.art-cta-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 10px;
}

.art-cta-card p {
  font-size: 13px;
  color: rgba(255, 255, 255, .75);
  margin: 0 0 20px;
  line-height: 1.55;
}

.art-cta-card .btn {
  width: 100%;
  justify-content: center;
}

.art-disclaimer {
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.55;
}

.art-disclaimer strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
}

/* Artículos relacionados */
.art-related {
  padding: 48px 0;
  background: var(--bg-warm);
}

.art-related h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 24px;
}

.art-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ============================================================
   RESPONSIVE — BIBLIOTECA
============================================================ */
@media (max-width: 1080px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .guides-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .bib-hero-grid {
    gap: 36px;
  }
}

@media (max-width: 820px) {
  .bib-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .bib-hero-left h1 {
    font-size: 36px;
  }

  .bib-hero-desc {
    font-size: 15px;
  }

  .bib-categories {
    top: 68px;
  }

  .articles-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guides-row {
    grid-template-columns: 1fr 1fr;
  }

  .bib-andrea-inner {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }

  .bib-andrea-img {
    width: 90px;
    height: 110px;
  }

  .bib-cta-inner {
    flex-direction: column;
    text-align: center;
  }

  .bib-cta-actions {
    justify-content: center;
  }

  /* Artículo */
  .art-hero-grid {
    grid-template-columns: 1fr;
  }

  .art-hero-img-wrap {
    display: none;
  }

  .art-body-grid {
    grid-template-columns: 1fr;
  }

  .art-related-grid {
    grid-template-columns: 1fr;
  }

  .art-cta-card {
    position: static;
  }
}

@media (max-width: 480px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .guides-row {
    grid-template-columns: 1fr;
  }

  .bib-hero-left h1 {
    font-size: 30px;
  }

  .cat-tab {
    font-size: 13px;
    padding: 14px 16px;
  }

  .bib-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .bib-cta-inner h2 {
    font-size: 21px;
  }
}