/* ============================================
   Category Grid Gallery — Single Post Styles
   ============================================ */

/* ── Outer wrapper ── */
.cgg-single-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    font-family: inherit;
    color: #1a1a1a;
}

/* ── ① Header: category badges + title ── */
.cgg-single-header {
    margin-bottom: 28px;
    text-align: center;
}

.cgg-single-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.cgg-single-cat-badge {
    display: inline-block;
    background: #111;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 5px 14px;
    border-radius: 20px;
    transition: background 0.2s;
}

.cgg-single-cat-badge:hover {
    background: #444;
    color: #fff;
}

.cgg-single-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #0d0d0d;
}

/* ── ② Hero / Featured Image ── */
.cgg-single-hero {
    width: 100%;
    margin-bottom: 36px;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
}

.cgg-single-hero__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ── ③ Description / Content ── */
.cgg-single-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #333;
    margin-bottom: 48px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.cgg-single-content p { margin: 0 0 1.2em; }
.cgg-single-content h2,
.cgg-single-content h3 { margin: 1.5em 0 0.5em; }
.cgg-single-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* ── ④ Gallery Section ── */
.cgg-single-gallery {
    margin-bottom: 48px;
}

.cgg-single-gallery__heading {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #111;
}

.cgg-single-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ── Gallery item ── */
.cgg-gal-item {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f0f0f0;
    cursor: pointer;
    text-decoration: none;
}

.cgg-gal-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.cgg-gal-item:hover .cgg-gal-item__img {
    transform: scale(1.06);
}

/* Zoom overlay icon */
.cgg-gal-item__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    color: #fff;
    transition: background 0.25s ease;
    opacity: 0;
}

.cgg-gal-item:hover .cgg-gal-item__overlay {
    background: rgba(0, 0, 0, 0.38);
    opacity: 1;
}

/* ── Lightbox (vanilla CSS — works with native <dialog> or JS) ── */
.cgg-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cgg-lightbox-overlay.is-open {
    display: flex;
}

.cgg-lightbox-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 60px rgba(0,0,0,0.6);
}

.cgg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.cgg-lightbox-close:hover { background: rgba(255,255,255,0.15); }

.cgg-lightbox-prev,
.cgg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 6px;
    transition: background 0.2s;
    line-height: 1;
}

.cgg-lightbox-prev { left: 16px; }
.cgg-lightbox-next { right: 16px; }

.cgg-lightbox-prev:hover,
.cgg-lightbox-next:hover { background: rgba(255,255,255,0.25); }

/* ── Back button ── */
.cgg-single-back {
    text-align: left;
    margin-top: 20px;
}

.cgg-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px 18px;
    transition: border-color 0.2s, color 0.2s;
}

.cgg-back-btn:hover {
    border-color: #111;
    color: #111;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cgg-single-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cgg-single-wrap {
        padding: 24px 16px 40px;
    }
}

@media (max-width: 480px) {
    .cgg-single-gallery__grid {
        grid-template-columns: 1fr;
    }
}
