/* Galería de viajes: archivo independiente para evitar caché de estilos antiguos. */
.travel-card.has-gallery {
    position: relative;
    cursor: pointer;
}

.travel-card.has-gallery::after {
    content: attr(data-gallery-label);
    position: absolute;
    z-index: 2;
    top: 166px;
    right: 15px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(9,35,49,.88);
    color: #fff;
    box-shadow: 0 7px 18px rgba(5,24,34,.25);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.travel-card.has-gallery:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}

.travel-card-footer {
    display: flex;
    width: 100%;
    margin-top: auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.travel-card-footer .travel-state { margin-top: 0; }
.travel-gallery-hint { color: #315f7d; font-size: .72rem; font-weight: 700; white-space: nowrap; }

.travel-gallery-modal:not([open]) { display: none !important; }
body.has-open-gallery { overflow: hidden !important; }

.travel-gallery-modal {
    position: fixed !important;
    z-index: 100000;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
    background: transparent;
    color: #fff;
    isolation: isolate;
}

.travel-gallery-modal::backdrop {
    background: rgba(3,12,18,.7);
    backdrop-filter: blur(5px);
}

.travel-gallery-dialog {
    position: relative;
    display: grid;
    width: min(1120px,100%);
    height: min(900px,calc(100dvh - 48px));
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    grid-template-rows: auto minmax(0,1fr) auto auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    background: rgba(8,27,37,.91);
    color: #fff;
    box-shadow: 0 28px 80px rgba(0,0,0,.48);
    backdrop-filter: blur(18px);
    animation: guido-gallery-in .22s ease-out both;
}

@keyframes guido-gallery-in {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.travel-gallery-header {
    display: flex;
    min-height: 90px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 76px 18px 28px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.travel-gallery-header h2 {
    margin: 3px 0 0;
    color: #fff;
    font-size: clamp(1.25rem,2vw,1.8rem);
    line-height: 1.2;
}

.travel-gallery-date {
    margin: 0;
    color: #a9cadb;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.travel-gallery-counter {
    margin: 0;
    color: #dce8ee;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

.travel-gallery-close,
.travel-gallery-nav {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    background: rgba(255,255,255,.09);
    color: #fff;
    cursor: pointer;
    font: inherit;
    transition: background-color .2s ease, transform .2s ease;
}

.travel-gallery-close:hover,
.travel-gallery-nav:hover { background: rgba(255,255,255,.2); transform: scale(1.06); }
.travel-gallery-close:focus-visible,
.travel-gallery-nav:focus-visible,
.travel-gallery-thumb:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.travel-gallery-close {
    position: absolute;
    z-index: 5;
    top: 22px;
    right: 22px;
    font-size: 1.6rem;
    line-height: 1;
}

.travel-gallery-stage {
    display: grid;
    min-height: 0;
    height: 100%;
    grid-template-columns: 72px minmax(0,1fr) 72px;
    align-items: center;
    overflow: hidden;
    padding: 14px 0 8px;
}

.travel-gallery-stage figure {
    display: grid;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-rows: minmax(0,1fr) auto;
    margin: 0;
}

.travel-gallery-media {
    position: relative;
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0,0,0,.36);
    touch-action: pan-y;
}

.travel-gallery-ambient {
    position: absolute;
    z-index: 0;
    inset: -30px;
    background-position: center;
    background-size: cover;
    filter: blur(25px) saturate(.82);
    opacity: .3;
    transform: scale(1.08);
}

.travel-gallery-media::after {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0;
    background: rgba(1,10,15,.25);
    pointer-events: none;
}

.travel-gallery-media > img {
    position: relative;
    z-index: 1;
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    image-orientation: from-image;
    margin: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.travel-gallery-stage figcaption {
    display: grid;
    min-height: 54px;
    max-height: 92px;
    max-width: 880px;
    margin: 0 auto;
    place-items: center;
    padding: 11px 18px 2px;
    overflow: auto;
    color: #c9dbe4;
    font-size: .82rem;
    line-height: 1.5;
    text-align: center;
}

.travel-gallery-nav { place-self: center; font-size: 1.2rem; }

.travel-gallery-thumbs {
    display: flex;
    min-height: 68px;
    flex: 0 0 auto;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 3px 28px 14px;
    scrollbar-color: rgba(255,255,255,.35) transparent;
}

.travel-gallery-thumb {
    flex: 0 0 82px;
    width: 82px;
    height: 61px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 7px;
    background: #16394b;
    cursor: pointer;
    opacity: .58;
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.travel-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.travel-gallery-thumb:hover { opacity: .9; }
.travel-gallery-thumb.is-active { border-color: #fff; opacity: 1; transform: translateY(-2px); }
.travel-gallery-help { margin: -3px 28px 14px; color: #91afbe; font-size: .65rem; text-align: right; }

@media (max-width: 800px) {
    .travel-gallery-modal { padding: 12px; }
    .travel-gallery-dialog { height: calc(100dvh - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
    .travel-gallery-header { min-height: 82px; padding: 16px 64px 15px 18px; }
    .travel-gallery-close { top: 18px; right: 16px; }
    .travel-gallery-stage { position: relative; grid-template-columns: minmax(0,1fr); padding: 0; }
    .travel-gallery-stage figure { grid-column: 1; grid-row: 1; }
    .travel-gallery-media { height: auto; min-height: 0; border-radius: 0; }
    .travel-gallery-stage figcaption { min-height: 52px; max-height: 86px; padding: 10px 48px 8px; }
    .travel-gallery-nav { position: absolute; z-index: 3; top: calc(50% - 42px); background: rgba(5,26,37,.8); }
    .travel-gallery-nav.is-prev { left: 10px; }
    .travel-gallery-nav.is-next { right: 10px; }
    .travel-gallery-thumbs { padding: 3px 18px 12px; }
    .travel-gallery-help { display: none; }
}

@media (max-width: 560px) {
    .travel-card.has-gallery::after { top: 148px; right: 12px; }
    .travel-gallery-modal { padding: 8px; }
    .travel-gallery-modal::backdrop { backdrop-filter: none; }
    .travel-gallery-dialog { width: 100%; height: calc(100dvh - 16px); min-height: 0; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; }
    .travel-gallery-dialog { background: rgba(8,27,37,.98); backdrop-filter: none; }
    .travel-gallery-header { position: relative; min-height: 78px; padding: 14px 108px 13px 14px; }
    .travel-gallery-header h2 { font-size: 1.08rem; }
    .travel-gallery-date { font-size: .58rem; letter-spacing: .08em; }
    .travel-gallery-counter { position: absolute; top: 29px; right: 70px; }
    .travel-gallery-close { top: 17px; right: 14px; width: 42px; height: 42px; }
    .travel-gallery-media { height: auto; min-height: 0; }
    .travel-gallery-ambient { display: none; }
    .travel-gallery-stage figcaption { min-height: 50px; max-height: 82px; padding: 9px 44px 7px; font-size: .74rem; line-height: 1.4; }
    .travel-gallery-nav { width: 42px; height: 42px; }
    .travel-gallery-thumb { flex-basis: 72px; width: 72px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    .travel-gallery-dialog { animation: none; }
}
