/* ============================================================
   css/categoria.css - Estilos para página de categoría
   ============================================================ */

:root {
    --primary-blue: #004d8c;
    --dark-blue: #002e5b;
    --accent-blue: #0072ce;
    --light-bg: #f4f7f9;
    --card-bg: #eef3f8;
    --text-dark: #222222;
    --text-gray: #666666;
    --bg-body: #ffffff;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --border-color: #e2e8f0;
}

body.dark-mode {
    --bg-body: #0f172a;
    --card-bg: #1e293b;
    --text-dark: #f1f5f9;
    --text-gray: #94a3b8;
    --light-bg: #1e293b;
    --shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    --border-color: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--accent-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================================
   BOTÓN FLOTANTE DE TEMA OSCURO
   ============================================================ */
.theme-toggle-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    color: var(--text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 999;
    border: 1px solid rgba(0,0,0,0.1);
}

.theme-toggle-float:hover {
    transform: scale(1.08);
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
    background: var(--bg-body);
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 60px;
}

.brand-text .sub-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: 0.5px;
    display: block;
}

.brand-text .main-title {
    font-size: 1.25rem;
    color: var(--primary-blue);
    line-height: 1.1;
}

body.dark-mode .brand-text .main-title {
    color: #60a5fa;
}

.brand-text .location {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.header-slogan p {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    color: var(--primary-blue);
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    width: 240px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.search-box button {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
}

/* ============================================================
   NAVEGACIÓN PRINCIPAL
   ============================================================ */
.main-nav {
    background: var(--primary-blue);
}

body.dark-mode .main-nav {
    background: #1a2332;
}

.nav-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
}

.nav-list li a {
    display: block;
    padding: 12px 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-list li.active a,
.nav-list li a:hover {
    background: var(--dark-blue);
}

body.dark-mode .nav-list li.active a,
body.dark-mode .nav-list li a:hover {
    background: #2d3748;
}

/* ============================================================
   ENCABEZADO DE CATEGORÍA
   ============================================================ */
.categoria-header {
    background: var(--card-bg);
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 4px solid var(--primary-blue);
}

.categoria-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.categoria-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ffffff;
    flex-shrink: 0;
}

.categoria-info h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.categoria-info p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.categoria-total {
    font-size: 0.8rem;
    color: var(--text-gray);
    font-weight: 600;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 310px;
    gap: 25px;
    padding: 0 0 40px 0;
}

/* ============================================================
   ARTÍCULOS GRID
   ============================================================ */
.articulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.articulo-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.articulo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.articulo-card .card-image {
    height: 160px;
    overflow: hidden;
}

.articulo-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.articulo-card .card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-gray);
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.articulo-card .card-body h3 {
    font-size: 1rem;
    line-height: 1.3;
}

.articulo-card .card-body h3 a {
    color: var(--text-dark);
}

.articulo-card .card-body h3 a:hover {
    color: var(--accent-blue);
}

.articulo-card .card-body p {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.card-autor {
    font-size: 0.78rem;
    color: var(--text-gray);
}

.card-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.card-link:hover {
    text-decoration: underline;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-body);
    transition: all 0.2s ease;
}

.page-link:hover:not(.disabled):not(.active) {
    background: var(--card-bg);
    border-color: var(--accent-blue);
}

.page-link.active {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-link.dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 16px;
}

.btn-volver {
    display: inline-block;
    background: var(--primary-blue);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-volver:hover {
    background: var(--dark-blue);
}

/* ============================================================
   WIDGETS (SIDEBAR)
   ============================================================ */
.widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

body.dark-mode .widget {
    background: #1e293b;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-blue);
    margin-bottom: 14px;
    font-size: 0.95rem;
}

body.dark-mode .widget-title {
    color: #60a5fa;
}

/* Widget categorías */
.categoria-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.2s;
}

.categoria-link:last-child {
    border-bottom: none;
}

.categoria-link:hover {
    color: var(--accent-blue);
}

.categoria-link .cat-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #ffffff;
    flex-shrink: 0;
}

.categoria-link .cat-nombre {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

.categoria-link .cat-cantidad {
    font-size: 0.7rem;
    color: var(--text-gray);
    background: var(--bg-body);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Widget quote */
.widget-quote {
    background: #e8ede6;
}

body.dark-mode .widget-quote {
    background: #1e293b;
}

.quote-content p {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    font-size: 0.82rem;
    color: #2e4d25;
    margin-bottom: 4px;
}

body.dark-mode .quote-content p {
    color: #94a3b8;
}

.quote-author {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2e4d25;
}

body.dark-mode .quote-author {
    color: #94a3b8;
}

/* Widget join */
.widget-join {
    background: var(--primary-blue);
    color: #ffffff;
}

body.dark-mode .widget-join {
    background: #1a2332;
}

.join-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.widget-join p {
    font-size: 0.78rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.btn-join {
    display: block;
    background: #ffffff;
    color: var(--primary-blue);
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

.btn-join:hover {
    opacity: 0.9;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--dark-blue);
    color: #ffffff;
    padding-top: 20px;
}

body.dark-mode .site-footer {
    background: #0f172a;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
}

.footer-logo {
    height: 35px;
}

.footer-links {
    font-size: 0.75rem;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    margin: 0 5px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-social a {
    color: #ffffff;
    margin-left: 10px;
    font-size: 0.9rem;
}

.footer-social a:hover {
    color: #60a5fa;
}

.footer-bottom {
    text-align: center;
    padding: 10px 0;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .articulos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .brand-logo {
        justify-content: center;
    }
    
    .search-box {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .categoria-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .categoria-info h1 {
        font-size: 1.4rem;
    }
    
    .articulos-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .categoria-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .card-meta {
        font-size: 0.65rem;
        gap: 4px;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0 6px;
    }
}