/**
 * Teoría legal — índice (/teoria)
 */

.tl-page {
    padding-bottom: 3rem;
}

.tl-hero .tl-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.5rem;
}

.tl-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    min-width: 120px;
}

.tl-stat strong {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.tl-stat span {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
}

.tl-body {
    padding: 2.5rem 0 1rem;
    background: #f8fafc;
}

.tl-toolbar {
    margin: -1.75rem 0 2rem;
    position: relative;
    z-index: 2;
}

.tl-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
}

.tl-search i {
    color: #94a3b8;
    flex-shrink: 0;
}

.tl-search input {
    flex: 1;
    border: none;
    padding: 12px 8px 12px 0;
    font-size: 0.95rem;
    color: #0f172a;
    background: transparent;
    outline: none;
    min-width: 0;
}

.tl-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
}

.tl-search-clear.is-visible {
    display: flex;
}

.tl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tl-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.tl-filter:hover {
    border-color: #cbd5e1;
    color: #0f172a;
}

.tl-filter.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.tl-filter-count {
    font-size: 0.72rem;
    opacity: 0.75;
}

.tl-section {
    margin-bottom: 2.5rem;
}

.tl-section-head {
    margin-bottom: 1.25rem;
}

.tl-section-head h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}

.tl-section-head p {
    margin: 0;
    color: #64748b;
    font-size: 0.92rem;
}

.tl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.tl-grid-featured {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tl-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    min-height: 100%;
}

.tl-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
    color: inherit;
}

.tl-card-featured {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.tl-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tl-card-code {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #2563eb;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 999px;
}

.tl-card-articles,
.tl-card-cat {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.tl-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.tl-card p {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
}

.tl-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 4px;
}

.tl-card-link {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
}

.tl-no-results {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.tl-no-results.is-visible {
    display: block;
}

.tl-no-results i {
    font-size: 2rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.tl-seo-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.tl-seo-block h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 12px;
    color: #0f172a;
}

.tl-seo-block p {
    color: #475569;
    line-height: 1.65;
    margin-bottom: 12px;
}

.tl-seo-block ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #2563eb;
}

.tl-seo-block li {
    margin-bottom: 6px;
}

.tl-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 1.5rem 1.75rem;
    background: #0f172a;
    border-radius: 16px;
    color: #e2e8f0;
}

.tl-cta h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: #fff;
}

.tl-cta p {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

.tl-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.tl-cta-btn:hover {
    background: #1d4ed8;
    color: #fff;
}

@media (max-width: 767px) {
    .tl-hero-stats {
        flex-direction: column;
    }

    .tl-stat {
        width: 100%;
    }

    .tl-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }
}
