/* ── Community Classifieds ───────────────────────────────────────────────── */

/* ── Index: nav ── */
.cc-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.cc-nav-link {
    padding: 6px 14px;
    border: 1px solid currentColor;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
}
.cc-nav-link:hover { opacity: 0.7; }

/* ── Index: group header ── */
.cc-group-header {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 32px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid currentColor;
}

/* ── Index: listing row (wrapping flex — not forced 3-col) ── */
.cc-listing-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
}

/* ── Index: individual listing card ── */
.cc-listing {
    width: calc( 33.333% - 12px );
    min-width: 180px;
    flex-shrink: 0;
}
.cc-listing a {
    display: block;
    text-decoration: none;
    color: inherit;
}
.cc-listing-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
}
.cc-listing-placard {
    padding: 8px 4px 0;
}
.cc-listing-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
}
.cc-listing-cost {
    font-size: 0.875rem;
    margin-top: 2px;
    opacity: 0.75;
}

/* ── Detail: banner ── */
.cc-banner {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.85);
    transform: scale(1.04); /* hide blur edge fringing */
    overflow: hidden;
}

/* ── Detail: avatar circle ── */
.cc-detail-avatar-wrap {
    margin-top: -60px;
    padding-left: 24px;
    position: relative;
    z-index: 1;
}
.cc-detail-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid #fff;
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ── Detail: body ── */
.cc-detail-body {
    max-width: 780px;
    margin: 0 auto;
    padding: 16px 24px 48px;
}

/* ── Detail: sold badge ── */
.cc-sold-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.cc-detail-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 8px 0 4px;
    line-height: 1.15;
}
.cc-detail-price {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.8;
}

/* ── Detail: submitter ── */
.cc-submitter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.cc-submitter-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
}
.cc-submitter-name {
    font-weight: 600;
    font-size: 0.95rem;
}
.cc-submitter-contact {
    font-size: 0.875rem;
    margin-top: 2px;
    opacity: 0.8;
}
.cc-submitter-contact a { text-decoration: underline; }

/* ── Detail: description ── */
.cc-description {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* ── Detail: big image / flyer ── */
.cc-big-image {
    margin-bottom: 28px;
}
.cc-big-image img {
    max-width: 100%;
    border-radius: 6px;
}

/* ── Detail: gallery carousel ── */
.cc-gallery-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
}
.cc-gallery-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.cc-gallery-scroll::-webkit-scrollbar { display: none; }

.cc-gallery-cell {
    flex: 0 0 auto;
    cursor: pointer;
}
.cc-gallery-thumb {
    width: 240px;
    height: 160px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    transition: opacity 0.15s;
}
.cc-gallery-thumb:hover { opacity: 0.85; }

.cc-gallery-arrow {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
    background: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cc-gallery-arrow:hover { background: #f0f0f0; }

/* ── Lightbox ── */
.cc-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.cc-lightbox--open {
    display: flex;
}
.cc-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
}
.cc-lightbox-img {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 4px;
    object-fit: contain;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.cc-lightbox-close,
.cc-lightbox-prev,
.cc-lightbox-next {
    position: absolute;
    z-index: 2;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cc-lightbox-close:hover,
.cc-lightbox-prev:hover,
.cc-lightbox-next:hover { background: rgba(255,255,255,0.25); }

.cc-lightbox-close { top: 16px;  right: 16px; font-size: 1rem; }
.cc-lightbox-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.cc-lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }

/* ── Back link ── */
.cc-back {
    margin-top: 32px;
    font-size: 0.9rem;
}
.cc-back a { text-decoration: underline; }

/* ── Responsive ── */
@media ( max-width: 640px ) {
    .cc-listing { width: calc( 50% - 8px ); }
    .cc-gallery-thumb { width: 180px; height: 120px; }
    .cc-detail-title { font-size: 1.5rem; }
    .cc-banner { height: 150px; }
}
@media ( max-width: 400px ) {
    .cc-listing { width: 100%; }
}
