/* ============================================================
   WP Jagged Gallery — style.css
   Gallery layout, hover effects, and image protection rules.
   v0.3 — Added masonry (CSS columns) layout for shortcode.
   ============================================================ */

/* ── Gallery Grid Container (flex, generic) ─────────────── */
.jg-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    list-style: none;
    margin: 0;
}

/* ── Masonry Layout (CSS columns — used by shortcode) ───── */
/*
   .jg-masonry overrides the flex model with CSS column-count.
   column-count is set inline by the shortcode (default: 3).
   This gives true masonry float behaviour: images of different
   heights stack tightly without gaps, like a brick wall.
*/
.jg-gallery.jg-masonry {
    display: block;
    /* Exit flex so columns can take over */
    column-gap: 12px;
    padding: 16px 0;
}

.jg-gallery.jg-masonry .jg-gallery-item {
    break-inside: avoid;
    /* Prevent an item splitting across columns */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    /* Required for column layout to respect break-inside */
    width: 100%;
    /* Fill the column width */
    margin-bottom: 12px;
    /* Vertical gap between items */
    flex: none;
    /* Override the flex shorthand from the base rule */
}

/* ── Individual Gallery Item ─────────────────────────────── */
.jg-gallery-item {
    flex: 1 1 calc(33.333% - 12px);
    /* ~3 columns; items grow/shrink freely */
    min-width: 220px;
    overflow: hidden;
    border-radius: 4px;
    background: #1a1a1e;
    cursor: pointer;
    position: relative;

    /* Smooth transition for the float + scale effect */
    transition:
        transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.28s ease;
}

/* ── Hover: Float + Scale Effect ────────────────────────── */
.jg-gallery-item:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    z-index: 10;
}

/* ── Gallery Images ──────────────────────────────────────── */
.jg-gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    /* Preserves non-standard aspect ratios */
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.28s ease, filter 0.28s ease;
    position: relative;
    z-index: 1;

    /* ── Security: Disable drag-to-save and text selection ── */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    /* Disable pointer events on the <img> itself so the
       parent <li> handles clicks; also prevents drag-start. */
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Slight brightness lift on hover for extra polish */
.jg-gallery-item:hover img {
    filter: brightness(1.08);
}

/* ── Image Caption ───────────────────────────────────────── */
.jg-caption {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.88);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.45));
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.4;
    border-radius: 0 0 4px 4px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* ── Caption Links ──────────────────────────────────────── */
.jg-caption a {
    color: #c9a96e;
    text-decoration: underline;
    text-decoration-color: rgba(201, 169, 110, 0.4);
    text-underline-offset: 2px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
    pointer-events: auto;
}

.jg-caption a:hover {
    color: #e2c58a;
    text-decoration-color: rgba(226, 197, 138, 0.8);
}

.jg-gallery-item:hover .jg-caption {
    opacity: 1;
}

/* ── Image Loading Placeholder (shimmer) ────────────────── */
.jg-gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 4px;
    background: linear-gradient(
        110deg,
        #1a1a1e 0%,
        #1a1a1e 30%,
        #2a2a30 50%,
        #1a1a1e 70%,
        #1a1a1e 100%
    );
    background-size: 300% 100%;
    animation: jg-shimmer 1.8s ease-in-out infinite;
    pointer-events: none;
}

/* Hide shimmer once image is loaded */
.jg-gallery-item.jg-loaded::before {
    display: none;
}

@keyframes jg-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Lightbox Overlay ────────────────────────────────────── */
#jg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#jg-lightbox.jg-active {
    display: flex;
}

/* Content wrapper: holds image + story panel */
#jg-lightbox-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 92vw;
    max-height: 92vh;
    cursor: default;
}

#jg-lightbox-img {
    max-width: 80vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    animation: jg-fade-in 0.22s ease;
    flex-shrink: 0;

    /* Keep security rules on lightbox image too */
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* When no story, image gets full rounded corners */
#jg-lightbox:not(.jg-has-story) #jg-lightbox-img {
    border-radius: 6px;
    max-width: 80vw;
}

/* When story is present, narrow the image to make room */
#jg-lightbox.jg-has-story #jg-lightbox-img {
    max-width: 58vw;
}

/* ── Story Panel ─────────────────────────────────────────── */
#jg-lightbox-story {
    display: none;
    width: 0;
    overflow: hidden;
    transition: width 0.25s ease, opacity 0.25s ease;
    opacity: 0;
}

#jg-lightbox-story.has-story {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 320px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 24px;
    background: rgba(20, 20, 20, 0.92);
    border-radius: 0 6px 6px 0;
    opacity: 1;
}

