/* ============================================================================
   SECUNDARIA 302
   PORTAL_NUEVOS.CSS — DISTRIBUCIÓN VISUAL
   ----------------------------------------------------------------------------
   SOLO PRESENTACIÓN.
   NO modifica PHP, sesiones, formularios, enlaces, IDs ni JavaScript.
   ============================================================================ */


/* ============================================================================
   1. CONTENEDOR PRINCIPAL
   ============================================================================ */

.main-layout-container {
    position: relative;
    z-index: 2;

    width: min(1480px, 100%);
    margin: 0 auto;

    display: grid;

    grid-template-columns:
        minmax(155px, 185px)
        minmax(190px, 215px)
        minmax(230px, 1fr)
        minmax(230px, 1fr)
        minmax(190px, 215px)
        minmax(155px, 185px);

    grid-template-rows:
        205px
        minmax(350px, auto)
        125px;

    grid-template-areas:
        "escudo header header header header colosio "
        "organigrama izquierda login login derecha visitas"
        "sitios sitios sitios sitios sitios sitios";

    gap: 16px;

    box-sizing: border-box;
}

.main-layout-container > * {
    min-width: 0;
}


/* ============================================================================
   2. ENCABEZADO
   ============================================================================ */

.main-header {
    grid-area: header;

    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    padding: 12px 18px;

    text-align: center;

    color: #fff;

    background: rgba(8, 25, 39, 0.32);

    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 20px;

    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.25);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.main-header h1 {
    font-size: clamp(36px, 4.2vw, 62px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1.5px;

    text-shadow:
        0 4px 14px rgba(0, 0, 0, 0.78);
}

.main-header h2 {
    margin-top: 7px;

    font-size: clamp(17px, 2.15vw, 31px);
    line-height: 1.1;
    font-weight: 900;

    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.78);
}

.main-header p {
    color: #f1c40f;

    font-size: clamp(14px, 1.25vw, 19px);
    line-height: 1.2;
    font-weight: 900;

    text-shadow:
        0 2px 7px rgba(0, 0, 0, 0.75);
}


/* ============================================================================
   3. ESCUDO
   ============================================================================ */

.portal-escudo {
    grid-area: escudo;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;

    background: transparent;
    border: 0;
    box-shadow: none;

    overflow: visible;
}

.portal-escudo img {
    display: block;

    width: min(100%, 175px);
    max-height: 195px;

    object-fit: contain;

    filter:
        drop-shadow(0 9px 14px rgba(0, 0, 0, 0.48));
}


/* ============================================================================
   4. COLOSIO
   ============================================================================ */

.portal-colosio {
    grid-area: colosio;

    width: 100%;
    min-width: 0;

    min-height: 205px;

    overflow: hidden;

    border-radius: 19px;

    border: 2px solid rgba(241, 196, 15, 0.80);

    background: rgba(7, 24, 38, 0.40);

    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.35);
}

.portal-colosio-link {
    position: relative;

    display: flex;

    width: 100%;
    height: 100%;
    min-height: 205px;

    align-items: flex-end;
    justify-content: center;

    overflow: hidden;

    text-decoration: none;
}

.portal-colosio-link img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center top;

    transition:
        transform 0.35s ease,
        filter 0.35s ease;
}

.portal-colosio-link::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(3, 12, 20, 0.88),
            rgba(3, 12, 20, 0.04) 72%
        );
}

.portal-colosio-link span {
    position: relative;
    z-index: 2;

    margin: 0 10px 10px;
    padding: 8px 15px;

    border-radius: 999px;

    background: rgba(8, 39, 60, 0.94);

    border: 1px solid rgba(241, 196, 15, 0.65);

    color: #fff;

    font-size: clamp(11px, 0.78vw, 15px);
    font-weight: 900;

    text-align: center;

    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.28);
}

.portal-colosio-link:hover img {
    transform: scale(1.045);
    filter: brightness(1.08);
}


/* ============================================================================
   5. ORGANIGRAMA
   ============================================================================ */

.portal-organigrama {
    grid-area: organigrama;

    width: 100%;
    min-width: 0;

    min-height: 350px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 18px 13px;

    box-sizing: border-box;

    border-radius: 18px;
}

.portal-organigrama h3 {
    color: #173047;

    font-size: clamp(14px, 1vw, 18px);
    line-height: 1.2;

    text-align: center;

    font-weight: 900;

    margin-bottom: 14px;
}

.portal-organigrama h3::after {
    content: "";

    display: block;

    width: 55px;
    height: 2px;

    margin: 9px auto 0;

    background: #b98214;
}

.portal-organigrama .floating-btn {
    width: 100%;
    min-height: 60px;

    padding: 10px;

    font-size: clamp(12px, 0.86vw, 15px);
}


/* ============================================================================
   6. BOTONES LATERALES
   ============================================================================ */

.main-layout-container > .side-buttons:first-of-type {
    grid-area: izquierda;

    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}

.main-layout-container > .side-buttons:last-of-type {
    grid-area: derecha;

    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 14px;
}

.main-layout-container > .side-buttons .floating-btn {
    width: 100%;
    min-width: 0;
    min-height: 94px;
}


