/* =====================================================
   WP Album Gallery — Frontend Styles
   ===================================================== */

/* ── Page wrapper ────────────────────────────────────── */
.wpag-page-wrap { padding: 0; }
.wpag-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* =====================================================
   ALBUM INDEX  — side-by-side list
   ===================================================== */
.wpag-index-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wpag-index-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    border-bottom: 1px solid #e5e7eb;
    padding: 32px 0;
}
.wpag-index-item:first-child { padding-top: 0; }
.wpag-index-item:last-child  { border-bottom: none; }

/* Cover image */
.wpag-index-cover-link { display: block; flex-shrink: 0; }
.wpag-index-cover {
    width: 280px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
}
.wpag-index-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.wpag-index-item:hover .wpag-index-cover img { transform: scale(1.04); }

.wpag-index-no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #c3c4c7;
}

/* Info panel */
.wpag-index-info {
    padding: 4px 0 4px 36px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpag-index-title {
    margin: 0;
    font-size: 1.45em;
    font-weight: 700;
    line-height: 1.2;
}
.wpag-index-title a {
    color: inherit;
    text-decoration: none;
}
.wpag-index-title a:hover { text-decoration: underline; }

.wpag-index-meta {
    margin: 0;
    font-size: 0.82em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.wpag-index-desc {
    color: #444;
    font-size: 0.95em;
    line-height: 1.7;
    margin: 0;
}
.wpag-index-desc p { margin: 0 0 0.5em; }
.wpag-index-desc p:last-child { margin: 0; }

.wpag-index-stats {
    margin: 0;
    font-size: 0.82em;
    color: #999;
}

.wpag-index-btn {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.88em;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid currentColor;
    padding-bottom: 1px;
    opacity: 0.75;
    transition: opacity 0.15s;
    width: fit-content;
}
.wpag-index-btn:hover { opacity: 1; }

/* ── Mobile: stack cover above info ─────────────────── */
@media (max-width: 680px) {
    .wpag-index-item { grid-template-columns: 1fr; gap: 16px; }
    .wpag-index-cover { width: 100%; aspect-ratio: 16 / 9; }
    .wpag-index-info { padding-left: 0; }
}

/* =====================================================
   SINGLE ALBUM  — gallery sections + square grid
   ===================================================== */
.wpag-album-wrap { }

.wpag-page-title {
    font-size: 1.8em;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.2;
}

/* Album header */
.wpag-album-header { margin-bottom: 32px; }

.wpag-album-meta {
    font-size: 0.82em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 10px;
}

.wpag-album-desc {
    color: #444;
    font-size: 0.97em;
    line-height: 1.75;
    max-width: 680px;
}
.wpag-album-desc p { margin: 0 0 0.75em; }

/* Gallery sections */
.wpag-gallery-section { margin-bottom: 48px; }
.wpag-gallery-section:last-child { margin-bottom: 0; }

.wpag-section-title {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0 0 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.wpag-section-desc {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 14px;
    line-height: 1.6;
}

/* Photo grid — uniform squares */
.wpag-photo-grid {
    display: grid;
    gap: 6px;
}
.wpag-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wpag-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wpag-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wpag-cols-5 { grid-template-columns: repeat(5, 1fr); }
.wpag-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
    .wpag-cols-5, .wpag-cols-6 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 680px) {
    .wpag-cols-4, .wpag-cols-5, .wpag-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
    .wpag-cols-3, .wpag-cols-4, .wpag-cols-5, .wpag-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

/* Photo cell */
.wpag-photo-cell {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: #f0f0f0;
    aspect-ratio: 1 / 1; /* enforces squares */
}

.wpag-photo-cell a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.wpag-photo-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    border-radius: 3px;
}

.wpag-photo-cell:hover img {
    transform: scale(1.06);
    filter: brightness(0.82);
}

.wpag-photo-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.72em;
    padding: 18px 8px 7px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0 0 3px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wpag-photo-cell:hover .wpag-photo-caption { opacity: 1; }

/* =====================================================
   LIGHTBOX
   ===================================================== */
.wpag-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wpag-lightbox[hidden] { display: none !important; }

.wpag-lb-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 1200px);
    max-height: 94vh;
    gap: 14px;
    padding: 0 60px;
    box-sizing: border-box;
}

.wpag-lb-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.wpag-lb-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 3px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6);
    transition: opacity 0.2s ease;
}

.wpag-lb-info {
    text-align: center;
    max-width: 600px;
    flex-shrink: 0;
}
.wpag-lb-caption {
    display: block;
    color: #fff;
    font-size: 0.95em;
    font-weight: 600;
}
.wpag-lb-desc {
    color: #aaa;
    font-size: 0.84em;
    margin: 4px 0 0;
    line-height: 1.5;
}
.wpag-lb-counter {
    display: block;
    font-size: 0.75em;
    color: #666;
    margin-top: 6px;
    letter-spacing: 0.06em;
}

/* Close / prev / next */
.wpag-lb-close,
.wpag-lb-prev,
.wpag-lb-next {
    position: fixed;
    border: none;
    cursor: pointer;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}
.wpag-lb-close:hover,
.wpag-lb-prev:hover,
.wpag-lb-next:hover { background: rgba(255,255,255,0.26); }

.wpag-lb-close {
    top: 16px; right: 20px;
    width: 44px; height: 44px;
    font-size: 28px;
}
.wpag-lb-prev,
.wpag-lb-next {
    top: 50%; transform: translateY(-50%);
    width: 52px; height: 52px;
    font-size: 22px;
}
.wpag-lb-prev { left: 12px; }
.wpag-lb-next { right: 12px; }

@media (max-width: 600px) {
    .wpag-lb-inner { padding: 0 44px; }
    .wpag-lb-prev  { left: 4px; }
    .wpag-lb-next  { right: 4px; }
}

/* ── Misc ─────────────────────────────────────────────── */
.wpag-empty {
    padding: 36px;
    text-align: center;
    color: #999;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
}

.wpag-el-placeholder {
    padding: 24px;
    background: #f0f4f8;
    text-align: center;
    border-radius: 6px;
    border: 2px dashed #c0cfe0;
    color: #7a90a8;
    font-size: 13px;
}
