/* Pilot Version 10
 * (c) Laurent Groult | Air4.media 2007-2026
 * modules/airgallery/assets/css/airgallery-public.css 10.10
 * Tokens-only gallery styling. Defaults to tenant design (--site-* from
 * head.html); when a per-gallery bg override is set, the PHP view adds
 * .air-gallery-light/.air-gallery-dark so text contrast stays correct.
 */

/* ─── Base / Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.air-gallery-body {
    margin: 0;
    font-family: var(--site-font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background: var(--site-bg-primary, #ffffff);
    color: var(--site-text-primary, #1a1a2e);
}

/* ─── Theme contrast classes ─────────────────── */
body.air-gallery-body.air-gallery-light {
    --site-text-primary: #1b2838;
    --site-text-secondary: #4a5568;
    --site-text-muted: #94a3b8;
}
body.air-gallery-body.air-gallery-dark {
    --site-text-primary: #f1f5f9;
    --site-text-secondary: #cbd5e1;
    --site-text-muted: #94a3b8;
}

/* ─── Tenant Chrome adapter ─────────────────────
 * Tenant's head.html / TenantChrome::header/footer ship raw Bootstrap markup
 * with default colors designed for a light bg. On themed (especially dark)
 * bg those defaults become unreadable. Re-bind to tokens.
 */
body.air-gallery-body .navbar { color: var(--site-text-primary, #1a1a2e); }
body.air-gallery-body .navbar .navbar-brand {
    color: var(--site-text-primary, #1a1a2e);
    font-weight: 700;
}
body.air-gallery-body .navbar .nav-link {
    color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 75%, transparent);
    transition: color 0.15s ease;
}
body.air-gallery-body .navbar .navbar-brand:hover,
body.air-gallery-body .navbar .navbar-brand:focus,
body.air-gallery-body .navbar .nav-link:hover,
body.air-gallery-body .navbar .nav-link:focus,
body.air-gallery-body .navbar .nav-link.active {
    color: var(--site-text-primary, #1a1a2e);
}
body.air-gallery-body .navbar .nav-link.nav-cta {
    background: var(--site-primary, currentColor);
    color: var(--site-text-inverse, #ffffff);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
}
body.air-gallery-body .navbar .nav-link.nav-cta:hover,
body.air-gallery-body .navbar .nav-link.nav-cta:focus {
    background: color-mix(in srgb, var(--site-primary, currentColor) 85%, black);
    color: var(--site-text-inverse, #ffffff);
}
body.air-gallery-body .navbar .navbar-toggler {
    color: var(--site-text-primary, #1a1a2e);
    border-color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 25%, transparent);
}

/* Bootstrap utility text classes that default to dark colors. When the page
 * sits on a dark theme, these become invisible (e.g. .text-muted in tenant
 * footers). Re-bind to design tokens. */
body.air-gallery-body .text-muted {
    color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 60%, transparent) !important;
}
body.air-gallery-body .text-secondary {
    color: var(--site-text-secondary, color-mix(in srgb, var(--site-text-primary, #1a1a2e) 70%, transparent)) !important;
}
body.air-gallery-body .text-body-secondary,
body.air-gallery-body .text-body-tertiary {
    color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 65%, transparent) !important;
}

/* ─── Page header (used by single + index views) ──── */
.gallery-header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 880px;
    margin: 0 auto;
}

.gallery-title {
    font-family: var(--site-font-heading, var(--site-font-body, inherit));
    font-weight: 800;
    font-size: 2.75rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 0.75rem;
    color: var(--site-text-primary, #1a1a2e);
}

.gallery-title small {
    font-family: var(--site-font-body, inherit);
    font-weight: 400;
    opacity: 0.55;
    margin-left: 0.25rem;
}

.gallery-description {
    font-size: 1.05rem;
    color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 70%, transparent);
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
}

.gallery-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--site-text-primary, #1a1a2e) 50%, transparent);
}

.gallery-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.gallery-download-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background: color-mix(in srgb, var(--site-primary, currentColor) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--site-primary, currentColor) 30%, transparent);
    border-radius: 999px;
    color: var(--site-text-primary, #374151);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.gallery-download-all-btn:hover {
    background: color-mix(in srgb, var(--site-primary, currentColor) 20%, transparent);
    border-color: var(--site-primary, currentColor);
}
.gallery-download-all-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ─── Gallery Container ────────────────────────── */
.gallery-container,
.gallery-index-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* ─── Photo Grid (single-gallery view) ─────────── */
.air-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--gallery-columns, 3), 1fr);
    gap: var(--gallery-gap, 18px);
}

