/* ============================================================
   Gallery Upgrade — Albums, Timeline, Player Filter, Infinite Scroll
   Add these styles to your site.css
   ============================================================ */

/* ── Gallery Toolbar (tabs + filter) ── */
.gallery-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.gallery-view-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg);
    border-radius: 10px;
    padding: 4px;
}

.gallery-tab {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

    .gallery-tab:hover {
        background: rgba(0, 0, 0, 0.04);
        color: var(--color-text);
    }

.gallery-tab-active {
    background: var(--color-surface) !important;
    color: var(--color-primary) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.gallery-player-filter {
    flex-shrink: 0;
}

.gallery-filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: var(--color-surface);
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    appearance: auto;
}

/* ── Album Grid ── */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.album-card {
    background: var(--color-surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .album-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    }

.album-cover-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-bg);
}

.album-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.album-card:hover .album-cover-img {
    transform: scale(1.04);
}

.album-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    opacity: 0.3;
    background: var(--color-bg);
}

.album-photo-count {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.album-card-info {
    padding: 1rem 1.25rem 1.25rem;
}

    .album-card-info h3 {
        margin: 0 0 0.25rem;
        font-size: 1.05rem;
        color: var(--color-primary);
        line-height: 1.3;
    }

.album-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.album-desc {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.album-uncategorized-link {
    text-align: center;
    margin-top: 2rem;
}

/* ── Album Detail ── */
.album-detail-header {
    margin-bottom: 1.5rem;
}

.btn-album-back {
    background: none;
    border: none;
    color: var(--color-accent-hover);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.5rem;
}

    .btn-album-back:hover {
        text-decoration: underline;
        color: var(--color-accent);
    }

.album-detail-header h2 {
    margin: 0.25rem 0 0;
}

.album-detail-desc {
    color: var(--color-text-muted);
    margin: 0.5rem 0 0;
}

/* ── Timeline View ── */
.timeline-group {
    margin-bottom: 2.5rem;
}

.timeline-month-header {
    font-size: 1.15rem;
    color: var(--color-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
    position: sticky;
    top: calc(var(--nav-height) + 8px);
    background: var(--color-surface);
    z-index: 10;
    padding-right: 1rem;
}

/* ── Infinite Scroll ── */
.gallery-scroll-sentinel {
    height: 1px;
    margin-top: 1rem;
}

.gallery-loading {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 1.5rem 0;
}

.gallery-photo-count {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

/* ── Lightbox Caption ── */
.lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ============================================================
   Admin — Album Manager
   ============================================================ */
.admin-album-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-album-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-album-cover {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-bg);
}

    .admin-album-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.admin-album-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0.3;
}

.admin-album-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.admin-album-meta {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    display: block;
}

.admin-album-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Photo Assignment Modal ── */
.admin-modal-wide {
    max-width: 900px;
    width: 95vw;
}

.admin-photo-assign-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.admin-photo-assign-col h4 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.admin-photo-assign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.admin-photo-assign-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

    .admin-photo-assign-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .admin-photo-assign-item.selected {
        border-color: var(--color-accent);
    }

.admin-photo-assign-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-view-tabs {
        justify-content: center;
    }

    .gallery-filter-select {
        width: 100%;
    }

    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .album-card-info {
        padding: 0.75rem 1rem;
    }

        .album-card-info h3 {
            font-size: 0.95rem;
        }

    .timeline-month-header {
        font-size: 1rem;
    }

    .admin-album-card {
        grid-template-columns: 80px 1fr;
        gap: 0.75rem;
    }

    .admin-album-actions {
        grid-column: 1 / -1;
    }

    .admin-photo-assign-layout {
        grid-template-columns: 1fr;
    }

    .admin-modal-wide {
        max-width: 100%;
        width: 100%;
    }
}

.gallery-tag-search {
    position: relative;
    min-width: 240px;
}

.gallery-tag-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gallery-tag-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .gallery-tag-input:focus {
        outline: none;
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px var(--color-accent-focus);
    }

    .gallery-tag-input::placeholder {
        color: var(--color-text-muted);
        font-size: 0.85rem;
    }

.gallery-tag-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background-color 0.15s;
    line-height: 1;
    padding: 0;
}

    .gallery-tag-clear:hover {
        background: rgba(0, 0, 0, 0.12);
        color: var(--color-text);
    }

