/**
 * Biblioteca Juridica — estilos de la page /biblioteca/ (ID 8190)
 * Namespace: .bfcr-lib-*
 * Depende de: bfcr-tesis-landing.css (tokens tl-*, fuentes Playfair + Source Sans 3)
 */

/* ============================================================
   0. RESETS DENTRO DEL NAMESPACE
   El tema Avante aplica fondos/padding/borders a h2-h6 dentro de .entry-content.
   Matamos todo heredado para que nuestras tipografias manden.
   ============================================================ */

.bfcr-lib-hero h1, .bfcr-lib-hero h2, .bfcr-lib-hero h3,
.bfcr-lib-featured h1, .bfcr-lib-featured h2, .bfcr-lib-featured h3, .bfcr-lib-featured h4,
.bfcr-lib-topviewed h1, .bfcr-lib-topviewed h2, .bfcr-lib-topviewed h3, .bfcr-lib-topviewed h4,
.bfcr-lib-discover h1, .bfcr-lib-discover h2, .bfcr-lib-discover h3, .bfcr-lib-discover h4,
.bfcr-lib-search h1, .bfcr-lib-search h2, .bfcr-lib-search h3, .bfcr-lib-search h4,
.bfcr-lib-card h1, .bfcr-lib-card h2, .bfcr-lib-card h3, .bfcr-lib-card h4 {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-align: left;
}

.bfcr-lib-hero h1, .bfcr-lib-hero h2, .bfcr-lib-hero h3 {
    text-align: center;
}

.bfcr-lib-section-header h2 { text-align: center; }
.bfcr-lib-section-header p { text-align: center; }

.bfcr-lib-hero p,
.bfcr-lib-featured p,
.bfcr-lib-topviewed p,
.bfcr-lib-discover p,
.bfcr-lib-search p,
.bfcr-lib-card p {
    background: none !important;
    padding: 0 !important;
    border: none !important;
}

.bfcr-lib-card a,
.bfcr-lib-card a:hover,
.bfcr-lib-card a:visited,
.bfcr-lib-topviewed a,
.bfcr-lib-topviewed a:hover,
.bfcr-lib-topviewed a:visited,
.bfcr-lib-discover a,
.bfcr-lib-discover a:hover,
.bfcr-lib-discover a:visited,
.bfcr-lib-autocomplete-item,
.bfcr-lib-autocomplete-item:hover,
.bfcr-lib-autocomplete-item:visited {
    text-decoration: none !important;
    box-shadow: none !important;
    background-image: none !important;
    color: inherit !important;
}

/* Restaurar color inheritado pero manteniendo el color-hover intencional de hijos */
.bfcr-lib-discover-link,
.bfcr-lib-topviewed-link,
.bfcr-lib-card-link {
    color: inherit !important;
}

.bfcr-lib-discover-item-title,
.bfcr-lib-card-title,
.bfcr-lib-topviewed-title {
    color: #0a1628 !important;
}

.bfcr-lib-topviewed-title {
    color: #fff !important;
}

.bfcr-lib-discover-item:hover .bfcr-lib-discover-item-title {
    color: #002a28 !important;
}

/* ============================================================
   1. HERO
   ============================================================ */

.bfcr-lib-hero {
    position: relative;
    padding: 88px 24px 72px;
    background:
        radial-gradient(ellipse at top left, rgba(200,164,78,0.12) 0%, transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(200,164,78,0.08) 0%, transparent 60%),
        linear-gradient(135deg, #002a28 0%, #0a1628 55%, #001a1a 100%);
    color: #fff;
    text-align: center;
    /* overflow: visible para que el autocomplete dropdown no se corte */
    overflow: visible;
    margin: 0 0 0 0;
}

/* Clip solo los decorativos (texture + filigrana) para no salirse del hero */
.bfcr-lib-hero > .bfcr-lib-hero-inner {
    position: relative;
    z-index: 5;
}

/* Filigrana dorada top + bottom */
.bfcr-lib-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #c8a44e 20%, #e8c96a 50%, #c8a44e 80%, transparent);
    z-index: 2;
}

/* Textura sutil de columnas clasicas (SVG inline) */
.bfcr-lib-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23c8a44e' stroke-width='0.4' opacity='0.08'><circle cx='60' cy='60' r='40'/><circle cx='60' cy='60' r='28'/><path d='M60 20v80M20 60h80'/></g></svg>");
    background-size: 260px 260px;
    background-position: center;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.bfcr-lib-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.bfcr-lib-hero-eyebrow {
    display: inline-block;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #e8c96a;
    margin-bottom: 18px;
}

