/**
 * Temple Gallery — Frontend Styles v2
 * Temple block grid + lightbox.
 */

/* ── Temple block ────────────────────────────────────────────────────────── */

.tg-temple-block {
    margin-bottom: 48px;
}

.tg-temple-name {
    margin: 0 0 4px;
    font-size: 1.4em;
}

.tg-temple-sub {
    margin: 0 0 16px;
    color: #666;
    font-size: 0.95em;
}

/* CSS grid — each row rendered as its own div with cols-N class */
.tg-row {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}
.tg-row.cols-1 { grid-template-columns: 1fr; }
.tg-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.tg-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tg-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.tg-row.cols-5 { grid-template-columns: repeat(5, 1fr); }
.tg-row.cols-6 { grid-template-columns: repeat(6, 1fr); }

.tg-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;
    position: relative;
    background: #f0f0f0;
}

.tg-item img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.tg-item:hover img {
    transform: scale(1.03);
}

.tg-no-photos {
    color: #888;
    font-style: italic;
}

/* ── Lightbox (birds-style, full-screen black) ───────────────────────────── */

#tg-lb {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important; height: 100vh !important;
    min-width: 100vw !important; min-height: 100vh !important;
    max-width: none !important; max-height: none !important;
    z-index: 2147483647 !important;
    margin: 0 !important; padding: 0 !important;
    background: rgba(0,0,0,0.95) !important;
    display: none;
    transform: none !important;
}

.tg-lb-overlay {
    position: absolute; inset: 0; z-index: 1;
}

.tg-lb-close {
    position: absolute; top: 20px; right: 30px;
    font-size: 50px; color: #fff;
    background: none; border: none; cursor: pointer;
    z-index: 100; opacity: 0.8; line-height: 1; padding: 0;
    transition: opacity 0.2s;
}
.tg-lb-close:hover { opacity: 1; }

.tg-lb-prev, .tg-lb-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    font-size: 80px; color: #fff;
    background: none; border: none; cursor: pointer;
    padding: 20px; opacity: 0.7; z-index: 100; line-height: 1;
    transition: opacity 0.2s;
}
.tg-lb-prev:hover, .tg-lb-next:hover { opacity: 1; }
.tg-lb-prev { left: 10px; }
.tg-lb-next { right: calc(35% + 10px); }

/* Content: image 65% | info 35% */
.tg-lb-content {
    position: relative; z-index: 10;
    display: flex; width: 100vw; height: 100vh;
}

.tg-lb-img-wrap {
    flex: 0 0 65%;
    display: flex; align-items: center; justify-content: center;
    padding: 0 0 0 150px; box-sizing: border-box;
    background: #000;
}

.tg-lb-img {
    max-width: 100%; max-height: 100vh;
    width: auto; height: auto;
    display: block; object-fit: contain;
}

/* Right info panel */
.tg-lb-info {
    flex: 0 0 35%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 36px; box-sizing: border-box;
    background: #000;
    border-left: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto; text-align: center; color: #fff;
    gap: 4px;
}

.tg-lb-name {
    font-size: 32px; font-weight: 700; line-height: 1.2;
    color: #fff; margin-bottom: 12px; text-align: center;
}

.tg-lb-location {
    font-size: 15px; color: rgba(255,255,255,0.75);
    margin-bottom: 20px; text-align: center;
}
.tg-lb-location::before { content: '📍 '; }

.tg-lb-deity-type, .tg-lb-deity-names, .tg-lb-circuits {
    display: flex; flex-direction: column;
    align-items: center; margin-bottom: 14px;
}

.tg-lb-label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.08em; color: rgba(255,255,255,0.45);
    margin-bottom: 3px;
}

.tg-lb-val {
    font-size: 15px; color: #fff; line-height: 1.4; text-align: center;
}

.tg-lb-links {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-top: 20px;
}

.tg-lb-link {
    font-size: 12px; color: rgba(255,255,255,0.7);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 14px; border-radius: 20px;
    transition: color 0.2s, border-color 0.2s;
}
.tg-lb-link:hover { color: #fff; border-color: rgba(255,255,255,0.8); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .tg-row.cols-4,
    .tg-row.cols-5,
    .tg-row.cols-6 { grid-template-columns: repeat(3, 1fr); }

    .tg-lb-content { flex-direction: column; }
    .tg-lb-img-wrap { flex: 0 0 55vh; padding: 0; }
    .tg-lb-img { max-height: 55vh; }
    .tg-lb-info { flex: 1; padding: 20px 16px; justify-content: flex-start; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); }
    .tg-lb-name { font-size: 22px; }
    .tg-lb-next { right: 10px; }
}

@media (max-width: 600px) {
    .tg-row { grid-template-columns: 1fr !important; }
}

/* ── Filter bar ──────────────────────────────── */
.tg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}
.tg-f-sel {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    min-width: 130px;
}
.tg-f-clear {
    padding: 6px 14px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 13px;
    background: #f5f5f5;
    cursor: pointer;
}
.tg-f-clear:hover { background: #e8e8e8; }
@media (max-width: 600px) {
    .tg-f-sel, .tg-f-clear { width: 100%; }
}
