/* --- General & Typography --- */
:root{
    /* colores */
    --clr-negro: #000000;
    --clr-blanco: white;
    --clr-dorado: #f4d229;
    --clr-amarillo-claro: #e6d690;
    --clr-azul: #7892c2;
    /* fuentes */
    --ff-title: 'Roboto', sans-serif;
    --ff-title-weight: 500;
    --ff-paragraph: 'Poppins', sans-serif;
    --ff-paragraph-weight: 300;
    --ff-paragraph-size: 1.3125rem;
}



body{
    
    font-family: var(--ff-paragraph);
    font-weight: var(--ff-paragraph-weight);
    font-size: var(--ff-paragraph-size);
    line-height: 1.6;
    background-color: #000000;
    margin: 0;
    padding: 1rem;
    color: #333;
    padding-top: 110px;
       
}

/* MOBILE STYLES (Default) */
.navbars{
    position: fixed;
    width: 100%;
    z-index: 1030; /* High z-index to ensure it's above everything */
    top: 0;
    left: 0;
}

/* Social Icons Bar - Mobile (TOP BAR) */
.social-top-navbar {
    padding: 0.3rem 0;
    min-height: auto;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    
}

/* Ensure social navbar is above main navbar on mobile */
.social-top-navbar {
    position: relative;
    z-index: 1031; /* Higher than main navbar */
}

.main-navbar {
    position: relative;
    z-index: 1030; /* Lower than social navbar */
}

/* Social icons styling for mobile */
ul.iconos {
    list-style-type: none;
    display: flex;
    justify-content: center; 
    margin: 0;
    padding: 0;
    gap: 1rem;
}

ul.iconos li {
    display: inline-block;
}

/* iconos centrados */
.header-icons {
    list-style-type: none;
    margin-inline: auto;
    width: 100%;
}

/* Main Navigation - Mobile */
.main-navbar.navbar {
    padding: 0.5rem 0;
}

/*Navbar for mobile max width of 992px*/
/* creates a toogle menu and push it to right of the navbar*/
@media (max-width: 991.98px) {
    .main-navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .main-navbar.navbar {
        min-height: 60px; /* Give the navbar a fixed height */
    }
    
    /* Push toggler to the right */
    .navbar-toggler {
        order: 2;
        margin-left: auto;
    }

    /* Keep brand on left */
    .header-name {
        order: 1;
    }

    /* and toggler menu*/
    .navbar-collapse{
        order: 3;
        flex-basis: 100%; /* Take full width */
        text-align: right;
    }

    /* Align nav items to right */
    .navbar-nav {
        text-align: right;
    }

    .nav-item {
        display: block;
    }
    
    .nav-link {
        text-align: right;
        padding: 0.75rem 1rem;
        display: block;
    }
       
    /* Hide desktop icons on mobile */
    .header-icons-desktop {
        display: none;
    }
}

/* centrar mas el nombre y el boton de la navbar secundaria */
.navbar-brand{
    margin-left: 0.8rem;
}

/*para aplicar un estilo a una clase anidada toca partir desde la clase nodriza */
.navbar .navbar-brand{
    color: var(--clr-dorado);
    font-size: 1.25rem;
}

.navbar-toggler {
    margin-right: 0.8rem;
}

/* Hide desktop social icons on mobile */
.header-icons-desktop {
    display: none;
}


.header-name {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Perfect center */
    margin: 0 !important;
    z-index: 1;
}

/* DESKTOP STYLES (min-width: 992px) */
@media (min-width: 992px) {
    /* Hide mobile social icons bar */
    .social-top-navbar {
        display: none !important;
    }
    
    /* Main navbar adjustments for desktop */
    .main-navbar.navbar {
        padding: 0.5rem 0;
        height: auto;
    }
    
    .navbars {
        position: fixed;
        width: 100%;
        z-index: 1030;
    }
    
    /* SIMPLE GRID SOLUTION - Perfect centering between elements */
    .main-navbar .container {
        display: grid;
        grid-template-columns: 1fr auto 1fr; /*3 columns brand is in the center column auto*/
        align-items: center;
        max-width: 100%;
        padding: 0 2rem;
        gap: 1rem;
    }
    
    /* PERFECT CENTERING FOR BRAND */
    .header-name {
        position: static;
        transform: none;
        margin: 0 !important;
        justify-self: center;
        text-align: center;
        width: 100%; /* Ensure it takes full width of grid cell */
    }
    
    .navbar .header-name .navbar-brand {
        color: var(--clr-dorado);
        font-size: 1.5rem;
        margin: 0 auto; /* This centers the brand within its container */
        white-space: nowrap;
        display: block; /* Make it block level for proper centering */
        text-align: center;
    }
    
    /* Desktop social icons */
    .header-icons-desktop {
        display: block;
        flex: 0 0 auto;
        margin-right: auto; /* Push to left */
    }
    
    .social-icons-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        gap: 0.8rem;
    }
    
    .social-icons-list li {
        display: inline-block;
    }
    
    /* Desktop navigation menu - Push to right */
    .navbar-collapse {
        display: flex !important;
        justify-self: end;
        flex-grow: 0;
        margin-left: auto; /* Push to right */
    }
    
    .navbar-nav {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        min-width: 0;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }
    
    /* Hover effects for desktop */
    .navbar .navbar-collapse .navbar-nav .nav-item .nav-link:hover {
        color: var(--clr-dorado);
    }
    
    .header-icons-desktop:hover {
        color: var(--clr-dorado);
    }

    body {
        /* Adjust padding for the single desktop navbar */
        padding-top: 80px; 
    }
}




