* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    color: #171717;
    background-color: #f7f7f5;

    font-family: "Inclusive Sans", sans-serif;
    font-weight: 300;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

.project-page {
    position: relative;

    min-height: 100vh;

    padding: 170px 0 150px;
}

/* ==========================================
   PUNTOS DECORATIVOS
========================================== */

.decorative-dot {
    position: absolute;
    z-index: 5;

    width: 15px;
    height: 15px;

    border-radius: 50%;

    background-color: #cbc7be;
}

.dot-top-left {
    top: 32px;
    left: 28px;
}

.dot-top-center {
    top: 32px;
    left: 50%;

    transform: translateX(-50%);
}

.dot-top-right {
    top: 32px;
    right: 28px;
}

.dot-left-one {
    top: 34%;
    left: 28px;
}

.dot-right-one {
    top: 34%;
    right: 28px;
}

.dot-left-two {
    top: 63%;
    left: 28px;
}

.dot-right-two {
    top: 63%;
    right: 28px;
}

.dot-left-three {
    bottom: 45px;
    left: 28px;
}

.dot-right-three {
    right: 28px;
    bottom: 45px;
}

/* ==========================================
   FLECHA
========================================== */

.back-button {
    position: absolute;
    top: 70px;
    left: 62px;
    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    font-family: "Inclusive Sans", sans-serif;
    font-size: 48px;
    font-weight: 300;
    line-height: 1;

    transition: transform 0.25s ease;
}

.back-button:hover {
    transform: translateX(-5px);
}

/* ==========================================
   MENÚ PRINCIPAL
========================================== */

.main-menu {
    position: absolute;
    top: 62px;
    right: 68px;
    z-index: 10;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    line-height: 0.95;
}

.main-menu a {
    font-family: "Inclusive Sans", sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 1.05;

    transition: opacity 0.2s ease;
}

.main-menu a:hover {
    opacity: 0.55;
}

.main-menu a.active {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ==========================================
   INTRODUCCIÓN
========================================== */

.project-introduction {
    width: min(970px, 78%);

    margin: 45px auto 110px;

    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(340px, 470px);

    justify-content: space-between;
    align-items: start;

    column-gap: clamp(65px, 9vw, 150px);
}

.project-title h1 {
    margin: 0;

    font-family: "Cormorant Garamond", serif;
    font-size: clamp(72px, 7vw, 105px);
    font-weight: 600;
    line-height: 0.82;
    letter-spacing: -0.04em;
}

.project-description {
    padding-top: 8px;
}

.project-description p {
    margin: 0 0 22px;

    font-family: "Cormorant Garamond", serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.28;
}

.project-description p:last-child {
    margin-bottom: 0;
}

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

.photo-gallery {
    width: min(970px, 78%);

    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 413px));

    justify-content: space-between;

    column-gap: clamp(60px, 9vw, 145px);
    row-gap: 66px;
}

.photo-item {
    position: relative;

    width: 100%;
    aspect-ratio: 413 / 580;

    margin: 0;

    overflow: hidden;

    background-color: #c6c6c6;

    cursor: pointer;
}

.photo-item img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.5s ease,
        opacity 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.025);
}

.photo-item:focus-within {
    outline: 1px solid #171717;
    outline-offset: 5px;
}

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

.site-footer {
    width: min(1250px, calc(100% - 80px));

    margin: 140px auto 0;
    padding: 38px 0 70px;

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

    align-items: start;

    border-top: 1px solid rgba(23, 23, 23, 0.22);
}


/* MARCA + INSTAGRAM */

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 65px;
}

.footer-brand,
.footer-menu,
.footer-contact {
    font-family: "Cormorant Garamond", serif;
    font-size: 18px;
    font-weight: 400;
}


/* MENÚ CENTRAL */

.footer-menu {
    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 22px;

    justify-self: center;
}


/* CONTACTO */

.footer-contact {
    justify-self: end;
}


/* HOVER */

.footer-brand a,
.footer-menu a,
.footer-contact a {
    transition: opacity 0.3s ease;
}

.footer-brand a:hover,
.footer-menu a:hover,
.footer-contact a:hover {
    opacity: 0.55;
}

/* ==========================================
   VISOR EDITORIAL
========================================== */

body.viewer-open {
    overflow: hidden;
}

.gallery-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;

    width: 100%;
    height: 100vh;

    overflow: hidden;

    color: #171717;
    background-color: #f7f7f5;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.gallery-viewer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Puntos del visor */

.viewer-dot {
    position: fixed;
    z-index: 2002;

    width: 15px;
    height: 15px;

    border-radius: 50%;

    background-color: #cbc7be;
}

.viewer-dot-top-left {
    top: 32px;
    left: 28px;
}

.viewer-dot-top-center {
    top: 32px;
    left: 50%;

    transform: translateX(-50%);
}

.viewer-dot-top-right {
    top: 32px;
    right: 28px;
}

.viewer-dot-left-center {
    top: 57%;
    left: 28px;
}

.viewer-dot-right-center {
    top: 57%;
    right: 28px;
}

.viewer-dot-bottom-left {
    bottom: 28px;
    left: 28px;
}

.viewer-dot-bottom-right {
    right: 28px;
    bottom: 28px;
}

/* Flecha del visor */

.viewer-back {
    position: fixed;
    top: 68px;
    left: 62px;
    z-index: 2003;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;
    border: 0;

    color: #171717;
    background: transparent;

    font-family: "Inclusive Sans", sans-serif;
    font-size: 48px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    transition: transform 0.25s ease;
}