.bfcr-lib-hero-eyebrow::before {
    content: "";
    display: inline-block;
    width: 34px;
    height: 2px;
    background: #c8a44e;
    vertical-align: middle;
    margin-right: 12px;
}

.bfcr-lib-hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 52px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: #fff;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 24px rgba(0,0,0,0.4);
}

.bfcr-lib-hero-title em {
    font-style: italic;
    color: #e8c96a;
    font-weight: 700;
}

.bfcr-lib-hero-lead {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    color: rgba(255,255,255,0.82);
    max-width: 680px;
    margin: 0 auto 36px;
    line-height: 1.55;
}

/* Search form ----------------------------------------- */

.bfcr-lib-hero-search {
    max-width: 680px;
    margin: 0 auto 40px;
}

.bfcr-lib-hero-search-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(200,164,78,0.25);
    overflow: visible;
    transition: box-shadow .25s, transform .2s;
}

.bfcr-lib-hero-search-wrap.is-focused,
.bfcr-lib-hero-search-wrap:focus-within {
    box-shadow: 0 22px 60px rgba(0,0,0,0.5), 0 0 0 3px #c8a44e;
    transform: translateY(-2px);
}

.bfcr-lib-hero-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #54617a;
    font-size: 18px;
    pointer-events: none;
    z-index: 2;
    transition: opacity .2s, transform .2s;
}

/* Ocultar icono lupa cuando input tiene focus o valor */
.bfcr-lib-hero-search-wrap.is-focused .bfcr-lib-hero-search-icon,
.bfcr-lib-hero-search-wrap.has-value .bfcr-lib-hero-search-icon {
    opacity: 0;
    transform: translateY(-50%) scale(0.6);
}

.bfcr-lib-hero-search-input {
    flex: 1;
    padding: 22px 20px 22px 58px;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 17px;
    color: #0a1628;
    min-width: 0;
    border-radius: 999px 0 0 999px;
    transition: padding-left .2s;
}

/* Cuando se oculta la lupa, reducir padding izquierdo para que el texto no quede flotando */
.bfcr-lib-hero-search-wrap.is-focused .bfcr-lib-hero-search-input,
.bfcr-lib-hero-search-wrap.has-value .bfcr-lib-hero-search-input {
    padding-left: 28px;
}

.bfcr-lib-hero-search-input::placeholder {
    color: #8892a8;
    font-style: italic;
    transition: opacity .15s;
}

.bfcr-lib-hero-search-wrap.is-focused .bfcr-lib-hero-search-input::placeholder {
    opacity: 0.5;
}

.bfcr-lib-hero-search-btn {
    padding: 0 36px;
    border: none;
    background: linear-gradient(135deg, #c8a44e 0%, #b08c3a 100%);
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    flex-shrink: 0;
    border-radius: 999px;
    margin: 4px;
    box-shadow: 0 4px 14px rgba(200,164,78,0.4);
}

.bfcr-lib-hero-search-btn:hover {
    background: linear-gradient(135deg, #d4b055 0%, #c8a44e 100%);
    box-shadow: 0 6px 20px rgba(200,164,78,0.55);
}

.bfcr-lib-hero-search-btn i {
    margin-right: 6px;
    font-size: 13px;
}

/* Autocomplete dropdown -------------------------------- */

.bfcr-lib-hero-autocomplete {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(200,164,78,0.25);
    max-height: 420px;
    overflow-y: auto;
    z-index: 100;
    text-align: left;
    padding: 6px;
    animation: bfcr-lib-fade-in .18s ease-out;
}

@keyframes bfcr-lib-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bfcr-lib-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none !important;
    color: #0a1628;
}

.bfcr-lib-autocomplete-empty {
    padding: 20px;
    text-align: center;
    color: #8892a8;
    font-size: 14px;
    font-style: italic;
}

.bfcr-lib-autocomplete-item:hover,
.bfcr-lib-autocomplete-item.is-active {
    background: linear-gradient(135deg, #fff6db, #f6f8fb);
}

.bfcr-lib-autocomplete-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: #002a28;
    color: #c8a44e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bfcr-lib-autocomplete-item[data-type="branch"] .bfcr-lib-autocomplete-badge {
    background: #c8a44e;
    color: #fff;
}

.bfcr-lib-autocomplete-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #0a1628;
    line-height: 1.3;
}

/* Stats row ------------------------------------------- */

.bfcr-lib-hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.bfcr-lib-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.bfcr-lib-hero-stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 800;
    color: #c8a44e;
    line-height: 1;
    margin-bottom: 6px;
}

.bfcr-lib-hero-stat-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

/* ============================================================
   2. SECTION SCAFFOLDING
   ============================================================ */

