:root {
    --site-width: 1020px;
    --sidebar-w: 320px;
    --hero-h: 360px;
    --gold: #FFD200;
    --black: #000;
}

/* ===== Fondo general fijo ===== */
html,
body {
    height: 100%;
}

body {
    background: url('/images/back.jpg') center top / cover no-repeat fixed;
    color: #111;
}

/* ===== Contenedor principal (1020px) ===== */
.site-wrapper {
    width: var(--site-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== Banner ===== */
.header-wrap {
    width: var(--site-width);
}

.header-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== HERO (menú + carrusel) ===== */
.hero-row {
    width: var(--site-width);
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-column-gap: 0;
    align-items: stretch;
    margin-top: 8px;
    position: relative;
    /* contexto z-index */
    z-index: 1;
}

/* Sidebar: sin bordes ni espacios, y por ENCIMA de contenido */
.sidebar {
    height: var(--hero-h);
    overflow: visible;
    position: relative;
    z-index: 1030;
    /* debajo de backdrop de modal (1990) pero sobre contenido */
}

.menu-root {
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: auto;
}

.menu-root>li {
    margin: 0;
}

/* Botón principal: rectangular, sin borde, negro */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: linear-gradient(#202020, #0f0f0f);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1rem;
    padding: 10px 16px;
    border: none;
    border-radius: 0;
}

/* Línea dorada divisoria entre botones */
.menu-root>li+li .menu-btn {
    border-top: 2px solid var(--gold);
}

.menu-btn:hover {
    color: #fff;
    background: linear-gradient(#262626, #141414);
}

/* Flecha (collapse) */
.menu-btn .arrow {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    flex-shrink: 0;
    background: radial-gradient(circle at 30% 50%, #bdbdbd 0 55%, #7a7a7a 56% 100%);
    clip-path: polygon(25% 0, 100% 50%, 25% 100%, 0 85%, 55% 50%, 0 15%);
    transition: transform .2s ease;
}

.menu-toggle[aria-expanded="true"] .arrow {
    transform: rotate(90deg);
}

/* Submenú: visible y por encima del carrusel/contenido */
.submenu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: #111;
    position: relative;
    z-index: 1031;
    /* sobre sidebar, debajo de modal */
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: block;
    color: #f1f1f1;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
}

.submenu a:hover {
    background: #1d1d1d;
    color: #fff;
}

/* Carrusel a la derecha con misma altura */
.hero-carousel {
    height: var(--hero-h);
}

.hero-carousel .carousel,
.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.obj-cover {
    object-fit: cover;
}

/* Útil en otros elementos */
.gold-border {
    border: 3px solid var(--gold);
    border-radius: 4px;
    overflow: hidden;
}

/* Barra negra entre header y contenido (sin línea dorada extra) */
.top-strip {
    background: #0b0b0b;
    border-left: none;
    border-right: none;
    color: #fff;
    margin: 10px 0 12px;
    position: relative;
    z-index: 10;
}

/* ===== Contenido ===== */
.content-box {
    width: var(--site-width);
    background: #fff;
    /* recuadro blanco principal */
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 18px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.content-box::after {
    content: '';
    display: block;
    clear: both;
}

/* Tarjeta de noticias: máx 50% y con fondo azul */
.news-card {
    float: right;
    max-width: 50%;
    margin: 0 0 12px 18px;
    box-sizing: border-box;
}

.news-card .card-body {
    background: url('/images/back_bluefire.jpg') center/cover no-repeat fixed;
}

.news-card p,
.news-card .small {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Indicadores carrusel */
.carousel .carousel-indicators [data-bs-target] {
    background-color: #d8d8d8;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ===== Footer full-width ===== */
.footer-full {
    width: 100%;
    min-width: var(--site-width);
    background: #8b8b8b;
    margin-top: 16px;
    color: #222;
}

.footer-top-line {
    height: 6px;
    background: var(--gold);
}

.footer-inner {
    width: var(--site-width);
    margin: 0 auto;
}

.footer-like {
    background: #f5f5f5;
    color: #333;
    padding: 6px;
    margin-top: 8px;
}

.footer-hr {
    border-color: rgba(0, 0, 0, .2);
}

.footer-links a {
    color: #222;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ===== MODALES (GLOBAL, FUERA DEL @media) ===== */
.modal {
    z-index: 2000;
}

.modal-backdrop {
    z-index: 1990;
    background-color: rgba(0, 0, 0, .55) !important;
    /* fondo oscuro normal */
}

.modal-backdrop.show {
    opacity: .55 !important;
}

/* Login modal: contenido blanco sólido */
#authModal .modal-content {
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, .1);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

/* Lightbox de galería: transparente y backdrop más oscuro (JS agrega .gallery-backdrop) */
#galleryModal {
    z-index: 2085 !important;
}

#galleryModal .modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

#galleryModal .modal-header,
#galleryModal .modal-footer {
    border: 0;
}

#galleryModal .btn-close {
    filter: invert(1) drop-shadow(0 0 2px rgba(0, 0, 0, .9));
    opacity: 1;
}

.gallery-backdrop {
    background-color: rgba(0, 0, 0, .85) !important;
    /* más oscuro para fotos */
    z-index: 2080 !important;
}

/* Botones control lightbox con contraste y borde dorado */
.btn-ctrl {
    background-color: #fff;
    border: 2px solid #d4af37;
    /* dorado */
    box-shadow: 0 2px 10px rgba(0, 0, 0, .55);
    font-weight: 600;
}

.btn-ctrl:hover {
    background-color: #f8f9fa;
    border-color: #caa538;
}

/* Utilidad para romper enlaces largos en cualquier lado */
.text-anywhere {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#namesScope .table td,
#namesScope .table th {
    vertical-align: middle;
}

#namesScope .mnEditInput {
    min-width: 220px;
}

/* ===== Responsive ===== */
@media (max-width: 1120px) {
    .site-wrapper {
        width: var(--site-width);
        min-width: 500px;
        padding: 0 12px;
    }

    .footer-inner {
        width: 100%;
        padding: 0 12px;
    }

    .hero-row {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
    }

    .hero-carousel {
        height: 230px;
    }

    .news-card {
        float: none;
        max-width: 100%;
        margin: 12px 0;
    }

    /* Galería */
    .gallery-img {
        object-fit: cover;
        width: 100%;
        height: 150px;
        cursor: pointer;
        border-radius: .25rem;
    }
}