/**
 * CoolMo JPA Memories — Frontend Styles
 * Design principles: minimal labels, generous spacing, large touch targets,
 * calm neutral palette, clarity over decoration.
 */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
    --jpa-accent:      #4a6fa5;
    --jpa-accent-dark: #3a5a8a;
    --jpa-green:       #3a7d56;
    --jpa-red:         #b94040;
    --jpa-text:        #2c2c2c;
    --jpa-muted:       #6b7280;
    --jpa-border:      #e2e4e8;
    --jpa-bg:          #f8f9fb;
    --jpa-white:       #ffffff;
    --jpa-radius:      10px;
    --jpa-shadow:      0 2px 8px rgba(0,0,0,.08);
    --jpa-font-size:   16px;
    --jpa-line-height: 1.65;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
.jpa-feed-wrap,
.jpa-share-wrap {
    font-size: var(--jpa-font-size);
    line-height: var(--jpa-line-height);
    color: var(--jpa-text);
    max-width: 960px;
    margin: 0 auto;
}

/* ── Feed header ────────────────────────────────────────────────────────── */
.jpa-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.jpa-section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    color: var(--jpa-text);
}

/* ── Share button ───────────────────────────────────────────────────────── */
.jpa-share-btn {
    display: inline-block;
    background: var(--jpa-accent);
    color: var(--jpa-white) !important;
    text-decoration: none !important;
    padding: 12px 24px;
    border-radius: var(--jpa-radius);
    font-size: 1rem;
    font-weight: 600;
    transition: background .2s;
    border: none;
    cursor: pointer;
}
.jpa-share-btn:hover { background: var(--jpa-accent-dark); }

/* ── Filters ────────────────────────────────────────────────────────────── */
.jpa-filters {
    margin-bottom: 28px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.jpa-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.jpa-filter-pill {
    background: var(--jpa-white);
    border: 1.5px solid var(--jpa-border);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: .9rem;
    cursor: pointer;
    color: var(--jpa-text);
    transition: all .2s;
    line-height: 1.2;
}
.jpa-filter-pill:hover,
.jpa-filter-pill.active {
    background: var(--jpa-accent);
    border-color: var(--jpa-accent);
    color: var(--jpa-white);
}
.jpa-topic-pill.active {
    background: var(--jpa-green);
    border-color: var(--jpa-green);
}

/* ── Grid ───────────────────────────────────────────────────────────────── */
.jpa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.jpa-card {
    background: var(--jpa-white);
    border-radius: var(--jpa-radius);
    box-shadow: var(--jpa-shadow);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.jpa-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

.jpa-card-thumb {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: var(--jpa-bg);
    position: relative;
}
.jpa-card-thumb--files {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef0f4;
}
.jpa-file-icon-large { font-size: 3rem; }

.jpa-card-admin-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: .8rem;
    cursor: pointer;
}
.jpa-card-admin-badge.is-public { background: rgba(58,125,86,.8); }

.jpa-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jpa-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--jpa-text);
}

.jpa-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.jpa-tag {
    font-size: .75rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}
.jpa-tag--event {
    background: #e8eef7;
    color: var(--jpa-accent);
}
.jpa-tag--topic {
    background: #e6f2ec;
    color: var(--jpa-green);
}

.jpa-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .82rem;
    color: var(--jpa-muted);
    margin-top: auto;
}

.jpa-card-view-btn {
    align-self: flex-start;
    background: transparent;
    border: 1.5px solid var(--jpa-accent);
    color: var(--jpa-accent);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .9rem;
    cursor: pointer;
    transition: all .2s;
    margin-top: 4px;
}
.jpa-card-view-btn:hover {
    background: var(--jpa-accent);
    color: var(--jpa-white);
}

/* ── Load more ──────────────────────────────────────────────────────────── */
.jpa-load-more-wrap {
    text-align: center;
    margin-bottom: 40px;
}
.jpa-load-more-btn {
    background: var(--jpa-white);
    border: 1.5px solid var(--jpa-border);
    color: var(--jpa-text);
    border-radius: var(--jpa-radius);
    padding: 12px 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
}
.jpa-load-more-btn:hover {
    border-color: var(--jpa-accent);
    color: var(--jpa-accent);
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.jpa-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--jpa-muted);
    font-size: 1.1rem;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.jpa-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jpa-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.7);
}
.jpa-lightbox-inner {
    position: relative;
    z-index: 1;
    background: var(--jpa-white);
    border-radius: 14px;
    width: min(820px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.jpa-lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--jpa-muted);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .2s;
}
.jpa-lightbox-close:hover { background: var(--jpa-bg); }

