/* ================================================================
   +BDC BUSCADOR — styles.css
   Tokens y tipografía coherentes con el diseño Home +BDC
   ================================================================ */

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Variables BDC ─────────────────────────────────────────────── */
:root {
    --orange:        #FA751B;
    --orange-dim:    rgba(250,117,27,.10);
    --orange-border: rgba(250,117,27,.28);
    --violet:        #80107E;
    --blue:          #1A1858;

    --bg:            #f0f2f7;
    --panel:         #ffffff;
    --panel-soft:    #f7f9fc;
    --line:          #e2e8f2;
    --line-soft:     #ecf0f7;

    --text:          #1c2438;
    --text-strong:   #0e1422;
    --muted:         #6b7a96;
    --muted-light:   #9aaccb;

    --radius:        6px;
    --radius-lg:     12px;
    --shadow:        0 4px 20px rgba(16,30,60,.07);
    --transition:    .18s ease;
}

/* ── Tipografía base ───────────────────────────────────────────── */
body {
    font-family: 'Inter', 'Sora', system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────── */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 24px;
    text-align: center;
    letter-spacing: -.02em;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    flex: 0 0 300px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 24px;
    align-self: flex-start;
    overflow: hidden;
}

/* ── Búsqueda ──────────────────────────────────────────────────── */
.sidebar-search {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.sidebar-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-soft);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.sidebar-search input:focus {
    border-color: var(--orange-border);
    box-shadow: 0 0 0 3px rgba(250,117,27,.08);
    background: #fff;
}

.sidebar-search input::placeholder {
    color: var(--muted-light);
}

/* ── Scroll de filtros ─────────────────────────────────────────── */
.scrollable-filters {
    max-height: 600px;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.scrollable-filters::-webkit-scrollbar { width: 5px; }
.scrollable-filters::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
}

/* ── Accordion ─────────────────────────────────────────────────── */
.accordion-group {
    border-top: 1px solid var(--line-soft);
}

.accordion-group:first-child {
    border-top: none;
}

.accordion-header button {
    background: none;
    border: none;
    width: 100%;
    padding: 11px 18px;
    font-size: 11px;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-strong);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}

.accordion-header button:hover { background: var(--panel-soft); }

.accordion-header button span {
    font-size: 10px;
    color: var(--muted-light);
    transition: transform .2s ease;
}

.accordion-header button.open span { transform: rotate(180deg); }

.accordion-body {
    display: none;
    padding: 4px 18px 14px;
}

.accordion-body.open { display: block; }

/* ── Separador de sección ──────────────────────────────────────── */
.bdc-filter-section-label {
    padding: 8px 18px 5px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    background: #f4f6fb;
    border-top: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bdc-filter-section-label i { opacity: .5; font-size: 9px; }

/* ── Accordion BDC (grupos de taxonomía) ───────────────────────── */
.bdc-filter-group {
    border-top: 1px solid var(--line-soft);
}

.bdc-filter-group:first-child { border-top: none; }

.bdc-filter-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}

.bdc-filter-toggle:hover { background: var(--panel-soft); }

.bdc-filter-toggle .chevron {
    font-size: 11px;
    color: var(--blue);
    transition: transform .2s;
    flex-shrink: 0;
}

.bdc-filter-toggle.collapsed .chevron { transform: rotate(-90deg); }

/* Accordion abierto: nombre en azul más oscuro */
.bdc-filter-toggle:not(.collapsed) {
    color: var(--blue);
    font-weight: 700;
}

.bdc-filter-body {
    padding: 0;
}

.bdc-filter-body.hidden { display: none; }

/* ── Buscador dentro del accordion ────────────────────────────── */
.filter-term-search {
    padding: 10px 14px;
}

.filter-term-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-soft);
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
}

.filter-term-search input:focus {
    border-color: rgba(26,24,88,.4);
    background: #fff;
}

.filter-term-search input::placeholder { color: var(--muted-light); }

/* ── Radio "Todas las X" ───────────────────────────────────────── */
.filter-all-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    cursor: pointer;
    gap: 8px;
}

