/* ==========================================================================
   LWP Extras — classic mode (Bootstrap-based layout)
   Sections on work/series pages, the card grid, and the single/archive
   extras pages. Scoped to the lwp-ex/lwp-exc prefixes.
   ========================================================================== */

/* ===== SECTION WRAPPERS ===== */

.lwp-exc-work-section,
.lwp-exc-series-section {
    padding: 64px 0;
    background-color: #f7f4fb;
}

.lwp-exc-section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 40px;
}

.lwp-exc-section-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7c5cbf;
    margin: 0 0 10px;
}

.lwp-exc-section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2b2340;
    margin: 0 0 16px;
}

.lwp-exc-section-divider {
    width: 60px;
    height: 2px;
    background: #7c5cbf;
    margin: 0 auto;
    opacity: 0.5;
}

/* ===== CARD ===== */

.lwp-exc-card {
    background: #ffffff;
    border: 1px solid #e5e0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.lwp-exc-card:hover {
    box-shadow: 0 10px 30px rgba(43, 35, 64, 0.12);
    transform: translateY(-2px);
}

.lwp-exc-card-media {
    line-height: 0;
}

.lwp-exc-card-media img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.lwp-exc-card-body {
    padding: 20px 20px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.lwp-exc-badge {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7c5cbf;
    background: #f1ecfa;
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 12px;
}

.lwp-exc-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px;
}

.lwp-exc-card-title a {
    color: #2b2340;
    text-decoration: none;
}

.lwp-exc-card-title a:hover {
    color: #7c5cbf;
}

.lwp-exc-card-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6b6480;
    margin: 0 0 16px;
    flex: 1;
}

.lwp-exc-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== BUTTONS ===== */

.lwp-exc-btn {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lwp-exc-btn--primary {
    background-color: #7c5cbf;
    border: 1px solid #7c5cbf;
    color: #ffffff;
}

.lwp-exc-btn--primary:hover {
    background-color: #6a4aad;
    border-color: #6a4aad;
    color: #ffffff;
}

.lwp-exc-btn--ghost {
    background-color: transparent;
    border: 1px solid #7c5cbf;
    color: #7c5cbf;
}

.lwp-exc-btn--ghost:hover {
    background-color: #7c5cbf;
    color: #ffffff;
}

/* ===== SINGLE EXTRA PAGE ===== */

.lwp-exc-single-hero {
    padding: 56px 0 32px;
    text-align: center;
}

.lwp-exc-single-hero img {
    max-width: 100%;
    max-height: 340px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(43, 35, 64, 0.18);
    margin-bottom: 24px;
}

.lwp-exc-single-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #2b2340;
    margin: 0 0 24px;
}

.lwp-exc-single-content {
    padding: 32px 0 48px;
}

.lwp-exc-single-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #4a4460;
}

.lwp-exc-single-figure {
    margin: 0 0 20px;
}

.lwp-exc-single-figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.lwp-exc-gallery {
    margin-bottom: 20px;
}

/* Carousel */
.lwp-exc-gallery-stage {
    margin: 0 0 16px;
    height: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f4f2f7;
    border-radius: 8px;
    overflow: hidden;
}

.lwp-exc-gallery-main {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.lwp-exc-gallery-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #7c8698;
    text-align: center;
    /* Reserve ~4 lines so swapping images doesn't reflow the stage. */
    min-height: calc(4 * 1.5em);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.lwp-exc-gallery-caption:empty {
    min-height: 0;
    margin-top: 0;
}

.lwp-exc-gallery-thumbs-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lwp-exc-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 4px 2px;
    flex: 1;
}

.lwp-exc-gallery-thumb {
    flex: 0 0 auto;
    width: 84px;
    height: 64px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    scroll-snap-align: start;
    overflow: hidden;
}

.lwp-exc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lwp-exc-gallery-thumb.is-active {
    border-color: #8b5cf6;
}

.lwp-exc-gallery-thumb:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.lwp-exc-gallery-arrow {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #e8e4f0;
    color: #4a4460;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lwp-exc-gallery-arrow:hover {
    background: #8b5cf6;
    color: #fff;
}

/* Grid */
.lwp-exc-gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.lwp-exc-gallery-grid-item {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.lwp-exc-gallery-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.lwp-exc-gallery-grid-item:hover img {
    transform: scale(1.04);
}

.lwp-exc-gallery-grid-item:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Stacked */
.lwp-exc-gallery-stack {
    margin: 0 0 20px;
}

.lwp-exc-gallery-stack img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.lwp-exc-gallery-stack figcaption {
    margin-top: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #7c8698;
    text-align: center;
    /* Reserve ~4 lines so captions of varying length don't reflow. */
    min-height: calc(4 * 1.5em);
}

/* Lightbox (grid only) */
.lwp-ex-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lwp-ex-lightbox[hidden] {
    display: none;
}

.lwp-ex-lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.lwp-ex-lightbox-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lwp-ex-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lwp-ex-lightbox-caption {
    margin-top: 12px;
    color: #fff;
    font-size: 0.95rem;
    text-align: center;
}

.lwp-ex-lightbox-counter {
    margin-top: 6px;
    color: #cfcfcf;
    font-size: 0.85rem;
}

.lwp-ex-lightbox-close,
.lwp-ex-lightbox-prev,
.lwp-ex-lightbox-next {
    position: absolute;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lwp-ex-lightbox-close:hover,
.lwp-ex-lightbox-prev:hover,
.lwp-ex-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.lwp-ex-lightbox-close {
    top: 20px;
    right: 20px;
}

.lwp-ex-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lwp-ex-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 600px) {
    .lwp-exc-gallery-stage {
        height: 280px;
    }

    .lwp-exc-gallery-thumb {
        width: 64px;
        height: 50px;
    }
}

.lwp-exc-single-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* Related books / series chips */

.lwp-exc-related {
    padding: 8px 0 56px;
}

.lwp-exc-related-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7c5cbf;
    margin: 0 0 12px;
}

.lwp-exc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.lwp-exc-chip {
    display: inline-block;
    font-size: 0.85rem;
    color: #4a4460;
    background: #f1ecfa;
    border: 1px solid #e5e0f0;
    border-radius: 999px;
    padding: 7px 14px;
    text-decoration: none;
}

.lwp-exc-chip:hover {
    background: #7c5cbf;
    color: #ffffff;
}

/* ===== ARCHIVE PAGE ===== */

.lwp-exc-archive-hero {
    padding: 56px 0 32px;
    text-align: center;
}

.lwp-exc-archive-empty {
    text-align: center;
    color: #6b6480;
    padding: 40px 0;
}
