/* public/css/main.css */

/* --- LAYOUT PRINCIPAL --- */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    margin-top: 30px;
}

/* --- HERO SLIDER --- */
.hero-section {
    padding: 30px 20px 0 20px;
    margin-bottom: 20px;
}
.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--color-dark);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    height: 400px;
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}
.slide.active {
    opacity: 1;
    z-index: 2;
}
.hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
}
.hero-overlay {
    position: absolute;
    left: 5%;
    bottom: 10%;
    background: rgba(0, 0, 0, 0.7);
    padding: 25px;
    border-radius: 10px;
    color: #fff;
    border-left: 5px solid var(--color-gold);
}
.hero-overlay h3 {
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}
.hero-overlay h4 {
    font-weight: 400;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #ddd;
}
.hero-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: all 0.3s;
}
.btn-outline-light {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}
.btn-outline-light:hover {
    background: #fff;
    color: #000;
}

/* --- SECCIÓN PARED DE LADRILLOS --- */
.bg-brick-wall {
    background-color: #e5e5e5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='30' viewBox='0 0 60 30'%3E%3Cpath d='M0 14h60v2H0zm30 15v15h2V15zM0 0h2v15H0zm60 0h-2v15h2z' fill='%23cccccc' fill-opacity='0.6'/%3E%3C/svg%3E");
    padding: 30px;
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}
.section-title-distressed {
    font-family: 'Impact', 'Arial Black', sans-serif;
    text-transform: uppercase;
    font-size: 2rem;
    color: #1a1a1a;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8);
}
.btn-pill-light {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}
.btn-pill-light:hover {
    background: #f9f9f9;
    color: var(--color-gold);
}

/* --- FILTROS DE COMUNICADOS --- */
.filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}
.filters i {
    color: #666;
    font-size: 1.1rem;
    margin-right: 5px;
}
.btn-filter {
    background-color: #fff;
    color: #444;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}
.btn-filter.active,
.btn-filter:hover {
    background-color: #374151;
    color: #fff;
}

/* --- TARJETAS DE COMUNICADOS (CARDS) --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.card-custom {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}
.card-custom img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.card-body {
    padding: 20px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.badge-category {
    background-color: #374151;
    color: #fff;
    font-size: 0.7rem;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #1a1a1a;
}
.card-date {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 12px;
    font-weight: bold;
}
.card-date i {
    margin-right: 5px;
}
.card-text {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.6;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #f1f1f1;
    padding-top: 15px;
}
.btn-read {
    background-color: #374151;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
}
.btn-read:hover {
    background-color: var(--color-gold);
}
.card-footer a.ver-mas {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}
.card-footer a.ver-mas:hover {
    color: var(--color-gold);
}

.pagination-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.dot {
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}
.dot.active, .dot:hover {
    background-color: var(--color-gold);
}

/* --- SIDEBAR WIDGETS (DERECHA) --- */
.widget-box {
    background-color: #4e3424;
    background-image: repeating-linear-gradient(to right, #4e3424 0px, #4e3424 25px, #432d1e 25px, #432d1e 50px);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid #2a1a10;
    border-radius: 10px;
    padding: 40px 20px 20px 20px;
    margin-bottom: 40px;
    position: relative;
    text-align: center;
}
.screw {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #777;
    border-radius: 50%;
    box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.6), inset -1px -1px 3px rgba(0, 0, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.6);
}
.screw::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 2px;
    background: #222;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.screw.tl { top: 12px; left: 12px; }
.screw.tr { top: 12px; right: 12px; }
.screw.bl { bottom: 12px; left: 12px; }
.screw.br { bottom: 12px; right: 12px; transform: rotate(90deg); }

.widget-plaque-container {
    display: flex;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}
.widget-plaque-string {
    position: absolute;
    top: -20px;
    width: 3px;
    height: 30px;
    background: #d4af37;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 1;
}
.widget-plaque-string::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2.5px;
    width: 8px;
    height: 8px;
    background: #222;
    border-radius: 50%;
    box-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3) inset;
}
.widget-plaque {
    background-color: #a33b3b;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 8px 30px;
    border-radius: 25px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5), 0 6px 8px rgba(0, 0, 0, 0.6);
    border: 3px solid #2a1a10;
    position: relative;
    top: -15px;
    z-index: 2;
    text-shadow: 2px 2px 2px #000;
    text-transform: uppercase;
}
.widget-plaque.wood-light {
    background-color: #d2a679;
    color: #2a1a10;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
}
.widget-plaque.gold {
    background-color: #d4af37;
    color: #1a1a1a;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}
.widget-content-white {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
}
.badge-proximo {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #333;
    color: #fff;
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.widget-content-white h6 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    padding-right: 60px;
}
.widget-content-white p {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
}
.widget-logo-slider {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    height: 120px;
    overflow: hidden;
}
.widget-logo-slider img {
    max-width: 80%;
    height: auto;
    object-fit: contain;
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: background 0.3s;
}
.slider-arrow:hover {
    background: #fff;
}
.slider-arrow.left { left: 5px; }
.slider-arrow.right { right: 5px; }
.btn-dark {
    background: #333;
    color: #fff;
    display: block;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-dark:hover {
    background: var(--color-gold);
}

/* ========================================= */
/* --- RESPONSIVE MAIN CONTENT --- */
/* ========================================= */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-image {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .bg-brick-wall {
        padding: 20px 15px;
    }
    .section-title-distressed {
        font-size: 1.5rem;
        text-align: center;
        width: 100%;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .hero-image {
        height: 250px;
        border-radius: 10px 10px 0 0;
    }
    .hero-overlay {
        position: relative;
        left: 0;
        bottom: 0;
        border-radius: 0 0 10px 10px;
        border-left: none;
        border-top: 5px solid var(--color-gold);
    }
}

/* --- MENU SUBMENU Y POPUP FIXES --- */
.navbar-nav .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a1a1a;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    min-width: 220px;
    z-index: 1000;
    padding: 0;
    margin: 0;
    list-style: none;
    border-radius: 0 0 4px 4px;
}

.navbar-nav li {
    position: relative;
}

@media (min-width: 993px) {
    .navbar-nav li:hover > .submenu {
        display: block;
    }
}

@media (max-width: 992px) {
    .navbar-nav .submenu {
        position: static;
        box-shadow: none;
        width: 100%;
        background-color: #222;
        padding-left: 15px;
    }
    .navbar-nav li.mobile-open > .submenu {
        display: block;
    }
}

.modal-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-popup-content {
    background: transparent;
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal-popup-overlay.show .modal-popup-content {
    transform: scale(1);
}

.modal-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.modal-popup-close:hover {
    background: #e2e8f0;
}

.modal-img-web {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    border-radius: 8px;
    border: 3px solid var(--color-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-img-mobile {
    display: none;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    border-radius: 8px;
    border: 3px solid var(--color-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .modal-img-web { display: none; }
    .modal-img-mobile { display: block; }
}