/* v 260606.2035 */

body.gallery-page {
    background: #111;
    color: #fff;
}

.gallery-title {
    margin: 24px 0 10px;
    text-align: center;
    font-size: clamp(2rem, 8vw, 2.7rem);
}

.gallery-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    background: #111;
    border-bottom: 1px solid #222;
}

.gallery-brand {
    font-size: clamp(1.7rem, 6vw, 2rem);
    font-weight: 800;
    text-decoration: none;
}

.breadcrumb {
    min-width: 0;
    overflow: hidden;
    color: #bbb;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb button {
    border: 0;
    background: transparent;
    color: #79b7ff;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.breadcrumb button:hover {
    text-decoration: underline;
}

#crumbAlbum {
    color: #fff;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 260px));
    justify-content: center;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.album-card {
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.album-card:hover,
.album-card:focus-visible {
    border-color: #e0c28d;
}

.album-card img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #222;
}

.album-card-body {
    padding: 10px;
}

.album-card-count {
    color: #aaa;
    font-size: 0.9rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

.gallery-grid button {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.gallery-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    object-fit: cover;
}

#lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.92);
}

#lightbox[aria-hidden="false"] {
    display: flex;
}

#lightboxImg {
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 10px;
    object-fit: contain;
}

.lightbox-controls {
    position: absolute;
    top: 12px;
    right: 20px;
    display: flex;
    gap: 12px;
}

.lb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.38));
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.lb-btn:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}

#setCoverBtn {
    font-size: 20px;
}
.lb-btn.danger {
    border-color: rgba(255, 190, 190, 0.9);
    background: radial-gradient(circle at center, rgba(170, 20, 20, 0.95), rgba(0, 0, 0, 0.55));
}

.lb-btn.danger:hover,
.lb-btn.danger:focus-visible {
    background: radial-gradient(circle at center, rgba(220, 40, 40, 0.98), rgba(0, 0, 0, 0.58));
}


#setCoverBtn.active {
    color: #ffd400;
}

#infoBtn.active {
    background: radial-gradient(circle at center, rgba(56, 142, 60, 0.95), rgba(0, 0, 0, 0.55));
}

.nav-btn {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 110px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.18));
    color: #fff;
    cursor: pointer;
    font-size: 60px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    transform: translateY(-50%);
}

.nav-btn:hover,
.nav-btn:focus-visible {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.36));
}

#nextBtn {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.18));
}

#nextBtn:hover,
#nextBtn:focus-visible {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.36));
}

#prevBtn {
    left: 20px;
}

#nextBtn {
    right: 20px;
}

#exifPanel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: none;
    max-width: min(320px, calc(100vw - 40px));
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.75);
    line-height: 1.5;
}


#commentsPanel {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: none;
    width: min(360px, calc(100vw - 40px));
    max-height: min(70vh, 560px);
    overflow: auto;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.78);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.65);
    line-height: 1.45;
}

#commentsPanel h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.comment-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.comment-meta {
    color: #bbb;
    font-size: 0.78rem;
}

.comment-text {
    margin-top: 4px;
}

#commentForm {
    display: none;
    margin-top: 12px;
}

#commentForm label {
    display: block;
    margin-bottom: 6px;
    color: #ddd;
    font-size: 0.85rem;
}

#commentForm textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    border: 1px solid #555;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    resize: vertical;
}

#commentForm button {
    margin-top: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: #e0c28d;
    color: #111;
    cursor: pointer;
    font-weight: 700;
}

#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    z-index: 9999;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.2s ease;
}

.gallery-empty {
    max-width: 760px;
    margin: 2rem auto;
    padding: 1.5rem;
    border: 1px solid #333;
    border-radius: 14px;
    color: #bbb;
    text-align: center;
}

@media (max-width: 700px) {
    .gallery-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .nav-btn {
        width: 54px;
        height: 84px;
        font-size: 44px;
    }

    #prevBtn {
        left: 8px;
    }

    #nextBtn {
        right: 8px;
    }

    #commentsPanel {
        right: 10px;
        bottom: 10px;
        width: min(340px, calc(100vw - 20px));
    }
}


.login-prompt {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
}

.login-prompt[aria-hidden="false"] {
    display: flex;
}

