/* ==========================================================================
   Template B (sequential) — content-filter injected styles.
   Scoped to .cf-seq-* / .cf-slider* / .cf-lightbox so nothing here leaks
   into the theme's own styling; only what's inside the_content is ours.
   ========================================================================== */

.cf-seq-root { --cf-ink: #1a1a1a; --cf-sub: #5c5c5c; --cf-line: #e4e4e4; --cf-radius: 6px; --cf-skeleton: #ececec; }
.cf-seq-root * { box-sizing: border-box; }
.cf-seq-root { width: 100%; }

/* ── Shared image card (used for the small inline images inserted into the
   flowing text via {{N}} tokens — NOT the big slider, see below) ── */
.cf-card { border: 1px solid var(--cf-line); border-radius: var(--cf-radius); overflow: hidden; max-width: 420px; margin: 0 auto 18px; }
.cf-card-img-wrap { position: relative; background: var(--cf-skeleton); aspect-ratio: 1/1; overflow: hidden; }
.cf-card-img-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; background: #fff; }
.cf-card-img-wrap.cf-skeleton::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(100deg, var(--cf-skeleton) 30%, #f6f6f6 50%, var(--cf-skeleton) 70%);
    background-size: 200% 100%; animation: cf-shimmer 1.4s ease-in-out infinite;
}
@keyframes cf-shimmer { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }

/* Download/Print — shared by the inline cards AND the slider's action bar.
   Text + icon on both now (icon left on Download, icon right on Print, per
   spec). Colors set with high specificity + !important on the dark slider
   variant deliberately: theme stylesheets commonly reset `button`/`a`
   color inside .entry-content with matching specificity, which is exactly
   what made the icons invisible before — this guarantees contrast
   regardless of what the active theme does. */
.cf-card-actions, .cf-slider-actions { display: flex; border-top: 1px solid var(--cf-line); }
.cf-download, .cf-print {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 8px; font-size: 0.76rem; font-weight: 600; text-decoration: none;
    color: var(--cf-ink); background: none; border: none; cursor: pointer;
}
.cf-download { flex: 0 0 62%; border-right: 1px solid var(--cf-line); }
.cf-print { flex: 0 0 38%; }
.cf-download:hover, .cf-print:hover { background: #f5f5f5; }
.cf-download.is-generating { opacity: 0.65; pointer-events: none; }
.cf-download svg, .cf-print svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* Dark variant, used inside/under the black slider — solid blue background
   so the buttons read as clickable controls, not text sitting on the black
   background; explicit white text, !important-guarded against theme resets. */
.cf-slider-actions { border: 1px solid #1d4ed8; border-radius: 0 0 var(--cf-radius) var(--cf-radius); margin: -14px 0 28px; background: #2563eb; overflow: hidden; }
.cf-slider-actions .cf-download,
.cf-slider-actions .cf-print { color: #fff !important; background: #2563eb !important; border-right-color: rgba(255,255,255,0.3); }
.cf-slider-actions .cf-download:hover,
.cf-slider-actions .cf-print:hover { background: #1d4ed8 !important; }

/* ── Slider Box — full-wide, professional gallery viewer. All slides and
   all thumbnails exist in the DOM from the start (crawlable) — only ONE
   slide is visually active at a time, switched by JS. Object-fit is
   CONTAIN (never cover): for printable resources the whole page matters,
   so we letterbox on black instead of cropping any part of the image. ── */
.cf-slider { width: 100%; margin: 0 0 14px; background: #000; border-radius: var(--cf-radius); overflow: hidden; display: flex; gap: 2px; }
.cf-slider-main { position: relative; flex: 1 1 68%; min-width: 0; background: #000; }
.cf-slider-imgbox { position: relative; height: clamp(330px, 66vh, 682px); background: #000; } /* +10% vs. original */
.cf-slider-imgbox img { width: 100%; height: 100%; object-fit: contain; }
.cf-slider-slide { display: none; }
.cf-slider-slide.is-active { display: block; }

.cf-slider-overlay-top { position: absolute; top: 12px; left: 12px; z-index: 999; display: flex; gap: 6px; }
.cf-slider-icon-btn {
    width: 36px; height: 36px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
    background-color: rgba(0,0,0,0.6) !important; cursor: pointer;
    background-repeat: no-repeat !important; background-position: center !important; background-size: 17px 17px !important;
}
.cf-slider-icon-btn:hover { background-color: rgba(0,0,0,0.85) !important; }
/* Icons as CSS background-image (data URI), not inline <svg> elements — if
   anything in the stack (theme, security plugin, HTML minifier) strips or
   interferes with inline SVG markup, a background-image is immune to that,
   since it's a CSS property value, not an HTML node. */
.cf-slider-icon-btn.cf-icon-playpause {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") !important;
}
.cf-slider-icon-btn.cf-icon-playpause.is-playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 5h4v14H6zM14 5h4v14h-4z'/%3E%3C/svg%3E") !important;
}
.cf-slider-icon-btn.cf-icon-fullscreen {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E") !important;
}

/* Bigger, more visible nav arrows — icon is now a proportionally large SVG
   chevron (not a small text glyph lost inside the circle). */
.cf-slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff;
    background: rgba(0,0,0,0.8) !important; color: #fff !important; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.cf-slider-arrow:hover { background: rgba(0,0,0,0.8) !important; }
.cf-slider-arrow.prev { left: 14px; }
.cf-slider-arrow.next { right: 14px; }
.cf-slider-arrow svg { width: 36px; height: 36px; display: block; }

/* Caption — hidden by default, only shown on hover (desktop) / focus (keyboard). */
.cf-slider-caption {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 14px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff !important; font-size: 0.8rem; font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.cf-slider-main:hover .cf-slider-caption,
.cf-slider-main:focus-within .cf-slider-caption { opacity: 1; }

/* Thumbnail grid — desktop: fixed 2-column grid. Height is set precisely
   by JS to show exactly 3 rows (6 thumbnails) before scrolling; the
   clamp() below is only a pre-JS fallback. Scrollbar is forced ALWAYS
   visible (not just on hover/scroll) as a clear, unambiguous cue that
   there's more content below — styling ::-webkit-scrollbar makes Chrome/
   Safari/Edge render it persistently regardless of the OS's own
   auto-hide setting; scrollbar-width/-color cover Firefox the same way. */
.cf-slider-thumbs-wrap {
    position: relative;
    flex: 0 0 32%;
    display: flex;
    flex-direction: column;
}
.cf-slider-thumbs {
    position: relative;
    width: 100%;
    max-height: clamp(330px, 66vh, 682px); overflow-y: scroll;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-content: start;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.85) rgba(255,255,255,0.15);
    scrollbar-gutter: stable;
}
.cf-slider-thumbs::-webkit-scrollbar { width: 10px; display: block !important; }
.cf-slider-thumbs::-webkit-scrollbar-track { background: rgba(255,255,255,0.15); }
.cf-slider-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.85); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
.cf-slider-thumbs::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,1); border: 2px solid transparent; background-clip: content-box; }
.cf-slider-thumb {
    display: block; position: relative; width: 100%; aspect-ratio: 1/1;
    border: none; padding: 0; cursor: pointer; background: #111; overflow: hidden;
    opacity: 0.55; transition: opacity 0.15s;
}
.cf-slider-thumb:hover { opacity: 0.85; }
.cf-slider-thumb.is-active { opacity: 1; box-shadow: inset 0 0 0 2px #fff; }
/* Pinned with position:absolute + inset:0 — deliberately taken OUT of the
   button's own layout/sizing so the box stays a fixed square regardless of
   the image's own intrinsic size, load order, or orientation (vertical vs
   horizontal). This is what was causing thumbnails to overlap/stack when a
   page has many images loading at once — the box size no longer depends on
   the image at all. */
.cf-slider-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* "More below" / "back to top" affordances for the thumbnail grid — same
   visual language as the main arrows, each shown only when relevant. A
   soft gradient sits behind each one (pointer-events:none, non-interactive)
   so the button reads as an intentional floating overlay instead of
   appearing to sit awkwardly on top of a random thumbnail. */
.cf-slider-thumbs-fade {
    position: absolute; left: 0; right: 0; height: 64px; pointer-events: none; z-index: 3;
}
.cf-slider-thumbs-fade.fade-top    { top: 0; background: linear-gradient(rgba(0,0,0,0.75), transparent); }
.cf-slider-thumbs-fade.fade-bottom { bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,0.75)); }
.cf-slider-more {
    display: none; position: absolute; left: 50%; transform: translateX(-50%); z-index: 4;
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff;
    background: rgba(0,0,0,0.9) !important; color: #fff !important; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7);
    align-items: center; justify-content: center;
}
.cf-slider-more svg { width: 32px; height: 32px; display: block; }
.cf-slider-more.is-visible { display: flex; }
.cf-slider-more:hover { background: rgba(0,0,0,0.85) !important; }
.cf-slider-more-down { bottom: 8px; }
.cf-slider-more-up { top: 8px; }

@media (max-width: 760px) {
    .cf-slider { flex-direction: column; }
    .cf-slider-main { flex: none; }
    .cf-slider-thumbs-wrap { flex: none; }
    .cf-slider-thumbs {
        flex: none; max-height: none !important; overflow-y: visible;
        grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72px;
        overflow-x: scroll; padding: 4px 4px 12px;
        scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.85) rgba(255,255,255,0.15);
    }
    .cf-slider-thumbs::-webkit-scrollbar { height: 8px; }
    .cf-slider-thumb { aspect-ratio: 1/1; width: 72px; }
    .cf-slider-more { display: none !important; } /* horizontal strip on mobile, no vertical "more" cue needed */
}

/* ── Flowing content ── */
.cf-seq-intro p, .cf-seq-content p { margin: 0 0 14px; }
.cf-seq-content { margin: 0 0 8px; }
.cf-seq-content h2 { font-size: 1.2rem; font-weight: 700; margin: 26px 0 10px; }
.cf-seq-content h2:first-child { margin-top: 0; }
.cf-seq-content strong { font-weight: 700; }
.cf-seq-content a { color: #2563eb; text-decoration: underline; }

/* Full Wide page layouts are great for the Slider Box (wants the full
   column width) but terrible for reading long lines of text — cap just
   the TEXT-bearing elements to 70% width, centered, on desktop only. The
   slider itself (.cf-slider, .cf-slider-actions) deliberately stays
   un-constrained/100% width. */
@media (min-width: 992px) {
    .cf-seq-intro, .cf-seq-content, .cf-faq, .cf-pagination {
        max-width: 70%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Pagination ── */
.cf-pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 28px 0; font-size: 0.85rem; }
.cf-pagination a, .cf-pagination .is-current { padding: 5px 10px; border: 1px solid var(--cf-line); border-radius: 5px; text-decoration: none; color: var(--cf-ink); }
.cf-pagination .is-current { background: var(--cf-ink); color: #fff; border-color: var(--cf-ink); }
.cf-pagination-label { color: var(--cf-sub); margin-right: 6px; }

/* ── FAQ ── */
.cf-faq { margin: 32px 0 40px; padding-top: 28px; border-top: 1px solid var(--cf-line); }
.cf-faq-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 16px; }
.cf-faq-body h3 { font-size: 1.02rem; font-weight: 700; margin: 18px 0 8px; }
.cf-faq-body h3:first-child { margin-top: 0; }
.cf-faq-body p { margin: 0 0 12px; }
.cf-faq-body ul { margin: 0 0 14px; padding-left: 22px; }
.cf-faq-body li { margin: 0 0 6px; }

/* ── Lightbox — fullscreen overlay, hidden by default ── */
.cf-lightbox { display: none; position: fixed; inset: 0; z-index: 99999; background: #000; align-items: center; justify-content: center; }
.cf-lightbox.is-open { display: flex; }
.cf-lightbox-img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.cf-lightbox-close, .cf-lightbox-nav {
    position: absolute; background: rgba(255,255,255,0.1) !important; border: 1px solid rgba(255,255,255,0.3);
    color: #fff !important; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.cf-lightbox-close { top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; }
.cf-lightbox-nav { top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,0.7) !important; }
.cf-lightbox-nav svg { width: 40px; height: 40px; display: block; }
.cf-lightbox-nav.prev { left: 18px; }
.cf-lightbox-nav.next { right: 18px; }
.cf-lightbox-close:hover, .cf-lightbox-nav:hover { background: rgba(255,255,255,0.2) !important; }
