/* gallery.php: styles only this page uses. Shared look: Styles/site.css */

/* ─── HERO ─── */

.page-hero-tag { display: inline-block; background: rgba(201,168,76,0.12); border: 1px solid var(--border); color: var(--gold); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 5px 16px; border-radius: 20px; margin-bottom: 16px; font-family: var(--font-ar); }

.page-hero h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 52px); color: var(--white); margin-bottom: 10px; }

.page-hero .ar-sub { font-family: var(--font-ar); font-size: 22px; color: var(--gold); margin-bottom: 14px; }

.page-hero p { font-size: 14px; color: rgba(255,255,255,0.5); letter-spacing: 1px; }

.page-hero .ornament-divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px auto; max-width: 200px; }

.ornament-line { flex: 1; height: 1px; }

.ornament-line-l { background: linear-gradient(90deg, transparent, var(--gold)); }

.ornament-line-r { background: linear-gradient(90deg, var(--gold), transparent); }

.ornament-diamond {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
}

/* ─── FILTER BAR ─── */

.filter-bar {
    background: var(--white);
    border-bottom: 1px solid rgba(0,14,44,0.08);
    padding: 16px 0;
    position: sticky;
    top: 72px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-count { font-size: 13px; color: var(--text-mid); }

.filter-count strong { color: var(--primary); }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cream);
    border: 1px solid rgba(0,14,44,0.12);
    border-radius: 4px;
    padding: 8px 14px;
    min-width: 240px;
}

.search-box i { color: var(--gold); font-size: 13px; }

.search-box input {
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-bn);
    font-size: 13px;
    color: var(--text-dark);
    width: 100%;
}

.search-box input::placeholder { color: var(--text-mid); opacity: 0.6; }

.view-toggle { display: flex; gap: 6px; }

.view-btn {
    width: 34px; height: 34px;
    border: 1px solid rgba(0,14,44,0.12);
    border-radius: 4px;
    background: none;
    cursor: pointer;
    color: var(--text-mid);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all 0.3s;
}

.view-btn.active { background: var(--primary); color: var(--gold); border-color: var(--primary); }

.view-btn:hover:not(.active) { border-color: var(--gold); color: var(--gold); }

/* ─── GALLERY GRID ─── */

.gallery-section { max-width: 1400px; margin: 0 auto; padding: 48px 24px 80px; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-grid.list-view {
    grid-template-columns: 1fr;
}

.gallery-grid.list-view .gallery-item {
    display: flex;
    gap: 20px;
    align-items: center;
}

.gallery-grid.list-view .gallery-item .img-wrap {
    width: 180px;
    flex-shrink: 0;
    height: 120px;
}

.gallery-grid.list-view .gallery-item .img-wrap img {
    height: 100%;
}

.gallery-grid.list-view .gallery-item .item-body {
    flex: 1;
}

.gallery-item {
    background: var(--white);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(0,14,44,0.07);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.35s ease;
    opacity: 0;
    transform: translateY(24px);
}

.gallery-item.visible { opacity: 1; transform: translateY(0); }

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,14,44,0.14);
    border-color: rgba(201,168,76,0.3);
}

.img-wrap {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.gallery-item:hover .img-wrap img { transform: scale(1.07); }

.img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,14,44,0.75) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .img-overlay { opacity: 1; }

.zoom-icon {
    width: 50px; height: 50px;
    background: rgba(201,168,76,0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 18px;
    transform: scale(0.7);
    transition: transform 0.3s;
}

.gallery-item:hover .zoom-icon { transform: scale(1); }

.gold-corner {
    position: absolute;
    top: 12px; right: 12px;
    width: 28px; height: 28px;
    border-top: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    border-radius: 0 3px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gold-corner { opacity: 1; }

.item-body { padding: 14px 16px; }

.item-caption {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 6px;
}

.item-date {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-date i { color: var(--gold); font-size: 10px; }

/* Empty state */

.gallery-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 24px;
}

.gallery-empty i { font-size: 48px; color: rgba(201,168,76,0.3); margin-bottom: 16px; display: block; }

.gallery-empty p { font-size: 16px; color: var(--text-mid); }

/* No results */

.no-results { display: none; text-align: center; padding: 60px 24px; }

.no-results i { font-size: 40px; color: rgba(201,168,76,0.3); margin-bottom: 12px; display: block; }

.no-results p { color: var(--text-mid); font-size: 15px; }

/* ─── LIGHTBOX MODAL ─── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 8, 20, 0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.lightbox.open { display: flex; animation: lbFadeIn 0.3s ease; }

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

.lightbox-inner {
    position: relative;
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-img-wrap {
    position: relative;
    width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 6px;
    object-fit: contain;
    border: 1px solid rgba(201,168,76,0.2);
    animation: imgPop 0.3s ease;
}

@keyframes imgPop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lightbox-close {
    position: fixed;
    top: 20px; right: 24px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-close:hover { background: var(--gold); color: var(--primary); border-color: var(--gold); }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 46px; height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.lightbox-nav:hover { background: var(--gold); color: var(--primary); border-color: var(--gold); }

.lightbox-prev { left: 16px; }

.lightbox-next { right: 16px; }

.lightbox-caption {
    text-align: center;
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    max-width: 600px;
    line-height: 1.7;
}

.lightbox-counter {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

.lightbox-gold-bar {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 4px auto;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

    .lightbox-nav { display: none; }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .img-wrap { height: 160px; }

    .filter-inner { flex-direction: column; align-items: flex-start; }

    .search-box { width: 100%; }

    .gallery-grid.list-view { grid-template-columns: 1fr; }

    .gallery-grid.list-view .gallery-item { flex-direction: column; }

    .gallery-grid.list-view .gallery-item .img-wrap { width: 100%; height: 200px; }
}