#jg-lightbox-story-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.65;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Story Panel Links ──────────────────────────────────── */
#jg-lightbox-story-text a {
    color: #c9a96e;
    text-decoration: underline;
    text-decoration-color: rgba(201, 169, 110, 0.4);
    text-underline-offset: 2px;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
    pointer-events: auto;
}

#jg-lightbox-story-text a:hover {
    color: #e2c58a;
    text-decoration-color: rgba(226, 197, 138, 0.8);
}

/* Close button */
#jg-lightbox-close {
    position: fixed;
    top: 18px;
    right: 24px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.15s ease;
    z-index: 100000;
    background: none;
    border: none;
    padding: 0;
}

#jg-lightbox-close:hover {
    opacity: 1;
}

/* Prev / Next arrow buttons */
#jg-lightbox-prev,
#jg-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 100000;
    user-select: none;
}

#jg-lightbox-prev {
    left: 0;
}

#jg-lightbox-next {
    right: 0;
}

#jg-lightbox-prev:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

#jg-lightbox-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
}

/* Image counter (e.g. "3 / 12") */
#jg-lightbox-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-family: sans-serif;
    letter-spacing: 0.05em;
    z-index: 100000;
    pointer-events: none;
}

/* ── Editor: Drag-to-Reorder (dnd-kit) ────────────────────── */
.jg-sortable-item {
    position: relative;
    cursor: default;
    touch-action: none;
}

.jg-sortable-item.jg-dragging {
    opacity: 0.35 !important;
}

/* Drag handle overlay — appears on hover */
.jg-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: grab;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 6px 8px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.jg-drag-handle:active {
    cursor: grabbing;
}

.jg-sortable-item:hover .jg-drag-handle {
    opacity: 1;
}

.jg-drag-icon {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.08em;
    pointer-events: none;
    user-select: none;
}

/* Drag overlay (ghost image while dragging) */
.jg-drag-overlay {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    transform: scale(1.04);
    opacity: 0.9;
}

/* Bottom control bar (position + story button) */
.jg-item-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 6;
}

.jg-sortable-item:hover .jg-item-controls {
    opacity: 1;
}

.jg-item-pos {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-family: sans-serif;
    min-width: 1.5em;
    text-align: center;
}

/* Story edit button */
.jg-story-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    font-size: 0.75rem;
    line-height: 1;
    padding: 3px 6px;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.12s ease;
    position: relative;
}

.jg-story-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Dot indicator when story exists */
.jg-story-btn.has-story::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    background: #3b82f6;
    border-radius: 50%;
}

/* Inline story editor */
.jg-story-editor {
    padding: 8px;
    background: #f0f0f0;
    border-radius: 0 0 4px 4px;
    border-top: 2px solid #3b82f6;
}

.jg-story-editor label,
.jg-story-editor .components-base-control__label {
    color: #1e1e1e !important;
    font-size: 0.8rem;
    font-weight: 600;
}

.jg-story-editor textarea,
.jg-story-editor .components-textarea-control__input {
    background: #fff !important;
    color: #1e1e1e !important;
    border: 1px solid #ccc !important;
    border-radius: 3px;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
}

.jg-story-editor .components-base-control__help {
    color: #666 !important;
    font-size: 0.72rem;
}

/* Fade-in animation for lightbox image */
@keyframes jg-fade-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Responsive Breakpoints ──────────────────────────────── */
@media (max-width: 768px) {
    .jg-gallery-item {
        flex: 1 1 calc(50% - 12px);
        /* 2 columns on tablet */
    }

    /* Masonry: drop to 2 columns on tablet */
    .jg-gallery.jg-masonry {
        column-count: 2 !important;
    }

    /* ── Mobile Lightbox: block-based scroll layout ─────────── */

    /* Overlay: keep centered, but DON'T scroll the overlay */
    #jg-lightbox.jg-active {
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    /* Content wrapper: block layout, scrollable box */
    #jg-lightbox-content {
        display: block;
        width: 92vw;
        max-width: 92vw;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }

    /* Image: block element, fills width, NO stacking context tricks */
    #jg-lightbox.jg-has-story #jg-lightbox-img,
    #jg-lightbox:not(.jg-has-story) #jg-lightbox-img {
        display: block;
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 100%;
        max-height: 50vh;
        object-fit: contain;
        border-radius: 6px 6px 0 0;
        flex-shrink: unset;
        /* Remove desktop effects that cause mobile rendering issues */
        box-shadow: none;
        animation: none;
    }

    /* Story panel: block element, flows after image, ABOVE image in z-stack */
    #jg-lightbox-story.has-story {
        display: block;
        position: relative;
        z-index: 2;
        width: 100%;
        max-height: none;
        border-radius: 0 0 6px 6px;
        padding: 20px 18px;
        overflow: visible;
        background: rgb(20, 20, 20);
    }

    /* Arrows: larger and easier to tap on mobile */
    #jg-lightbox-prev,
    #jg-lightbox-next {
        font-size: 3.5rem;
        padding: 0 16px;
        opacity: 0.8;
        background: rgba(0, 0, 0, 0.25);
        min-width: 48px;
        min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }

    #jg-lightbox-prev:hover,
    #jg-lightbox-next:hover,
    #jg-lightbox-prev:active,
    #jg-lightbox-next:active {
        opacity: 1;
        background: rgba(0, 0, 0, 0.45);
    }
}