.bfcr-lib-featured,
.bfcr-lib-topviewed,
.bfcr-lib-leastviewed,
.bfcr-lib-search,
.bfcr-lib-discover,
.bfcr-lib-branches-section,
.bfcr-lib-intro,
.bfcr-lib-what {
    padding: 80px 24px;
    font-family: 'Source Sans 3', sans-serif;
    position: relative;
    overflow: hidden;
}

/* ============================================================
   INTRO EDITORIAL (shortcode [bfcr_library_intro])
   ============================================================ */

.bfcr-lib-intro {
    background:
        radial-gradient(ellipse at top right, rgba(200,164,78,0.06) 0%, transparent 55%),
        #fff;
}

.bfcr-lib-intro-inner {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.bfcr-lib-intro .bfcr-lib-section-eyebrow {
    margin-bottom: 16px;
}

.bfcr-lib-intro-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 36px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: #0a1628 !important;
    line-height: 1.2 !important;
    margin: 0 0 32px 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.bfcr-lib-intro-body {
    text-align: left;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    color: #2a3a52;
}

.bfcr-lib-intro-body p {
    margin: 0 0 20px 0;
    background: none !important;
    padding: 0 !important;
    border: none !important;
}

.bfcr-lib-intro-body p:last-child {
    margin-bottom: 0;
}

.bfcr-lib-intro-body strong {
    color: #002a28;
    font-weight: 700;
}

/* ============================================================
   WHAT CONTAINS (shortcode [bfcr_library_what])
   ============================================================ */

.bfcr-lib-what {
    background:
        linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.bfcr-lib-what::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c8a44e 50%, transparent);
}

.bfcr-lib-what-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.bfcr-lib-what-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-top: 40px;
}

.bfcr-lib-what-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    border: 1px solid rgba(10,22,40,0.06);
    box-shadow: 0 4px 20px rgba(10,22,40,0.04);
    transition: transform .2s, box-shadow .25s, border-color .2s;
    position: relative;
    overflow: hidden;
}

.bfcr-lib-what-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c8a44e, #e8c96a, #c8a44e);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.3,1);
}

.bfcr-lib-what-card:hover {
    transform: translateY(-4px);
    border-color: rgba(200,164,78,0.3);
    box-shadow: 0 16px 40px rgba(10,22,40,0.1);
}

.bfcr-lib-what-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.bfcr-lib-what-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #002a28, #0a1628);
    color: #c8a44e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
    box-shadow: 0 6px 18px rgba(0,42,40,0.22);
}

.bfcr-lib-what-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #0a1628 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.bfcr-lib-what-text {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: #54617a;
    margin: 0;
    background: none !important;
    padding: 0 !important;
    border: none !important;
}

/* H1-h6 reset tambien para estos namespaces */
.bfcr-lib-intro h1, .bfcr-lib-intro h2, .bfcr-lib-intro h3,
.bfcr-lib-what h1, .bfcr-lib-what h2, .bfcr-lib-what h3, .bfcr-lib-what h4 {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .bfcr-lib-intro,
    .bfcr-lib-what {
        padding: 48px 16px;
    }
    .bfcr-lib-intro-title {
        font-size: 26px !important;
    }
    .bfcr-lib-intro-body {
        font-size: 16px;
    }
    .bfcr-lib-what-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.bfcr-lib-leastviewed {
    background:
        radial-gradient(ellipse at top, rgba(200,164,78,0.05) 0%, transparent 60%),
        #fafbfd;
}

.bfcr-lib-leastviewed::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c8a44e 50%, transparent);
}

.bfcr-lib-leastviewed-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.bfcr-lib-leastviewed-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 28px;
}

.bfcr-lib-leastviewed-item {
    background: #fff;
    border: 1px solid rgba(10,22,40,0.06);
    border-radius: 12px;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}

.bfcr-lib-leastviewed-item:hover {
    border-color: rgba(200,164,78,0.5);
    transform: translateX(-4px);
    box-shadow: 0 10px 28px rgba(10,22,40,0.08);
}

.bfcr-lib-leastviewed-link {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px 16px 16px;
    text-decoration: none !important;
    color: inherit !important;
}

.bfcr-lib-leastviewed-rank {
    font-family: 'Playfair Display', serif;
    font-size: 38px;
    font-weight: 800;
    color: rgba(200,164,78,0.55);
    line-height: 1;
    flex-shrink: 0;
    min-width: 54px;
    text-align: center;
    letter-spacing: -0.02em;
}

.bfcr-lib-leastviewed-thumb {
    flex-shrink: 0;
    width: 62px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    background: #f6f8fb;
}

.bfcr-lib-leastviewed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bfcr-lib-leastviewed-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(200,164,78,0.5);
    font-size: 22px;
}