.viewer-back:hover {
    transform: translateX(-5px);
}

/* Menú del visor */

.viewer-menu {
    position: fixed;
    top: 62px;
    right: 68px;
    z-index: 2003;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    line-height: 0.95;
}

.viewer-menu a {
    font-family: "Inclusive Sans", sans-serif;
    font-size: 20px;
    font-weight: 300;
    line-height: 1.05;
}

.viewer-menu a:hover {
    opacity: 0.55;
}

.viewer-menu a.active {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Distribución del visor */

.viewer-layout {
    width: min(1110px, 78%);
    height: 100vh;

    margin: 0 auto;
    padding: 125px 0 62px;

    display: grid;
    grid-template-columns:
        minmax(330px, 540px)
        minmax(200px, 300px);

    justify-content: center;
    align-items: center;

    column-gap: clamp(95px, 10vw, 175px);
}

/* Fotografía principal */

.viewer-current {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.viewer-main-image {
    display: block;

    width: 100%;
    max-height: 72vh;

    object-fit: contain;

    opacity: 0;
    transform: translateY(12px);

    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
}

.gallery-viewer.is-open .viewer-main-image {
    opacity: 1;
    transform: translateY(0);
}

/* Contador */

.viewer-counter {
    margin: 22px 0 0;

    color: #383838;

    font-family: "Cormorant Garamond", serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* Vista de la siguiente imagen */

.viewer-preview {
    width: 100%;

    align-self: center;
}

.viewer-next-label {
    margin: 0 0 13px;

    color: #55514c;

    font-family: "Cormorant Garamond", serif;
    font-size: 18px;
    font-weight: 500;
}

.viewer-next {
    display: block;

    width: 100%;

    padding: 0;
    border: 0;

    background: transparent;

    cursor: pointer;

    opacity: 0;
    transform: translateX(18px);

    transition:
        opacity 0.4s ease 0.1s,
        transform 0.4s ease 0.1s;
}

.gallery-viewer.is-open .viewer-next {
    opacity: 1;
    transform: translateX(0);
}

.viewer-next img {
    display: block;

    width: 100%;
    max-height: 49vh;

    object-fit: contain;

    transition: opacity 0.25s ease;
}

.viewer-next:hover img {
    opacity: 0.72;
}

/* Botón X */

.viewer-close {
    position: fixed;
    right: 66px;
    bottom: 45px;
    z-index: 2003;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;
    border: 0;

    color: #171717;
    background: transparent;

    font-family: "Inclusive Sans", sans-serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;

    transition: transform 0.25s ease;
}

.viewer-close:hover {
    transform: rotate(90deg);
}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 1000px) {

    .project-introduction,
    .photo-gallery {
        width: 82%;
    }

    .project-introduction {
        grid-template-columns: minmax(230px, 340px) 1fr;

        column-gap: 60px;
    }

    .project-title h1 {
        font-size: 72px;
    }

    .photo-gallery {
        column-gap: 55px;
    }

    .viewer-layout {
        width: 76%;

        grid-template-columns: minmax(290px, 1fr) 210px;

        column-gap: 55px;
    }

}

/* ==========================================
   MÓVIL
========================================== */

@media (max-width: 720px) {

    .project-page {
        padding: 145px 0 100px;
    }

    .back-button {
        top: 55px;
        left: 28px;

        font-size: 40px;
    }

    .main-menu {
        top: 50px;
        right: 28px;
    }

    .main-menu a {
        font-size: 16px;
    }

    .project-introduction {
        width: 76%;

        margin: 50px auto 75px;

        display: block;
    }

    .project-title {
        margin-bottom: 45px;
    }

    .project-title h1 {
        font-size: 66px;
    }

    .project-description p {
        font-size: 18px;
    }

    .photo-gallery {
        width: 76%;

        display: flex;
        flex-direction: column;

        gap: 45px;
    }

    .photo-center {
        width: 100%;
    }

    .site-footer {
        width: calc(100% - 55px);

        margin-top: 95px;

        grid-template-columns: 1fr 1fr;

        row-gap: 30px;
    }

    .footer-menu {
        display: none;
    }

    .footer-contact {
        justify-self: end;
    }

    /* Visor móvil */

    .viewer-menu {
        top: 48px;
        right: 28px;
    }

    .viewer-menu a {
        font-size: 16px;
    }

    .viewer-back {
        top: 52px;
        left: 26px;

        font-size: 40px;
    }

    .viewer-layout {
        width: 72%;
        height: 100vh;

        padding: 145px 0 78px;

        display: flex;
        flex-direction: column;
        justify-content: center;

        gap: 35px;

        overflow-y: auto;
    }

    .viewer-current {
        align-items: center;
    }

    .viewer-main-image {
        max-height: 55vh;
    }

    .viewer-counter {
        align-self: flex-end;
    }

    .viewer-preview {
        width: min(180px, 58%);

        align-self: flex-end;
    }

    .viewer-next-label {
        font-size: 16px;
    }

    .viewer-next img {
        max-height: 24vh;
    }

    .viewer-close {
        right: 26px;
        bottom: 25px;
    }

}

/* ==========================================
   PANTALLAS MUY PEQUEÑAS
========================================== */

@media (max-width: 420px) {

    .main-menu a,
    .viewer-menu a {
        font-size: 14px;
    }

    .project-title h1 {
        font-size: 54px;
    }

    .project-description p {
        font-size: 16px;
    }

    .viewer-layout {
        width: 70%;
    }

    .viewer-preview {
        width: 130px;
    }

}