@media (max-width: 480px) {
    .jg-gallery-item {
        flex: 1 1 100%;
        /* 1 column on mobile */
    }

    /* Masonry: single column on mobile */
    .jg-gallery.jg-masonry {
        column-count: 1 !important;
    }

    #jg-lightbox-content {
        width: 96vw;
        max-width: 96vw;
    }

    #jg-lightbox.jg-has-story #jg-lightbox-img,
    #jg-lightbox:not(.jg-has-story) #jg-lightbox-img {
        max-height: 45vh;
    }
}


/* ═══════════════════════════════════════════════════════════
   GALLERY DIRECTORY — Front-End Card Grid
   ═══════════════════════════════════════════════════════════ */

/* Grid container */
.jg-dir-grid {
    display: grid;
    gap: 22px;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Individual card */
.jg-dir-card {
    display: block;
    text-decoration: none;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 3 / 2;
    cursor: pointer;
}

/* Inner wrapper for overflow clip */
.jg-dir-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 3px;
}

/* Cover image — fills card, slow Ken Burns zoom on hover */
.jg-dir-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    /* Slight desaturation at rest */
    filter: saturate(0.9);
}

.jg-dir-card:hover img {
    transform: scale(1.05);
    filter: saturate(1);
}

/* Warm gradient overlay */
.jg-dir-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 24px 20px;
    background: linear-gradient(to top,
            rgba(15, 12, 8, 0.65) 0%,
            rgba(15, 12, 8, 0.25) 55%,
            transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
}

/* Title — elegant serif */
.jg-dir-title {
    color: #fff;
    font-family: 'Cinzel', 'Playfair Display', 'Georgia', serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Gold accent line — fades in on hover */
.jg-dir-accent {
    display: block;
    width: 0;
    height: 2px;
    background: #c9a96e;
    margin-top: 8px;
    transition: width 0.4s ease 0.05s;
}

.jg-dir-card:hover .jg-dir-accent {
    width: 48px;
}


/* ── Page Transition Overlay ─────────────────────────────── */
.jg-page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 8, 1);
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
}

/* Fade TO black (on click) */
.jg-page-transition.jg-fade-out {
    pointer-events: all;
    animation: jg-fade-to-black 0.4s ease forwards;
}

/* Fade FROM black (on page load) */
.jg-page-transition.jg-fade-in {
    opacity: 1;
    animation: jg-fade-from-black 0.35s ease 0.05s forwards;
}

@keyframes jg-fade-to-black {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes jg-fade-from-black {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}


/* ── Directory Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .jg-dir-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }

    .jg-dir-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .jg-dir-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .jg-dir-card {
        aspect-ratio: 16 / 10;
    }

    .jg-dir-title {
        font-size: 1rem;
    }
}


/* ═══════════════════════════════════════════════════════════
   GALLERY DIRECTORY — Editor Preview
   ═══════════════════════════════════════════════════════════ */

.jg-dir-card-editor {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    touch-action: none;
}

.jg-dir-card-preview {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
}

.jg-dir-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    color: #777;
    font-size: 0.85rem;
}

/* Editor title overlay */
.jg-dir-overlay-editor {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 14px 12px;
    background: linear-gradient(to top,
            rgba(15, 12, 8, 0.65),
            transparent);
    pointer-events: none;
}

.jg-dir-title-editor {
    color: #fff;
    font-family: 'Cinzel', 'Playfair Display', 'Georgia', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.jg-dir-accent-editor {
    display: block;
    width: 30px;
    height: 2px;
    background: #c9a96e;
    margin-top: 6px;
}

/* Edit / Remove buttons */
.jg-dir-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    background: rgba(0, 0, 0, 0.05);
}

/* Editor add-form */
.jg-dir-editor-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 12px 0;
}

/* ── Fix white-on-white: force dark text in all editor forms ── */
.jg-dir-editor-form,
.jg-dir-editor-form label,
.jg-dir-editor-form h4,
.jg-dir-editor-form p,
.jg-dir-editor-form .components-base-control__label,
.jg-dir-editor-form .components-base-control__help,
.jg-story-editor,
.jg-story-editor label,
.jg-story-editor .components-base-control__label,
.jg-story-editor .components-base-control__help {
    color: #1e1e1e !important;
}