/* lightbox content */
.jpa-lb-title { font-size: 1.5rem; font-weight: 600; margin: 0 0 8px; }
.jpa-lb-meta  { color: var(--jpa-muted); font-size: .9rem; margin-bottom: 16px; }
.jpa-lb-body  { margin-bottom: 20px; line-height: 1.7; }
.jpa-lb-tags  { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.jpa-lb-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.jpa-lb-images img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity .2s;
}
.jpa-lb-images img:hover { opacity: .85; }
.jpa-lb-files { display: flex; flex-direction: column; gap: 10px; }
.jpa-lb-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--jpa-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--jpa-text);
    transition: background .2s;
}
.jpa-lb-file-row:hover { background: #e8eef7; }
.jpa-lb-file-icon { font-size: 1.4rem; flex-shrink: 0; }
.jpa-lb-file-info { flex: 1; min-width: 0; }
.jpa-lb-file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jpa-lb-file-size { font-size: .8rem; color: var(--jpa-muted); }
.jpa-lb-admin-bar {
    border-top: 1px solid var(--jpa-border);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.jpa-lb-toggle-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--jpa-border);
    background: var(--jpa-white);
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s;
}
.jpa-lb-toggle-btn.is-public { border-color: var(--jpa-green); color: var(--jpa-green); }
.jpa-lb-delete-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--jpa-red);
    background: transparent;
    color: var(--jpa-red);
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s;
    margin-left: auto;
}
.jpa-lb-delete-btn:hover { background: var(--jpa-red); color: var(--jpa-white); }

/* ── Share form ─────────────────────────────────────────────────────────── */
.jpa-share-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.jpa-back-link {
    color: var(--jpa-accent);
    text-decoration: none;
    font-size: .95rem;
}
.jpa-back-link:hover { text-decoration: underline; }

.jpa-share-form {
    background: var(--jpa-white);
    border-radius: var(--jpa-radius);
    padding: 32px;
    box-shadow: var(--jpa-shadow);
    max-width: 680px;
}

.jpa-field {
    margin-bottom: 22px;
}
.jpa-share-wrap .jpa-field label,
.jpa-feed-wrap .jpa-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
    font-size: .95rem;
    color: var(--jpa-text);
    width: auto;
    float: none;
    text-align: left;
    padding: 0;
}
.jpa-hint {
    font-weight: 400;
    font-size: .82rem;
    color: var(--jpa-muted);
    margin-left: 6px;
}
.jpa-required { color: var(--jpa-red); }