.filter-all-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-strong);
    flex: 1;
}

.filter-all-radio {
    width: 17px;
    height: 17px;
    border: 2px solid var(--muted-light);
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--transition), background var(--transition);
    background: #fff;
}

.filter-all-radio:checked {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: inset 0 0 0 3px #fff;
}

/* ── Lista de términos ─────────────────────────────────────────── */
.term-list {
    padding: 0 0 8px;
}

.filter-term-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    gap: 10px;
    transition: background var(--transition);
}

.filter-term-item:hover { background: var(--panel-soft); }

.term-name {
    font-size: 13px;
    color: var(--text);
    flex: 1;
    line-height: 1.3;
}

.term-count {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 3px;
}

.filter-term-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border: 2px solid var(--muted-light);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--transition), background var(--transition);
}

.filter-term-item input[type="checkbox"]:checked {
    border-color: var(--blue);
    background: var(--blue);
}

.filter-term-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Item seleccionado */
.filter-term-item:has(input:checked) {
    background: rgba(26,24,88,.04);
}

.filter-term-item:has(input:checked) .term-name { font-weight: 600; color: var(--blue); }

/* Items deshabilitados / sin resultados */
.tax-disabled .bdc-filter-toggle {
    opacity: .4;
    cursor: default;
}

.tax-disabled .bdc-filter-toggle:hover { background: none; }

/* Vacío */
.filter-empty {
    font-size: 12px;
    color: var(--muted-light);
    padding: 10px 16px;
    margin: 0;
}

/* ── Checkboxes ────────────────────────────────────────────────── */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background var(--transition);
}

.checkbox-item:hover { background: var(--orange-dim); }

.checkbox-item input {
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--muted-light);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    accent-color: var(--orange);
    flex-shrink: 0;
}

.checkbox-item span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

/* ── Botón limpiar ─────────────────────────────────────────────── */
.clear-filters {
    display: block;
    width: calc(100% - 36px);
    margin: 14px 18px 18px;
    padding: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
}

.clear-filters:hover {
    border-color: var(--orange-border);
    color: var(--orange);
    background: var(--orange-dim);
}

/* ================================================================
   FILTROS APLICADOS
   ================================================================ */
.applied-filters-section {
    margin-bottom: 18px;
    padding: 12px 16px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.applied-filters-section h3 {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    margin-bottom: 8px;
}

.applied-filters-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-badge,
.bdc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--orange-dim);
    border: 1px solid var(--orange-border);
    color: #8c3d0a;
    border-radius: 20px;
    cursor: pointer;
    transition: background var(--transition);
}

.filter-badge:hover,
.bdc-chip:hover { background: rgba(250,117,27,.2); }

.filter-badge i.close,
.remove-chip { font-size: 10px; opacity: .65; }

/* ================================================================
   CONTENIDO PRINCIPAL
   ================================================================ */
.main-content { flex: 1; min-width: 0; }

/* ── Grid de posts ─────────────────────────────────────────────── */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ── Card de post ──────────────────────────────────────────────── */
.post-item {
    padding: 16px 22px 14px 24px;
    border-bottom: 1px solid var(--line-soft);
    position: relative;
    transition: background var(--transition);
    margin-bottom: 0;
}

.post-item:last-child { border-bottom: none; }
.post-item:hover { background: var(--panel-soft); }

.post-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--orange);
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: 0 2px 2px 0;
}

.post-item:hover::before { opacity: 1; }

/* ── Tipo / badge ──────────────────────────────────────────────── */
.post-type {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 7px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 2px 9px;
    border-radius: 20px;
}

