/* Фотоархив по ротам (стиль 11politruk) */

.gallery-page {
    background: transparent;
}

.gallery-albums-grid {
    align-items: stretch;
}

.gallery-folder-card {
    border: 1px solid #c5d9e3;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(18, 107, 133, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(18, 107, 133, 0.18);
}

.gallery-folder-cover {
    position: relative;
    height: 180px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #e8f4f7, #d1eaf2);
    padding: 1rem;
    overflow: hidden;
}

.gallery-folder-cover-img {
    display: block;
    width: auto;
    max-width: min(78%, 200px);
    max-height: 148px;
    height: auto;
    object-fit: contain;
    opacity: 1 !important;
    visibility: visible !important;
}

.gallery-folder-count {
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 2;
    background: #126B85;
    color: #fff;
    border-radius: 999px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 0.45rem;
    line-height: 1;
}

.gallery-folder-body {
    padding: 0.85rem 0.95rem 0.9rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.55rem;
}

.gallery-folder-title {
    line-height: 1.3;
    min-height: calc(1.3em * 2);
    margin: 0;
    font-weight: 700;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.gallery-folder-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.65rem;
    margin-top: auto;
}

.gallery-folder-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.gallery-folder-city-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f3f7fa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #126B85;
    font-size: 1.35rem;
}

.gallery-folder-company {
    color: #0f3d4d;
    font-weight: 600;
}

.gallery-folder-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

.gallery-folder-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.gallery-album-hero-splash {
    width: 120px;
    height: auto;
    object-fit: contain;
    background: #eef2f7;
    border-radius: 12px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
}

.gallery-photo-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.gallery-photo-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.gallery-photo-caption {
    padding: 0.45rem 0.65rem;
    color: #4a6d7a;
}

.gallery-photo-caption-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gallery-photo-caption-link:hover {
    color: var(--color-primary, #2f6b4f);
}

.gallery-search .form-label {
    color: #4a6d7a;
}

.gallery-upload-help {
    max-width: 52rem;
}

.gallery-upload-slot {
    border: 1px solid #d7e4ea;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: #f8fbfd;
}

.gallery-upload-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.gallery-lb-login-hint a {
    color: #9ad7ea;
}

.gallery-photo-open:focus-visible {
    outline: 2px solid #126B85;
    outline-offset: 2px;
}

.gallery-photo-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.65rem;
    padding: 0.35rem 0.65rem 0.55rem;
    border-top: 1px solid #eef2f5;
    font-size: 0.75rem;
}

.gallery-card-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.gallery-card-reaction {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: #4a6d7a;
}

.gallery-card-reaction-count {
    font-variant-numeric: tabular-nums;
    min-width: 0.75em;
}

.gallery-card-meta-right {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
}

.gallery-album-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #c5d9e3;
    border-radius: 12px;
    background: linear-gradient(160deg, #f4fafc, #eef6f9);
}

.gallery-album-reactions-label {
    font-weight: 600;
    color: #0f3d4d;
    white-space: nowrap;
}

.gallery-album-reactions .article-reactions {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.gallery-album-reactions .article-reaction-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(18, 107, 133, 0.08);
    font-size: 0.9rem;
}

.gallery-album-reactions-total {
    margin-left: 0.25rem;
}

/* Lightbox */
body.gallery-lb-open {
    overflow: hidden;
}

.gallery-lb {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gallery-lb.is-open {
    display: flex;
}

.gallery-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 22, 28, 0.78);
}

.gallery-lb-dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: #0f252e;
    color: #f3f7fa;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    padding: 1rem 1rem 1.15rem;
}

.gallery-lb-close {
    position: absolute;
    top: 0.35rem;
    right: 0.55rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-lb-nav {
    position: absolute;
    top: 28%;
    z-index: 3;
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gallery-lb-prev { left: 0.55rem; }
.gallery-lb-next { right: 0.55rem; }

.gallery-lb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 0.5rem 2.5rem 0.75rem;
}

.gallery-lb-stage img {
    display: block;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: #000;
}

.gallery-lb-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.gallery-lb-counter {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    margin-right: 0.35rem;
}

.gallery-lb-caption {
    text-align: center;
    margin: 0 0 0.75rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

.gallery-lb-caption a {
    color: #9ad7ea;
}

.gallery-lb-reactions {
    display: flex;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.gallery-lb-reactions .article-reactions {
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-lb-reactions .article-reaction-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.gallery-lb-reactions .article-reaction-btn.is-active {
    background: rgba(18, 107, 133, 0.55);
    border-color: #4db8d4;
}

.gallery-lb-comments-wrap {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 0.75rem;
}

.gallery-lb-comments-title {
    font-size: 1rem;
    margin: 0 0 0.55rem;
}

.gallery-lb-comments {
    max-height: 180px;
    overflow: auto;
    margin-bottom: 0.65rem;
}

.gallery-lb-comment {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-lb-comment-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.15rem;
}

.gallery-lb-comment-text {
    font-size: 0.92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.gallery-lb-comment-form .form-control {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.gallery-lb-comment-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 576px) {
    .gallery-lb-dialog {
        padding: 0.75rem;
    }

    .gallery-lb-stage {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .gallery-lb-nav {
        top: auto;
        bottom: auto;
        position: static;
        margin: 0 0.25rem;
    }

    .gallery-lb-toolbar {
        order: 0;
    }
}

[data-theme="dark"] .gallery-folder-card,
[data-theme="dark"] .gallery-photo-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .gallery-folder-cover {
    background: linear-gradient(160deg, #1a323c, #0f252e);
}

[data-theme="dark"] .gallery-folder-title,
[data-theme="dark"] .gallery-folder-body .text-dark {
    color: var(--color-text) !important;
}

[data-theme="dark"] .gallery-folder-city-icon {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-border);
    color: var(--color-primary);
}

[data-theme="dark"] .gallery-album-reactions {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--color-border);
}

[data-theme="dark"] .gallery-album-reactions-label {
    color: var(--color-text);
}

[data-theme="dark"] .gallery-photo-card-meta {
    border-top-color: var(--color-border);
}