.jpa-share-wrap .jpa-field input[type="text"],
.jpa-share-wrap .jpa-field input[type="search"],
.jpa-share-wrap .jpa-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--jpa-border) !important;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--jpa-text);
    background: var(--jpa-white) !important;
    box-sizing: border-box;
    transition: border-color .2s;
    font-family: inherit;
    line-height: 1.4;
    margin: 0;
    float: none;
    height: auto;
    max-width: 100%;
    vertical-align: top;
    display: block;
}
/* Selects need less vertical padding to avoid text clipping */
.jpa-share-wrap .jpa-field select,
.jpa-topic-row select,
.jpa-filter-select {
    padding: 10px 12px;
    border: 1.5px solid var(--jpa-border) !important;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--jpa-text) !important;
    background: var(--jpa-white) !important;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
    margin: 0;
    float: none;
    height: auto !important;
    min-height: 44px;
    appearance: auto;
    -webkit-appearance: menulist;
    max-width: 100%;
    vertical-align: top;
    overflow: visible;
}
.jpa-share-wrap .jpa-field input[type="text"]:focus,
.jpa-share-wrap .jpa-field textarea:focus,
.jpa-share-wrap .jpa-field select:focus {
    outline: none;
    border-color: var(--jpa-accent);
    box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
.jpa-share-wrap .jpa-field textarea { resize: vertical; min-height: 100px; }
/* Standalone selects — direct child of .jpa-field */
.jpa-share-wrap .jpa-field > select {
    display: block;
    width: 100%;
}
/* Filter selects on feed page */
.jpa-feed-wrap .jpa-filter-select {
    max-width: 100%;
    box-sizing: border-box;
}

.jpa-field-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.jpa-field--half { flex: 1; min-width: 140px; }

/* ── Dropzone ───────────────────────────────────────────────────────────── */
.jpa-dropzone {
    border: 2px dashed var(--jpa-border);
    border-radius: var(--jpa-radius);
    padding: 36px 20px;
    text-align: center;
    background: var(--jpa-bg);
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.jpa-dropzone.drag-over {
    border-color: var(--jpa-accent);
    background: #eef2f9;
}
.jpa-dropzone-icon { font-size: 2.4rem; margin-bottom: 8px; color: var(--jpa-muted); }
.jpa-dropzone > div > p { margin: 4px 0; color: var(--jpa-muted); font-size: .95rem; }
.jpa-dropzone-hint { font-size: .82rem !important; }
.jpa-browse-btn {
    background: none;
    border: none;
    color: var(--jpa-accent);
    text-decoration: underline;
    cursor: pointer;
    font-size: .95rem;
    padding: 0;
}

/* ── Upload list ────────────────────────────────────────────────────────── */
.jpa-upload-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.jpa-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--jpa-bg);
    border-radius: 8px;
    border: 1px solid var(--jpa-border);
}
.jpa-upload-item-icon  { font-size: 1.4rem; flex-shrink: 0; }
.jpa-upload-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.jpa-upload-item-info  { flex: 1; min-width: 0; }
.jpa-upload-item-name  { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.jpa-upload-item-size  { font-size: .78rem; color: var(--jpa-muted); }
.jpa-upload-item-status { font-size: .78rem; }
.jpa-upload-item-status.uploading { color: var(--jpa-accent); }
.jpa-upload-item-status.done      { color: var(--jpa-green); }
.jpa-upload-item-status.error     { color: var(--jpa-red); }
.jpa-upload-item-remove {
    background: none;
    border: none;
    color: var(--jpa-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color .2s;
    flex-shrink: 0;
}
.jpa-upload-item-remove:hover { color: var(--jpa-red); }

/* ── Submit row ─────────────────────────────────────────────────────────── */
.jpa-submit-row { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.jpa-submit-btn {
    background: var(--jpa-accent);
    color: var(--jpa-white);
    border: none;
    border-radius: var(--jpa-radius);
    padding: 14px 36px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.jpa-submit-btn:hover     { background: var(--jpa-accent-dark); }
.jpa-submit-btn:disabled  { opacity: .55; cursor: not-allowed; }

/* Spinner */
.jpa-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--jpa-border);
    border-top-color: var(--jpa-accent);
    border-radius: 50%;
    animation: jpa-spin .7s linear infinite;
}
@keyframes jpa-spin { to { transform: rotate(360deg); } }

/* ── Notice ─────────────────────────────────────────────────────────────── */
.jpa-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: .95rem;
}
.jpa-notice.success { background: #e6f2ec; color: var(--jpa-green); border: 1px solid #b6dcc9; }
.jpa-notice.error   { background: #fceaea; color: var(--jpa-red);   border: 1px solid #f0b8b8; }

/* ── Success state ──────────────────────────────────────────────────────── */
.jpa-share-success {
    text-align: center;
    padding: 60px 20px;
}
.jpa-success-icon {
    width: 68px;
    height: 68px;
    background: var(--jpa-green);
    color: var(--jpa-white);
    font-size: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.jpa-success-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}
.jpa-share-another-btn {
    padding: 12px 24px;
    border: 1.5px solid var(--jpa-border);
    background: var(--jpa-white);
    border-radius: var(--jpa-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
    color: var(--jpa-text);
}
.jpa-share-another-btn:hover { border-color: var(--jpa-accent); color: var(--jpa-accent); }

/* ── No-access message ──────────────────────────────────────────────────── */
.jpa-no-access {
    padding: 40px;
    text-align: center;
    color: var(--jpa-muted);
    font-size: 1.05rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .jpa-grid { grid-template-columns: 1fr; }
    .jpa-share-form { padding: 20px; }
    .jpa-lightbox-inner { padding: 20px; }
    .jpa-field-row { flex-direction: column; }
}

/* ── Uniform File Tiles (lightbox) ──────────────────────────────────────── */
.jpa-lb-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* Every file — image or doc — is the same card shape */
.jpa-file-tile {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--jpa-border);
    background: var(--jpa-white);
    text-decoration: none !important;
    color: var(--jpa-text);
    transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: pointer;
    min-height: 160px;
}
.jpa-file-tile:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transform: translateY(-2px);
    border-color: var(--jpa-accent);
}

/* Tile image area — background-size/position set inline per tile type */
.jpa-file-tile .jpa-tile-img {
    flex: 1;
    min-height: 120px;
    background-color: var(--jpa-bg);
}

/* Doc/non-image tiles also use jpa-tile-img (SVG placeholder as bg) */
/* No separate icon-only variant needed — all tiles are uniform */

/* Footer strip — same on both types */
.jpa-tile-footer {
    padding: 8px 10px;
    border-top: 1px solid var(--jpa-border);
    background: var(--jpa-white);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.jpa-tile-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--jpa-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jpa-tile-name {
    font-size: .75rem;
    color: var(--jpa-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jpa-tile-size {
    font-size: .72rem;
    color: var(--jpa-muted);
}

/* "Open file" hint on hover */
.jpa-file-tile::after {
    content: 'Tap to open';
    display: block;
    text-align: center;
    font-size: .72rem;
    color: var(--jpa-accent);
    padding: 4px;
    background: #f0f4fb;
    opacity: 0;
    transition: opacity .2s;
}
.jpa-file-tile--download::after { content: 'Download / open file'; }
.jpa-file-tile--image::after { content: 'View image'; }
.jpa-file-tile:hover::after { opacity: 1; }

/* Lightbox loading state */
.jpa-lb-loading {
    padding: 50px;
    text-align: center;
    color: var(--jpa-muted);
    font-size: 1rem;
}

/* Admin bar — tightened up, only shows to admins */
.jpa-lb-admin-bar {
    border-top: 1px solid var(--jpa-border);
    padding-top: 16px;
    margin-top: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.jpa-lb-toggle-btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--jpa-border);
    background: var(--jpa-white);
    cursor: pointer;
    font-size: .9rem;
    color: var(--jpa-text);
    transition: all .2s;
}
.jpa-lb-toggle-btn:hover     { border-color: var(--jpa-accent); color: var(--jpa-accent); }
.jpa-lb-toggle-btn.is-public { border-color: var(--jpa-green);  color: var(--jpa-green); }
.jpa-lb-delete-btn {
    margin-left: auto;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1.5px solid var(--jpa-red);
    background: transparent;
    color: var(--jpa-red);
    cursor: pointer;
    font-size: .9rem;
    transition: all .2s;
}
.jpa-lb-delete-btn:hover { background: var(--jpa-red); color: var(--jpa-white); }

/* Card thumb — icon fallback */
.jpa-card-thumb--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef0f4;
    font-size: 3rem;
}

/* ── Filter selects ─────────────────────────────────────────────────────── */
/* .jpa-filters base rules already defined above — just keeping selects here */
.jpa-filter-item { flex: 1; min-width: 200px; max-width: 340px; }
.jpa-filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--jpa-border);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--jpa-text);
    background: var(--jpa-white);
    cursor: pointer;
    appearance: auto;
    transition: border-color .2s;
}
.jpa-filter-select:focus {
    outline: none;
    border-color: var(--jpa-accent);
    box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
.jpa-filter-clear {
    background: none;
    border: none;
    color: var(--jpa-muted);
    font-size: .88rem;
    cursor: pointer;
    padding: 6px 2px;
    text-decoration: underline;
    white-space: nowrap;
}
.jpa-filter-clear:hover { color: var(--jpa-accent); }

/* ── Inline topic add (admin share form) ────────────────────────────────── */
.jpa-topic-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.jpa-topic-row select { flex: 1; min-width: 0; width: auto !important; }
.jpa-add-topic-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--jpa-accent);
    background: var(--jpa-white);
    color: var(--jpa-accent);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    padding: 0;
}
.jpa-add-topic-btn:hover { background: var(--jpa-accent); color: var(--jpa-white); }

