/* Mini Carousel - core styles
   Extracted from app/michaelblood.com/boisewestend.php for bvid-wide use.
   Include this CSS wherever mini_carousel() is used.
   App-specific context overrides (max-height, margins inside specific layouts)
   belong in the app's own CSS file. */

.mini-carousel {
    position: relative;
    width: 100%;
    background: #1e1e28;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
}

.mini-carousel-main {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
}

.mini-carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.mini-carousel-empty {
    padding: 2rem;
    text-align: center;
    background: rgba(30, 30, 40, 0.6);
    border-radius: 4px;
}

.mini-carousel-empty p {
    color: rgba(200, 200, 200, 0.7);
    margin-bottom: 1rem;
}

.mini-carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
}

.mini-carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.mini-carousel-dots .dot.active {
    background: #fff;
    transform: scale(1.3);
}

.mini-carousel-dots .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Developer overlay labels and upload controls */
.carousel-dev-label {
    display: none;
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 20;
    background: rgba(0,0,0,0.78);
    color: #4fc3f7;
    font-family: monospace;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid rgba(79,195,247,0.35);
    white-space: nowrap;
}
.carousel-dev-label:hover { background: rgba(0,0,0,0.95); color: #81d4fa; }

body.dev-carousels .carousel-dev-label {
    display: block;
    color: #C1440E;
    border-color: rgba(193,68,14,0.45);
    background: rgba(0,0,0,0.82);
}
body.dev-carousels .carousel-dev-label:hover { color: #e05a20; }

.mini-carousel-empty-slot {
    display: none;
    width: 100%;
    aspect-ratio: 4/3;
    background: rgba(79,195,247,0.04);
    border: 2px dashed rgba(79,195,247,0.25);
    border-radius: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}
.mini-carousel-empty-slot .carousel-dev-label {
    position: static;
    display: block;
    font-size: 0.85rem;
    padding: 5px 14px;
}
.carousel-empty-hint {
    font-family: monospace;
    font-size: 0.7rem;
    color: rgba(79,195,247,0.4);
}
body.dev-carousels .mini-carousel-empty-slot {
    display: flex;
    border-color: rgba(193,68,14,0.35);
    background: rgba(193,68,14,0.04);
}
body.dev-carousels .carousel-empty-hint { color: rgba(193,68,14,0.45); }
body.dev-carousels .mini-carousel-empty-slot { cursor: pointer; }
.mini-carousel-empty-slot .carousel-paste-btn {
    position: static;
    display: none;
}
body.dev-carousels .mini-carousel-empty-slot .carousel-paste-btn { display: block; }

.carousel-upload-btn {
    display: none;
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 20;
    background: rgba(193,68,14,0.85);
    color: white;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid rgba(193,68,14,0.6);
    cursor: pointer;
}
.carousel-upload-btn:hover { background: rgba(193,68,14,1); }
body.dev-carousels .carousel-upload-btn { display: block; }
.carousel-paste-btn {
    display: none;
    position: absolute;
    bottom: 8px;
    right: 72px;
    z-index: 20;
    background: rgba(193,68,14,0.85);
    color: white;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid rgba(193,68,14,0.6);
    cursor: pointer;
}
.carousel-paste-btn:hover { background: rgba(193,68,14,1); }
body.dev-carousels .carousel-paste-btn { display: block; }
.carousel-uploading { opacity: 0.6; pointer-events: none; }
.carousel-uploading .carousel-upload-btn { background: rgba(80,80,80,0.85); }
.carousel-uploading .carousel-paste-btn { background: rgba(80,80,80,0.85); }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.lightbox.active { display: flex; }

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lightbox-caption {
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    white-space: nowrap;
    padding: 8px 12px;
}

body.is-developer .lightbox-caption {
    cursor: text;
    border-bottom: 1px dashed rgba(255,255,255,0.3);
}
body.is-developer .lightbox-caption:hover { border-bottom-color: rgba(193,68,14,0.8); color: rgba(255,255,255,0.7); }

.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    padding: 20px;
    user-select: none;
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-nav:hover, .lightbox-close:hover { opacity: 0.7; }

/* Buried-text carousel (btcarousel)
   Inline carousel badge that sits inside paragraph text.
   Click shows a preview popup; click again opens lightbox.
   Page-specific colors can override --btc-accent (default: #C1440E). */
.btcarousel {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 3px;
}

.btcarousel-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(193,68,14,0.15);
    color: #C1440E;
    border: 1px solid rgba(193,68,14,0.45);
    border-radius: 3px;
    padding: 2px 7px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    vertical-align: middle;
}
.btc-icon { display: block; flex-shrink: 0; }
.btcarousel-badge:hover { background: rgba(193,68,14,0.28); }

.btcarousel-preview {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    z-index: 1000;
    cursor: pointer;
    background: #0f0f19;
    border: 1px solid rgba(193,68,14,0.3);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.7);
}
.btcarousel-preview-inner { overflow: hidden; }
.btcarousel-img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.btcarousel-caption {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    color: rgba(247,243,233,0.7);
    padding: 4px 8px 2px;
}
.btcarousel-viewfull {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.66rem;
    color: #C1440E;
    padding: 2px 8px 6px;
    text-align: right;
    opacity: 0.85;
}

/* btcarousel dev labels — shown when body.dev-carousels is active */
.btcarousel-empty-dev {
    display: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    background: rgba(0,0,0,0.78);
    color: #C1440E;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px dashed rgba(193,68,14,0.45);
    vertical-align: middle;
    margin: 0 3px;
}
body.dev-carousels .btcarousel-empty-dev { display: inline-block; }

.btcarousel-dev-label {
    display: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    background: rgba(0,0,0,0.78);
    color: #C1440E;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px dashed rgba(193,68,14,0.45);
    vertical-align: middle;
    margin: 0 2px;
    text-decoration: none;
}
body.dev-carousels .btcarousel-dev-label { display: inline-block; }
