/* Galería: estilos acotados a esta página y a su modal. */
.pen-gallery { --gallery-blue: #011e41; color: #111; background: #fff; font-family: var(--font-ui); }
.pen-gallery [hidden], .pen-gallery-modal [hidden] { display: none !important; }
.pen-gallery__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pen-gallery__hero { position: relative; min-height: min(760px, 76svh); display: flex; align-items: center; isolation: isolate; overflow: hidden; }
.pen-gallery__hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; z-index: -2; }
.pen-gallery__hero::after { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / 60%); z-index: -1; }
.pen-gallery__hero-inner { width: min(calc(100% - 40px), 1170px); margin: auto; padding: 72px 0; color: #fff; }
.pen-gallery__eyebrow { display: flex; align-items: center; gap: 18px; margin: 0 0 28px; font-size: clamp(14px, 1.4vw, 20px); font-weight: 600; }
.pen-gallery__eyebrow::before { content: ''; width: 56px; height: 2px; background: currentColor; flex-shrink: 0; }
.pen-gallery__hero h1 { margin: 0; font: 400 clamp(38px, 5.2vw, 86px)/1.05 var(--font-display); letter-spacing: -.025em; }
.pen-gallery__collection { padding: 70px 0 80px; }
.pen-gallery__intro { width: min(calc(100% - 40px), 1170px); margin: 0 auto 30px; display: grid; grid-template-columns: 1.6fr 1fr; align-items: end; gap: 70px; }
.pen-gallery__description h2 { margin: 0 0 20px; font-size: 30px; font-weight: 600; line-height: 1.2; }
.pen-gallery__description p { margin: 0; font-size: 20px; line-height: 1.4; }
.pen-gallery__filter { position: relative; z-index: 3; min-width: 0; }
.pen-gallery__select { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 16px 22px; border: 1px solid #111; border-radius: 8px; color: #5b5b5b; background: #fff; text-align: left; font: 400 16px/1.3 var(--font-ui); cursor: pointer; }
.pen-gallery__select svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--gallery-blue); stroke-width: 2; transition: transform .25s ease; }
.pen-gallery__select[aria-expanded="true"] svg { transform: rotate(180deg); }
.pen-gallery__options { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: grid; gap: 5px; padding: 18px 14px; max-height: min(550px, 65svh); overflow-y: auto; overscroll-behavior: contain; border-radius: 12px; background: #fff; box-shadow: 0 12px 28px rgb(0 0 0 / 12%); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .22s ease, transform .22s ease, visibility 0s .22s; }
.pen-gallery__filter.is-open .pen-gallery__options { transition-delay: 0s; opacity: 1; visibility: visible; transform: translateY(0); }
.pen-gallery__options button { padding: 14px 20px; min-height: 48px; border: 0; border-radius: 12px; text-align: left; font: 400 20px/1.2 var(--font-ui); color: #595959; background: #f4f4f4; cursor: pointer; transition: color .2s, background .2s; }
.pen-gallery__options button:is(:hover, :focus-visible, [aria-selected="true"]) { background: #011e41; color: #fff; }
.pen-gallery__reset { display: block; margin: 12px 0 0 auto; border: 0; background: transparent; color: var(--gallery-blue); text-decoration: underline; font: inherit; cursor: pointer; }
.pen-gallery__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 3px; padding: 0 6px; }
.pen-gallery__card { position: relative; display: block; width: 100%; aspect-ratio: 1.17; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: #122938; cursor: pointer; isolation: isolate; }
.pen-gallery__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.22, 1, .36, 1); }
/* Marco común un 10% menor; compensación óptica del área y márgenes de cada SVG. */
.pen-gallery__logo { position: absolute; z-index: 2; inset: 0; margin: auto; width: 64.8%; height: 37.8%; object-fit: contain; transform: translate(var(--gallery-logo-x, 0%), var(--gallery-logo-y, 0%)) scale(var(--gallery-logo-scale, 1)); filter: brightness(0) invert(1); pointer-events: none; }
.pen-gallery__card[data-gallery-open="amancay"] { --gallery-logo-scale: 1.0000; --gallery-logo-x: -0.417%; --gallery-logo-y: 0.659%; }
.pen-gallery__card[data-gallery-open="brelia"] { --gallery-logo-scale: 0.7758; --gallery-logo-x: -0.000%; --gallery-logo-y: 0.359%; }
.pen-gallery__card[data-gallery-open="bolongo"] { --gallery-logo-scale: 0.9801; --gallery-logo-x: 0.184%; --gallery-logo-y: 0.036%; }
.pen-gallery__card[data-gallery-open="cima-park"] { --gallery-logo-scale: 0.8338; --gallery-logo-x: 0.342%; --gallery-logo-y: -1.356%; }
.pen-gallery__card[data-gallery-open="duet"] { --gallery-logo-scale: 0.8202; --gallery-logo-x: -1.366%; --gallery-logo-y: 0.687%; }
.pen-gallery__card[data-gallery-open="hacienda-san-pancho"],
.pen-gallery__card[data-gallery-open="peninsula-acapulco"] { --gallery-logo-scale: 0.9823; --gallery-logo-x: -0.402%; --gallery-logo-y: 0.803%; }
.pen-gallery__card[data-gallery-open="heredit"] { --gallery-logo-scale: 0.8115; --gallery-logo-x: 0.000%; --gallery-logo-y: 0.000%; }
.pen-gallery__card[data-gallery-open="limu"] { --gallery-logo-scale: 0.7968; --gallery-logo-x: 0.001%; --gallery-logo-y: -3.333%; }
.pen-gallery__card[data-gallery-open="mare"] { --gallery-logo-scale: 0.9310; --gallery-logo-x: 0.000%; --gallery-logo-y: 0.528%; }
.pen-gallery__card[data-gallery-open="maroa"] { --gallery-logo-scale: 0.9918; --gallery-logo-x: 0.001%; --gallery-logo-y: -0.827%; }
@media (hover: hover) { .pen-gallery__card:hover .pen-gallery__cover { transform: scale(1.3); } }
.pen-gallery__card:focus-visible { outline: 3px solid #a36e29; outline-offset: -3px; }
.pen-gallery__card:focus-visible .pen-gallery__cover { transform: scale(1.3); }
.pen-gallery__empty { padding: 40px 20px; margin: 0; text-align: center; font-size: 18px; color: #595959; }
.pen-gallery-modal { position: fixed; inset: 0; margin: auto; width: min(1440px, calc(100vw - 32px), calc((100dvh - 32px) * 16 / 9)); max-width: none; max-height: calc(100dvh - 32px); height: auto; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 28px; overflow: hidden; background: #07121c; color: #011e41; font-family: var(--font-ui); opacity: 0; transform: translateY(12px) scale(.6895); transition: opacity .25s ease, transform .25s ease; }
.pen-gallery-modal.is-open { opacity: 1; transform: translateY(0) scale(.7); }
.pen-gallery-modal::backdrop { background: rgb(0 0 0 / 70%); }
.pen-gallery-modal__photos, .pen-gallery-modal__unavailable { position: absolute; inset: 0; transition: opacity .3s ease, visibility .3s; }
.pen-gallery-modal__photos { touch-action: pan-y pinch-zoom; }
.pen-gallery-modal__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s ease; }
.pen-gallery-modal__image.is-visible { opacity: 1; }
.pen-gallery-modal__unavailable { opacity: 0; visibility: hidden; background: #eee url('../img/galeria/recorrido-no-disponible.png') left top / auto 200% no-repeat; }
.pen-gallery-modal.is-tour .pen-gallery-modal__photos { opacity: 0; visibility: hidden; }
.pen-gallery-modal.is-tour .pen-gallery-modal__unavailable { opacity: 1; visibility: visible; }
.pen-gallery-modal__message { position: absolute; left: 6%; right: 22%; bottom: 10%; }
.pen-gallery-modal__message h3 { margin: 0 0 20px; font: 400 clamp(28px, 5vw, 76px)/1.1 var(--font-display); }
.pen-gallery-modal__message p { margin: 0; font-size: clamp(16px, 2.3vw, 32px); line-height: 1.25; }
.pen-gallery-modal button { cursor: pointer; }
.pen-gallery-modal button:focus-visible { outline: 3px solid #a36e29; outline-offset: -5px; }
.pen-gallery-modal__close { position: absolute; top: 4%; right: 3%; display: grid; place-items: center; width: 44px; height: 44px; padding: 5px; border: 0; border-radius: 50%; color: #07121c; background: rgb(255 255 255 / 85%); z-index: 3; }
/* El SVG ya incluye su círculo: el foco no debe dibujar otro contorno. */
.pen-gallery-modal .pen-gallery-modal__close:is(:focus, :focus-visible) { outline: none; box-shadow: none; }
.pen-gallery-modal .pen-gallery-modal__close:focus-visible svg { stroke-width: 3.5; }
.pen-gallery-modal__close svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; }
.pen-gallery-modal__switch { position: absolute; right: 3%; top: 50%; transform: translateY(-50%); display: grid; gap: 28px; z-index: 2; }
.pen-gallery-modal__switch button { display: grid; place-items: center; width: clamp(48px, 5.5vw, 78px); height: clamp(46px, 4.7vw, 68px); padding: 12px; border: 1px solid #111; border-radius: 8px; background: #fff; color: #333; transition: background .2s, color .2s; }
.pen-gallery-modal__switch button[aria-pressed="true"] { color: #011e41; border-color: #011e41; box-shadow: inset 0 0 0 2px #011e41; }
.pen-gallery-modal__switch svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pen-gallery-modal__navigation { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; z-index: 2; }
.pen-gallery-modal__navigation button { display: grid; place-items: center; width: 44px; height: 40px; padding: 10px; background: #fff; color: #011e41; border: 1px solid #011e41; border-radius: 5px; }
.pen-gallery-modal__navigation button:disabled { opacity: .45; cursor: default; }
.pen-gallery-modal__navigation svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.pen-gallery-modal__count { color: #fff; background: rgb(0 0 0 / 65%); border-radius: 20px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.pen-gallery-modal__developments { position: absolute; right: 3%; bottom: 10%; padding: 12px 20px; color: #fff; background: #0065d4; border: 0; border-radius: 5px; font: 500 16px/1.2 var(--font-ui); }
.pen-gallery-modal__error { position: absolute; left: 10%; right: 10%; top: 40%; padding: 15px; text-align: center; color: #fff; background: #011e41; }
@media (max-width: 1000px) {
    .pen-gallery__intro { gap: 30px; grid-template-columns: 1.4fr 1fr; }
    .pen-gallery__description p { font-size: 18px; }
    .pen-gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .pen-gallery__hero { min-height: 56svh; }
    .pen-gallery__hero-inner { width: calc(100% - 32px); padding: 55px 0; }
    .pen-gallery__hero h1 { font-size: clamp(25px, 7.5vw, 44px); }
    .pen-gallery__eyebrow { font-size: 12px; gap: 12px; margin-bottom: 22px; }
    .pen-gallery__eyebrow::before { width: 32px; }
    .pen-gallery__collection { padding-top: 40px; padding-bottom: 40px; }
    .pen-gallery__intro { width: calc(100% - 32px); grid-template-columns: 1fr; gap: 24px; }
    .pen-gallery__description h2 { font-size: 24px; margin-bottom: 16px; }
    .pen-gallery__description p { font-size: 16px; }
    .pen-gallery__options { max-height: 50svh; }
    .pen-gallery__options button { font-size: 18px; }
    .pen-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 3px; }

}
/* Elementos exclusivos de la experiencia móvil. */
.pen-gallery-modal__mobile-track, .pen-gallery-modal__mode-label { display: none; }
/* Tres zonas estables: controles, fotografía y navegación. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) and (max-height: 600px) {
    .pen-gallery-modal {
        --gallery-side: max(10px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
        --gallery-top: max(8px, env(safe-area-inset-top, 0px));
        --gallery-bottom: max(8px, env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        width: calc(100vw - var(--gallery-side) * 2);
        max-width: calc(100vw - var(--gallery-side) * 2);
        height: calc(100vh - var(--gallery-top) - var(--gallery-bottom));
        height: calc(100dvh - var(--gallery-top) - var(--gallery-bottom));
        max-height: none; min-height: 0; aspect-ratio: auto;
        inset: var(--gallery-top) var(--gallery-side) var(--gallery-bottom);
        margin: 0 auto; padding: 0; overflow: hidden; overscroll-behavior: contain;
        border-radius: 12px; background: #07121c; color: #fff;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 56px minmax(0, 1fr) 60px;
        transform: translateY(8px);
    }
    .pen-gallery-modal[open] { display: grid; }
    .pen-gallery-modal.is-open { transform: translateY(0); }
    .pen-gallery-modal__photos, .pen-gallery-modal__unavailable {
        position: relative; inset: auto; grid-area: 2 / 1;
        min-width: 0; min-height: 0; overflow: hidden; border-radius: 4px;
    }
    .pen-gallery-modal__photos { background: #07121c; touch-action: pan-y pinch-zoom; }
    .pen-gallery-modal__photos > .pen-gallery-modal__image { display: none; }
    .pen-gallery-modal__mobile-track {
        display: flex; width: 100%; height: 100%; transform: translate3d(-100%, 0, 0);
        will-change: transform;
    }
    .pen-gallery-modal__mobile-slide { position: relative; flex: 0 0 100%; min-width: 0; height: 100%; overflow: hidden; }
    .pen-gallery-modal__mobile-image {
        display: block; width: 100%; height: 100%; object-fit: cover;
        object-position: var(--gallery-mobile-focus, 50% 50%); user-select: none; -webkit-user-drag: none;
    }
    .pen-gallery-modal__mobile-image:not([src]) { visibility: hidden; }
    .pen-gallery-modal__mobile-image[data-trim-bolongo] { transform: scale(1.035923); transform-origin: left center; }
    .pen-gallery-modal__photos[aria-busy="true"]::after {
        content: ''; position: absolute; width: 28px; height: 28px; inset: 0; margin: auto;
        border: 3px solid #ffffff55; border-top-color: #fff; border-radius: 50%;
        animation: pen-gallery-loading .8s linear infinite; pointer-events: none;
    }
    .pen-gallery-modal button { touch-action: manipulation; }
    .pen-gallery-modal button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
    .pen-gallery-modal__close {
        position: relative; grid-area: 1 / 1; justify-self: end; align-self: center;
        inset: auto; margin-right: 2px; width: 48px; height: 48px; padding: 9px;
        color: #fff; background: transparent;
    }
    .pen-gallery-modal__switch {
        position: relative; grid-area: 1 / 1; justify-self: start; align-self: center;
        inset: auto; margin-left: 2px; max-width: calc(100% - 58px); transform: none;
        display: flex; gap: 0;
    }
    .pen-gallery-modal__switch button[aria-pressed="true"] { display: none; }
    .pen-gallery-modal__switch button {
        display: flex; justify-content: center; align-items: center; gap: 8px;
        width: auto; min-width: 44px; height: 48px; padding: 8px 10px;
        border: 0; border-radius: 6px; background: transparent; color: #fff;
        font: 500 14px/1.2 var(--font-ui);
    }
    .pen-gallery-modal__switch svg { width: 24px; height: 24px; flex-shrink: 0; }
    .pen-gallery-modal__mode-label { display: inline; }
    .pen-gallery-modal__navigation {
        position: relative; grid-area: 3 / 1; justify-self: center; align-self: center;
        inset: auto; transform: none; gap: 16px; height: 48px;
    }
    .pen-gallery-modal__navigation button { width: 48px; height: 48px; padding: 12px; border: 0; border-radius: 8px; }
    .pen-gallery-modal__navigation svg { width: 22px; height: 22px; }
    .pen-gallery-modal__count { box-sizing: border-box; min-width: 64px; text-align: center; font-size: 14px; background: transparent; }
    .pen-gallery-modal__unavailable { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; gap: 20px; color: #011e41; }
    .pen-gallery-modal__message { position: static; text-align: center; }
    .pen-gallery-modal__message h3 { font-size: clamp(24px, 6vw, 36px); margin-bottom: 8px; }
    .pen-gallery-modal__message p { font-size: 16px; }
    .pen-gallery-modal__developments { position: static; transform: none; min-height: 44px; padding: 10px 16px; font-size: 14px; flex-shrink: 0; }
    .pen-gallery-modal__error { grid-area: 2 / 1; align-self: center; position: relative; inset: auto; margin: 16px; padding: 16px; z-index: 2; font-size: 14px; }
}
@media (orientation: landscape) and (max-width: 767px), (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-height: 600px) {
    .pen-gallery-modal { grid-template-rows: 48px minmax(0, 1fr) 48px; }
    .pen-gallery-modal__close, .pen-gallery-modal__switch button, .pen-gallery-modal__navigation,
    .pen-gallery-modal__navigation button { height: 44px; }
    .pen-gallery-modal__unavailable { flex-direction: row; gap: 24px; padding: 8px 16px; }
    .pen-gallery-modal__message h3 { font-size: 24px; margin-bottom: 4px; }
    .pen-gallery-modal__message p { font-size: 14px; }
}
@keyframes pen-gallery-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .pen-gallery-modal__photos[aria-busy="true"]::after { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pen-gallery *, .pen-gallery-modal, .pen-gallery-modal * { transition: none !important; }
}

/* Oculta sin eliminar la configuración de estos desarrollos. */
.pen-gallery__card[data-gallery-open="peninsula-acapulco"],
.pen-gallery__card[data-gallery-open="duet"] { display: none; }

/* galeria-03 tiene 43 px transparentes a la derecha de su lienzo de 1240 px. */
.pen-gallery-modal__image[src*="/img/galeria/bolongo/galeria-03.webp"] {
    transform: scale(1.035923);
    transform-origin: left center;
}

/* Identificación provisional de las nuevas cards con logotipo pendiente. */
.pen-gallery__name { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 20px; color: #fff; font: 500 clamp(16px, 1.8vw, 30px)/1.15 var(--font-ui); text-align: center; text-wrap: balance; pointer-events: none; }