.badge-primary   { background:rgba(26,92,179,.11);  color:#1a3d6b; border:1px solid rgba(26,92,179,.22); }
.badge-success   { background:rgba(46,125,50,.11);   color:#1a4d1d; border:1px solid rgba(46,125,50,.22); }
.badge-warning   { background:rgba(250,117,27,.11);  color:#8c3d0a; border:1px solid rgba(250,117,27,.25); }
.badge-info      { background:rgba(0,121,107,.11);   color:#004d43; border:1px solid rgba(0,121,107,.22); }
.badge-secondary { background:rgba(21,101,192,.10);  color:#0d3c7a; border:1px solid rgba(21,101,192,.22); }
.badge-danger    { background:rgba(183,28,28,.10);   color:#7a1212; border:1px solid rgba(183,28,28,.22); }
.badge-dark      { background:rgba(26,24,88,.10);    color:var(--blue); border:1px solid rgba(26,24,88,.18); }
.text-white      { color:#fff !important; }

/* ── Jerarquía textual ─────────────────────────────────────────── */

/* Volanta: post_title chico y gris */
.post-volanta {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin: 0 0 3px;
    line-height: 1.3;
}

/* Título principal: excerpt (tipos != novedades) */
.entry-excerpt {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-strong);
    margin: 0 0 5px;
    letter-spacing: -.01em;
}

.entry-excerpt a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

.entry-excerpt a:hover { color: var(--orange); }

/* Título principal para novedades */
.entry-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-strong);
    margin: 0 0 5px;
    letter-spacing: -.01em;
    text-transform: none;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

.entry-title a:hover { color: var(--orange); }

/* Bajada: excerpt (novedades) */
.post-excerpt {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 400;
    margin: 0 0 5px;
    text-transform: none;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bajada: sumario (tipos != novedades) */
.post-summary {
    font-size: 12.5px;
    color: var(--muted);
    margin: 0 0 6px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta fechas */
.post-meta {
    font-size: 11px;
    color: var(--muted-light);
    margin: 4px 0 0;
    font-weight: 500;
}

.post-meta p { margin: 0; }

/* ── Bloque sumario interno ────────────────────────────────────── */
.sumario {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: var(--text);
    font-style: normal !important;
    line-height: 1.5 !important;
    font-size: 13px;
    margin-top: 10px;
}

.sumario em, .sumario i, .sumario p {
    font-style: normal !important;
    font-size: 13px !important;
    font-family: inherit !important;
    line-height: 1.4;
    margin-bottom: 5px !important;
}

/* ================================================================
   PAGINACIÓN
   ================================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination-btn,
.page-link {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-strong);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover,
.page-link:hover {
    background: var(--orange-dim);
    border-color: var(--orange-border);
    color: var(--orange);
}

.pagination-btn.active,
.page-link.active {
    background: var(--orange);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(250,117,27,.28);
}

/* ================================================================
   MODAL
   ================================================================ */
#postModal .modal-content {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(16,30,60,.18);
    border: 1px solid var(--line);
}

#postModal .modal-header {
    background: var(--blue);
    color: #fff;
    border-bottom: 2px solid rgba(250,117,27,.3);
    padding: 16px 20px;
}

#postModal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

#postModal .modal-body {
    padding: 22px 24px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
}

#postModal .modal-body .lead {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 14px;
    line-height: 1.4;
}

#postModal .modal-body .sumario {
    background: var(--panel-soft);
    border: 1px solid var(--line);
    padding: 14px 16px;
    margin-top: 14px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    font-style: normal !important;
    font-family: inherit !important;
    line-height: 1.4;
}

#postModal .modal-footer {
    background: var(--panel-soft);
    border-top: 1px solid var(--line-soft);
    padding: 12px 20px;
    justify-content: space-between;
}

#modalViewFull.btn-primary {
    background-color: var(--orange);
    border-color: var(--orange);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    padding: 8px 18px;
    transition: background var(--transition);
}

#modalViewFull.btn-primary:hover {
    background-color: #e06417;
    border-color: #e06417;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .container { flex-direction: column; padding: 20px 14px 48px; }
    .sidebar { position: static; flex: 1; order: -1; }
}

@media (max-width: 560px) {
    h1 { font-size: 1.2rem; }
    .post-item { padding: 14px 16px 12px 18px; }
    .entry-excerpt, .entry-title { font-size: 14px; }
}