.bfcr-lib-leastviewed-body {
    flex: 1;
    min-width: 0;
}

.bfcr-lib-leastviewed-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bfcr-lib-leastviewed-type {
    color: #c8a44e;
    font-weight: 700;
}

.bfcr-lib-leastviewed-branch {
    color: #8892a8;
    font-weight: 500;
}

.bfcr-lib-leastviewed-title {
    font-family: 'Source Sans 3', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #0a1628 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: normal !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bfcr-lib-leastviewed-views {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #54617a;
}

.bfcr-lib-leastviewed-views i {
    color: #c8a44e;
    font-size: 12px;
}

/* H1-h6 reset tambien para este namespace */
.bfcr-lib-leastviewed h1, .bfcr-lib-leastviewed h2, .bfcr-lib-leastviewed h3, .bfcr-lib-leastviewed h4 {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.bfcr-lib-featured {
    background:
        radial-gradient(ellipse at top, rgba(200,164,78,0.04) 0%, transparent 60%),
        #f6f8fb;
}

.bfcr-lib-featured::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #c8a44e 50%, transparent);
}

.bfcr-lib-topviewed {
    background:
        radial-gradient(ellipse at center, rgba(200,164,78,0.05) 0%, transparent 60%),
        linear-gradient(135deg, #0a1628 0%, #002a28 100%);
    color: #fff;
}

.bfcr-lib-topviewed::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c8a44e 30%, #e8c96a 50%, #c8a44e 70%, transparent);
}

.bfcr-lib-search {
    background: #fff;
}

.bfcr-lib-discover {
    background: #fff;
}

.bfcr-lib-branches-section {
    background: linear-gradient(180deg, #fff 0%, #f6f8fb 100%);
    padding: 80px 24px 100px;
}

.bfcr-lib-featured-inner,
.bfcr-lib-topviewed-inner,
.bfcr-lib-search-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.bfcr-lib-section-header {
    text-align: center;
    margin-bottom: 42px;
}

.bfcr-lib-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0a1628;
    margin: 0 0 14px 0;
    line-height: 1.15;
    position: relative;
}

.bfcr-lib-section-eyebrow {
    display: inline-block;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #c8a44e;
    margin-bottom: 14px;
}

.bfcr-lib-section-eyebrow::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    background: #c8a44e;
    vertical-align: middle;
    margin-right: 10px;
}

.bfcr-lib-section-eyebrow::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    background: #c8a44e;
    vertical-align: middle;
    margin-left: 10px;
}

.bfcr-lib-section-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 17px;
    color: #54617a;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.55;
}

.bfcr-lib-section-header-dark .bfcr-lib-section-title { color: #fff; }
.bfcr-lib-section-header-dark .bfcr-lib-section-subtitle { color: rgba(255,255,255,0.75); }

.bfcr-lib-empty {
    text-align: center;
    font-family: 'Source Sans 3', sans-serif;
    color: #54617a;
    font-size: 16px;
    padding: 40px 20px;
}

/* ============================================================
   3. CARD (componente unificado)
   ============================================================ */

.bfcr-lib-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(10,22,40,0.08), 0 0 0 1px rgba(10,22,40,0.04);
    transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Filete dorado superior visible en hover */
.bfcr-lib-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c8a44e, #e8c96a, #c8a44e);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.3,1);
    z-index: 3;
}

.bfcr-lib-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(10,22,40,0.18), 0 0 0 1px rgba(200,164,78,0.4);
}

.bfcr-lib-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.bfcr-lib-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none !important;
    color: inherit;
}

.bfcr-lib-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #f6f8fb, #e8eef5);
    overflow: hidden;
    flex-shrink: 0;
}

.bfcr-lib-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.bfcr-lib-card:hover .bfcr-lib-card-thumb img {
    transform: scale(1.05);
}

.bfcr-lib-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(10,22,40,0.25);
    font-size: 42px;
}

.bfcr-lib-card-type-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    background: #002a28;
    color: #c8a44e;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2;
}

.bfcr-lib-card-type-badge.is-biografia {
    background: #c8a44e;
    color: #fff;
}

.bfcr-lib-card-type-badge.is-investigacion {
    background: #fff;
    color: #002a28;
}

.bfcr-lib-card-law-number {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.95);
    color: #0a1628;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
}

.bfcr-lib-card-featured-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #c8a44e, #e8c96a);
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(200,164,78,0.4);
}

.bfcr-lib-card-body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bfcr-lib-card-branch {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c8a44e;
    margin-bottom: 8px;
}

.bfcr-lib-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    color: #0a1628;
    margin: 0 0 10px 0;
    letter-spacing: -0.01em;
}

