/* ============================================================
   TOGABE SCHOOLS — Gallery Page Stylesheet
   ============================================================ */

/* ── Gallery Filter Bar ── */
.gallery-filter {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 72px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.gallery-filter-inner {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.gallery-filter-inner::-webkit-scrollbar { display: none; }

.gallery-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}
.gallery-filter-btn [data-lucide] { width: 15px; height: 15px; }
.gallery-filter-btn:hover  { color: var(--primary); background: var(--primary-xlight); }
.gallery-filter-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.gallery-filter-count {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    line-height: 1.4;
}

/* ── Gallery Section ── */
.gallery-section {
    padding: 4rem 0 5rem;
    background: var(--bg-section);
}

/* Gallery Stats Bar */
.gallery-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.gallery-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.gallery-count strong { color: var(--text-dark); }
.gallery-view-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.gallery-view-note [data-lucide] { width: 14px; height: 14px; color: var(--primary); }

/* Masonry Grid */
.gallery-grid {
    columns: 3;
    column-gap: 1.25rem;
}
.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1.5px solid var(--border);
    transition: var(--transition);
    display: block;
}
.gallery-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.gallery-item.hidden { display: none; }

/* Gallery placeholder card */
.gallery-placeholder {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
}
.gallery-placeholder.size-tall    { padding-top: 4rem; padding-bottom: 4rem; }
.gallery-placeholder.size-wide    { padding-top: 2rem; padding-bottom: 2rem; }
.gallery-placeholder.size-normal  { padding-top: 3rem; padding-bottom: 3rem; }

.gallery-placeholder::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    border-radius: 50%;
    opacity: 0.15;
    pointer-events: none;
}
.gallery-placeholder::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -30px;
    width: 150px; height: 150px;
    border-radius: 50%;
    opacity: 0.1;
    pointer-events: none;
}

.gallery-placeholder-icon {
    width: 70px; height: 70px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
    position: relative; z-index: 1;
    border: 2px solid rgba(255,255,255,0.3);
}
.gallery-placeholder-icon [data-lucide] { width: 32px; height: 32px; color: #fff; }

.gallery-placeholder-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    position: relative; z-index: 1;
    margin-bottom: 0.4rem;
}
.gallery-placeholder-desc {
    font-size: 0.775rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
    position: relative; z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hover overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease;
    z-index: 10;
}
.gallery-overlay-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.25s ease;
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.gallery-overlay-icon [data-lucide] { width: 22px; height: 22px; }
.gallery-item:hover .gallery-overlay {
    background: rgba(0,0,0,0.2);
}
.gallery-item:hover .gallery-overlay-icon {
    opacity: 1;
    transform: scale(1);
}

/* Category badge on card */
.gallery-cat-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255,255,255,0.92);
    border-radius: 20px;
    padding: 0.25rem 0.65rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dark);
    z-index: 5;
    backdrop-filter: blur(4px);
}

/* No results */
.gallery-no-results {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border);
}
.gallery-no-results.show { display: block; }
.gallery-no-results [data-lucide] {
    width: 52px; height: 52px;
    color: var(--border);
    margin: 0 auto 1.25rem;
    display: block;
}
.gallery-no-results h4 { color: var(--text-dark); margin-bottom: 0.5rem; }
.gallery-no-results p  { font-size: 0.875rem; color: var(--text-muted); }

/* ── Lightbox ── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,22,40,0.95);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease;
}
.lightbox-overlay.open { display: flex; }

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

.lightbox {
    position: relative;
    max-width: 800px;
    width: 100%;
    background: #1a2332;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    animation: scaleIn 0.25s ease;
}
@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    z-index: 10;
    transition: var(--transition);
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.lightbox-close [data-lucide] { width: 18px; height: 18px; }

/* Lightbox image area */
.lightbox-image-area {
    width: 100%;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
}
.lightbox-placeholder-content {
    text-align: center;
    position: relative; z-index: 1;
}
.lightbox-placeholder-icon {
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    border: 2px solid rgba(255,255,255,0.15);
}
.lightbox-placeholder-icon [data-lucide] {
    width: 48px; height: 48px;
    color: rgba(255,255,255,0.8);
}

.lightbox-info {
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.lightbox-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(49,149,202,0.2);
    color: #7ec8e8;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.875rem;
}
.lightbox-category [data-lucide] { width: 12px; height: 12px; }
.lightbox-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}
.lightbox-description {
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Navigation arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
    z-index: 10;
}
.lightbox-nav:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.lightbox-nav [data-lucide] { width: 20px; height: 20px; }
.lightbox-nav-prev { left: -56px; }
.lightbox-nav-next { right: -56px; }

/* Lightbox counter */
.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .gallery-grid      { columns: 2; }
    .lightbox-nav-prev { left: 0.5rem; }
    .lightbox-nav-next { right: 0.5rem; }
}
@media (max-width: 768px) {
    .gallery-grid { columns: 1; }
    .lightbox      { border-radius: 12px; }
    .lightbox-image-area { min-height: 260px; padding: 2rem 1.5rem; }
    .lightbox-info { padding: 1.25rem 1.5rem 1.5rem; }
    .lightbox-title { font-size: 1.1rem; }
    .lightbox-placeholder-icon { width: 80px; height: 80px; }
    .lightbox-placeholder-icon [data-lucide] { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
    .gallery-filter-btn { padding: 0.875rem 0.875rem; font-size: 0.8rem; }
}