.jpa-new-topic-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}
.jpa-new-topic-row input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--jpa-accent);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--jpa-text);
}
.jpa-new-topic-row input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
.jpa-cancel-link {
    background: none;
    border: none;
    color: var(--jpa-muted);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 4px;
    white-space: nowrap;
}

/* ── Live Search ─────────────────────────────────────────────────────────── */
.jpa-search-bar {
    position: relative;
    margin-bottom: 20px;
    max-width: 480px;
}
.jpa-search-bar input[type="search"] {
    width: 100%;
    padding: 12px 18px;
    border: 1.5px solid var(--jpa-border);
    border-radius: 24px;
    font-size: 1rem;
    color: var(--jpa-text);
    background: var(--jpa-white);
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.jpa-search-bar input[type="search"]:focus {
    outline: none;
    border-color: var(--jpa-accent);
    box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
.jpa-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--jpa-white);
    border: 1.5px solid var(--jpa-border);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
    z-index: 9999;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}
.jpa-search-result {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--jpa-border);
    transition: background .15s;
    align-items: center;
}
.jpa-search-result:last-child { border-bottom: none; }
.jpa-search-result:hover { background: var(--jpa-bg); }
.jpa-sr-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--jpa-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.jpa-sr-info { flex: 1; min-width: 0; }
.jpa-sr-title { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jpa-sr-meta  { font-size: .78rem; color: var(--jpa-muted); margin-top: 2px; }
.jpa-sr-tags  { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.jpa-search-empty { padding: 20px; text-align: center; color: var(--jpa-muted); font-size: .9rem; }

/* ── Collections tag on cards ────────────────────────────────────────────── */
.jpa-tag--collection {
    background: #f3e8ff;
    color: #6b21a8;
}

/* ── Contributions ──────────────────────────────────────────────────────── */
.jpa-lb-contribute-bar {
    border-top: 1px solid var(--jpa-border);
    padding-top: 20px;
    margin-top: 18px;
}
.jpa-contribute-callout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #f7fbff 0%, #ffffff 100%);
    border: 1.5px solid #c9d8ee;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 24px rgba(31, 70, 117, .08);
}
.jpa-contribute-callout-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--jpa-accent);
    color: var(--jpa-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    line-height: 1;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(31, 70, 117, .18);
}
.jpa-contribute-callout-copy {
    flex: 1;
    min-width: 0;
}
.jpa-contribute-callout-copy h3 {
    margin: 0 0 6px;
    color: var(--jpa-primary);
    font-size: 1.08rem;
    line-height: 1.3;
}
.jpa-contribute-callout-copy p {
    margin: 0 0 9px;
    color: var(--jpa-text);
    font-size: .95rem;
    line-height: 1.5;
}
.jpa-contribute-help-text {
    color: var(--jpa-muted) !important;
    font-size: .88rem !important;
}
.jpa-contribute-btn {
    background: var(--jpa-accent);
    border: 1.5px solid var(--jpa-accent);
    color: var(--jpa-white);
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
    box-shadow: 0 8px 18px rgba(31, 70, 117, .16);
}
.jpa-contribute-btn:hover,
.jpa-contribute-btn:focus {
    background: var(--jpa-primary);
    color: var(--jpa-white);
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(31, 70, 117, .22);
}