.bfcr-lib-card-abstract {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: #54617a;
    margin: 0 0 14px 0;
    flex: 1;
}

.bfcr-lib-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #8892a8;
    padding-top: 12px;
    border-top: 1px solid rgba(10,22,40,0.06);
    margin-top: auto;
}

.bfcr-lib-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bfcr-lib-card-meta-item i {
    color: #c8a44e;
    font-size: 12px;
}

/* ============================================================
   4. CARDGRID
   ============================================================ */

.bfcr-lib-cardgrid {
    display: grid;
    gap: 26px;
}

.bfcr-lib-cardgrid-3col {
    grid-template-columns: repeat(3, 1fr);
}

.bfcr-lib-cardgrid-2col {
    grid-template-columns: repeat(2, 1fr);
}

.bfcr-lib-cardgrid-4col {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   5. TOP VIEWED RANKING
   ============================================================ */

.bfcr-lib-topviewed-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 28px;
    counter-reset: topview;
}

.bfcr-lib-topviewed-item {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(200,164,78,0.18);
    border-radius: 12px;
    transition: background .2s, border-color .2s, transform .2s;
}

.bfcr-lib-topviewed-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(200,164,78,0.5);
    transform: translateX(4px);
}

.bfcr-lib-topviewed-link {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px 16px 16px;
    text-decoration: none !important;
    color: inherit;
}

.bfcr-lib-topviewed-rank {
    font-family: 'Playfair Display', serif;
    font-size: 38px;
    font-weight: 800;
    color: #c8a44e;
    line-height: 1;
    flex-shrink: 0;
    min-width: 54px;
    text-align: center;
    letter-spacing: -0.02em;
}

.bfcr-lib-topviewed-thumb {
    flex-shrink: 0;
    width: 62px;
    height: 62px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

.bfcr-lib-topviewed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bfcr-lib-topviewed-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(200,164,78,0.5);
    font-size: 22px;
}

.bfcr-lib-topviewed-body {
    flex: 1;
    min-width: 0;
}

.bfcr-lib-topviewed-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bfcr-lib-topviewed-type {
    color: #c8a44e;
    font-weight: 700;
}

.bfcr-lib-topviewed-branch {
    color: rgba(255,255,255,0.55);
    font-weight: 500;
}

.bfcr-lib-topviewed-title {
    font-family: 'Source Sans 3', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bfcr-lib-topviewed-views {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
}

.bfcr-lib-topviewed-views i {
    color: #c8a44e;
    font-size: 12px;
}

/* ============================================================
   6. SEARCH (Etapa 3 — base inicial, refinar)
   ============================================================ */

.bfcr-lib-search-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: flex-start;
}

.bfcr-lib-search-sidebar {
    position: sticky;
    top: 100px;
    padding: 24px;
    background: #f6f8fb;
    border-radius: 12px;
    border: 1px solid rgba(10,22,40,0.06);
}

.bfcr-lib-filter-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(10,22,40,0.08);
}

.bfcr-lib-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bfcr-lib-filter-title {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    color: #0a1628;
    margin: 0 0 14px 0;
    letter-spacing: -0.005em;
}

.bfcr-lib-filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bfcr-lib-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    color: #2a3a52;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.bfcr-lib-filter-option:hover {
    background: rgba(200,164,78,0.08);
}

.bfcr-lib-filter-option input {
    flex-shrink: 0;
    accent-color: #002a28;
}

.bfcr-lib-filter-option-count {
    margin-left: auto;
    font-size: 12px;
    color: #8892a8;
    font-weight: 600;
}

.bfcr-lib-filter-option.is-active {
    background: #002a28;
    color: #fff;
    font-weight: 600;
}

.bfcr-lib-filter-option.is-active .bfcr-lib-filter-option-count {
    color: rgba(255,255,255,0.7);
}

/* Main results column */

.bfcr-lib-search-main {
    min-width: 0;
}

.bfcr-lib-search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: #f6f8fb;
    border-radius: 10px;
    margin-bottom: 24px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    flex-wrap: wrap;
}

.bfcr-lib-search-count {
    color: #54617a;
    font-weight: 500;
}

.bfcr-lib-search-count strong {
    color: #0a1628;
    font-weight: 700;
}