.login-prompt-card {
    position: relative;
    width: min(460px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: #171717;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.login-prompt-card h2 {
    margin: 0 0 10px;
}

.login-prompt-card p {
    color: #ddd;
}

.login-prompt-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 28px;
}

.login-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.login-prompt-primary,
.login-prompt-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.login-prompt-primary {
    border: 0;
    background: #e0c28d;
    color: #111;
}

.login-prompt-secondary {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}


.delete-prompt {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(4px);
}

.delete-prompt[aria-hidden="false"] {
    display: flex;
}

.delete-prompt-card {
    position: relative;
    width: min(480px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 190, 190, 0.28);
    border-radius: 22px;
    background: linear-gradient(145deg, #211514, #131313);
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.72);
    color: #fff;
    text-align: center;
}

.delete-prompt-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.delete-prompt-thumb-wrap {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: #111;
}

.delete-prompt-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-prompt-card h2 {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.delete-prompt-card p {
    margin: 8px 0;
    color: #e6d8d3;
}

.delete-prompt-file {
    overflow-wrap: anywhere;
    color: #fff !important;
    font-weight: 700;
}

.delete-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 22px;
}

.delete-prompt-danger,
.delete-prompt-secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
}

.delete-prompt-danger {
    border: 1px solid rgba(255, 190, 190, 0.75);
    background: #8f2b18;
    color: #fff;
}

.delete-prompt-danger:hover,
.delete-prompt-danger:focus-visible {
    background: #b43620;
}

.delete-prompt-secondary {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.delete-prompt-secondary:hover,
.delete-prompt-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.14);
}

/* v 260520.0208 UTC - comment status and return-position polish */
.gallery-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.gallery-thumb.last-viewed {
    outline: 2px solid rgba(224, 194, 141, 0.95);
    outline-offset: 3px;
}

.thumb-comment-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(224, 194, 141, 0.7);
    border-radius: 999px;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.48));
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.7);
    color: #e0c28d;
    font-size: 14px;
    pointer-events: none;
}

#commentBtn {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.95);
    color: rgba(255, 255, 255, 0.58);
}

#commentBtn .comment-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linejoin: round;
    transition: fill 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#commentBtn.has-comments {
    color: rgba(255,255,255,0.95);
}

#commentBtn.has-comments .comment-icon {
    fill: currentColor;
    stroke: currentColor;
}

#commentBtn.active {
    color: #d4af37;
    border-color: rgba(255, 255, 255, 0.95);
    background: radial-gradient(
        circle at center,
        rgba(212,175,55,0.22),
        rgba(0,0,0,0.55)
    );
    box-shadow: 0 0 18px rgba(212,175,55,0.28);
}

#commentBtn.active .comment-icon {
    transform: scale(1.08);
}

/* v 260606.2035 UTC - plus control moved to left edge of toolbar */
.plus-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.plus-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-color: rgba(255, 255, 255, 0.95);
    color: #fff;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
}

.plus-btn:hover,
.plus-btn:focus-visible {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.plus-count {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 2ch;
    color: #e0c28d;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.plus-control:not(.has-pluses) .plus-count {
    display: none;
}

.plus-control.is-plussed {
    gap: 0;
}

.plus-control.is-plussed .plus-count {
    min-width: 0;
    padding: 0 2px;
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.comment-icon-btn,
.comment-post-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(224, 194, 141, 0.78);
    border-radius: 999px;
    background: rgba(224, 194, 141, 0.16);
    color: #e0c28d;
    cursor: pointer;
    font: inherit;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}


#addCommentBtn {
    font-size: 22px;
    font-weight: 800;
}

.comment-icon-btn:hover,
.comment-icon-btn:focus-visible,
.comment-post-btn:hover,
.comment-post-btn:focus-visible {
    background: rgba(224, 194, 141, 0.28);
    transform: translateY(-1px);
}

#commentForm.is-open {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

#commentForm.is-open label {
    grid-column: 1 / -1;
}

#commentForm.is-open textarea {
    min-height: 44px;
}

#commentForm.is-open .comment-post-btn {
    margin-top: 0;
    padding: 0;
    background: rgba(224, 194, 141, 0.22);
    color: #e0c28d;
}
