/* public/css/header.css
   Colegio Militar Francisco Bolognesi
   Paleta: Granate / Rojo / Amarillo / Blanco
*/

:root {
    --cmfb-granate: #720d18;
    --cmfb-granate-dark: #560910;
    --cmfb-granate-light: #8a1420;
    --cmfb-rojo: #c8102e;
    --cmfb-amarillo: #d4af37;
    --cmfb-amarillo-claro: #e6c65c;
    --cmfb-blanco: #ffffff;
    --cmfb-crema: #f4eedc;
}

/* =========================================================
   TOP BAR
   ========================================================= */

.top-bar {
    background: var(--cmfb-granate-dark);
    padding: 0 20px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--cmfb-amarillo);
    box-sizing: border-box;
}

.topbar-left {
    display: none;
}

.topbar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: 1060px;
}

.top-bar a {
    color: var(--cmfb-blanco);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: .5px;
    transition: color .3s ease;
}

.top-bar a:hover {
    color: var(--cmfb-amarillo-claro);
}


/* =========================================================
   HEADER PRINCIPAL
   ========================================================= */

.main-header {
    position: relative;
    height: 400px;
    min-height: 400px;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    background-position: center center;
    background-repeat: repeat;
    background-size: auto;
}

.header-container {
    position: relative;
    width: 100%;
    max-width: 1300px;
    height: 400px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}


/* =========================================================
   CADETE
   Solo el cadete se fija abajo.
   ========================================================= */

.header-left {
    position: absolute;
    left: 20px;
    bottom: 0;
    width: 280px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 3;
}

.header-left img {
    display: block;
    width: auto;
    max-width: 240px;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    object-position: bottom center;
    margin: 0;
    filter: drop-shadow(3px 5px 6px rgba(0,0,0,.5));
}


/* =========================================================
   CENTRO
   Se mantiene realmente centrado en la pantalla del header.
   ========================================================= */

.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 560px;
    max-width: calc(100% - 520px);
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 4;
}

.header-center > a {
    display: block;
    line-height: 0;
}

.logo-center {
    display: block;
    width: 520px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto 10px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.6));
    transition: transform .3s ease, filter .3s ease;
}

.logo-center:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,.8));
}

.main-header h1 {
    width: 100%;
    max-width: 560px;
    margin: 0 0 5px;
    color: var(--cmfb-blanco);
    font-weight: 900;
    font-size: 2.05rem;
    line-height: 1.08;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,.85);
}

.main-header h2 {
    margin: 0;
    color: var(--cmfb-amarillo);
    font-weight: 800;
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,.8);
}


/* =========================================================
   PORTAL DE TRANSPARENCIA
   Imagen configurable al lado del logo
   ========================================================= */

.header-transparency {
    position: absolute;
    left: calc(50% + 390px);
    top: 150px;
    width: 165px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    z-index: 20;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.header-transparency > a,
.header-transparency > div {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 0;
    text-decoration: none;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.header-transparency img {
    display: block;
    width: auto;
    max-width: 165px;
    height: auto;
    max-height: 100px;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: center;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,.25));
    transition: transform .25s ease, filter .25s ease;
}

.header-transparency a:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 5px 8px rgba(0,0,0,.35));
}

@media (max-width: 1100px) {
    .header-transparency { left: 43px; right: auto; top: 68px; width: 135px; min-height: 80px; }
    .header-transparency img { max-width: 135px; max-height: 85px; }
}

@media (max-width: 900px) {
    .header-transparency { left: 43px; right: auto; top: 68px; width: 35px; min-height: 80px;}
    .header-transparency img { max-width: 110px; max-height: 75px; }
}

@media (max-width: 768px) {
    .header-transparency { left: 43px; right: auto; top: 68px; width: 35px; min-height: 80px; }
    .header-transparency img { max-width: 90px; max-height: 65px; }
}

@media (max-width: 480px) {
    .header-transparency { left: 43px; right: auto; top: 68px; width: 35px; min-height: 80px; }
    .header-transparency img { max-width: 75px; max-height: 55px; }
}


/* =========================================================
   REDES SOCIALES
   =========================================================

====================================== */

.header-right {
    position: absolute;
    right: 20px;
    top: 78px;
    width: 36px;
    display: flex;
    justify-content: center;
    z-index: 8;
}

.social-icons-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.social-icons-header a {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: var(--cmfb-crema);
    color: var(--cmfb-granate-dark);
    border-radius: 4px;
    font-size: 1.1rem;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
    text-decoration: none;
    transition: background-color .3s ease, color .3s ease, transform .3s ease;
}

.social-icons-header a i {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    color: var(--cmfb-granate-dark);
    line-height: 1;
}

.social-icons-header a:hover {
    background: var(--cmfb-amarillo);
    color: var(--cmfb-blanco);
    transform: scale(1.08);
}