.bfcr-lib-search-sort {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bfcr-lib-search-sort label {
    color: #54617a;
    font-size: 13px;
}

.bfcr-lib-search-sort select {
    padding: 6px 30px 6px 12px;
    border: 1px solid rgba(10,22,40,0.12);
    border-radius: 6px;
    background: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #0a1628;
    cursor: pointer;
}

.bfcr-lib-search-loadmore {
    display: block;
    margin: 32px auto 0;
    padding: 14px 32px;
    border: 2px solid #002a28;
    border-radius: 10px;
    background: #fff;
    color: #002a28;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.bfcr-lib-search-loadmore:hover {
    background: #002a28;
    color: #fff;
}

.bfcr-lib-search-loadmore[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   7. SKELETON LOADERS
   ============================================================ */

.bfcr-lib-skeleton {
    background: linear-gradient(90deg, rgba(10,22,40,0.04) 25%, rgba(10,22,40,0.08) 50%, rgba(10,22,40,0.04) 75%);
    background-size: 200% 100%;
    animation: bfcr-lib-skeleton-shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes bfcr-lib-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.bfcr-lib-card-skeleton {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(10,22,40,0.06);
}

.bfcr-lib-card-skeleton-thumb {
    aspect-ratio: 16 / 10;
    background: linear-gradient(90deg, rgba(10,22,40,0.04) 25%, rgba(10,22,40,0.08) 50%, rgba(10,22,40,0.04) 75%);
    background-size: 200% 100%;
    animation: bfcr-lib-skeleton-shimmer 1.5s infinite;
}

.bfcr-lib-card-skeleton-body {
    padding: 22px;
}

.bfcr-lib-card-skeleton-body .bfcr-lib-skeleton {
    height: 12px;
    margin-bottom: 10px;
}

.bfcr-lib-card-skeleton-body .bfcr-lib-skeleton:nth-child(1) { width: 40%; }
.bfcr-lib-card-skeleton-body .bfcr-lib-skeleton:nth-child(2) { width: 90%; height: 18px; }
.bfcr-lib-card-skeleton-body .bfcr-lib-skeleton:nth-child(3) { width: 100%; }
.bfcr-lib-card-skeleton-body .bfcr-lib-skeleton:nth-child(4) { width: 75%; }

/* ============================================================
   8. RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .bfcr-lib-search-layout {
        grid-template-columns: 220px 1fr;
        gap: 28px;
    }
    .bfcr-lib-cardgrid-3col,
    .bfcr-lib-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bfcr-lib-cardgrid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    .bfcr-lib-topviewed-list {
        grid-template-columns: 1fr;
    }
    .bfcr-lib-discover-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .bfcr-lib-hero-title {
        font-size: 40px;
    }
    .bfcr-lib-section-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .bfcr-lib-hero {
        padding: 48px 20px 40px;
    }
    .bfcr-lib-hero-title {
        font-size: 28px;
    }
    .bfcr-lib-hero-lead {
        font-size: 15.5px;
    }
    .bfcr-lib-hero-search-input {
        padding: 16px 16px 16px 46px;
        font-size: 15px;
    }
    .bfcr-lib-hero-search-icon {
        left: 16px;
        font-size: 15px;
    }
    .bfcr-lib-hero-search-btn {
        padding: 0 18px;
        font-size: 13px;
    }
    .bfcr-lib-hero-stats {
        gap: 28px;
    }
    .bfcr-lib-hero-stat-num {
        font-size: 32px;
    }
    .bfcr-lib-featured,
    .bfcr-lib-topviewed,
    .bfcr-lib-search {
        padding: 48px 16px;
    }
    .bfcr-lib-section-title {
        font-size: 24px;
    }
    .bfcr-lib-cardgrid-3col,
    .bfcr-lib-cardgrid-2col,
    .bfcr-lib-cardgrid-4col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .bfcr-lib-search-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .bfcr-lib-search-sidebar {
        position: relative;
        top: auto;
    }
    .bfcr-lib-topviewed-rank {
        font-size: 30px;
        min-width: 42px;
    }
    .bfcr-lib-topviewed-thumb {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 480px) {
    .bfcr-lib-hero-search-btn span { display: none; }
    .bfcr-lib-hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    .bfcr-lib-hero-stat {
        flex-direction: row;
        gap: 12px;
        align-items: baseline;
    }
    .bfcr-lib-topviewed-views span {
        display: none;
    }
}

/* ============================================================
   10. DISCOVER MODULE (2 cols: recien anadidas + ultimas reformas)
   ============================================================ */

.bfcr-lib-discover-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.bfcr-lib-discover-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.bfcr-lib-discover-col {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    border: 1px solid rgba(10,22,40,0.06);
    box-shadow: 0 4px 24px rgba(10,22,40,0.06);
    position: relative;
    overflow: hidden;
}

.bfcr-lib-discover-col::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #c8a44e, #e8c96a, #c8a44e);
}

.bfcr-lib-discover-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(10,22,40,0.08);
}

.bfcr-lib-discover-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #002a28, #0a1628);
    color: #c8a44e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 18px rgba(0,42,40,0.25);
}