.jpa-contribute-area {
    margin-top: 14px;
    background: var(--jpa-white);
    border: 1px solid var(--jpa-border);
    border-radius: 14px;
    padding: 14px;
}
.jpa-contribute-step {
    font-weight: 700;
    color: var(--jpa-primary);
    margin-bottom: 10px;
    font-size: .95rem;
}
.jpa-contribute-dropzone {
    border: 2px dashed #b8c7dd;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    background: var(--jpa-bg);
    font-size: .95rem;
    color: var(--jpa-muted);
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.jpa-contribute-dropzone.drag-over {
    border-color: var(--jpa-accent);
    background: #eef2f9;
}
.jpa-contribute-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}
.jpa-contribute-cancel {
    background: none;
    border: none;
    color: var(--jpa-muted);
    font-size: .88rem;
    cursor: pointer;
    text-decoration: underline;
}
.jpa-contribute-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .9rem;
    margin-top: 10px;
}
.jpa-contribute-notice.success { background: #e6f2ec; color: var(--jpa-green); border: 1px solid #b6dcc9; }
.jpa-contribute-notice.error   { background: #fceaea; color: var(--jpa-red);   border: 1px solid #f0b8b8; }


@media (max-width: 640px) {
    .jpa-contribute-callout {
        display: block;
        padding: 16px;
    }
    .jpa-contribute-callout-icon {
        margin-bottom: 12px;
    }
    .jpa-contribute-btn {
        width: 100%;
        text-align: center;
    }
}

/* Pending admin review panel */
.jpa-lb-pending {
    border: 1.5px solid #f6a84a;
    background: #fff8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
}
.jpa-lb-pending-label {
    font-weight: 600;
    font-size: .9rem;
    color: #c05621;
    margin-bottom: 10px;
}
.jpa-lb-pending-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0d0a8;
    font-size: .88rem;
}
.jpa-lb-pending-row:last-child { border-bottom: none; }
.jpa-lb-pending-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* File tile additions */
.jpa-tile-retract,
.jpa-tile-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}
.jpa-tile-retract:hover,
.jpa-tile-delete:hover { background: var(--jpa-red); }
.jpa-file-tile .jpa-tile-img { position: relative; }