/* ============================================================================
   7. VISITAS
   ============================================================================ */

.portal-visitas {
    grid-area: visitas;

    width: 100%;
    min-width: 0;

    min-height: 350px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 14px;

    padding: 16px 10px;

    box-sizing: border-box;

    text-align: center;

    border-radius: 18px;
}

.portal-visitas h3 {
    color: #173047;

    font-size: clamp(14px, 1vw, 18px);

    font-weight: 900;
}

.portal-visitas strong {
    display: flex;

    align-items: center;
    justify-content: center;

    width: clamp(70px, 5vw, 88px);
    height: clamp(70px, 5vw, 88px);

    border-radius: 50%;

    background: #173047;

    color: #fff;

    border: 2px solid #d6a332;

    font-size: clamp(24px, 1.8vw, 32px);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.30);
}

.portal-visitas::after {
    content: "Gracias por ser parte de nuestra comunidad";

    display: block;

    max-width: 145px;

    color: #173047;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.35;
}


/* ============================================================================
   8. LOGIN
   ============================================================================ */

.login-wrapper {
    grid-area: login;

    position: relative;
    z-index: 10;

    width: 100%;
    min-width: 0;

    display: flex;
    align-items: stretch;
}

.login-wrapper #login-form {
    width: 100%;
    min-width: 0;
    min-height: 350px;

    padding: clamp(28px, 3vw, 42px);

    border-radius: 22px;

    background: rgba(8, 25, 39, 0.78);

    border: 2px solid rgba(241, 196, 15, 0.78);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-wrapper #login-form h2 {
    color: #fff;

    text-shadow:
        0 3px 10px rgba(0, 0, 0, 0.65);
}

.login-wrapper #login-btn {
    min-height: 54px;
}


/* ============================================================================
   9. SITIOS DE INTERÉS
   ----------------------------------------------------------------------------
   IMPORTANTE:
   Este bloque fuerza explícitamente que el panel ocupe TODA la tercera fila.
   ============================================================================ */

.portal-sitios {
    grid-area: sitios;

    /* Fuerza el panel a ocupar las 6 columnas */
    grid-column: 1 / -1;
    grid-row: 3;

    width: 100%;
    min-width: 0;
    max-width: none;

    min-height: 125px;

    padding: 11px 24px 13px;

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    grid-template-rows:
        28px minmax(54px, 1fr);

    column-gap: 18px;
    row-gap: 8px;

    align-items: center;

    box-sizing: border-box;

    overflow: hidden;

    background:
        rgba(7, 27, 41, 0.74);

    border: 1px solid rgba(255, 255, 255, 0.42);

    border-radius: 20px;

    box-shadow:
        0 15px 34px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


/* TÍTULO */

.portal-sitios h3 {
    grid-column: 1 / -1;

    width: 100%;

    margin: 0;

    text-align: center;

    color: #f1c40f;

    font-size: clamp(15px, 1.12vw, 21px);

    font-weight: 900;

    line-height: 1;

    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.80);
}

.portal-sitios h3::before,
.portal-sitios h3::after {
    content: "";

    display: inline-block;

    width: 42px;
    height: 2px;

    margin: 0 12px;

    vertical-align: middle;

    background: #d49b22;
}


/* BOTONES */

.portal-sitios > a {
    width: 100%;
    min-width: 0;
    max-width: 100%;

    height: 54px;
    min-height: 54px;

    padding: 8px 12px;

    display: flex;

    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    overflow: hidden;

    border-radius: 11px;

    background:
        rgba(250, 251, 253, 0.90);

    border: 1px solid rgba(255, 255, 255, 0.95);

    color: #173047;

    text-decoration: none;

    text-align: center;

    font-size: clamp(13px, 0.95vw, 17px);

    font-weight: 900;

    white-space: nowrap;

    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.20);

    transition:
        transform 0.22s ease,
        background 0.22s ease,
        color 0.22s ease;
}

.portal-sitios > a:hover {
    background: #173047;

    color: #fff;

    transform: translateY(-2px);
}


/* ============================================================================
   10. RESPONSIVE
   ============================================================================ */

@media (max-width: 980px) {

    .main-layout-container {
        grid-template-columns: 1fr 1fr;

        grid-template-rows: auto;

        grid-template-areas:
            "escudo colosio"
            "header header"
            "organigrama visitas"
            "izquierda izquierda"
            "login login"
            "derecha derecha"
            "sitios sitios";
    }

    .portal-sitios {
        grid-column: 1 / -1;
        grid-row: auto;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 650px) {

    .main-layout-container {
        grid-template-columns: 1fr;

        grid-template-areas:
            "escudo"
            "header"
            "colosio"
            "organigrama"
            "izquierda"
            "login"
            "derecha"
            "visitas"
            "sitios";
    }

    .portal-sitios {
        grid-column: 1;
        grid-template-columns: 1fr;
    }

    .portal-escudo {
        min-height: 125px;
    }

    .portal-escudo img {
        width: 125px;
    }

    .portal-colosio,
    .portal-colosio-link {
        min-height: 205px;
    }

    .portal-organigrama,
    .portal-visitas,
    .login-wrapper #login-form {
        min-height: 260px;
    }
}