.bfcr-lib-discover-headline {
    flex: 1;
}

.bfcr-lib-discover-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #0a1628;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.bfcr-lib-discover-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    color: #54617a;
    margin: 0;
}

.bfcr-lib-discover-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bfcr-lib-discover-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(10,22,40,0.05);
    transition: background .15s, padding .15s;
}

.bfcr-lib-discover-item:last-child {
    border-bottom: none;
}

.bfcr-lib-discover-item:hover {
    padding-left: 8px;
}

.bfcr-lib-discover-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none !important;
    color: inherit;
}

.bfcr-lib-discover-rank {
    flex-shrink: 0;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 800;
    color: #c8a44e;
    line-height: 1.2;
    min-width: 28px;
    letter-spacing: -0.02em;
}

.bfcr-lib-discover-body {
    flex: 1;
    min-width: 0;
}

.bfcr-lib-discover-item-title {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #0a1628;
    line-height: 1.35;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bfcr-lib-discover-item:hover .bfcr-lib-discover-item-title {
    color: #002a28;
}

.bfcr-lib-discover-item-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 12px;
    color: #8892a8;
    flex-wrap: wrap;
}

.bfcr-lib-discover-item-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f6f8fb;
    color: #002a28;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ============================================================
   11. SEARCH RESULTS (AJAX panel)
   ============================================================ */

.bfcr-lib-results {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 30px;
}

.bfcr-lib-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: #f6f8fb;
    border-radius: 14px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.bfcr-lib-results-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.bfcr-lib-rama-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bfcr-lib-rama-label {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #54617a;
    letter-spacing: 0.02em;
}

.bfcr-lib-rama-select {
    padding: 8px 32px 8px 14px;
    border: 1px solid rgba(10,22,40,0.12);
    border-radius: 999px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23002a28' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") no-repeat right 12px center;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #002a28;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .15s, box-shadow .15s;
    max-width: 220px;
}

.bfcr-lib-rama-select:hover,
.bfcr-lib-rama-select:focus {
    border-color: #c8a44e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(200,164,78,0.15);
}

/* X clear button en la linea de results-count */
.bfcr-lib-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    border-radius: 50%;
    background: #002a28;
    color: #c8a44e;
    border: none;
    cursor: pointer;
    font-size: 10px;
    transition: background .15s, transform .15s, box-shadow .2s;
    vertical-align: middle;
    flex-shrink: 0;
}

.bfcr-lib-clear-filter:hover {
    background: #c8a44e;
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(200,164,78,0.4);
}

.bfcr-lib-results-count {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 15px;
    color: #54617a;
}

.bfcr-lib-results-count strong {
    color: #0a1628;
    font-weight: 700;
}

.bfcr-lib-results-count em {
    color: #002a28;
    font-style: normal;
    font-weight: 700;
}

.bfcr-lib-results-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bfcr-lib-results-filter {
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(10,22,40,0.12);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #54617a;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .15s;
}

.bfcr-lib-results-filter:hover {
    border-color: #c8a44e;
    color: #002a28;
    transform: translateY(-1px);
}

.bfcr-lib-results-filter.is-active {
    background: #002a28;
    color: #fff;
    border-color: #002a28;
}

.bfcr-lib-results-filter .bfcr-lib-count-badge {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(200,164,78,0.2);
    color: #c8a44e;
    font-size: 11px;
    font-weight: 700;
}

.bfcr-lib-results-filter.is-active .bfcr-lib-count-badge {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.bfcr-lib-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    min-height: 400px;
}

.bfcr-lib-results-footer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.bfcr-lib-loadmore {
    padding: 16px 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, #002a28, #0a1628);
    border: none;
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 6px 18px rgba(0,42,40,0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bfcr-lib-loadmore:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,42,40,0.45);
}

.bfcr-lib-loadmore[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.bfcr-lib-loadmore i {
    font-size: 12px;
}

.bfcr-lib-results-page-indicator {
    margin-left: 6px;
    font-size: 13px;
    color: #8892a8;
}

/* Paginacion SSR classic (visible tambien con JS) */
.bfcr-lib-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.bfcr-lib-pag-link,
.bfcr-lib-pag-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(10,22,40,0.12);
    color: #54617a !important;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.bfcr-lib-pag-link:hover,
.bfcr-lib-pag-arrow:hover {
    border-color: #c8a44e;
    color: #002a28 !important;
    transform: translateY(-1px);
}

.bfcr-lib-pag-link.is-current {
    background: #002a28;
    border-color: #002a28;
    color: #c8a44e !important;
    cursor: default;
    pointer-events: none;
}

.bfcr-lib-pag-gap {
    color: #8892a8;
    font-weight: 700;
    padding: 0 4px;
}

.bfcr-lib-results-empty {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Source Sans 3', sans-serif;
    color: #54617a;
    grid-column: 1 / -1;
}

.bfcr-lib-results-empty h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #0a1628;
    margin: 0 0 10px 0;
}

