/* Public Gallery page (/gallery) and its full-screen viewer. Loaded only on
   that page. The hero reuses the site's existing .es-lifestyle-hero styles. */

.gl { background: #fff; }

/* ---- Sections: alternating bands so each collection reads as its own block ---- */
.gl-section { padding: 56px 20px 60px; scroll-margin-top: 90px; }
.gl-section--tint { background: #f4f7f8; }
.gl-section__inner { max-width: 1180px; margin: 0 auto; }

.gl-section__head { margin-bottom: 26px; }
.gl-section__title {
    display: inline-block;
    margin: 0;
    padding-left: 16px;
    border-left: 5px solid #FC6304;
    font-size: clamp(26px, 3.2vw, 36px);
    line-height: 1.15;
    color: #080838;
}
.gl-section__count {
    display: inline-block;
    margin-left: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #FFF1E6;
    color: #b94500;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .03em;
    vertical-align: middle;
}
.gl-section__desc {
    margin: 12px 0 0;
    max-width: 70ch;
    font-size: 16.5px;
    line-height: 1.6;
    color: #4a5560;
}

/* ---- Grid ---- */
.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.gl-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: #dfe6e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
}
.gl-item[hidden] { display: none; }
.gl-item img,
.gl-item__blank {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}
.gl-item__blank { background: linear-gradient(135deg, #004d65, #0b6b8a); }
.gl-item:hover img,
.gl-item:focus-visible img { transform: scale(1.06); }
.gl-item:focus-visible { outline: 3px solid #FC6304; outline-offset: 3px; }

.gl-item__zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 20, 30, 0.6);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}
.gl-item__zoom svg { width: 20px; height: 20px; fill: #fff; }
.gl-item:hover .gl-item__zoom,
.gl-item:focus-visible .gl-item__zoom { opacity: 1; transform: none; }

/* Video tiles */
.gl-item--video { cursor: pointer; }
.gl-item__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.45));
}
.gl-item__play svg {
    width: 62px;
    height: 62px;
    padding: 16px 12px 16px 20px;
    border-radius: 50%;
    background: #FC6304;
    fill: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform .2s ease;
}
.gl-item--video:hover .gl-item__play svg { transform: scale(1.1); }
.gl-item__label {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.gl-more { margin-top: 26px; text-align: center; }
.gl-more__btn {
    padding: 14px 34px;
    border: 2px solid #004d65;
    border-radius: 999px;
    background: #fff;
    color: #004d65;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .03em;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.gl-more__btn:hover { background: #004d65; color: #fff; }

.gl-empty { padding: 90px 20px; text-align: center; font-size: 18px; color: #4a5560; }

@media (max-width: 767px) {
    .gl-section { padding: 40px 14px 44px; }
    .gl-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gl-item { border-radius: 9px; }
    .gl-section__count { margin: 10px 0 0; }
    /* No hover on touch — keep the little zoom cue visible. */
    .gl-item__zoom { opacity: 1; transform: none; width: 30px; height: 30px; }
}

/* ---- Full-screen viewer ---- */
.gl-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: rgba(4, 10, 16, 0.96);
    opacity: 0;
    transition: opacity .2s ease;
}
.gl-viewer[hidden] { display: none; }
.gl-viewer.is-open { opacity: 1; }

.gl-viewer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    color: #fff;
}
.gl-viewer__title { font-size: 16px; font-weight: 700; }
.gl-viewer__count { margin-left: 10px; font-size: 14px; font-weight: 600; opacity: .7; }
.gl-viewer__close,
.gl-viewer__nav {
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease;
}
.gl-viewer__close:hover,
.gl-viewer__nav:hover { background: rgba(255, 255, 255, 0.28); }
.gl-viewer__close:focus-visible,
.gl-viewer__nav:focus-visible { outline: 3px solid #FC6304; outline-offset: 2px; }
.gl-viewer__close { width: 44px; height: 44px; font-size: 30px; line-height: 1; }

.gl-viewer__stage {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 64px 20px;
    touch-action: pan-y;
}
.gl-viewer__media {
    flex: 1 1 auto;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gl-viewer__stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}
.gl-viewer__stage iframe,
.gl-viewer__stage video {
    width: min(100%, calc((100vh - 130px) * 16 / 9));
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
    background: #000;
}
.gl-viewer__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 48px;
    height: 48px;
    margin-top: -34px;
    font-size: 26px;
    line-height: 1;
}
.gl-viewer__nav--prev { left: 10px; }
.gl-viewer__nav--next { right: 10px; }
.gl-viewer__caption {
    padding: 0 20px 18px;
    text-align: center;
    color: #dfe8ec;
    font-size: 15px;
}
body.gl-lock { overflow: hidden; }

@media (max-width: 767px) {
    .gl-viewer__stage { padding: 0 8px 14px; }
    .gl-viewer__nav { width: 40px; height: 40px; font-size: 22px; }
    .gl-viewer__nav--prev { left: 6px; }
    .gl-viewer__nav--next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .gl-item img, .gl-item__zoom, .gl-viewer, .gl-item__play svg { transition: none; }
}

/* The site's base theme paints any focused <button> pink; keep the viewer's
   own colours when a button has keyboard focus (which is where focus lands
   as soon as the viewer opens). */
.gl-viewer .gl-viewer__close:focus,
.gl-viewer .gl-viewer__nav:focus {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}
.gl-viewer .gl-viewer__close:hover,
.gl-viewer .gl-viewer__nav:hover { background: rgba(255, 255, 255, 0.28); }
.gl-section .gl-more__btn:focus { background: #fff; color: #004d65; }
.gl-section .gl-more__btn:hover { background: #004d65; color: #fff; }