/* Dropdown */
.gallery-tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.gallery-tag-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--color-text);
    border-radius: 6px;
    text-align: left;
    transition: background-color 0.1s;
}

    .gallery-tag-option:hover {
        background: var(--color-card-bg);
    }

.gallery-tag-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Active filter indicator */
.gallery-tag-active {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

    .gallery-tag-active strong {
        color: var(--color-primary);
    }

/* ── Timeline — Month Headers ── */
.gallery-month-group {
    margin-bottom: 2rem;
}

.gallery-month-header {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    letter-spacing: -0.01em;
}

/* ── Timeline — Week Subgroups (collapsible) ── */
.gallery-week-group {
    margin-bottom: 1rem;
}

.gallery-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--color-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

    .gallery-week-header:hover {
        background: var(--color-card-hover);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

.gallery-week-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text);
}

.gallery-week-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 10px;
    border-radius: 12px;
}

.gallery-week-toggle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* Photo grid within a week */
.gallery-week-group .gallery-grid {
    margin-top: 0.75rem;
}

/* Load More within a week */
.gallery-week-group .gallery-load-more {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* ── Toolbar layout update ── */
.gallery-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-tag-search {
        min-width: unset;
    }

    .gallery-month-header {
        font-size: 1.1rem;
    }

    .gallery-week-header {
        padding: 0.6rem 0.75rem;
    }

    .gallery-week-label {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}
/* ============================================================
   Photo Gallery — Tag Search + Week Timeline
   Add these styles to your site.css
   ============================================================ */

/* ── Tag Search (replaces player dropdown) ── */
.gallery-tag-search {
    position: relative;
    min-width: 240px;
}

.gallery-tag-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gallery-tag-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .gallery-tag-input:focus {
        outline: none;
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px var(--color-accent-focus);
    }

    .gallery-tag-input::placeholder {
        color: var(--color-text-muted);
        font-size: 0.85rem;
    }

.gallery-tag-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background-color 0.15s;
    line-height: 1;
    padding: 0;
}

    .gallery-tag-clear:hover {
        background: rgba(0, 0, 0, 0.12);
        color: var(--color-text);
    }

/* Dropdown */
.gallery-tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 50;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
}

.gallery-tag-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--color-text);
    border-radius: 6px;
    text-align: left;
    transition: background-color 0.1s;
}

    .gallery-tag-option:hover {
        background: var(--color-card-bg);
    }

.gallery-tag-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Active filter indicator */
.gallery-tag-active {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

    .gallery-tag-active strong {
        color: var(--color-primary);
    }

/* ── Timeline — Month Headers ── */
.gallery-month-group {
    margin-bottom: 2rem;
}

.gallery-month-header {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    letter-spacing: -0.01em;
}

/* ── Timeline — Week Subgroups (collapsible) ── */
.gallery-week-group {
    margin-bottom: 1rem;
}

.gallery-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--color-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

    .gallery-week-header:hover {
        background: var(--color-card-hover);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

.gallery-week-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text);
}

.gallery-week-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 10px;
    border-radius: 12px;
}

.gallery-week-toggle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

/* Photo grid within a week */
.gallery-week-group .gallery-grid {
    margin-top: 0.75rem;
}

/* Load More within a week */
.gallery-week-group .gallery-load-more {
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* ── Toolbar layout update ── */
.gallery-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .gallery-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-tag-search {
        min-width: unset;
    }

    .gallery-month-header {
        font-size: 1.1rem;
    }

    .gallery-week-header {
        padding: 0.6rem 0.75rem;
    }

    .gallery-week-label {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}
