/* CSS Reset for consistent rendering */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    /* Base font size - ensures consistency */
    -webkit-text-size-adjust: 100%;
    /* Prevents iOS text size adjustment */
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

:root {
    --rojo: #59514D;
    --negro: #FFFFFF;
    /* Replaced dark red with tech-archive blue */
    --gris: #0047AB; 
    --gris-claro: #fbfbfb;
}

/* GENERAL */
body {
    margin: 0;
    padding: 40px;
    padding-top: 80px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 300;
    background: var(--negro);
    color: var(--gris);
    letter-spacing: 0.3px;
}

body.no-scroll {
    overflow: hidden;
    /* Disable scroll when lightbox is open */
}

/* HEADER */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    /* Increased to accommodate larger text */
    padding: 0 40px;
    background: var(--negro);
    display: flex;
    justify-content: space-between;
    /* Left/Right layout */
    align-items: center;
    /* Custom spacing for dotted border using gradient */
    border-bottom: none;
    background-image: radial-gradient(circle, #000 1px, transparent 1.5px);
    background-size: 10px 1px;
    /* Smaller dots and spacing */
    background-repeat: repeat-x;
    background-position: bottom;
    z-index: 1000;
}

.main-menu {
    display: flex;
    gap: 40px;
    /* Space between links */
}

.site-header a.menu-link {
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: -0.5px;
    color: #000;
    text-decoration: none;
    position: relative;
}

/* Hover Animation: Sliding Underline */
.site-header a.menu-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -3px;
    left: 0;
    background-color: var(--rojo);
    /* Using the accent color for interaction */
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.site-header a.menu-link:hover::after,
.site-header a.menu-link.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.site-header a.menu-link:hover {
    color: var(--gris);
    /* Match footer hover (Red) */
}

.logo {
    margin-right: auto;
    font-family: 'Bodoni Moda', serif;
    /* Classy serif logo */
    font-weight: 800;
    font-size: 20px;
    /* Smaller, minimalist logo */
}

/* TITULOS */
.main-title {
    font-family: 'Bodoni Moda', serif;
    /* Balenciaga style */
    font-size: 60px;
    /* Smaller, minimalist */
    font-weight: 400;
    /* Much thinner (Regular) */
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -2px;
    /* Tighter for that condensed fashionable look */
    color: var(--gris);
    margin-bottom: 20px;
    margin-left: -1px;
}

/* Modifier for About Page Title */
.about-title {
    color: #000;
    margin-top: 40px; /* Reduced visual gap from desktop navbar */
    margin-bottom: 50px;
}

.subtitle {
    font-size: 14px;
    /* Reduced from 16px */
    font-weight: 400;
    color: #444;
    /* Softer contrast for body text */
    max-width: 550px; /* Narrower width */
    text-align: left; /* Left aligned flush */
    margin-bottom: 30px;
    line-height: 1.7; /* Breathing room */
}

/* Language separator */
.language-separator {
    max-width: 550px;
    border: none;
    border-top: 1px solid #ddd;
    margin: 60px 0;
}

/* GALERÍA */
.gallery {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 images per row */
    gap: 100px;
    /* Adjusted for better balance */
}

/* VIDEO GALLERY OVERRIDE */
.video-gallery {
    grid-template-columns: 1fr;
    max-width: 1000px;
    /* Contemplative size */
    margin: 40px auto 0 auto;
    /* Centered with top margin */
}

.gallery-item {
    display: flex;
    flex-direction: column;
}

