/* =========================================
   GALERÍAS — JORGE P. CARCEDO
   ========================================= */

.galeria {
    width: min(1240px, 92%);
    margin: 0 auto;
    padding: 48px 0 70px;
    color: #302b26;
}

.cabecera-galeria {
    position: relative;
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(91, 77, 62, .18);
}

.volver {
    position: absolute;
    top: 5px;
    left: 0;
    color: #76695c;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    text-decoration: none;
}

.volver:hover {
    color: #29231e;
}

.apellido-galeria {
    margin: 0 0 12px;
    color: #887967;
    font-family: "DM Sans", sans-serif;
    font-size: 19px;
    letter-spacing: .24em;
}

.cabecera-galeria h1 {
    margin: 0;
    color: #302820;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(38px, 5vw, 54px);
    font-weight: 400;
    letter-spacing: -.025em;
}

.subtitulo-galeria {
    margin: 12px 0 0;
    color: #817568;
    font-family: "DM Sans", sans-serif;
    font-size: 21px;
    letter-spacing: .035em;
}

/* LITERATURA */

.rejilla-libros {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px 32px;
    align-items: start;
}

.tarjeta-libro {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    text-align: center;
}

.portada-libro {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 330px;
    padding: 12px;
    background: rgba(255, 255, 255, .48);
    box-sizing: border-box;
    transition: background .25s, transform .25s;
}

.portada-libro img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 5px 16px rgba(48, 39, 29, .13);
}

.tarjeta-libro:hover .portada-libro {
    background: rgba(255, 255, 255, .8);
    transform: translateY(-4px);
}

.tarjeta-libro h2 {
    margin: 17px 0 0;
    color: #55483b;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.35;
}

/* PINTURA */

.rejilla-obras {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 42px 28px;
    align-items: start;
}

.tarjeta-obra {
    display: block;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    text-align: center;
}

.imagen-obra {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 310px;
    padding: 14px;
    background: rgba(255, 255, 255, .38);
    box-sizing: border-box;
    transition: background .25s, transform .25s;
}

.imagen-obra img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    box-shadow: 0 4px 15px rgba(48, 39, 29, .10);
}

.tarjeta-obra:hover .imagen-obra {
    background: rgba(255, 255, 255, .72);
    transform: translateY(-3px);
}

.tarjeta-obra h2 {
    margin: 16px 0 0;
    color: #55483b;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.35;
}

/* PIE */

.pie-galeria {
    margin-top: 65px;
    padding-top: 20px;
    border-top: 1px solid rgba(91, 77, 62, .18);
    text-align: center;
}

.pie-galeria a {
    color: #887967;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    letter-spacing: .22em;
    text-decoration: none;
}

/* FICHAS INDIVIDUALES */

.ficha {
    width: min(1050px, 92%);
    margin: 0 auto;
    padding: 50px 0 70px;
}

.ficha-contenido {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: 55px;
    align-items: start;
}

.ficha-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 18px;
    background: rgba(255, 255, 255, .48);
}

.ficha-imagen img {
    display: block;
    max-width: 100%;
    max-height: 650px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.ficha-texto h1 {
    margin: 0 0 25px;
    color: #302820;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 400;
}

.ficha-texto p {
    margin: 0 0 14px;
    color: #62574c;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    line-height: 1.8;
}

.ficha-compra {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 22px;
    border: 1px solid #796957;
    color: #55483b;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.ficha-compra:hover {
    background: #55483b;
    color: #fff;
}

.ficha-volver {
    display: inline-block;
    margin-top: 35px;
    color: #817568;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    text-decoration: none;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .rejilla-libros {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 38px 22px;
    }

    .rejilla-obras {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portada-libro {
        height: 290px;
    }
}

@media (max-width: 600px) {
    .galeria {
        width: 92%;
        padding-top: 35px;
    }

    .cabecera-galeria {
        margin-bottom: 32px;
        padding-top: 35px;
    }

    .volver {
        top: 0;
    }

    .rejilla-libros,
    .rejilla-obras {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 30px 14px;
    }

    .portada-libro {
        height: 225px;
        padding: 7px;
    }

    .imagen-obra {
        height: 210px;
        padding: 7px;
    }

    .tarjeta-libro h2,
    .tarjeta-obra h2 {
        font-size: 16px;
    }

    .ficha-contenido {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
/* FICHA LITERARIA */

.detalle {
    width: min(1050px, 92%);
    margin: 0 auto;
    padding: 50px 0 70px;
}

.detalle-contenido {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: 55px;
    align-items: start;
    margin-top: 35px;
}

.detalle-imagen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    padding: 18px;
    background: rgba(255, 255, 255, .48);
}

.detalle-imagen img {
    display: block;
    max-width: 100%;
    max-height: 650px;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 5px 16px rgba(48, 39, 29, .13);
}

.detalle-texto h1 {
    margin: 15px 0 8px;
    color: #302820;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 400;
}

.subtitulo-libro {
    margin: 0 0 28px;
    color: #887967;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 20px;
    font-style: italic;
}

.dato-ficha {
    color: #62574c;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    line-height: 1.8;
}

.descripcion-detalle {
    margin-top: 30px;
}

.descripcion-detalle h2 {
    color: #55483b;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 400;
}

.descripcion-detalle p {
    color: #62574c;
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    line-height: 1.8;
}

.enlace-compra {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 22px;
    border: 1px solid #796957;
    color: #55483b;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    text-decoration: none;
}

.enlace-compra:hover {
    background: #55483b;
    color: #fff;
}

@media (max-width: 600px) {
    .detalle-contenido {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
.subtitulo-libro-tarjeta {
    margin: 6px 0 0;
    color: #887967;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
}
/* =========================================
   FICHAS AMPLIADAS: PINTURA Y LITERATURA
   ========================================= */

/* PINTURA: mayor superficie de exposición */

.detalle-obra {
    width: min(1320px, 94%);
}

.detalle-obra .detalle-contenido {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
    gap: 55px;
}

.detalle-obra .detalle-imagen {
    min-height: 72vh;
    padding: 18px;
}

.detalle-obra .detalle-imagen img {
    width: 100%;
    height: 72vh;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    object-position: center;
}

/* LITERATURA: fichas individuales ampliadas */

.detalle:not(.detalle-obra) {
    width: min(1500px, 96%);
}

.detalle:not(.detalle-obra) .detalle-contenido {
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, .85fr);
    gap: 45px;
}

.detalle:not(.detalle-obra) .detalle-imagen {
    min-height: 82vh;
    padding: 18px;
}

.detalle:not(.detalle-obra) .detalle-imagen img {
    display: block;
    width: 100%;
    height: 82vh;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
}

/* ADAPTACIÓN A PANTALLAS PEQUEÑAS */

@media (max-width: 600px) {
    .detalle-obra .detalle-imagen,
    .detalle:not(.detalle-obra) .detalle-imagen {
        min-height: 0;
    }

    .detalle-obra .detalle-imagen img {
        height: auto;
        max-height: 75vh;
    }

    .detalle:not(.detalle-obra) .detalle-imagen img {
        max-height: 75vh;
    }
}