.air-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: color-mix(in srgb, var(--site-bg-primary, #ffffff) 92%, var(--site-text-primary, #000000));
    border: 1px solid color-mix(in srgb, var(--site-text-primary, #000000) 8%, transparent);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.25s,
                border-color 0.25s;
}

.air-gallery-item:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--site-primary, currentColor) 70%, transparent);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--site-text-primary, #000) 18%, transparent),
                0 0 0 1px color-mix(in srgb, var(--site-primary, currentColor) 40%, transparent);
}

.air-gallery-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.air-gallery-grid .air-gallery-link {
    aspect-ratio: 4 / 3;
}

.air-gallery-grid .air-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s;
}

.air-gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.3s;
}

.air-gallery-grid.aspect-1-1 .air-gallery-link { aspect-ratio: 1 / 1; }
.air-gallery-grid.aspect-4-3 .air-gallery-link { aspect-ratio: 4 / 3; }
.air-gallery-grid.aspect-16-9 .air-gallery-link { aspect-ratio: 16 / 9; }
.air-gallery-grid.aspect-3-2 .air-gallery-link { aspect-ratio: 3 / 2; }
.air-gallery-grid.aspect-9-16 .air-gallery-link { aspect-ratio: 9 / 16; }

.air-gallery-item.hover-zoom:hover img { transform: scale(1.05); }
.air-gallery-item.hover-fade:hover img { filter: brightness(0.85); }
.air-gallery-item.hover-slide:hover img { transform: scale(1.03); }

/* ─── Video Play Badge ─────────────────────────── */
.air-gallery-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    pointer-events: none;
    transition: transform 0.3s, background 0.3s;
    z-index: 2;
}

.air-gallery-play i { margin-left: 3px; }

.air-gallery-item:hover .air-gallery-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--site-primary, rgba(0, 0, 0, 0.7));
}

/* ─── Card body padding & sizing ───────────────── */
body.air-gallery-body .air-gallery-item { padding-bottom: 0; }
body.air-gallery-body .air-gallery-caption-below {
    padding: 12px 14px 6px;
    font-size: 0.95rem;
    font-weight: 600;
}
body.air-gallery-body .air-gallery-edit-caption { padding: 12px 14px 6px; }
body.air-gallery-body .air-gallery-item > .air-gallery-meta-block {
    padding: 2px 14px 14px;
    margin-top: 0;
    font-size: 13px;
}
body.air-gallery-body .air-gallery-meta-description { font-size: 14px; line-height: 1.5; }
body.air-gallery-body .air-gallery-meta-row { font-size: 12px; gap: 12px; margin: 6px 0; }
body.air-gallery-body .air-gallery-transcript > summary { font-size: 12px; padding: 6px 0; }
body.air-gallery-body .air-gallery-transcript > summary::before { font-size: 10px; margin-right: 8px; }
body.air-gallery-body .air-gallery-tag { font-size: 11px; padding: 3px 10px; }
body.air-gallery-body .air-gallery-tags { gap: 5px; margin-top: 10px; }

/* ─── Caption Overlay (on hover) ───────────────── */
.air-gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.air-gallery-item:hover .air-gallery-overlay { opacity: 1; }

