/* JSL Facilities: the listing pages, the facility pages, the gallery images and their viewer.
   Colours and fonts use the theme's custom properties when it defines them
   (RCJPS V3: --navy, --gold, ...), with standalone fallbacks. */

.jslf-page {
    --jslf-navy: var(--navy, #0A1628);
    --jslf-navy-deep: var(--navy-deep, #060E1C);
    --jslf-navy-mid: var(--navy-mid, #122040);
    --jslf-gold: var(--gold, #C9A84C);
    --jslf-white: var(--white, #FFFFFF);
    --jslf-offwhite: var(--offwhite, #F7F5F0);
    --jslf-stone: var(--stone, #EFE9DE);
    --jslf-stone-border: var(--stone-border, #DFD6C6);
    --jslf-muted: var(--muted, #6B7280);
    --jslf-border: var(--border, #E3DDD4);
    --jslf-heading: 'Playfair Display', Georgia, serif;
    --jslf-label: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}

.jslf-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* ── LAYOUT ─────────────────────────────────────── */
.jslf-section {
    padding: 100px 48px;
    background: var(--jslf-offwhite);
}

.jslf-single {
    background: var(--jslf-white);
}

.jslf-inner {
    max-width: 1320px;
    margin: 0 auto;
}

/* Default header, used when the theme doesn't supply its own (jsl_facilities_header) */
.jslf-header {
    padding: 140px 48px 56px;
    background: var(--jslf-navy);
    color: var(--jslf-white);
}

.jslf-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--jslf-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 18px;
}

.jslf-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.jslf-breadcrumb a:hover {
    color: var(--jslf-gold);
}

.jslf-eyebrow {
    font-family: var(--jslf-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--jslf-gold);
    margin: 0 0 12px;
}

.jslf-title {
    font-family: var(--jslf-heading);
    font-size: clamp(32px, 5vw, 60px);
    line-height: 1.1;
    margin: 0;
    color: inherit;
}

.jslf-lead {
    margin: 16px 0 0;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.7);
}

/* ── LISTING ────────────────────────────────────── */
.jslf-intro {
    max-width: 760px;
    margin-bottom: 44px;
    font-size: 16px;
    line-height: 1.85;
    color: var(--jslf-muted);
}

.jslf-intro > * + * {
    margin-top: 1em;
}

.jslf-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--jslf-border);
    margin-bottom: 40px;
}

.jslf-tab {
    position: relative;
    padding: 18px 24px;
    font-family: var(--jslf-label);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--jslf-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.jslf-tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: var(--jslf-gold);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.jslf-tab:hover,
.jslf-tab:focus-visible,
.jslf-tab.is-active {
    color: var(--jslf-navy);
}

.jslf-tab.is-active::after {
    transform: scaleX(1);
}

.jslf-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.jslf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--jslf-white);
    border: 1px solid var(--jslf-border);
    border-radius: 12px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

a.jslf-card:hover,
a.jslf-card:focus-visible {
    border-color: transparent;
    box-shadow: 0 20px 52px rgba(10, 22, 40, 0.13);
}

.jslf-card-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--jslf-stone);
    color: var(--jslf-gold);
    font-size: 48px;
}

.jslf-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

a.jslf-card:hover .jslf-card-media img {
    transform: scale(1.06);
}

.jslf-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 26px 28px;
}

.jslf-card-title {
    font-family: var(--jslf-heading);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--jslf-navy);
    margin: 0;
}

.jslf-card-text {
    margin: 12px 0 0;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--jslf-muted);
}

.jslf-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    font-family: var(--jslf-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--jslf-gold);
}

div.jslf-card .jslf-card-link {
    color: var(--jslf-muted);
}

.jslf-empty {
    text-align: center;
    background: var(--jslf-white);
    border: 1px dashed var(--jslf-stone-border);
    border-radius: 12px;
    padding: 64px 24px;
}

.jslf-empty-icon {
    display: inline-flex;
    font-size: 40px;
    color: var(--jslf-gold);
    margin-bottom: 14px;
}

.jslf-empty p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--jslf-muted);
}

/* ── FACILITY PAGE ──────────────────────────────── */
.jslf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 64px;
    align-items: start;
}

.jslf-figure {
    margin: 0 0 36px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--jslf-stone);
}

.jslf-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.jslf-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--jslf-muted);
}

.jslf-content > * + * {
    margin-top: 1.1em;
}