.gallery img {
    width: 100%;
    border: 1px solid var(--gris-claro);
    /* Thinner border for subtlety */
    object-fit: cover;
    cursor: zoom-in;
    transition:
        transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.gallery img:hover {
    /* Removed blue hover border */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    /* Soft gray shadow */
    transform: scale(1.03);
    /* Clean zoom */
}

/* COMPRESSION SUBTEXT */
.comp-text {
    display: inline-block;
    margin-top: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    color: #666;
    letter-spacing: 0.3px;
}

.ui-title .comp-text {
    font-size: 14px;
    font-weight: 400;
    color: #444;
}

/* ZOOM & CAPTION */
.caption {
    margin-top: 8px;
    font-size: 11px;
    /* Smaller, minimalist */
    font-weight: 300;
    /* Lighter as requested */
    color: #000 !important;
    /* Force Black */
    letter-spacing: 0.3px;
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(242, 242, 242, 0.98);
    /* Slightly more transparent as requested */
    display: none;
    z-index: 2000;
    /* Flex centering for the content */
    justify-content: center;
    align-items: center;
    padding: 20px;
}


/* LIGHTBOX IMAGE (Centered vertically and aligned right) */
.lightbox-content {
    display: flex;
    justify-content: flex-end;
    /* Right aligned */
    align-items: center;
    /* Vertically centered */
    width: 100%;
    height: 100%;
    padding-bottom: 0;
    /* Removed bottom padding for true centering */
    padding-right: 40px;
    /* Spacing from right edge */
    box-sizing: border-box;
}

.lightbox-content img {
    max-height: 85vh;
    /* Increased from 80vh for more prominence */
    max-width: 95vw;
    /* Increased from 90vw for more screen usage */
    border: none;
    /* Clean look or keep border? User didn't specified, but clean is better for contemplative */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* NEW LIGHTBOX UI (Bottom Left) */
.lightbox-ui {
    position: fixed;
    bottom: 30px;
    /* Reduced from 40px */
    left: 40px;
    z-index: 3000;
    text-align: left;
    color: #000;
}

.ui-title {
    font-family: 'Bodoni Moda', serif;
    font-weight: 400;
    font-size: 36px;
    /* Balanced size - not too big, not too small */
    margin: 0 0 14px 0;
    /* Slightly increased margin */
    line-height: 1;
    color: #000;
    letter-spacing: -1px;
    /* Balanced letter spacing */
}

.ui-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    /* Increased for better readability */
    font-weight: 500;
    /* Custom spaced dots for footer */
    border-top: none;
    background-image: radial-gradient(circle, #000 1px, transparent 1.5px);
    background-size: 10px 1px;
    background-repeat: repeat-x;
    background-position: top;
    padding-top: 10px;
    width: max-content;
    min-width: 250px;
}

.ui-btn {
    background: transparent;
    border: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    /* Increased for better readability */
    font-weight: 500;
    color: #000;
    cursor: pointer;
    padding: 0;
    text-transform: uppercase;
    transition: color 0.2s ease;
    white-space: nowrap;
    /* Prevent text wrapping */
}

.ui-btn:hover {
    color: var(--gris);
    /* Red hover */
}

.ui-counter {
    margin-right: auto;
    /* Push nav group right? Or just spacing. Let's keep strict gap */
    letter-spacing: 1px;
}

.nav-group {
    display: flex;
    gap: 20px;
    margin-left: 20px;
}

/* CERRAR */
/* Removed as requested */


/* NAVIGATION BUTTONS */
.nav-btn {
    position: fixed;
    /* Fixed to viewport as requested so they don't move */
    top: 50%;
    transform: translateY(-50%);
    transform: translateY(-50%);
    background: transparent;
    /* Minimalist: No background */
    border: none;
    font-size: 48px;
    /* Larger icon for visibility without circle */
    color: #000;
    /* Black icon for contrast */
    cursor: pointer;
    z-index: 3000;
    padding: 20px;
    /* Hit area */
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-50%) scale(1.2);
    background: transparent;
    color: var(--gris);
    /* Red hover effect */
}

.prev {
    left: 40px;
    /* Fixed distance from left screen edge */
}

.next {
    right: 40px;
    /* Fixed distance from right screen edge */
}

/* INFO BUTTON */
/* INFO BUTTON */
.info-btn {
    position: fixed;
    /* Fixed to viewport */
    top: 40px;
    /* Top Right position */
    right: 40px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #000;
    /* Solid Black */
    color: #FFF;
    /* White text */
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 20px;
    font-style: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: transform 0.2s ease, background 0.2s ease;
}

.info-btn:hover,
.info-btn.active {
    background: var(--gris);
    /* Red hover effect */
    color: #FFF;
    transform: scale(1.1);
}


/* INFO DETAILS PANEL */
/* INFO DETAILS PANEL */
.lightbox-details {
    position: fixed;
    /* Side Drawer */
    top: 0;
    right: 0;
    bottom: 0;
    /* Full height */
    width: 320px;
    background: #F2F2F2;
    /* Light background */
    padding: 100px 40px 40px 40px;
    /* Top padding clears the button */
    border-left: 2px solid #000;
    /* Border on left */
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    color: #000;
    z-index: 2900;
    box-sizing: border-box;
    transform: translateX(100%);
    /* Hidden by default */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: block;
    /* Always block for transform to work, control visibility via class */
}

.lightbox-details.show {
    transform: translateX(0);
    /* Slide in */
    display: block;
}

.lightbox-details strong {
    display: block;
    color: var(--gris);
    /* Red accent for ID */
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* iPad Pro and large tablets (landscape) - max-width: 1366px */
@media (max-width: 1366px) and (min-width: 1025px) {
    body {
        padding: 30px;
        padding-top: 75px;
    }

    .site-header {
        padding: 0 30px;
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 80px;
    }

    .main-title {
        font-size: 54px;
    }

    .subtitle {
        font-size: 15px;
    }
}

/* iPad Pro (portrait) and iPad (landscape) - 768px to 1024px */
@media (max-width: 1024px) and (min-width: 769px) {
    body {
        padding: 25px;
        padding-top: 70px;
    }

    .site-header {
        padding: 0 25px;
        height: 60px;
    }

    .site-header a.menu-link {
        font-size: 15px;
    }

    .logo {
        font-size: 20px;
    }

    .main-menu {
        gap: 30px;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 60px;
        margin-top: 30px;
    }

    .main-title {
        font-size: 50px;
        margin-bottom: 18px;
    }

    .subtitle {
        font-size: 15px;
        line-height: 1.6;
    }

    .caption {
        font-size: 11px;
    }

    /* Lightbox optimized for iPad */
    .lightbox-content {
        padding-right: 30px;
        padding-left: 30px;
    }

    .lightbox-content img {
        max-height: 80vh;
        max-width: 92vw;
    }

    .lightbox-ui {
        bottom: 25px;
        left: 25px;
    }

    .ui-title {
        font-size: 32px;
        margin-bottom: 12px;
    }

    .ui-bar {
        font-size: 11px;
        gap: 18px;
        min-width: 280px;
    }

    .ui-btn {
        font-size: 11px;
    }

    .nav-group {
        gap: 18px;
        margin-left: 15px;
    }

    .nav-btn {
        font-size: 40px;
        padding: 15px;
    }

    .prev {
        left: 25px;
    }

    .next {
        right: 25px;
    }

    .info-btn {
        top: 25px;
        right: 25px;
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .lightbox-details {
        width: 300px;
        padding: 90px 30px 30px 30px;
        font-size: 13px;
    }

    .lightbox-details strong {
        font-size: 15px;
    }
}

/* iPad (portrait) - 768px and below but larger than phones */
@media (max-width: 768px) and (min-width: 601px) {
    body {
        padding: 20px;
        padding-top: 65px;
    }

    .site-header {
        height: 60px;
        padding: 0 20px;
    }

    .site-header a.menu-link {
        font-size: 14px;
    }

    .logo {
        font-size: 18px;
    }

    .main-menu {
        gap: 25px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 50px;
        margin-top: 25px;
    }

    .main-title {
        font-size: 42px;
        margin-bottom: 16px;
    }

    .subtitle {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 35px;
    }

    .caption {
        font-size: 10px;
    }

    .lightbox-content {
        padding-right: 20px;
        padding-left: 20px;
    }

    .lightbox-content img {
        max-height: 75vh;
        max-width: 90vw;
    }

    .lightbox-ui {
        bottom: 22px;
        left: 20px;
    }

    .ui-title {
        font-size: 28px;
        margin-bottom: 11px;
    }

    .ui-bar {
        font-size: 10px;
        gap: 15px;
        min-width: 240px;
    }

    .ui-btn {
        font-size: 10px;
    }

    .nav-group {
        gap: 15px;
        margin-left: 10px;
    }

    .nav-btn {
        font-size: 36px;
        padding: 12px;
    }

    .prev {
        left: 20px;
    }

    .next {
        right: 20px;
    }

    .info-btn {
        top: 22px;
        right: 22px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .lightbox-details {
        width: 290px;
        padding: 85px 25px 25px 25px;
        font-size: 12px;
    }

    .lightbox-details strong {
        font-size: 14px;
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    body {
        padding: 15px;
        padding-top: 60px;
    }

    .site-header {
        height: 60px;
        padding: 0 15px;
    }

    .site-header a.menu-link {
        font-size: 14px;
        font-weight: 600;
    }

    .logo {
        font-size: 18px;
    }

    .main-menu {
        gap: 20px;
    }

    .gallery {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 80px;
        width: 100%;
        margin-top: 40px;
        padding: 0 20px;
    }

    .gallery-item {
        width: 100%;
        max-width: 260px;
        align-items: center;
        text-align: center;
    }

    .main-title {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .about-title {
        margin-top: 40px; /* Better balanced */
        margin-bottom: 30px;
    }

    .subtitle {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 25px;
        text-align: left;
    }

    .language-separator {
        margin: 40px 0;
    }

    /* Lightbox adjustments for mobile */
    .lightbox-content {
        padding-right: 15px;
        padding-left: 15px;
        padding-bottom: 120px; /* Extra space for taller text UI */
        justify-content: center; /* Centering the zoomed image strictly on mobile */
    }

    .lightbox-content img {
        max-height: 60vh;
        max-width: 90vw;
    }

    .lightbox-ui {
        bottom: 15px;
        left: 15px;
        right: 15px;
    }

    .ui-title {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .ui-bar {
        font-size: 13px;
        /* Larger text for mobile */
        gap: 15px;
        min-width: auto;
        width: 100%;
        padding-top: 12px;
        display: flex;
        flex-wrap: nowrap;
        /* Keep on one line */
        align-items: center;
    }

    .ui-btn {
        font-size: 13px;
        /* Larger text for mobile */
        padding: 10px 16px;
        /* Larger touch target */
        min-height: 44px;
        /* Apple's recommended minimum */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .nav-group {
        gap: 15px;
        margin-left: auto;
        /* Push to right */
        display: flex;
        align-items: center;
    }

    #close-btn {
        margin-right: 0;
    }

    .ui-counter {
        margin-right: auto;
        /* Push nav buttons to the right */
        letter-spacing: 1px;
        font-size: 13px;
    }

    /* Navigation buttons for mobile */
    .nav-btn {
        font-size: 32px;
        padding: 10px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    /* Info panel adjustments */
    .lightbox-details {
        width: 100%;
        max-width: 280px;
        padding: 80px 20px 20px 20px;
        font-size: 12px;
    }

    .lightbox-details strong {
        font-size: 14px;
    }

    .info-btn {
        top: 20px;
        right: 20px;
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}

/* Small phones (max-width: 480px) */
@media (max-width: 480px) {
    body {
        padding: 12px;
        padding-top: 55px;
    }

    .site-header {
        height: 60px;
        padding: 0 15px;
    }

    .site-header a.menu-link {
        font-size: 14px;
        font-weight: 600;
    }

    .logo {
        font-size: 18px;
    }

    .main-menu {
        gap: 15px;
    }

    .gallery {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 60px;
        width: 100%;
        margin-top: 40px;
        padding: 0 20px;
    }

    .gallery-item {
        width: 100%;
        max-width: 240px;
        align-items: center;
        text-align: center;
    }

    .main-title {
        font-size: 28px;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 13px;
    }

    .caption {
        font-size: 10px;
    }

    /* Lightbox for small phones */
    .lightbox-content {
        padding-bottom: 160px; /* Space for stacked UI buttons + text */
        justify-content: center; /* Centering the zoomed image */
    }

    .lightbox-content img {
        max-height: 50vh;
        max-width: 95vw;
    }

    .lightbox-ui {
        bottom: 12px;
        left: 12px;
        right: 12px;
    }

    .ui-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .ui-bar {
        font-size: 12px;
        gap: 12px;
        flex-direction: column;
        /* Stack vertically on small phones */
        align-items: stretch;
        padding-top: 12px;
    }

    .ui-btn {
        font-size: 14px;
        /* Larger text */
        padding: 12px 20px;
        /* Even larger touch targets */
        min-height: 48px;
        /* Larger minimum */
        width: 100%;
        /* Full width buttons */
        text-align: center;
        font-weight: 500;
    }

    #close-btn {
        order: 3;
        /* Move close to bottom */
    }

    .ui-counter {
        order: 1;
        margin-bottom: 12px;
        text-align: center;
        font-size: 13px;
        /* Larger counter text */
    }

    .nav-group {
        order: 2;
        display: flex;
        gap: 12px;
        width: 100%;
        margin-left: 0;
    }

    .nav-group .ui-btn {
        flex: 1;
        /* Equal width for PREV and NEXT */
        font-size: 14px;
        /* Larger text */
        font-weight: 600;
    }

    .nav-btn {
        font-size: 28px;
        padding: 8px;
    }

    .prev {
        left: 5px;
    }

    .next {
        right: 5px;
    }

    .info-btn {
        top: 15px;
        right: 15px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .lightbox-details {
        max-width: 100%;
        font-size: 11px;
    }
}