.air-gallery-caption {
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.air-gallery-credit {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ─── Caption Below (non-edit mode) ────────────── */
.air-gallery-caption-below {
    padding: 0.6rem 0.75rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--site-text-primary, #1a1a2e);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Inline Edit Caption ──────────────────────── */
.air-gallery-edit-caption {
    padding: 0.4rem 0.65rem;
    position: relative;
}

.air-caption-input {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    color: var(--site-text-primary, #374151);
    background: color-mix(in srgb, var(--site-bg-primary, #fff) 92%, var(--site-text-primary, #000));
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.air-caption-input:focus {
    border-color: var(--site-primary, #3b82f6);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--site-primary, #3b82f6) 25%, transparent);
    background: var(--site-bg-primary, #fff);
}

.air-caption-input::placeholder {
    color: color-mix(in srgb, var(--site-text-primary, #000) 35%, transparent);
}

.air-caption-status {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.air-caption-status.saved { color: var(--site-success, #10b981); opacity: 1; }
.air-caption-status.saving { color: var(--site-text-muted, #6b7280); opacity: 1; }

/* ─── Masonry Layout ───────────────────────────── */
.air-gallery-masonry {
    columns: var(--gallery-columns, 3);
    column-gap: var(--gallery-gap, 18px);
}

.air-gallery-masonry .air-gallery-item {
    break-inside: avoid;
    margin-bottom: var(--gallery-gap, 18px);
}

.air-gallery-masonry .air-gallery-link { aspect-ratio: auto; }

.air-gallery-masonry .air-gallery-item img {
    height: auto;
    object-fit: initial;
}

/* ─── Carousel Layout ──────────────────────────── */
.air-gallery-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: color-mix(in srgb, var(--site-bg-primary, #fff) 92%, var(--site-text-primary, #000));
}

.air-gallery-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.air-gallery-carousel-slide {
    min-width: 100%;
    position: relative;
}

.air-gallery-carousel-slide img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.air-gallery-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--site-bg-primary, rgba(255,255,255,0.9));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--site-text-primary, #1a1a2e);
    border: 1px solid color-mix(in srgb, var(--site-text-primary, #000) 12%, transparent);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--site-text-primary, #000) 15%, transparent);
    z-index: 5;
}

.air-gallery-carousel-nav:hover {
    border-color: var(--site-primary, currentColor);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--site-text-primary, #000) 20%, transparent);
}

.air-gallery-carousel-prev { left: 16px; }
.air-gallery-carousel-next { right: 16px; }

.air-gallery-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.air-gallery-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--site-text-primary, #000) 18%, transparent);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.air-gallery-carousel-dot.active {
    background: var(--site-primary, currentColor);
    width: 24px;
    border-radius: 4px;
}

/* ─── Lightbox (always dark, by design) ────────── */
.air-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 1);
    z-index: 99999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.air-lightbox.active { display: flex; }

.air-lightbox-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    z-index: 10;
}

.air-lightbox-counter { color: rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 500; }
.air-lightbox-actions { display: flex; gap: 0.5rem; }

.air-lightbox-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.air-lightbox-btn:hover { background: rgba(255,255,255,0.2); }
.air-lightbox-btn.active { background: rgba(255,255,255,0.25); }

.air-lightbox-content {
    position: relative;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.air-lightbox-content img,
.air-lightbox-content video {
    max-width: 92vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
}

.air-lightbox-content video { outline: none; background: #000; width: auto; height: auto; }

.air-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.air-lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.air-lightbox-prev { left: 1.5rem; }
.air-lightbox-next { right: 1.5rem; }

.air-lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 1.5rem;
    z-index: 10;
    pointer-events: none;
}

.air-lightbox-caption { color: #fff; font-size: 0.95rem; font-weight: 500; margin-bottom: 0.25rem; }
.air-lightbox-description {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}
.air-lightbox-exif { color: rgba(255,255,255,0.45); font-size: 0.8rem; margin-top: 0.25rem; }
.air-lightbox-credit-tag { color: rgba(255,255,255,0.5); font-size: 0.85rem; font-style: italic; }

.air-lightbox-transcript { margin-top: 0.75rem; pointer-events: auto; }

.air-transcript-toggle {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.air-transcript-toggle:hover { background: rgba(0,0,0,0.7); color: #fff; }

.transcript-chevron { transition: transform 0.2s; font-size: 0.65rem; }
.air-lightbox-transcript.expanded .transcript-chevron { transform: rotate(180deg); }

.air-transcript-content {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    text-align: left;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-line;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.air-lightbox-transcript.expanded .air-transcript-content { display: block; }

.air-transcript-content::-webkit-scrollbar { width: 4px; }
.air-transcript-content::-webkit-scrollbar-track { background: transparent; }
.air-transcript-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.air-lightbox-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.air-lightbox-info-panel.active { transform: translateX(0); }

.air-lightbox-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.air-lightbox-info-header h6 { color: #fff; margin: 0; font-weight: 600; font-size: 0.9rem; }
.air-lightbox-info-body { padding: 1rem 1.25rem; }
.info-section { margin-bottom: 1rem; }

.info-section label {
    display: block;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.info-section p { color: rgba(255,255,255,0.85); font-size: 0.82rem; margin: 0; line-height: 1.5; }
.info-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.air-lightbox-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.02em;
}

.info-transcript { font-style: italic; color: rgba(255,255,255,0.6) !important; font-size: 0.78rem !important; }

.info-section textarea.info-edit-field {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 6px 8px;
    border-radius: 4px;
    resize: vertical;
    min-height: 36px;
    font-size: 0.82rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.info-section textarea.info-edit-field:focus { outline: none; border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.12); }
.info-section textarea.info-edit-field::placeholder { color: rgba(255,255,255,0.3); }
.info-section .air-caption-status { display: block; font-size: 0.7rem; margin-top: 2px; min-height: 1em; transition: color 0.2s; }
.info-section .air-caption-status.saved { color: var(--site-success, #4caf50); }
.info-section .air-caption-status.saving { color: var(--site-warning, #ff9800); }
.info-section .air-caption-status.error { color: var(--site-danger, #f44336); }

/* ─── Responsive ───────────────────────────────── */
@media (max-width: 1024px) {
    .air-gallery-grid { grid-template-columns: repeat(min(var(--gallery-columns, 3), 3), 1fr); }
    .gallery-index-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .air-gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .air-gallery-masonry { columns: 2; }
    .gallery-header { padding: 2rem 1rem 1.5rem; }
    .gallery-title { font-size: 2rem; }
    .gallery-description { font-size: 0.95rem; }
    .air-lightbox-nav { width: 44px; height: 44px; }
    .air-lightbox-prev { left: 0.75rem; }
    .air-lightbox-next { right: 0.75rem; }
    .air-lightbox-info-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        max-height: 50vh;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        border-radius: 16px 16px 0 0;
    }
    .air-lightbox-info-panel.active { transform: translateY(0); }
}

@media (max-width: 640px) {
    .gallery-index-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 480px) {
    .air-gallery-grid { grid-template-columns: 1fr; }
    .air-gallery-masonry { columns: 1; }
    .gallery-title { font-size: 1.6rem; }
    .air-gallery-play { width: 44px; height: 44px; font-size: 1rem; }
    .air-lightbox-nav { width: 38px; height: 38px; font-size: 1rem; }
}

/* ─── Gallery Index Page (gallery-of-galleries) ─── */
.gallery-index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 1rem;
}

.gallery-index-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    background: color-mix(in srgb, var(--site-bg-primary, #fff) 94%, var(--site-text-primary, #000));
    border: 1px solid color-mix(in srgb, var(--site-text-primary, #000) 8%, transparent);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--site-text-primary, #000) 8%, transparent);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s,
                border-color 0.3s;
}

.gallery-index-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--site-primary, currentColor) 50%, transparent);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--site-text-primary, #000) 18%, transparent),
                0 0 0 1px color-mix(in srgb, var(--site-primary, currentColor) 25%, transparent);
    color: inherit;
    text-decoration: none;
}

.gallery-index-card-cover {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: color-mix(in srgb, var(--site-bg-primary, #fff) 88%, var(--site-text-primary, #000));
}

.gallery-index-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-index-card:hover .gallery-index-card-cover img { transform: scale(1.05); }

.gallery-index-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: color-mix(in srgb, var(--site-text-primary, #000) 30%, transparent);
    font-size: 2.5rem;
}

.gallery-index-card-body { padding: 1.25rem 1.35rem 1.4rem; }

.gallery-index-card-title {
    font-family: var(--site-font-heading, var(--site-font-body, inherit));
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--site-text-primary, #1a1a2e);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.gallery-index-card-desc {
    font-size: 0.88rem;
    color: color-mix(in srgb, var(--site-text-primary, #000) 65%, transparent);
    margin: 0 0 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-index-card-meta {
    font-size: 0.78rem;
    color: color-mix(in srgb, var(--site-text-primary, #000) 50%, transparent);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gallery-index-card-meta i { margin-right: 0.3rem; color: color-mix(in srgb, var(--site-primary, currentColor) 80%, transparent); }

.gallery-index-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: color-mix(in srgb, var(--site-text-primary, #000) 50%, transparent);
}

.gallery-index-empty i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: 0.5; }
.gallery-index-empty p { font-size: 1rem; margin: 0; }

/* ─── Gallery Footer ───────────────────────────── */
.gallery-footer {
    text-align: center;
    padding: 2rem 1rem 3rem;
    color: color-mix(in srgb, var(--site-text-primary, #000) 70%, transparent);
    font-size: 0.85rem;
}

.gallery-footer a {
    color: var(--site-text-primary, #1a1a2e);
    text-decoration: none;
    font-weight: 600;
}

.gallery-footer a:hover { color: var(--site-primary, var(--site-text-primary, #1a1a2e)); }

/* ─── Gallery back button ──────────────────────── */
.gallery-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: color-mix(in srgb, var(--site-primary, currentColor) 12%, transparent);
    color: var(--site-text-primary, #1a1a1a);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    border: 1px solid color-mix(in srgb, var(--site-primary, currentColor) 28%, transparent);
}
.gallery-back-link:hover {
    background: color-mix(in srgb, var(--site-primary, currentColor) 22%, transparent);
    border-color: var(--site-primary, currentColor);
    color: var(--site-text-primary, #1a1a1a);
    transform: translateX(-2px);
    text-decoration: none;
}
.gallery-back-link i { font-size: 0.85rem; }


/* ============================================================
   AirGallery appearance themes (multi-tenant) — 2026-06-18
   Body class ag-theme-<name>, set from settings.appearance.
   "site" = Match my site: derived from tenant design tokens (--site-*).
   ============================================================ */
body.air-gallery-body.ag-theme-site{
  background:
    radial-gradient(60% 50% at 16% 8%,  color-mix(in srgb, var(--site-primary,#E91E78) 9%, transparent), transparent 70%),
    radial-gradient(50% 45% at 90% 14%, color-mix(in srgb, var(--site-accent,#F7941D) 8%, transparent), transparent 70%),
    radial-gradient(62% 55% at 80% 100%,color-mix(in srgb, var(--site-secondary,#8DC63F) 7%, transparent), transparent 70%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--site-primary,#E91E78) 7%, #ffffff) 0%,
      #ffffff 30%,
      color-mix(in srgb, var(--site-accent,#F7941D) 7%, #ffffff) 62%,
      color-mix(in srgb, var(--site-secondary,#8DC63F) 8%, #ffffff) 100%) !important;
  background-attachment: fixed !important;
  min-height:100vh;
}
body.air-gallery-body.ag-theme-site .gallery-header,
body.air-gallery-body.ag-theme-site .gallery-container,
body.air-gallery-body.ag-theme-site .gallery-footer{ position:relative; z-index:1; }
body.air-gallery-body.ag-theme-site .air-gallery-item{
  background:#ffffff !important;
  border:1px solid color-mix(in srgb, var(--site-primary,#E91E78) 8%, transparent) !important;
  border-radius:18px !important;
  box-shadow:0 20px 50px color-mix(in srgb, var(--site-primary,#E91E78) 12%, transparent),
             0 8px 20px rgba(0,0,0,.05) !important;
}
body.air-gallery-body.ag-theme-site .air-gallery-item:hover{
  box-shadow:0 26px 62px color-mix(in srgb, var(--site-primary,#E91E78) 18%, transparent),
             0 10px 24px rgba(0,0,0,.07) !important;
}
body.air-gallery-body.ag-theme-site .gallery-title{ color: var(--site-text-primary,#2D2D2D) !important; }
body.air-gallery-body.ag-theme-site .gallery-description,
body.air-gallery-body.ag-theme-site .gallery-meta-item{ color: var(--site-text-secondary,#5A5A5A) !important; }
body.air-gallery-body.ag-theme-site .gallery-back-link{
  background: color-mix(in srgb, var(--site-primary,#E91E78) 10%, #ffffff) !important;
  color: var(--site-primary,#E91E78) !important;
}
body.air-gallery-body.ag-theme-site .air-gallery-tag{
  background: color-mix(in srgb, var(--site-primary,#E91E78) 10%, #ffffff) !important;
  color: color-mix(in srgb, var(--site-primary,#E91E78) 72%, #000) !important;
}

/* Liquid glass — frosted translucent cards over the token-tinted gradient */
body.air-gallery-body.ag-theme-glass{
  background:
    radial-gradient(60% 50% at 16% 8%,  color-mix(in srgb, var(--site-primary,#E91E78) 14%, transparent), transparent 70%),
    radial-gradient(55% 45% at 90% 14%, color-mix(in srgb, var(--site-accent,#F7941D) 12%, transparent), transparent 70%),
    linear-gradient(150deg,
      color-mix(in srgb, var(--site-primary,#E91E78) 16%, #ffffff) 0%,
      color-mix(in srgb, var(--site-accent,#F7941D) 14%, #ffffff) 60%,
      color-mix(in srgb, var(--site-secondary,#8DC63F) 16%, #ffffff) 100%) !important;
  background-attachment: fixed !important; min-height:100vh;
}
body.air-gallery-body.ag-theme-glass .air-gallery-item{
  background: rgba(255,255,255,.46) !important;
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border:1px solid rgba(255,255,255,.62) !important; border-radius:20px !important;
  box-shadow:0 16px 44px color-mix(in srgb, var(--site-primary,#E91E78) 16%, transparent),
             inset 0 1px 0 rgba(255,255,255,.8) !important;
}
body.air-gallery-body.ag-theme-glass .gallery-title{ color: var(--site-text-primary,#2D2D2D) !important; }
body.air-gallery-body.ag-theme-glass .gallery-description,
body.air-gallery-body.ag-theme-glass .gallery-meta-item{ color: var(--site-text-secondary,#5A5A5A) !important; }
body.air-gallery-body.ag-theme-glass .gallery-back-link{
  background: rgba(255,255,255,.5) !important; color: var(--site-primary,#E91E78) !important; }
body.air-gallery-body.ag-theme-glass .air-gallery-tag{
  background: rgba(255,255,255,.55) !important; color: color-mix(in srgb, var(--site-primary,#E91E78) 72%, #000) !important; }

/* Dark — dark glass, light text */
body.air-gallery-body.ag-theme-dark{
  background: linear-gradient(160deg,#15141c 0%,#0b0b12 100%) fixed !important; min-height:100vh;
}
body.air-gallery-body.ag-theme-dark .air-gallery-item{
  background: rgba(255,255,255,.06) !important;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border:1px solid rgba(255,255,255,.12) !important; border-radius:16px !important;
  box-shadow:0 16px 40px rgba(0,0,0,.4) !important;
}
body.air-gallery-body.ag-theme-dark .gallery-title{ color:#fff !important; }
body.air-gallery-body.ag-theme-dark .gallery-description,
body.air-gallery-body.ag-theme-dark .gallery-meta-item{ color:#c9c9d4 !important; }
body.air-gallery-body.ag-theme-dark .gallery-back-link{ background:rgba(255,255,255,.1) !important; color:#fff !important; }
body.air-gallery-body.ag-theme-dark .air-gallery-tag{ background:rgba(255,255,255,.12) !important; color:#e6e6ee !important; }
/* Classic = no theme class (current default look) */
