/* ==========================================================================
   Estilos del sitio público — Escuela Luis González Gómez / Asilo San Luis Gonzaga
   ========================================================================== */

:root {
    --azul: #0a1240;
    --guinda: #7b151c;
    --degradado: linear-gradient(45deg, var(--azul) 50%, var(--guinda) 50%);
}

html,
body {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ----------------------------- Encabezado y pie ----------------------------- */

header,
footer {
    background: var(--degradado);
    color: #fff;
}

header {
    padding: 15px;
}

header h1 {
    font-size: clamp(1.25rem, 3.5vw, 2.5rem);
}

footer {
    padding: 20px;
}

/* ----------------------------- Fondo y secciones ----------------------------- */

.background-custom {
    flex-grow: 1;
    color: #fff;
    background-color: var(--azul);
    background-image: linear-gradient(rgba(10, 18, 64, 0.5), rgba(123, 21, 28, 0.5)), url("../img/fondo.jpeg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.background-custom .container {
    padding: 20px;
}

.section-content {
    text-align: center;
}

.tarjeta-inicio {
    padding: 1.5rem;
    border-radius: 1rem;
    background: rgba(10, 18, 64, 0.25);
}

.modal-marca {
    background: linear-gradient(45deg, var(--azul) 65%, var(--guinda) 35%);
}

/* ----------------------------- Enlace a la congregación (portada) ----------------------------- */

.brand {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    max-width: 100%;
    padding: .65rem 1.4rem .65rem .7rem;
    border-radius: 3rem;
    background: #6a1a2c;
    border: 2px solid rgba(255, 255, 255, .85);
    color: #fff;
    text-decoration: none;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    transition: transform .2s ease, background-color .2s ease;
}

.brand:hover,
.brand:focus-visible {
    color: #fff;
    background: #561522;
    transform: translateY(-2px);
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
}

.brand-name {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.25;
}

.brand-ir {
    font-size: .9rem;
    opacity: .75;
    flex-shrink: 0;
}

/* ----------------------------- Aliados y Donantes (Asilo) ----------------------------- */

.franja-aliados {
    padding: 1.5rem 1rem 2rem;
    background: rgba(10, 18, 64, .45);
    border-top: 1px solid rgba(255, 255, 255, .2);
}

/* ----------------------------- Menú de secciones -----------------------------
   Computadora (≥992px): fila de botones arriba del contenido.
   Celular y tablet: panel lateral derecho que se abre con el botón flotante. */

.nav-menu {
    gap: .5rem;
    margin: 0;
}

.nav-menu .nav-link {
    font-size: .85rem;
    padding: .5rem 1.25rem;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show,
.nav-menu .nav-link.active {
    color: #fff !important;
    background-color: var(--guinda);
    border-color: var(--guinda);
}

@media (min-width: 992px) {
    .menu-lateral .offcanvas-body {
        justify-content: center;
        padding: 1rem;
    }

    .menu-lateral .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Panel lateral */
@media (max-width: 991.98px) {
    .menu-lateral {
        --bs-offcanvas-width: min(320px, 85vw);
        background: linear-gradient(160deg, var(--azul) 60%, var(--guinda) 100%);
        color: #fff;
        border-left: 3px solid var(--guinda);
    }

    .menu-lateral .offcanvas-header {
        gap: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, .2);
    }

    .menu-lateral .offcanvas-title {
        flex: 1;
        font-weight: bold;
        font-size: 1rem;
        line-height: 1.3;
        margin: 0;
    }

    .menu-lateral .btn-cerrar-menu {
        flex-shrink: 0;
    }

    .menu-lateral .nav-menu .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .75rem;
        width: 100%;
        text-align: left;
        padding: .75rem 1.25rem;
        font-size: .9rem;
        border: 1px solid rgba(255, 255, 255, .25);
    }

    .menu-extra {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, .2);
        display: flex;
        flex-direction: column;
        gap: .75rem;
    }

    .menu-extra a {
        color: #fff;
        text-decoration: none;
        font-size: .95rem;
    }

    .menu-extra a:hover {
        text-decoration: underline;
    }
}

.btn-cerrar-menu {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s ease;
}

.btn-cerrar-menu:hover,
.btn-cerrar-menu:focus-visible {
    background: var(--guinda);
}

/* Botón flotante del menú
   Por defecto: lado derecho, parte media superior de la pantalla.
   El visitante puede arrastrarlo; al soltarlo se pega al borde más cercano. */
.btn-menu-flotante {
    position: fixed;
    top: 28vh;
    right: .75rem;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .65rem 1.1rem .65rem .6rem;
    border: 2px solid #fff;
    border-radius: 2rem;
    background: var(--guinda);
    color: #fff;
    font-weight: bold;
    font-size: .95rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    touch-action: none;       /* permite arrastrar sin mover la página */
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
    transition: background-color .2s ease, left .25s ease, right .25s ease;
}

.btn-menu-flotante.lado-izquierdo {
    right: auto;
    left: .75rem;
}

.btn-menu-flotante .bi-list {
    font-size: 1.4rem;
    line-height: 1;
}

/* Puntitos que indican que el botón se puede mover */
.btn-menu-flotante .agarre {
    font-size: 1rem;
    opacity: .65;
}

.btn-menu-flotante:hover,
.btn-menu-flotante:focus-visible {
    background: var(--azul);
}

.btn-menu-flotante.arrastrando {
    cursor: grabbing;
    transition: none;
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
}

/* ----------------------------- Imágenes ----------------------------- */


.cover-img {
    height: 275px;
    width: auto;
    max-width: 70%;
    object-fit: cover;
}

.gallery {
    height: 200px;
    width: 200px;
    max-width: 80%;
    object-fit: cover;
    margin: 5px;
    border-radius: .5rem;
}

.donor {
    height: 70px;
    width: auto;
    max-width: 70%;
    object-fit: contain;
    transition: transform .3s ease;
}

.donorC {
    height: 95px;
    width: auto;
    max-width: 30%;
    object-fit: contain;
    margin: 5px;
    transition: transform .3s ease;
}

.donor:hover,
.donorC:hover {
    transform: scale(1.8);
    position: relative;
    z-index: 2;
}

/* Visor de PDF (requisitos, aviso de privacidad, etc.) */
.visor-pdf {
    width: 100%;
    height: 500px;
    border: 0;
    background: #fff;
    border-radius: .5rem;
}

.visor-pdf.alto {
    height: 650px;
}

/* ----------------------------- Botones ----------------------------- */

.btn {
    border-radius: 2rem;
    padding: .6rem 2rem;
    font-weight: bold;
    color: #fff;
}

.h-btn {
    display: inline-block;
    background-color: transparent;
    padding: .3rem 1.5rem;
    color: #fff;
    border: 4px solid;
    border-image-source: var(--degradado);
    border-image-slice: 1;
    transition: border .3s ease-in-out;
}

.h-btn:hover {
    color: #fff;
    border-image-source: linear-gradient(45deg, var(--guinda) 50%, var(--azul) 50%);
}

.btn-primary {
    color: #fff;
    background-color: var(--azul);
    border-color: var(--azul);
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all .3s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #fff;
    background-color: #fff;
    border-color: #fff;
}

/* Barra guinda que cruza el botón al pasar el cursor */
.btn-primary::before {
    content: "";
    z-index: -1;
    width: 0;
    height: 100%;
    background: var(--guinda);
    position: absolute;
    left: 50%;
    top: 0;
    transform: skew(45deg, 0);
    transition: all .4s ease;
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
    width: 130%;
    left: -15%;
}

/* ----------------------------- Carrusel ----------------------------- */

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--azul);
    border-radius: 50%;
    opacity: .85;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: var(--guinda);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 30px;
    height: 30px;
}

