/* ── Filter notice ────────────────────────────────────────────────────────── */

.jg-filter-notice {
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 3px solid #f0ad00;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 16px;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */

.jg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.jg-filter-search-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jg-filter-search {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 18px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.jg-filter-search:focus {
    border-color: #999;
}

.jg-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jg-filter-btn {
    height: 32px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    color: #555;
    white-space: nowrap;
}

.jg-filter-btn:hover {
    border-color: #aaa;
    color: #222;
}

.jg-filter-btn.jg-filter-active {
    background: #222;
    border-color: #222;
    color: #fff;
}

.jg-share-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px dashed #ccc;
    border-radius: 16px;
    background: transparent;
    font-size: 0.78rem;
    color: #aaa;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.jg-share-btn:hover {
    border-color: #888;
    color: #444;
}

.jg-share-btn--active {
    border-color: #222;
    border-style: solid;
    color: #222;
}

.jg-share-btn--active:hover {
    background: #222;
    color: #fff;
}

/* ── Autocomplete dropdown ────────────────────────────────────────────────── */

.jg-suggest {
    position: absolute;
    top: calc( 100% + 4px );
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    max-height: 220px;
    overflow-y: auto;
}

.jg-suggest[hidden] { display: none; }

.jg-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px 7px 14px;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
    gap: 8px;
}

.jg-suggest-item:hover,
.jg-suggest-item.jg-suggest-active {
    background: #f0f0f0;
}

.jg-suggest-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.jg-suggest-item strong {
    font-weight: 600;
    color: #000;
}

.jg-suggest-ignore {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #bbb;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    opacity: 0;
}

.jg-suggest-item:hover .jg-suggest-ignore {
    opacity: 1;
}

.jg-suggest-ignore:hover {
    background: #e0e0e0;
    color: #333;
}

/* ── Gallery ──────────────────────────────────────────────────────────────── */

.jg-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Each row is a flex container — images grow proportionally via flex: <ar> */
.jg-row {
    display: flex;
    width: 100%;
    overflow: hidden;
}

/* Each image figure */
.jg-item {
    overflow: hidden;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    background: #1a1a1a;
    border-radius: 0;
    min-width: 0;
    position: relative;
}

.jg-item img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    max-width: none !important;
    max-height: none !important;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.35s ease;
    will-change: transform;
}

.jg-item:hover img {
    transform: scale(1.03);
    filter: brightness(0.88);
}

/* Caption overlay */
.jg-item figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.68) 0%, transparent 100%);
    color: #fff;
    font-size: 0.78rem;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.jg-item:hover figcaption {
    opacity: 1;
    transform: translateY(0);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.jg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    touch-action: pinch-zoom;
    margin-block-start: 0 !important;
}

.jg-lightbox.jg-lb-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: #000;
    touch-action: none;
}

.jg-lb-stage {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pinch-zoom;
}

.jg-lb-img-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pinch-zoom;
    /* Leave room at bottom for thumbnail strip */
    padding-bottom: 90px;
    box-sizing: border-box;
}

.jg-lb-img {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    touch-action: pinch-zoom;
}

.jg-lb-caption {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX( -50% );
    margin: 0;
    padding: 5px 16px;
    background: rgba(0,0,0,0.55);
    border-radius: 20px;
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-family: Georgia, serif;
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 3;
}

/* ── Chevron nav buttons ──────────────────────────────────────────────────── */

.jg-lb-btn {
    position: fixed;
    top: calc( 50% - 45px ); /* shift up to account for strip height */
    transform: translateY( -50% );
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.4s ease;
    z-index: 3;
    padding: 0;
    box-sizing: border-box;
}

.jg-lb-prev { left: 16px; }
.jg-lb-next { right: 16px; }

.jg-lb-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Close button ─────────────────────────────────────────────────────────── */

.jg-lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: rgba(255,255,255,0.8);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jg-lb-close:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* ── Counter ──────────────────────────────────────────────────────────────── */

.jg-lb-counter {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX( -50% );
    color: rgba(255,255,255,0.5);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    font-family: 'Courier New', monospace;
    z-index: 3;
    pointer-events: none;
}

/* ── Auto-hide ────────────────────────────────────────────────────────────── */

.jg-lb-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

.jg-lb-btn,
.jg-lb-close,
.jg-lb-strip-wrap {
    transition: opacity 0.4s ease;
}

/* ── Thumbnail strip ──────────────────────────────────────────────────────── */

.jg-lb-strip-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 82px;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.jg-lb-strip {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    align-items: center;
}

.jg-lb-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
    box-sizing: border-box;
}

.jg-lb-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    pointer-events: none;
}

.jg-lb-thumb:hover {
    opacity: 0.8;
    transform: scale( 1.05 );
}

.jg-lb-thumb-active {
    opacity: 1 !important;
    border-color: #fff;
}

/* ── Editor Styles ────────────────────────────────────────────────────────── */

.jg-editor-wrap {
    border: 1px dashed #c7c7c7;
    border-radius: 4px;
    padding: 16px;
    background: #fafafa;
}

.jg-editor-toolbar { margin-bottom: 14px; }

.jg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #999;
    text-align: center;
}

.jg-empty-state .dashicons {
    font-size: 2.5rem;
    width: auto;
    height: auto;
    margin-bottom: 10px;
    opacity: 0.4;
}

.jg-editor-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
    min-height: 100px;
}

.jg-thumb-wrap {
    position: relative;
    display: inline-block;
}

.jg-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #cc3300;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.jg-thumb-wrap:hover .jg-remove-btn { opacity: 1; }

.jg-editor-note {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: #aaa;
    font-style: italic;
}

/* ── Editor tag checklist ─────────────────────────────────────────────────── */

.jg-tag-checklist {
    margin-top: 12px;
    margin-bottom: 8px;
}

.jg-tag-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.jg-tag-checklist-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e1e1e;
    margin: 0;
}

.jg-tag-checklist-toggle {
    font-size: 11px;
    color: #007cba;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jg-tag-checklist-toggle:hover {
    color: #005a87;
}

.jg-tag-checklist-help {
    font-size: 12px;
    color: #757575;
    margin: 0 0 8px;
    font-style: normal;
}

.jg-tag-checklist-empty {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin: 4px 0;
}

.jg-tag-checklist-items {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px 8px;
    background: #fafafa;
}

.jg-tag-checklist-items .components-checkbox-control {
    margin-bottom: 2px;
}

.jg-tag-checklist-search {
    width: 100%;
    padding: 5px 8px;
    margin-bottom: 6px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    outline: none;
}

.jg-tag-checklist-search:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}