.jg-dir-editor-form input[type="text"],
.jg-dir-editor-form input[type="url"],
.jg-dir-editor-form textarea,
.jg-dir-editor-form .components-text-control__input,
.jg-story-editor textarea,
.jg-story-editor .components-textarea-control__input {
    color: #1e1e1e !important;
    background: #fff !important;
    border: 1px solid #949494 !important;
}

/* Story editor container */
.jg-story-editor {
    background: #f9f9f9;
    border-radius: 0 0 4px 4px;
    padding: 10px 12px;
    border-top: 1px solid #ddd;
}


/* ═══════════════════════════════════════════════════════════
   EXIF DATA — Grid Badge + Tooltip
   ═══════════════════════════════════════════════════════════ */

/* Camera icon badge — bottom-left of each gallery item */
.jg-exif-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s ease, transform 0.15s ease;
    padding: 0;
    pointer-events: auto;
}

.jg-gallery-item:hover .jg-exif-badge {
    opacity: 1;
}

.jg-exif-badge:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.1);
}

.jg-exif-badge-icon {
    font-size: 0.9rem;
    line-height: 1;
    pointer-events: none;
    filter: grayscale(0.3);
}

/* EXIF Tooltip — dark popover above badge */
.jg-exif-tooltip {
    position: absolute;
    bottom: 46px;
    left: 8px;
    z-index: 20;
    min-width: 200px;
    max-width: 280px;
    padding: 12px 14px;
    background: rgba(15, 12, 8, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: jg-tooltip-in 0.18s ease;
    pointer-events: auto;
}

/* Pointer arrow */
.jg-exif-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 14px;
    width: 12px;
    height: 12px;
    background: rgba(15, 12, 8, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: rotate(45deg);
}

@keyframes jg-tooltip-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══════════════════════════════════════════════════════════
   EXIF DATA — Shared Detail Table
   ═══════════════════════════════════════════════════════════ */

.jg-exif-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.jg-exif-table tr + tr {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.jg-exif-table td {
    padding: 3px 0;
    vertical-align: top;
}

.jg-exif-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-right: 12px;
    white-space: nowrap;
    width: 1%;
}


/* ═══════════════════════════════════════════════════════════
   EXIF DATA — Lightbox Info Button + Bar
   ═══════════════════════════════════════════════════════════ */

/* ℹ️ toggle button — near the counter */
#jg-lightbox-exif-btn {
    position: fixed;
    bottom: 16px;
    right: 24px;
    z-index: 100000;
    font-size: 1.3rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    padding: 6px 10px;
    opacity: 0.7;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

#jg-lightbox-exif-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* EXIF info bar — slides up from bottom */
#jg-lightbox-exif-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100001;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                padding 0.3s ease;
    pointer-events: none;
}

#jg-lightbox-exif-bar.jg-active {
    max-height: 300px;
    padding: 16px 28px 20px;
    pointer-events: auto;
}

#jg-lightbox-exif-content {
    max-width: 650px;
    margin: 0 auto;
}

/* One-line summary (Camera • f/5.6 • 1/250s • ISO 400 • 200mm) */
.jg-exif-bar-summary {
    color: rgba(255, 255, 255, 0.75);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* Table inside lightbox bar */
#jg-lightbox-exif-bar .jg-exif-table {
    font-size: 0.78rem;
}


/* ═══════════════════════════════════════════════════════════
   EXIF DATA — Responsive Adjustments
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Slightly larger touch targets on mobile */
    .jg-exif-badge {
        width: 36px;
        height: 36px;
        bottom: 6px;
        left: 6px;
    }

    .jg-exif-badge-icon {
        font-size: 1rem;
    }

    /* Tooltip: full width minus padding */
    .jg-exif-tooltip {
        left: 4px;
        right: 4px;
        bottom: 44px;
        max-width: none;
    }

    /* Lightbox EXIF button */
    #jg-lightbox-exif-btn {
        bottom: 12px;
        right: 16px;
        font-size: 1.1rem;
        padding: 8px 12px;
    }

    /* Lightbox EXIF bar */
    #jg-lightbox-exif-bar.jg-active {
        padding: 12px 16px 16px;
    }

    .jg-exif-bar-summary {
        font-size: 0.72rem;
    }

    #jg-lightbox-exif-bar .jg-exif-table {
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .jg-exif-tooltip {
        min-width: unset;
    }

    .jg-exif-bar-summary {
        font-size: 0.68rem;
    }
}