/* --- GENERAL STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat';
}

body {
    background: url(../img/photos/hallway-2.jpg);
    background-size: cover;
    background-position: center;
}

.layout {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: 1fr 1fr 0.8fr;
    grid-template-rows: min-content min-content 1fr min-content;
    grid-template-areas: 
        "header header header"
        "carousel carousel aside"
        "main main aside"
        "footer footer footer";
    width: 100%; /* o max-width: 100vw */
}




/* --- HEADER SECTION --- */
.header {
    grid-area: header;
    background-image: linear-gradient(135deg, #1758a7, #1c6caa, #1758a7);
    border-bottom: 1.5px solid rgb(35, 76, 138);
    padding: 20px 0 12px;
    position: sticky;
    top: 0px;
    z-index: 40;
}

/* Estilos del logo, título y las redes sociales */
.header__container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
    position: relative;
}

.header__logo {
    width: calc(95px + 1.2dvw);
    object-fit: cover;
    position: absolute;
    padding-right: 15px;
    margin-top: 27px;
    right: 86%;
}

.header__title {
    color: aliceblue;
    text-align: center;
    font-size: clamp(15px, 2.9dvw, 26px);
    flex-basis: auto;
    flex-grow: 2;
    margin-left: 50px;
}

.header__social-media {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.social-media__li {
    display: flex;
    justify-content: center; 
    align-items: center;
}

.social-media__link {
    display: flex;
    justify-content: center;
    align-items: center;
}

.social-media__logo {
    width: 2.2em;
    height: 2.2em;
    object-fit: cover;
    color: white;
    transition: transform 0.25s ease;
}

.social-media__logo:hover {transform: scale(1.1);}


/* Barra de navegacion */
.header__nav {
    margin: auto;
    width: 74%;
    position: relative; /* Para poder ver posicionar el button del Menu Hamburguesa */
}

/* Botón hamburguesa (oculto por defecto) */
.nav__hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 15px;
    position: absolute;
    left: -10px;
    top: -45px;
    z-index: 30;
}

.hamburger-icon, .close-icon {
    width: 30px;
    height: 30px;
    color: white;
}

/* Enlaces */
.nav__ul {
    padding-top: 15px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: clamp(20px, 2vw, 30px);
    padding-left: 15px; /* Evita acercarse al logo */
}

