.pagina-galeria {
    background: #faf8fb;
    color: #21182a;
    line-height: 1.5;
}

.pagina-galeria #cabecera {
    position: relative;
    top: 0;
    float: none;
    background: #231930;
}

.pagina-galeria #menu-r {
    background: none;
    border: 0;
    font: inherit;
}

.pagina-galeria #menu ul.menu-abierto {
    display: block;
}

.pagina-galeria :focus-visible {
    outline: 3px solid #ab4892;
    outline-offset: 3px;
}

.galeria {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 3rem;
}

.galeria-ruta {
    margin-bottom: 1rem;
}

.galeria-ruta a {
    color: #643b86;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.galeria h1 {
    font-size: clamp(1.85rem, 5vw, 3rem);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.galeria-intro {
    max-width: 65ch;
    margin-bottom: 1.75rem;
    margin-inline: auto;
    color: #594b63;
    text-align: center;
}

.galeria-albumes,
.galeria-fotos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.galeria-albumes a,
.galeria-fotos a {
    display: block;
    overflow: hidden;
    border-radius: 0.75rem;
    color: inherit;
}

.galeria-albumes a {
    height: 100%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e7deeb;
    text-decoration: none;
}

.galeria-albumes a:hover h2 {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.galeria-albumes img,
.galeria-fotos img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    background: #e7deeb;
}

.galeria-albumes img {
    object-fit: cover;
}

.galeria-album-texto {
    padding: 1rem;
}

.galeria-album-texto h2 {
    font-size: 1.125rem;
    line-height: 1.45;
}

.galeria-album-texto p {
    margin-top: 0.45rem;
    color: #594b63;
}

.galeria-fotos img {
    object-fit: contain;
}

.galeria-visor {
    box-sizing: border-box;
    max-width: min(96vw, 1440px);
    max-height: 95vh;
    padding: 0.75rem;
    border: 0;
    border-radius: 0.75rem;
    background: #22192a;
    color: white;
}

.galeria-visor::backdrop {
    background: rgb(0 0 0 / 85%);
}

.galeria-visor-barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.galeria-estado {
    font-size: 0.875rem;
}

.galeria-visor-foto {
    position: relative;
}

.galeria-visor img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    margin: auto;
}

.galeria-cerrar {
    padding: 0.45rem 0.8rem;
    border: 0;
    border-radius: 0.3rem;
    font: inherit;
    cursor: pointer;
}

.galeria-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 60%);
    border-radius: 50%;
    background: rgb(34 25 42 / 90%);
    color: white;
    font-size: 1.875rem;
    line-height: 1;
    cursor: pointer;
}

.galeria-flecha:hover {
    background: #4c355a;
}

.galeria-anterior {
    left: 0.5rem;
}

.galeria-siguiente {
    right: 0.5rem;
}

@media (max-width: 800px) {
    .galeria-albumes,
    .galeria-fotos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .galeria-albumes {
        grid-template-columns: 1fr;
    }

    .galeria-fotos {
        gap: 0.65rem;
    }
}