.social-icons-header a:hover i {
    color: var(--cmfb-blanco);
}




/* =========================================================
   NAVEGACIÓN
   ========================================================= */

.navbar-custom {
    position: relative;
    z-index: 30;
    background: var(--cmfb-granate-dark);
    border-top: 4px solid var(--cmfb-amarillo);
    border-bottom: 4px solid var(--cmfb-amarillo);
    box-shadow: inset 0 4px 0 rgba(0,0,0,.3), inset 0 -4px 0 rgba(0,0,0,.3);
}

.navbar-custom .container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    list-style: none;
    padding: 0;
    margin: 0;
}

.navbar-nav > li {
    position: relative;
}

.navbar-nav li a {
    display: block;
    color: var(--cmfb-blanco);
    font-weight: 700;
    text-transform: uppercase;
    padding: 16px 25px;
    font-size: .85rem;
    line-height: 1.2;
    letter-spacing: .5px;
    text-decoration: none;
    transition: color .3s ease, background-color .3s ease;
}

.navbar-nav li a:hover {
    color: var(--cmfb-amarillo-claro);
    background: var(--cmfb-granate-light);
}


/* =========================================================
   SUBMENÚ
   ========================================================= */

.navbar-nav li > .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 5px 0;
    list-style: none;
    background: var(--cmfb-granate-dark);
    border-top: 3px solid var(--cmfb-amarillo);
    box-shadow: 0 8px 18px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 100;
}

.navbar-nav li:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.navbar-nav li > .submenu li a {
    padding: 11px 16px;
    font-size: .78rem;
    white-space: nowrap;
}

.navbar-nav li > .submenu li a:hover {
    background: var(--cmfb-rojo);
    color: var(--cmfb-blanco);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .header-left {
        left: 15px;
        width: 220px;
    }

    .header-left img {
        max-width: 305px;
        max-height: 180px;
    }

    .header-center {
        width: 500px;
        max-width: calc(100% - 430px);
    }


    .header-transparency img {
        width: 145px;
    }

    .header-right {
        right: 15px;
    }

    .navbar-nav li a {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 900px) {
    .main-header,
    .header-container {
        height: 250px;
        min-height: 250px;
    }

    .header-left {
        width: 185px;
    }

    .header-left img {
        max-width: 275px;
        max-height: 180px;
    }

    .header-center {
        width: 430px;
        max-width: calc(100% - 350px);
    }

    .logo-center {
        width: 150px;
    }

    .main-header h1 {
        font-size: 1.55rem;
    }

    .main-header h2 {
        font-size: .95rem;
    }

    .header-transparency img {
        width: 110px;
    }

    .header-right {
        top: 20px;
        right: 12px;
    }

    .navbar-nav li a {
        padding: 13px;
        font-size: .78rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        min-height: auto;
        padding: 10px 15px;
    }

    .topbar-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 15px;
    }

    .top-bar a {
        font-size: .68rem;
    }

    .main-header,
    .header-container {
        height: 250px;
        min-height: 250px;
    }

    .header-left {
        left: 50%;
        bottom: 0;
        width: 150px;
        height: 175px;
        transform: translateX(-50%);
    }

    .header-left img {
        max-width: 245px;
        max-height: 180px;
    }

    .header-center {
        top: 22px;
        left: 50%;
        width: calc(100% - 80px);
        max-width: none;
        transform: translateX(-50%);
    }

    .logo-center {
        width: 250px;
    }

    .main-header h1 {
        font-size: 1.3rem;
    }

    .main-header h2 {
        font-size: .82rem;
    }


    .header-transparency img {
        width: 100px;
    }

    .header-right {
        top: 20px;
        right: 10px;
    }

    .social-icons-header a {
        width: 32px;
        height: 32px;
        font-size: .95rem;
    }

    .navbar-nav li a {
        padding: 10px 12px;
        font-size: .72rem;
    }
}

@media (max-width: 480px) {
    .main-header,
    .header-container {
        height: 250px;
        min-height: 250px;
    }

    .header-center {
        top: 18px;
        width: calc(100% - 55px);
    }

    .logo-center {
        width: 265px;
    }

    .main-header h1 {
        font-size: 1.05rem;
    }

    .main-header h2 {
        font-size: .72rem;
    }

    .header-left {
        width: 125px;
        height: 145px;
    }

    .header-left img {
        max-width: 320px;
        max-height: 180px;
    }


    .header-transparency img {
        width: 82px;
    }

    .header-right {
        top: 20px;
        right: 7px;
    }

    .social-icons-header a {
        width: 29px;
        height: 29px;
        font-size: .85rem;
    }

    .navbar-nav li a {
        padding: 9px 8px;
        font-size: .66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-center,
    .header-transparency img,
    .social-icons-header a,
    .navbar-nav li > .submenu {
        transition: none;
    }
}