.jslf-content img {
    max-width: 100%;
    height: auto;
}

.jslf-gallery-title {
    font-family: var(--jslf-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--jslf-navy);
    margin: 48px 0 20px;
}

.jslf-side {
    position: sticky;
    top: 104px;
    background: var(--jslf-offwhite);
    border: 1px solid var(--jslf-border);
    border-radius: 12px;
    padding: 26px 24px;
}

.jslf-side-title {
    font-family: var(--jslf-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    color: var(--jslf-gold);
    margin: 0 0 14px;
}

.jslf-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jslf-side-list li + li {
    border-top: 1px solid var(--jslf-border);
}

.jslf-side-list a,
.jslf-side-list span {
    display: block;
    padding: 10px 0;
    font-size: 14.5px;
    color: var(--jslf-muted);
    text-decoration: none;
}

.jslf-side-list a:hover,
.jslf-side-list .is-current span {
    color: var(--jslf-navy);
}

.jslf-side-list .is-current span {
    font-weight: 600;
}

.jslf-pager {
    padding: 28px 48px;
    background: var(--jslf-offwhite);
    border-top: 1px solid var(--jslf-border);
}

.jslf-pager-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.jslf-pager-link,
.jslf-pager-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--jslf-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--jslf-navy);
    text-decoration: none;
}

.jslf-pager-link.is-next {
    justify-self: end;
    text-align: right;
}

.jslf-pager-link:hover,
.jslf-pager-all:hover {
    color: var(--jslf-gold);
}

/* ── GALLERY IMAGES ─────────────────────────────── */
.jslf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.jslf-gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--jslf-stone);
}

.jslf-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.jslf-gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 14, 28, 0.35);
    opacity: 0;
    transition: opacity 0.3s;
}

.jslf-zoom {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--jslf-gold);
    color: var(--jslf-navy-deep);
    font-size: 17px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}

.jslf-gallery-item:hover img,
.jslf-gallery-item:focus-visible img {
    transform: scale(1.06);
}

.jslf-gallery-item:hover::after,
.jslf-gallery-item:focus-visible::after,
.jslf-gallery-item:hover .jslf-zoom,
.jslf-gallery-item:focus-visible .jslf-zoom {
    opacity: 1;
    transform: none;
}

.jslf-gallery-item:focus-visible,
.jslf-card:focus-visible,
.jslf-tab:focus-visible {
    outline: 2px solid var(--jslf-gold);
    outline-offset: 3px;
}

/* ── IMAGE VIEWER ───────────────────────────────── */
.jslf-viewer {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(6, 14, 28, 0.95);
    color: #fff;
}

.jslf-viewer::backdrop {
    background: rgba(6, 14, 28, 0.95);
}

.jslf-viewer[open] {
    display: flex;
    flex-direction: column;
}

.jslf-viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    flex-shrink: 0;
}

.jslf-viewer-count {
    font-family: var(--jslf-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
}

.jslf-viewer button {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.jslf-viewer button:hover,
.jslf-viewer button:focus-visible {
    background: var(--jslf-gold);
    border-color: var(--jslf-gold);
    color: var(--jslf-navy-deep);
}

.jslf-viewer button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.jslf-viewer button[hidden] {
    display: none;
}

.jslf-viewer-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 20px;
}

.jslf-viewer-stage img {
    display: block;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.jslf-viewer-caption {
    flex-shrink: 0;
    min-height: 64px;
    margin: 0;
    padding: 16px 24px 24px;
    text-align: center;
    font-family: var(--jslf-heading);
    font-size: 18px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1100px) {
    .jslf-section {
        padding: 80px 40px;
    }

    .jslf-cards {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .jslf-layout {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .jslf-side {
        position: static;
    }
}

@media (max-width: 640px) {
    .jslf-section {
        padding: 56px 20px;
    }

    .jslf-header {
        padding: 110px 24px 40px;
    }

    .jslf-tab {
        flex: 1;
        padding: 16px 8px;
        text-align: center;
        font-size: 10.5px;
        letter-spacing: 1px;
    }

    .jslf-cards {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .jslf-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .jslf-pager {
        padding: 22px 20px;
    }

    .jslf-pager-inner {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .jslf-pager-link.is-next {
        justify-self: center;
    }

    .jslf-viewer-stage {
        gap: 6px;
        padding: 0 8px;
    }

    .jslf-viewer button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jslf-page * {
        transition: none !important;
    }
}