.jpa-tile-pending {
    display: block;
    font-size: .72rem;
    color: #c05621;
    background: #fff3cc;
    border-radius: 4px;
    padding: 2px 6px;
    margin-top: 4px;
    text-align: center;
}
.jpa-tile-contrib-by {
    font-size: .72rem;
    color: var(--jpa-muted);
    display: block;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── v1.3.7 refinements: smaller visibility badges, sticky lightbox header ── */
.jpa-card-admin-badge {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    border-radius: 8px;
}

.jpa-lightbox-inner {
    padding: 0;
}

.jpa-lightbox-close {
    position: sticky;
    top: 14px;
    float: right;
    z-index: 6;
    margin: 14px 16px 0 0;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--jpa-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.jpa-lb-sticky-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--jpa-white);
    padding: 32px 62px 18px 32px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 6px 16px rgba(0,0,0,.05);
}

.jpa-lb-sticky-header .jpa-lb-tags {
    margin-bottom: 0;
}

.jpa-lb-scroll-body {
    padding: 22px 32px 32px;
}

.jpa-tile-name {
    display: none !important;
}

.jpa-visibility-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.jpa-visibility-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1.5px solid var(--jpa-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--jpa-white);
    cursor: pointer;
}

.jpa-visibility-option input {
    margin-top: 4px;
}

.jpa-visibility-option span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.jpa-visibility-option small {
    color: var(--jpa-muted);
    line-height: 1.35;
}

@media (max-width: 600px) {
    .jpa-lb-sticky-header { padding: 24px 56px 16px 20px; }
    .jpa-lb-scroll-body { padding: 18px 20px 24px; }
}

/* ── v1.4.0 performance/image viewer refinements ───────────────────────── */
.jpa-file-tile {
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    text-align: left;
    font-family: inherit;
}

button.jpa-file-tile {
    width: 100%;
}

/* v1.4.12: lock the individual-memory lightbox back to small, uniform file tiles. */
.jpa-lb-scroll-body .jpa-lb-files {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    align-items: start;
    gap: 14px;
}
.jpa-lb-scroll-body .jpa-file-tile {
    width: 100%;
    min-height: 160px;
}
.jpa-lb-scroll-body .jpa-file-tile .jpa-tile-img {
    min-height: 120px;
    max-height: 120px;
}
.jpa-lb-scroll-body .jpa-file-tile .jpa-tile-thumb {
    width: 100%;
    height: 120px !important;
    max-height: 120px !important;
}

.jpa-file-tile .jpa-tile-img {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
}

.jpa-tile-thumb {
    display: block;
    width: 100%;
    height: 120px;
}

.jpa-tile-thumb--image {
    object-fit: cover;
}

.jpa-tile-thumb--icon {
    object-fit: contain;
    padding: 18px;
    background: #f8f9fb;
    box-sizing: border-box;
}

.jpa-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.jpa-image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 25, .86);
    backdrop-filter: blur(2px);
}

.jpa-image-viewer-panel {
    position: relative;
    z-index: 1;
    width: min(1100px, 96vw);
    height: min(92vh, 900px);
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jpa-image-viewer-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jpa-image-viewer-back {
    border: 1px solid rgba(255,255,255,.32);
    background: rgba(255,255,255,.94);
    border-radius: 999px;
    cursor: pointer;
    color: #1f2937;
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    padding: 9px 14px;
    font-size: .9rem;
    font-weight: 650;
}

.jpa-image-viewer-back:hover {
    background: #fff;
    border-color: var(--jpa-accent);
    color: var(--jpa-accent);
}

.jpa-image-viewer-body {
    width: 100%;
    height: 100%;
    padding: 58px 12px 12px;
    overflow: auto;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.jpa-image-viewer-body img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,.38);
}

@media (max-width: 640px) {
    .jpa-image-viewer { padding: 8px; }
    .jpa-image-viewer-actions { top: 10px; right: 10px; left: 10px; justify-content: space-between; }
    .jpa-image-viewer-body { padding-top: 60px; }
}

/* ── v1.4.4: shortcode/theme safety + clickable cards/tags ─────────────── */
.jpa-card {
    cursor: pointer;
}
.jpa-card:focus {
    outline: 3px solid rgba(74,111,165,.22);
    outline-offset: 3px;
}
.jpa-card .jpa-card-view-btn,
.jpa-card .jpa-filter-link,
.jpa-card .jpa-card-admin-badge {
    cursor: pointer;
}
.jpa-tag,
button.jpa-tag {
    display: inline-flex;
    align-items: center;
    border: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1.25;
    font-family: inherit;
}
button.jpa-tag:hover,
button.jpa-tag:focus,
.jpa-meta-link:hover,
.jpa-meta-link:focus,
.jpa-lb-author:hover,
.jpa-lb-author:focus {
    filter: brightness(.96);
    text-decoration: underline;
    outline: none;
}
.jpa-meta-link,
.jpa-lb-author {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}
.jpa-lb-tags .jpa-tag {
    margin: 0;
}