.carousel-control-prev {
    left: -20px;
}

.carousel-control-next {
    right: -20px;
}

.carousel-indicators {
    top: 0;
    bottom: auto;
}

/* ----------------------------- Contacto y redes ----------------------------- */

.icon-large {
    font-size: 6rem;
    line-height: 1.2;
    display: block;
}

.social-netw {
    display: inline-block;
    font-size: 1.25rem;
    transition: transform .5s ease-in-out;
}

.social-netw:hover {
    transform: scale(1.6) rotate(360deg);
}

/* ----------------------------- Adaptación a pantallas ----------------------------- */

@media (max-width: 1200px) {
    .cover-img { height: 220px; }
    .gallery { height: 170px; width: 170px; }
    .icon-large { font-size: 4.5rem; }
}

@media (max-width: 992px) {
    .cover-img { height: 180px; }
    .gallery { height: 140px; width: 140px; }
    .icon-large { font-size: 3.5rem; }
    .carousel-control-prev { left: 0; }
    .carousel-control-next { right: 0; }
    .background-custom { background-attachment: scroll; }
}

@media (max-width: 576px) {
    .display-4 { font-size: 2rem; }
    h5 { font-size: 1rem; }
    .cover-img { height: 150px; max-width: 90%; }
    .gallery { height: 120px; width: 120px; }
    .donorC { height: 70px; }
    .visor-pdf, .visor-pdf.alto { height: 420px; }
    .btn { padding: .5rem 1.25rem; }
    .brand { padding: .55rem 1rem .55rem .55rem; gap: .6rem; }
    .brand-name { font-size: 1rem; }
}

/* En celular los navegadores no muestran PDFs incrustados: se ofrece un botón */
@media (max-width: 767.98px) {
    .visor-pdf,
    .visor-pdf.alto {
        display: none;
    }

    .modal-body,
    .section-content {
        text-align: center;
    }

    .enlace-pdf {
        display: inline-block !important;
        margin: 1.5rem auto;
        padding: .75rem 1.5rem;
        border-radius: 2rem;
        background: var(--azul);
        border: 2px solid #fff;
        text-decoration: none;
        font-weight: bold;
    }
}

/* Carrusel con muchos apartados: indicadores fáciles de tocar en celular */
@media (max-width: 576px) {
    .carousel-indicators {
        margin-left: 3.5rem;
        margin-right: 3.5rem;
        flex-wrap: wrap;
    }

    .carousel-indicators [data-bs-target] {
        width: 28px;
        min-width: 28px;
        height: 4px;
        margin: 0 2px;
        border-top-width: 12px;
        border-bottom-width: 12px;
        box-sizing: content-box;
    }

    /* espacio para cuando los indicadores ocupan dos renglones */
    #carruselEventos .carousel-item h2 {
        margin-top: 4.5rem !important;
    }
}