.ul__item {
    text-align: center;
    flex-basis: auto;
    list-style: none;
    border-radius: 6px;
    padding: 6px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.ul__link {
    color: aliceblue;
    text-decoration: none;
}

.ul__item:hover {background-color: rgb(56, 56, 56);}

/* El enlace del link del Login */
.ul__item--login {background-color: rgb(78, 143, 204);}




/* --- CAROUSEL --- */
.carousel {
    grid-area: carousel;
    width: 75%;
    height: 250px;
    margin: 30px auto 0;
    border-radius: 3px;
    overflow: hidden;
    position: relative; /* Para posicionar los botones/textos */
}

/* Texto de presentación */
.welcome-container {
    color: aliceblue;
    text-align: center;
    border-radius: 6px;
    padding: 1em;
    width: 65%;
    display: inline;
    background: #7070709c;
    border: 3px #7070703d solid;
    backdrop-filter: blur(0.9rem);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.welcome-container h2 {
    font-size: clamp(2px, 2.8dvw, 21px);
    padding-bottom: 1.5rem;
}
.welcome-container p {
    font-size: clamp(1px, 2dvw, 16px);
    padding-bottom: 0.5rem;
}
.welcome-container span {
    font-size: 1.3em;
}

/* Imágenes del carrusel */
.carousel ul {
    display: flex;
    width: 400%; /* el 400% adapta las 4 imágenes*/
    padding: 0;
    animation: slide 20s infinite alternate ease-in-out;
}

.carousel li {
    width: 100%;
    list-style: none;
}

.carousel img {
    width: 100%;
}

/* Animación del carrusel */
@keyframes slide {
    /* La animación se adapta a 4 imágenes dentro del carrusel, si hay más o menos, puede romper */
    0% {margin-left: 0;}
    20% {margin-left: 0;}

    25% {margin-left: -100%;}
    45% {margin-left: -100%;}

    50% {margin-left: -200%;}
    70% {margin-left: -200%;}

    75% {margin-left: -300%;}
    100% {margin-left: -300%;}
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.39);
    color: white;
    border: none;
    cursor: pointer;
    padding: 6px 13px;
    font-size: 18px;
    border-radius: 50%;
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}




/* --- MAIN SECTION --- */
main {
    grid-area: main;
    padding: 3em 5em;
}

.post-container {
    margin: 15px auto;
    display: grid;
    width: 90%;
    grid-template-columns: 50% 50%;
    justify-content: center;
    grid-auto-rows: minmax(auto, 210px);
    gap: 3em 2.2em;
}

.post {
    background-color: aliceblue;
    border-radius: 6px;
    box-shadow: 0px 5px 10px -2px rgba(0, 0, 0, 0.151);
    transition:  box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post:hover {
    transform: scale(1.01);
    box-shadow: 0px 12px 16px -5px rgba(0, 0, 0, 0.226);
}

.post__link {
    text-decoration: none;
}

.post__container-image {
    max-width: 100%;
    height: 65%;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.post__title {
    color: #1d7bc4;
    text-align: center;
    font-size: clamp(14px, 2vw, 16px);
    max-width: 100%;
    margin-top: 0.7em;
}

.post__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Dar peso visual a la primera publicacion */
.post:first-child {
    grid-column: span 2;
    height: 300px;
    width: 90%;
    align-self: center;
    justify-self: center;
}
.post:first-child .post__container-image {
    height: 75%;
}



/* --- ASIDE SECTION --- */
.extra-information {
    grid-area: aside;
    background-image: linear-gradient(135deg, #1758a7, #1c6caa, #1758a7);
    border-radius: 6px;
    position: sticky;
    top: 125px;
    height: fit-content;
    margin-right: 4em;
    z-index: -1;
}

.extra__image-wrapper {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    margin: auto;
    margin-top: 1em;
}

.extra__image {
    width: 100%;
    transition: 0.5s ease;
}

.extra__image:hover {
    transform: scale(1.2);
}

.extra__description {
    text-align: justify;
    color: aliceblue;
    padding: 1em 2em;
    font-size: 0.85em;
}

.extra__phrase {
    text-align: center;
    font-weight: bold;
    font-style: italic;
    color: aliceblue;
    font-size: 0.9em;
    margin-bottom: 1em;
}




/* --- FOOTER SECTION --- */
.footer {
    grid-area: footer;
    border-top: 1.5px solid rgb(27, 27, 27);
    background-image: linear-gradient(135deg, #3f4041, #54595c, #3f4041);
    padding: 50px 30px;
}

.footer__description {
    color: aliceblue;
    text-align: justify;
    font-size: 15px;
    padding: 2px 0;
}

.footer__description:first-child {
    font-weight: bold;
    margin-bottom: 10px;
}

.footer__description:last-child {
    margin-top: 30px;
    text-align: center;
}




/* --- RESPONSIVE DESIGN --- */
@media (width <= 768px) {
    /* --- HEADER SECTION --- */

    /* Al no haber logo, la barra de navegación puede ocupar más espacio */
    .header__nav {width: 95%;}

    /* Quitamos las redes sociales del encabezado para mantener un diseño compacto */
    .header__social-media, .header__logo {display: none;}

    /* Sin el logo y las redes, centramos el titulo del encabezado */
    .header__title {margin: 0;}


    /* Barra de navegación */
    .nav__hamburger {display: block; /* Mostrar botón hamburguesa */}

    .nav__ul {
        position: fixed;
        top: 0;
        left: 0;
        width: 55%;
        height: 100vh;
        background-color: rgba(23, 88, 167, 0.98);
        flex-direction: column;
        justify-content: start;
        align-items: center;
        gap: 1.8em;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 20;
        padding: 3.8em 0 0;
    }
    
    .nav__ul.active {transform: translateX(0);}
    
    .ul__item {
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        text-align: center;
        padding: 8px 10px;
    }
    
    .nav__ul.active .ul__item {opacity: 1;}


    
    /* --- MAIN SECTION --- */
    .post-container {
        width: 80%;
        grid-template-columns: 85%;
        padding: 0%;
    }



    /* --- ANIMATIONS --- */

    /* Animación para los items del menú */
    @keyframes fadeIn {
        from { opacity: 0; transform: translateX(-20px); }
        to { opacity: 1; transform: translateX(0); }
    }
    
    .nav__ul.active .ul__item {animation: fadeIn 0.3s ease forwards;}
    
    .nav__ul.active .ul__item:nth-child(1) { animation-delay: 0.1s; }
    .nav__ul.active .ul__item:nth-child(2) { animation-delay: 0.2s; }
    .nav__ul.active .ul__item:nth-child(3) { animation-delay: 0.3s; }
    .nav__ul.active .ul__item:nth-child(4) { animation-delay: 0.4s; }
}