/* =====================================================
   UDOMIPYME
   GALERÍA
   ===================================================== */


/* ================= VARIABLES ================= */

:root {

    --navy: #23255E;
    --navy-dark: #171943;

    --cyan: #01A9D6;
    --cyan-light: #59D4F2;

    --mist: #F1F3F5;
    --white: #FFFFFF;

    --gray: #6D7180;
    --dark: #191B25;

}


/* ================= GENERAL ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

    font-family: "Inter", sans-serif;

    color: var(--dark);

    background: var(--white);

    line-height: 1.6;
}

img,
video {
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}


/* ================= HEADER ================= */

.gallery-header {

    position: relative;

    width: 100%;

    background: var(--navy);

    border-bottom: 1px solid rgba(255,255,255,.12);
}

.gallery-nav {

    width: min(1200px, 92%);

    margin: auto;

    min-height: 82px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;
}


/* LOGO */

.gallery-logo {

    display: flex;

    align-items: center;

    gap: 12px;

    color: white;
}

.logo-mark {

    width: 42px;
    height: 42px;

    display: grid;

    place-items: center;

    border: 2px solid var(--cyan);

    color: var(--cyan);

    font-family: "Fraunces", serif;

    font-size: 22px;

    font-weight: 700;
}

.logo-text {

    display: flex;

    flex-direction: column;

    font-size: 17px;

    font-weight: 800;

    letter-spacing: .04em;
}

.logo-text small {

    margin-top: 2px;

    color: rgba(255,255,255,.55);

    font-size: 8px;

    letter-spacing: .08em;

    font-weight: 500;
}


/* BACK BUTTON */

.back-button {

    border: 1px solid rgba(255,255,255,.3);

    color: white;

    padding: 10px 18px;

    border-radius: 5px;

    font-size: 13px;

    font-weight: 600;

    transition: .25s ease;
}

.back-button:hover {

    background: var(--cyan);

    border-color: var(--cyan);

    color: var(--navy-dark);
}


/* ================= HERO ================= */

.gallery-hero {

    background: var(--navy);

    color: white;

    padding: 110px 8% 130px;

    position: relative;

    overflow: hidden;
}

.gallery-hero::after {

    content: "";

    position: absolute;

    width: 450px;
    height: 450px;

    border: 1px solid rgba(1,169,214,.18);

    border-radius: 50%;

    right: -130px;

    top: -160px;
}

.hero-line {

    width: 55px;

    height: 3px;

    background: var(--cyan);

    margin-bottom: 25px;
}

.gallery-eyebrow {

    font-family: "IBM Plex Mono", monospace;

    color: var(--cyan-light);

    font-size: 11px;

    letter-spacing: .15em;

    font-weight: 600;
}

.gallery-hero h1 {

    max-width: 850px;

    margin-top: 18px;

    font-family: "Fraunces", serif;

    font-size: clamp(48px, 7vw, 88px);

    line-height: .98;

    font-weight: 500;

    letter-spacing: -.04em;
}

.gallery-hero h1 em {

    color: var(--cyan);

    font-style: normal;
}

.gallery-hero p {

    max-width: 650px;

    margin-top: 30px;

    color: rgba(255,255,255,.7);

    font-size: 16px;
}


/* ================= CONTAINER ================= */

.gallery-container {
    width: 100%;
    margin: 0;
    padding: 100px 0 120px;
}


/* INTRO */

.gallery-intro {
    width: min(1200px, 90%);
    margin: 0 auto 55px;

    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 80px;

    align-items: end;
}

.section-number {

    font-family: "IBM Plex Mono", monospace;

    font-size: 12px;

    color: var(--cyan);

    letter-spacing: .15em;
}

.gallery-intro h2 {

    margin-top: 12px;

    font-family: "Fraunces", serif;

    font-size: clamp(38px, 5vw, 60px);

    line-height: 1;

    color: var(--navy);

    font-weight: 500;
}

.gallery-intro p {

    max-width: 480px;

    color: var(--gray);

    font-size: 15px;

    border-left: 2px solid var(--cyan);

    padding-left: 25px;
}


/* ================= GALLERY GRID ================= */

.gallery-grid {
    width: 100%;

    display: grid;

    grid-template-columns: repeat(12, 1fr);

    grid-auto-rows: 300px;

    gap: 5px;
}


/* ITEMS */