/* LARGE DESKTOP OPTIMIZATION */
@media (min-width: 1200px) {
    .main-navbar .container {
        padding: 0 3rem;
    }
    
    .nav-link {
        padding: 0.5rem 1.2rem;
    }
}

/* Control navbar height for different screen sizes */
@media only screen and (min-width: 600px) {
    .navbar {
        height: auto !important; 
    }
}

@media only screen and (min-width: 768px) {
    .navbar {
        height: auto !important; 
    }
}

/* Control button size */
@media only screen and (min-width: 768px) {
    .navbar-toggler {
        height: 3rem !important; 
        width: 4rem !important;
    }
}

/* display background color black on navbar scroll */
.navbarScroll.navbarDark {
    background-color: black;
}

.navbar {
    transition: none !important;
}

.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    color: var(--clr-blanco);
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}


/* --- Gallery Layout --- */

/* Default Mobile Layout: Single Column */
.video-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem; /* This replaces the need for individual margins */
}

.video-item {
    width: 90vw; /* 90% of the viewport width on mobile */
    max-width: 500px; /* Prevents it from becoming too wide on larger phones */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden; /* Keeps thumbnail within the rounded corners */
}

.video-thumbnail {
    width: 100%;
    height: auto; /* This maintains the native aspect ratio */
    display: block;
    aspect-ratio: 1 / 1; /* Default to square, Instagram's thumbnail ratio */
    object-fit: cover;
}


/* Tablet & Desktop Layout: 3-Column Grid */
@media (min-width: 768px) {
    .video-gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
        gap: 1.5rem;
    }

    .video-item {
        width: 100%; /* The item now takes 100% width of its grid cell */
        max-width: none; /* Reset max-width for grid layout */
    }
}


/* --- Thumbnail & Play Button --- */
.video-thumbnail-wrapper {
    position: relative; /* Required for absolute positioning of the play button */
    display: block;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    background: none;
}

.video-thumbnail-wrapper:focus-visible {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

/* Play button overlay */
.play-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail-wrapper:hover .play-button {
    opacity: 1;
}

.play-button svg {
    width: 25%;
    height: 25%;
    max-width: 64px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}


/* --- Caption & GLightbox --- */
.video-caption {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #555;
    text-align: left;
    background-color: #fff;
    margin: 0;
}

/* --- Definitive CSS Fallback for Portrait Videos --- */

/* CRITICAL: Target the outer container first */
.glightbox-container.portrait-mode .ginner-container {
    width: auto !important;
    max-width: none !important;
    justify-content: center !important;
}

/* LAYER 1: Override GLightbox's Flexbox Container */
.glightbox-container.portrait-mode .gslide {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    margin: auto !important;
    width: auto !important;
    max-width: 90vh !important; /* Limit width based on height */
}

/* LAYER 2: Override GLightbox's Media Container */
.glightbox-container.portrait-mode .gslide-media {
    width: auto !important;
    max-width: none !important;
}

.glightbox-container.portrait-mode .gslide-video {
    width: auto !important;
    height: 90vh !important;
    max-width: none !important;
}

/* LAYER 3: Override Plyr's Aspect Ratio Wrapper - MOST CRITICAL */
.glightbox-container.portrait-mode .plyr,
.glightbox-container.portrait-mode .plyr__video-wrapper {
    /* Kill the default 16:9 aspect ratio */
    aspect-ratio: unset !important;
    padding-bottom: 0 !important;
    
    /* Make it fill the height */
    height: 100% !important;
    width: auto !important;
    max-width: none !important;
}

/* LAYER 4: Video element sizing */
.glightbox-container.portrait-mode .plyr__video-wrapper video {
    position: relative !important;
    object-fit: contain !important;
    height: 100% !important;
    width: auto !important;
    max-height: 90vh !important;
}

/* LAYER 5: Plyr controls container */
.glightbox-container.portrait-mode .plyr__controls {
    width: 100% !important;
}

/* Optional: Center the video better on very wide screens */
@media (min-width: 768px) {
    .glightbox-container.portrait-mode .gslide {
        max-width: calc(90vh * 0.5625) !important; /* For 9:16 videos */
    }
}

.glightbox-instagram-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 8px 12px;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.glightbox-instagram-link:hover {
    background-color: #e0e0e0;
}


/* --- UI States (Loading & Error) --- */
#loading-indicator {
    font-size: 1.2rem;
    padding: 2rem;
}

#error-message {
    background-color: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 1rem;
    color: #d46b08;
    max-width: 600px;
    margin: 2rem auto;
}

#error-message button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    font-size: 1rem;
}

#error-message button:hover {
    background-color: #0056b3;
}