/* ── v1.4.5 share form polish + search usability ─────────────────────── */
.jpa-share-section {
    border: 1px solid rgba(74, 111, 165, .16);
    border-radius: 14px;
    padding: 18px 18px 2px;
    margin: 4px 0 24px;
    background: linear-gradient(180deg, rgba(74,111,165,.045), rgba(255,255,255,0));
}

.jpa-share-section-heading {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(74, 111, 165, .12);
}

.jpa-share-section-heading h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    line-height: 1.25;
    color: var(--jpa-accent);
}

.jpa-share-section-heading p {
    margin: 0;
    color: var(--jpa-muted);
    font-size: .9rem;
    line-height: 1.45;
}

.jpa-field--full {
    width: 100%;
}

.jpa-field-row--collection-topic {
    align-items: flex-start;
}

.jpa-visibility-field {
    border: 1px solid rgba(74, 111, 165, .16);
    border-radius: 14px;
    padding: 18px;
    background: rgba(74, 111, 165, .035);
}

.jpa-visibility-field > label {
    margin-bottom: 12px !important;
}

.jpa-visibility-option {
    position: relative;
    min-height: 76px;
    border-color: rgba(74, 111, 165, .18);
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.jpa-visibility-option:hover {
    border-color: rgba(74, 111, 165, .45);
    box-shadow: 0 6px 16px rgba(31, 41, 55, .08);
    transform: translateY(-1px);
}

.jpa-visibility-option:has(input:checked) {
    border-color: var(--jpa-accent);
    background: #f4f7fc;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, .10);
}

.jpa-visibility-option strong {
    color: var(--jpa-text);
}

.jpa-visibility-field .jpa-hint {
    display: block;
    margin: 10px 0 0;
    line-height: 1.45;
}

.jpa-files-field .jpa-hint {
    display: inline-block;
    margin-left: 8px;
    font-weight: 500;
}

.jpa-dropzone {
    background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
}

.jpa-search-bar input[type="search"] {
    -webkit-appearance: none;
}

@media (max-width: 700px) {
    .jpa-share-section,
    .jpa-visibility-field {
        padding: 16px;
    }

    .jpa-files-field .jpa-hint {
        display: block;
        margin: 4px 0 0;
    }
}

/* ── v1.4.6: image navigation + share visibility spacing ──────────────── */
.jpa-image-viewer-panel {
    overflow: visible;
}

.jpa-image-viewer-actions {
    gap: 10px;
}

.jpa-image-viewer-count {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.88);
    color: #374151;
    font-size: .86rem;
    font-weight: 650;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.jpa-image-viewer-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.36);
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #1f2937;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(0,0,0,.26);
    transition: transform .16s ease, background .16s ease, color .16s ease;
}

.jpa-image-viewer-nav:hover,
.jpa-image-viewer-nav:focus {
    background: #fff;
    color: var(--jpa-accent);
    transform: translateY(-50%) scale(1.04);
    outline: none;
}

.jpa-image-viewer-prev {
    left: max(12px, calc(50% - 590px));
}

.jpa-image-viewer-next {
    right: max(12px, calc(50% - 590px));
}

.jpa-visibility-field {
    padding: 26px 28px !important;
}

.jpa-visibility-field > label {
    display: block;
    margin: 0 0 16px !important;
    line-height: 1.35;
}

.jpa-visibility-options {
    gap: 16px;
}

.jpa-visibility-option {
    padding: 18px 20px 18px 46px !important;
    min-height: 92px;
    align-items: flex-start;
}

.jpa-visibility-option input {
    position: absolute;
    top: 20px;
    left: 18px;
    margin: 0;
}

.jpa-visibility-option span {
    gap: 6px;
}

.jpa-visibility-option strong {
    line-height: 1.25;
}

.jpa-visibility-option small {
    line-height: 1.45;
}

.jpa-visibility-field .jpa-hint {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(74,111,165,.12);
}

