/**
 * Backgrounds Theme - Custom Styles
 * Plantilla con fondos personalizables y contenedor centrado de 1200px
 */

/* ========================================
   Variables CSS
   ======================================== */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #495057;
    --accent-color: #e74c3c;
    --text-color: #333;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* ========================================
   Layout General
   ======================================== */
body {
    background-color: #e9ecef;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    flex: 1;
    width: 100%;
    padding: 2rem 0;
}

/* Contenedor principal - max-width 1200px */
.main-container {
    max-width: 1200px;
    background: var(--bg-white);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
        border-radius: 0;
    }
    
    .main-wrapper {
        padding: 1rem 0;
    }
}

/* ========================================
   Header
   ======================================== */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    min-height: 140px;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: var(--shadow-md);
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.site-header .navbar {
    position: relative;
    z-index: 2;
    width: 100%;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar-brand:hover {
    background: rgba(0, 0, 0, 0.4);
}

.navbar-brand i {
    font-size: 1.8rem;
}

/* Logo imagen: sin efectos, limpio */
.navbar-brand img {
    display: block;
    max-height: 50px;
    width: auto;
}

/* Cuando hay logo imagen, quitar el fondo del contenedor */
.navbar-brand:has(img) {
    background: transparent;
    padding: 0.25rem;
    backdrop-filter: none;
}

.navbar-brand:has(img):hover {
    background: transparent;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
    background: rgba(0, 0, 0, 0.2);
    margin: 0.25rem;
    border-radius: var(--border-radius);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Botón de búsqueda en el header */
.navbar .btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    color: rgba(255,255,255,0.85);
    margin-top: auto;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}

.site-footer h5 {
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.site-footer h6 {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-footer .footer-link {
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
}

.site-footer .footer-link:hover {
    color: #fff;
    transform: translateX(5px);
}

.site-footer .footer-link i {
    font-size: 1.2rem;
    opacity: 0.5;
}

.site-footer hr {
    border-color: rgba(255,255,255,0.1);
    opacity: 0.3;
}

.site-footer .text-white-50 {
    color: rgba(255,255,255,0.65) !important;
    line-height: 1.6;
}

/* ========================================
   Cards y Posts
   ======================================== */
.post-card {
    background: var(--bg-white);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.post-image-link {
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.post-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: var(--transition);
    display: block;
}

.post-card:hover img {
    transform: scale(1.08);
}

.post-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    opacity: 0.8;
    transition: var(--transition);
}

.post-card:hover .post-placeholder {
    opacity: 1;
    transform: scale(1.08);
}

.post-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.post-card .card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: var(--text-color);
}

.post-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.post-card .card-title a:hover {
    color: var(--secondary-color);
}

.post-card .card-text {
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.post-meta {
    font-size: 0.85rem;
    color: #111111;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.post-meta small {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.post-meta i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.post-meta span {
    opacity: 0.5;
    font-weight: 300;
}

.post-meta a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.post-meta a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Badges de categorías */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.4em 0.9em;
    border-radius: 6px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #e0e0e0;
}

.post-meta .badge {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #e0e0e0;
}

.badge:hover {
    background-color: #333;
    color: white;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Badge contador (números) */
.badge.badge-count {
    background-color: #2c3e50;
    color: white;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    min-width: 28px;
    text-align: center;
}

.badge.badge-count:hover {
    background-color: #1a252f;
    transform: none;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar .card {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.sidebar .card:hover {
    box-shadow: var(--shadow-md);
}

.sidebar .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.sidebar .list-group-item {
    border: none;
    border-left: 3px solid transparent;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.sidebar .list-group-item:hover {
    border-left-color: var(--secondary-color);
    background-color: var(--bg-light);
    padding-left: 1.25rem;
}

/* Categoría activa - sin fondo azul */
.sidebar .list-group-item.active {
    background-color: #f8f9fa;
    border-left-color: var(--text-color);
    border-left-width: 4px;
    font-weight: 600;
}

.sidebar .list-group-item.active a {
    color: var(--text-color);
}

.sidebar .list-group-item a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
}

.sidebar .list-group-item a:hover {
    color: var(--secondary-color);
}

/* Widget personalizado */
.custom-widget {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
}

/* ========================================
   Post Individual
   ======================================== */
.post-header {
    margin-bottom: 2rem;
    padding-bottom: 0rem;
    border-bottom: 2px solid #e0e0e0;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.post-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.6rem;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin: 1.5rem 0;
}

.post-content a {
    color: var(--secondary-color);
    text-decoration: underline;
    transition: var(--transition);
}

.post-content a:hover {
    color: var(--accent-color);
}

.post-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
}

.post-content code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #e74c3c;
}

.post-content pre {
    background: #2c3e50;
    color: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ========================================
   Posts Relacionados
   ======================================== */
.related-posts h3 {
    color: var(--text-color);
    font-weight: 600;
}

.related-posts .card-title a {
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
}

.related-posts .card-title a:hover {
    color: #495057;
}

/* Sobrescribir color de enlaces por defecto */
a {
    color: var(--text-color);
    text-decoration: none;
}

a:hover {
    color: #495057;
}

/* ========================================
   Tabla de Contenidos
   ======================================== */
.table-of-contents {
    background: var(--bg-light);
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 2rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    padding: 0.25rem 0;
}

.toc-item a {
    color: var(--text-color);
    font-size: 0.95rem;
}

.toc-item a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Indentación por nivel de encabezado */
.toc-h2 { padding-left: 0; }
.toc-h3 { padding-left: 1rem; }
.toc-h4 { padding-left: 2rem; }
.toc-h5 { padding-left: 3rem; }
.toc-h6 { padding-left: 4rem; }

/* ========================================
   Paginación
   ======================================== */
.pagination {
    margin-top: 2rem;
}

.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #e0e0e0;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.pagination .page-link:hover {
    background: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: #495057;
    border-color: #495057;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ========================================
   Búsqueda
   ======================================== */
.search-box {
    margin-bottom: 2rem;
}

.search-box .form-control {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
}

.search-box .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ========================================
   Autor
   ======================================== */
.author-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: #fff;
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    text-align: center;
}

.author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.author-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.author-bio {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Ocultar información de usuarios si está desactivado */
body.hide-users .post-meta a[href*="/author/"],
body.hide-users .author-info,
body.hide-users .author-header {
    display: none !important;
}

/* ========================================
   404 Error
   ======================================== */
.error-404 {
    text-align: center;
    padding: 4rem 2rem;
}

.error-404 .error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--secondary-color);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404 .error-message {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ========================================
   Botón volver arriba
   ======================================== */
.btn-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #495057 !important;
    border-color: #495057 !important;
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: var(--transition);
    z-index: 1000;
}

.btn-back-to-top:hover {
    background-color: #343a40 !important;
    border-color: #343a40 !important;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .post-title {
        font-size: 2rem;
    }
    
    .author-name {
        font-size: 1.5rem;
    }
    
    .error-404 .error-code {
        font-size: 5rem;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 1.75rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .site-header {
        min-height: 100px;
    }
    
    .post-card .card-title {
        font-size: 1.15rem;
    }
    
    .post-card .card-body {
        padding: 1.25rem;
    }
    
    .post-card img,
    .post-placeholder {
        height: 200px;
    }
}

/* ========================================
   Utilidades
   ======================================== */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

/* Sobrescribir botones azules de Bootstrap */
.btn-primary {
    background-color: #495057;
    border-color: #495057;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #343a40;
    border-color: #343a40;
    color: #fff;
}

.btn-outline-primary {
    color: #495057;
    border-color: #495057;
}

.btn-outline-primary:hover {
    background-color: #495057;
    border-color: #495057;
    color: #fff;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary-custom:hover {
    background-color: #1e2a38;
    border-color: #1e2a38;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