.gallery-item {

    position: relative;

    overflow: hidden;

    background: #ddd;

    border-radius: 3px;
}

.gallery-item:not(.video-item) {
    cursor: zoom-in;
}

.gallery-item:not(.video-item):focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: -3px;
}

.gallery-item img {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform .6s cubic-bezier(.2,.7,.2,1),
        filter .5s ease;
}

.gallery-item:hover img {

    transform: scale(1.06);

    filter: brightness(.65);
}


/* ================= POSITIONS ================= */

.gallery-item:nth-child(1) {

    grid-column: span 7;

    grid-row: span 2;
}

.gallery-item:nth-child(2) {

    grid-column: span 5;

    grid-row: span 1;
}

.gallery-item:nth-child(3) {

    grid-column: span 5;

    grid-row: span 2;
}

.gallery-item:nth-child(4) {

    grid-column: span 7;

    grid-row: span 1;
}

.gallery-item:nth-child(5) {

    grid-column: span 4;

    grid-row: span 2;
}

.gallery-item:nth-child(6) {

    grid-column: span 4;

    grid-row: span 1;
}

.gallery-item:nth-child(7) {

    grid-column: span 4;

    grid-row: span 1;
}

.gallery-item:nth-child(8) {

    grid-column: span 8;

    grid-row: span 1;
}


/* ================= IMAGE OVERLAY ================= */

.image-overlay {

    position: absolute;

    inset: 0;

    padding: 25px;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    background:
        linear-gradient(
            transparent 35%,
            rgba(15,17,30,.85)
        );

    color: white;

    opacity: 0;

    transition: opacity .35s ease;
}

.gallery-item:hover .image-overlay {

    opacity: 1;
}

.image-overlay span {

    font-family: "IBM Plex Mono", monospace;

    font-size: 9px;

    letter-spacing: .13em;

    color: var(--cyan-light);

    margin-bottom: 7px;
}

.image-overlay h3 {

    font-family: "Fraunces", serif;

    font-size: 25px;

    font-weight: 500;
}


/* ================= VIDEO ================= */

.video-item {

    background: var(--navy);
}