@media (max-width: 700px) {
    .jpa-visibility-field {
        padding: 20px !important;
    }

    .jpa-visibility-option {
        min-height: auto;
        padding: 16px 16px 16px 42px !important;
    }

    .jpa-visibility-option input {
        top: 18px;
        left: 16px;
    }

    .jpa-image-viewer-nav {
        width: 42px;
        height: 42px;
        font-size: 1.7rem;
    }

    .jpa-image-viewer-prev {
        left: 8px;
    }

    .jpa-image-viewer-next {
        right: 8px;
    }

    .jpa-image-viewer-count {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   JPA Memories Slideshow
   ═══════════════════════════════════════════════════════════════════════ */

.jpa-feed-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.jpa-slideshow-launch,
.jpa-slideshow-control {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #233b5d;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(35,59,93,.18);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.jpa-slideshow-launch:hover,
.jpa-slideshow-control:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(35,59,93,.24);
}

.jpa-slideshow-launch:focus,
.jpa-slideshow-control:focus {
    outline: 3px solid rgba(35,59,93,.25);
    outline-offset: 3px;
}

.jpa-slideshow-control[disabled] {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.jpa-slideshow-shortcode {
    margin: 0 0 18px;
}

.jpa-lb-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.jpa-slideshow-launch--memory {
    min-height: auto;
    padding: 8px 18px;
    font-size: .9rem;
    font-weight: 600;
    background: transparent;
    color: var(--jpa-accent) !important;
    border: 1.5px solid var(--jpa-accent);
    border-radius: 8px;
    box-shadow: none;
}
.jpa-slideshow-launch--memory:hover {
    background: var(--jpa-accent);
    color: var(--jpa-white) !important;
    box-shadow: none;
    transform: none;
}

.jpa-slideshow-viewer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.jpa-slideshow-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 18, .86);
    backdrop-filter: blur(8px);
}

.jpa-slideshow-panel {
    position: relative;
    z-index: 1;
    width: min(1180px, 96vw);
    height: min(820px, 92vh);
    background: #111827;
    color: #fff;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
    display: flex;
    flex-direction: column;
}

.jpa-slideshow-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.jpa-slideshow-topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 78px 16px 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0));
}

.jpa-slideshow-title {
    font-size: clamp(1.05rem, 2vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.jpa-slideshow-subtitle,
.jpa-slideshow-count {
    color: rgba(255,255,255,.75);
    font-size: .95rem;
    margin-top: 4px;
}

.jpa-slideshow-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 70px;
}

.jpa-slideshow-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.28);
}

.jpa-slideshow-effect-fade { animation: jpaSlideshowFade .55s ease both; }
.jpa-slideshow-effect-zoom { animation: jpaSlideshowZoom .75s ease both; }
.jpa-slideshow-effect-slide { animation: jpaSlideshowSlide .55s ease both; }
.jpa-slideshow-effect-soft { animation: jpaSlideshowSoft .8s ease both; }
.jpa-slideshow-effect-none { animation: none; }

@keyframes jpaSlideshowFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes jpaSlideshowZoom {
    from { opacity: 0; transform: scale(.965); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes jpaSlideshowSlide {
    from { opacity: 0; transform: translateX(22px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes jpaSlideshowSoft {
    from { opacity: 0; filter: blur(7px); transform: scale(1.015); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .jpa-slideshow-image { animation: none !important; }
}

.jpa-slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    font-size: 2.4rem;
    line-height: .8;
}

.jpa-slideshow-prev { left: 18px; }
.jpa-slideshow-next { right: 18px; }

.jpa-slideshow-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px 22px;
    background: linear-gradient(0deg, rgba(255,255,255,.08), rgba(255,255,255,0));
}

.jpa-slideshow-open {
    background: rgba(255,255,255,.15);
}

.jpa-slideshow-loading,
.jpa-slideshow-empty {
    margin: auto;
    padding: 28px;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 700px) {
    .jpa-feed-actions {
        width: 100%;
    }

    .jpa-feed-actions .jpa-slideshow-launch,
    .jpa-feed-actions .jpa-share-btn {
        width: 100%;
    }

    .jpa-lb-header-actions .jpa-slideshow-launch--memory {
        width: auto;
    }

    .jpa-slideshow-viewer {
        padding: 10px;
    }

    .jpa-slideshow-panel {
        width: 100%;
        height: 94vh;
        border-radius: 18px;
    }

    .jpa-slideshow-topbar {
        padding: 18px 68px 12px 16px;
        flex-direction: column;
        gap: 4px;
    }

    .jpa-slideshow-stage {
        padding: 8px 54px;
    }

    .jpa-slideshow-nav {
        width: 42px;
        height: 42px;
        font-size: 1.9rem;
    }

    .jpa-slideshow-prev { left: 8px; }
    .jpa-slideshow-next { right: 8px; }
}