.bfcr-lib-results-empty p {
    font-size: 15px;
    margin: 0;
}

.bfcr-lib-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.bfcr-lib-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(200,164,78,0.2);
    border-top-color: #c8a44e;
    border-radius: 50%;
    animation: bfcr-lib-spin 0.8s linear infinite;
}

@keyframes bfcr-lib-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   12. RAMAS SECTION WRAPPER (spacing top)
   Cuando [bfcr_ramas_derecho] esta dentro de nuestra seccion wrapper
   ============================================================ */

.bfcr-lib-branches-section-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.bfcr-lib-branches-section .tl-branches {
    gap: 14px;
}

.bfcr-lib-branches-section .tl-branch {
    padding: 16px 18px;
    font-size: 15px;
    transition: all .2s;
}

.bfcr-lib-branches-section .tl-branch:hover {
    background: linear-gradient(135deg, #fff, #fff6db);
    box-shadow: 0 8px 24px rgba(200,164,78,0.2);
}

/* ============================================================
   13. FIXES PARA ELEMENTOR FULL-WIDTH
   ============================================================ */

/* Cuando la page usa Elementor con sections content_width: full,
   el shortcode debe romper el wrapper default de Avante. */
.page-biblioteca .entry-content > .bfcr-lib-hero,
.page-biblioteca .entry-content > .bfcr-lib-featured,
.page-biblioteca .entry-content > .bfcr-lib-topviewed,
.page-biblioteca .entry-content > .bfcr-lib-search {
    margin-left: calc(-1 * ((100vw - 100%) / 2));
    margin-right: calc(-1 * ((100vw - 100%) / 2));
    width: 100vw;
    max-width: 100vw;
}

/* ============================================================
   14. MOBILE FIXES (overrides explicitos - ultimos en cascada)
   ------------------------------------------------------------
   Los bloques "10. DISCOVER" (L1572+) y "11. SEARCH RESULTS"
   (L1731+) declaran grids base DESPUES del bloque RESPONSIVE
   en L1465, por lo que sus media queries quedan invalidados.
   Ademas .bfcr-lib-leastviewed-list no tiene ningun override
   de mobile y las secciones leastviewed/discover no reducen
   padding en el @media 768px.
   Este bloque va al final y gana por orden de cascada.
   ============================================================ */

@media (max-width: 1024px) {
    .bfcr-lib-results-grid { grid-template-columns: repeat(2, 1fr); }
    .bfcr-lib-discover-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
    /* Section paddings faltantes */
    .bfcr-lib-leastviewed,
    .bfcr-lib-discover { padding: 48px 16px; }

    /* Grids a 1 columna */
    .bfcr-lib-results-grid       { grid-template-columns: 1fr; gap: 20px; }
    .bfcr-lib-leastviewed-list   { grid-template-columns: 1fr; gap: 16px; }
    .bfcr-lib-discover-grid      { grid-template-columns: 1fr; gap: 20px; }

    /* Padding interno de cards */
    .bfcr-lib-discover-col       { padding: 24px 20px; }
    .bfcr-lib-leastviewed-link,
    .bfcr-lib-topviewed-link     { padding: 14px 14px 14px 12px; gap: 14px; }

    /* Rank y thumbs: mas compactos */
    .bfcr-lib-leastviewed-rank   { font-size: 28px; min-width: 36px; }
    .bfcr-lib-leastviewed-thumb  { width: 48px; height: 48px; }

    /* Titulo de discover-col mas chico */
    .bfcr-lib-discover-title     { font-size: 20px; }
}

@media (max-width: 480px) {
    /* Paddings de seccion mas estrechos para pantallas muy chicas */
    .bfcr-lib-leastviewed,
    .bfcr-lib-discover,
    .bfcr-lib-featured,
    .bfcr-lib-topviewed,
    .bfcr-lib-search             { padding: 36px 12px; }

    .bfcr-lib-discover-col       { padding: 20px 16px; }
    .bfcr-lib-discover-header    { gap: 12px; padding-bottom: 16px; margin-bottom: 14px; }
    .bfcr-lib-discover-icon      { width: 42px; height: 42px; font-size: 18px; }
    .bfcr-lib-discover-title     { font-size: 18px; }

    /* Results header wrap mas gentil */
    .bfcr-lib-results-header     { padding: 14px 16px; gap: 12px; }
    .bfcr-lib-results-filter     { padding: 7px 12px; font-size: 12.5px; }
}
