:root {
    --page-padding: 22px;
    --text: #2D2D2A;
    --bg: #F9F7F4;
    --slider-aspect-ratio: calc(1500 / 1970);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.arrow {
  border: solid rgb(68, 68, 68);
  border-width: 0 2.5px 2.5px 0;
  display: inline-block;
  padding: 2.5px;
}

.izq {
  transform: rotate(135deg);
  -webkit-transform: rotate(135deg);
}

/* --- CORRECCIÓN PLANOS --- */
/* Se aplica a las imágenes dentro de figuras con la clase drawings o a imágenes con la clase drawings */
.gallery figure.drawings img,
img.drawings,
.drawings img {
    mix-blend-mode: multiply;
    filter: none; /* Elimina el filtro de la galería para que la mezcla funcione sobre el off-white */
    background-color: transparent;
}
/* ------------------------- */


/* ESTRUCTURA BASE (Móvil) */
.project-layout {
    display: flex;
    flex-direction: column;
    padding: 18px var(--page-padding) 60px;
    gap: 40px;
}

.project-info { 
    order: 2; 
    font-size: 10.5px;
    line-height: 1.22;
}

.gallery {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gallery figure { margin: 0; }
.gallery img {
    display: block;
    width: 100%;
    height: auto;
    filter: contrast(1.05) saturate(0.95); /* Este filtro se anula en los planos gracias a la corrección de arriba */
    transition: opacity 0.3s ease;
}

.gallery figure {
    margin: 0 0 0 0; /* Espaciado entre bloques imagen+texto */
}

.image-credit {
    display: flex;
    justify-content: space-between; /* Empuja un texto a la izq y otro a la der */
    font-size: 11px; /* Ajusta según el tamaño de tu fuente base */
    color: var(--text);
    margin-top: 8px; /* Espacio entre la imagen y el texto */
    line-height: 1.2;
}

/* Opcional: si quieres que el texto de la derecha sea ligeramente distinto */
.image-credit .right {
    opacity: 0.8;
}

.image-credit .left {
    opacity: 0.8;
}

.project-details p {
    margin: 0 0 20px 0;
    max-width: 240px;
    /* Propiedades para justificación controlada */
    text-align: left; 
    
    /* Esta propiedad es la que da el aspecto "profesional" */
    text-wrap: pretty; /* Evita viudas (palabras huérfanas al final) de forma inteligente */
}

h1, h2 {
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    margin: 0;
    /* Añade aquí cualquier otra propiedad de tus etiquetas p si es necesario */
}

.project-navigation{
    padding-bottom: 20px;
}

.project-navigation a {
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    display: block;
    margin-bottom: 10px;
    transition: opacity 0.3s ease; /* Transición igual al footer */
}

.footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--page-padding) calc(var(--footer-bottom) + env(safe-area-inset-bottom));
}

.footer a {
    text-decoration: none;
    color: var(--text);
}

.footer .instagram {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.footer .instagram img {
    width: 9.5px !important;  /* Tamaño estandarizado */
    height: 9.5px !important; /* Tamaño estandarizado */
    display: block;          /* Evita espacios extra debajo de la imagen */
    object-fit: contain;     /* Asegura que la imagen no se deforme */
}

.column {
  float: left;
  line-height: 0.075;
  width: 50%;
}

/* Clear floats after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
  margin-top: 10px;
}

@media (max-width: 767px){

    .project-details p {
        max-width: 100%;
    }

    .column{
        text-align: right;
        width: 40%;
    }

    .row:after{
        margin-bottom: 25px;
    }
}



/* TABLET Y ESCRITORIO */
@media (min-width: 768px) {
    .project-layout {
        flex-direction: row;
        padding: 40px var(--page-padding);
        gap: 60px;
        align-items: flex-start;
        height: auto;
    }

    .project-info {
        font-size: 11px;
        line-height: 1.28;
        order: 1;
        position: sticky;
        top: 40px;
        width: 240px;
        height: calc(100vh - 75px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        bottom: 0;
    }

    .project-navigation {
        font-size: 11px;
        margin-top: auto;      /* Empuja la flecha hacia abajo */
        margin-bottom: 80px;   /* Ajusta este valor para alinear con la imagen */
    }

    .project-navigation a:hover {
        opacity: 0.65; /* Mismo efecto hover que el footer */
    }

    .project-navigation a {
        font-size: 11px; /* Consistencia en escritorio */
    }

    .gallery {
        order: 2;
        flex: 1;
        max-width: min(760px, calc((100dvh - 220px) * var(--slider-aspect-ratio)));
        margin: 0;
    }

    .footer {
        width: 760px;
        max-width: 100%;
        align-self: flex-start;
        position: absolute;
        bottom: 0;
        left: 0;
        margin-top: 60px;
    }

    .footer a {
        text-decoration: none;
        color: var(--text);
        transition: opacity 0.3s ease;
    }

    .instagram img {
        height: .84em;
        width: auto;
    }
}

@media (min-width: 1200px) {
    :root { --page-padding: 40px; }
    .gallery { max-width: min(1080px, calc((100dvh - 220px) * var(--slider-aspect-ratio))); }
    .project-info {
        font-size: 11px;
        line-height: 1.18;
    }    
    .footer {
        width: 1080px;
        max-width: 100%;
    }
    .footer a {
        transition: opacity 0.3s ease;
        font-size: 10.8px;
        line-height: 1.10;
    }
    .footer a:hover {
        opacity: 0.65;
    }
    .instagram img {
        height: .84em;
    }
}

@media (min-width: 2560px) {
    :root { --page-padding: 60px; }
    .gallery { max-width: min(1800px, calc((100dvh - 220px) * var(--slider-aspect-ratio))); }
}