.video-item video {

    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.video-label {

    position: absolute;

    pointer-events: none;

    left: 20px;

    bottom: 20px;

    color: white;

    background: rgba(35,37,94,.9);

    padding: 12px 16px;

    border-left: 3px solid var(--cyan);
}

.video-label span {

    font-family: "IBM Plex Mono", monospace;

    font-size: 9px;

    color: var(--cyan-light);

    letter-spacing: .12em;
}

.video-label h3 {

    margin-top: 3px;

    font-family: "Fraunces", serif;

    font-size: 20px;

    font-weight: 500;
}


/* ================= CTA ================= */

.gallery-cta {

    background: var(--navy);

    color: white;

    padding: 100px 8%;

    display: grid;

    grid-template-columns: 120px 1fr;

    gap: 40px;

    position: relative;

    overflow: hidden;
}

.gallery-cta::before {

    content: "";

    position: absolute;

    width: 500px;
    height: 500px;

    border: 1px solid rgba(1,169,214,.15);

    border-radius: 50%;

    right: -150px;

    bottom: -250px;
}

.cta-number {

    font-family: "IBM Plex Mono", monospace;

    color: var(--cyan);

    font-size: 12px;

    letter-spacing: .12em;
}

.cta-content {

    max-width: 700px;
}

.cta-content > span {

    font-family: "IBM Plex Mono", monospace;

    font-size: 10px;

    letter-spacing: .16em;

    color: var(--cyan-light);
}

.cta-content h2 {

    margin-top: 15px;

    font-family: "Fraunces", serif;

    font-size: clamp(45px, 6vw, 70px);

    line-height: 1;

    font-weight: 500;
}

.cta-content h2 em {

    color: var(--cyan);

    font-style: normal;
}

.cta-content p {

    margin-top: 25px;

    color: rgba(255,255,255,.65);

    max-width: 520px;
}


/* CTA BUTTON */

.cta-button {

    display: inline-flex;

    align-items: center;

    gap: 20px;

    margin-top: 35px;

    padding: 13px 20px;

    border: 1px solid var(--cyan);

    color: white;

    font-size: 13px;

    font-weight: 700;

    transition: .25s ease;
}

.cta-button span {

    font-size: 18px;

    color: var(--cyan);
}

.cta-button:hover {

    background: var(--cyan);

    color: var(--navy);
}

.cta-button:hover span {

    color: var(--navy);
}


/* ================= FOOTER ================= */

.gallery-footer {

    background: #12142f;

    color: rgba(255,255,255,.5);

    padding: 25px 8%;

    display: flex;

    justify-content: space-between;

    font-size: 11px;

    letter-spacing: .04em;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 850px) {

    .gallery-intro {

        grid-template-columns: 1fr;

        gap: 25px;
    }

    .gallery-grid {

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

        grid-auto-rows: 240px;
    }

    .gallery-item:nth-child(n) {

        grid-column: span 1;

        grid-row: span 1;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(8) {

        grid-column: span 2;
    }

    .gallery-cta {

        grid-template-columns: 1fr;

        gap: 15px;
    }

}


@media (max-width: 600px) {

    .gallery-nav {

        min-height: 70px;
    }

    .logo-text small {

        display: none;
    }

    .back-button {

        padding: 8px 12px;

        font-size: 11px;
    }

    .gallery-hero {

        padding: 80px 7% 90px;
    }

    .gallery-container {

        padding: 70px 0 80px;
    }

    .gallery-grid {

        display: flex;

        flex-direction: column;
    }

    .gallery-item {

        height: 280px;
    }

    .gallery-item:nth-child(1) {

        height: 380px;
    }

    .gallery-cta {

        padding: 80px 7%;
    }

    .gallery-footer {

        flex-direction: column;

        gap: 8px;

        text-align: center;
    }

}

.gallery-item:nth-child(9),
.gallery-item:nth-child(11),
.gallery-item:nth-child(13),
.gallery-item:nth-child(14),
.gallery-item:nth-child(17),
.gallery-item:nth-child(18),
.gallery-item:nth-child(19) {
    grid-column: span 4;
    grid-row: span 2;
}

.gallery-item:nth-child(10),
.gallery-item:nth-child(12),
.gallery-item:nth-child(15),
.gallery-item:nth-child(16) {
    grid-column: span 8;
    grid-row: span 2;
}

.gallery-item:nth-child(20) {
    grid-column: span 4;
    grid-row: span 1;
}

.gallery-item:nth-child(21) {
    grid-column: span 8;
    grid-row: span 1;
}

.gallery-item:nth-child(22) {
    grid-column: span 12;
    grid-row: span 2;
}

/* ================= VISOR DE FOTOGRAFÍAS ================= */

body.lightbox-open { overflow: hidden; }

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: minmax(52px, 1fr) minmax(0, 12fr) minmax(52px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 70px 24px 28px;
    background: rgba(8, 9, 25, .94);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.gallery-lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-content {
    display: flex;
    min-width: 0;
    max-height: calc(100vh - 98px);
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.lightbox-content figcaption {
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .08);
    color: var(--white);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: var(--cyan); border-color: var(--cyan); color: var(--navy-dark); }

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.lightbox-nav {
    width: 48px;
    height: 48px;
    justify-self: center;
    border-radius: 50%;
    font-size: 22px;
}

@media (max-width: 850px) {
    .gallery-item:nth-child(n) { grid-column: span 1; grid-row: span 1; }
    .gallery-item:nth-child(1),
    .gallery-item:nth-child(8),
    .gallery-item:nth-child(10),
    .gallery-item:nth-child(12),
    .gallery-item:nth-child(15),
    .gallery-item:nth-child(16),
    .gallery-item:nth-child(21),
    .gallery-item:nth-child(22) { grid-column: span 2; }
}

@media (max-width: 600px) {
    .gallery-lightbox { grid-template-columns: 1fr 1fr; align-content: center; padding: 66px 16px 18px; }
    .lightbox-content { grid-column: 1 / -1; grid-row: 1; }
    .lightbox-prev { grid-column: 1; grid-row: 2; justify-self: end; }
    .lightbox-next { grid-column: 2; grid-row: 2; justify-self: start; }
    .lightbox-content img { max-height: calc(100vh - 180px); }
}

/* Encabezado blanco y logo enlazado al inicio. */
.gallery-header { background: var(--white); border-bottom: 1px solid #D9DFEA; }
.gallery-logo { line-height: 0; }
.gallery-logo img { display: block; width: 210px; height: auto; }
