/* ============================================================
   Bundle Cg (2026-05-11): Patient Results Gallery — public CSS
============================================================ */

/* --- Gallery section --- */
.cmh-gallery-section {
    background: #fafafa;
    padding: 40px 20px 60px;
}
.cmh-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}
.cmh-gallery-intro {
    text-align: center;
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 760px;
    margin: 1rem auto 2rem;
}

/* --- Disclaimer block (Cgu-hotfix-1: plain primary-color text, no box) --- */
.cmh-gallery-disclaimer {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    color: var(--primary, #005485);
    padding: 0.5rem 0;
    margin: 1.5rem auto;
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 680px;
    text-align: center;
}
.cmh-gallery-disclaimer strong {
    color: var(--primary, #005485);
}
.cmh-gallery-disclaimer--bottom {
    margin-top: 3rem;
}

/* --- Breadcrumbs --- */
.cmh-gallery-breadcrumbs {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.cmh-gallery-breadcrumbs a {
    color: #0d9488;
    text-decoration: none;
}
.cmh-gallery-breadcrumbs a:hover {
    text-decoration: underline;
}
.cmh-gallery-breadcrumbs span {
    margin: 0 0.5rem;
    color: #94a3b8;
}

/* --- Category filter chips --- */
.cmh-gallery-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}
.cmh-gallery-filter__chip {
    /* Cgu-hotfix-1: rectangular shape, theme accent on active */
    padding: 0.55rem 1.1rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #334155;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.cmh-gallery-filter__chip:hover {
    border-color: var(--accent, #0099cc);
    color: var(--accent, #0099cc);
}
.cmh-gallery-filter__chip--active {
    background: var(--accent, #0099cc);
    border-color: var(--accent, #0099cc);
    color: #fff;
}

/* --- Card grid --- */
.cmh-gallery-grid {
    /* Bundle Cgu-hotfix-2: 280px -> 360px minmax caps at 3 cards/row on a 1200px container */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.cmh-gallery-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.cmh-gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.cmh-gallery-card__images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #e2e8f0;
}
.cmh-gallery-card__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.cmh-gallery-card__body {
    padding: 0.85rem 1rem;
}
.cmh-gallery-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    color: #1e293b;
    line-height: 1.3;
}
.cmh-gallery-card__meta {
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* --- Case detail --- */
.cmh-gallery-section-heading {
    margin: 2.5rem 0 1rem;
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 600;
}
.cmh-gallery-primary-slider {
    margin: 2rem auto;
    max-width: 680px;
}
/* Bundle Cgs (2026-05-13) — CMH-owned before/after slider.
 * Replaces vendored img-comparison-slider@8.0.6. CSP-clean by construction:
 * positioning is driven entirely by a CSS custom property --cmh-ba-pos which
 * JS updates via element.style.setProperty (no <style> element injection).
 *
 * AFTER image is the underlay (always fully visible).
 * BEFORE image is overlaid with clip-path that reveals only the left X%
 *   (X = --cmh-ba-pos). Dragging right uncovers more AFTER.
 * .divider line + .handle horizontally positioned at left: var(--cmh-ba-pos).
 */
.cmh-ba-slider {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    touch-action: none;
    cursor: ew-resize;
    user-select: none;
    --cmh-ba-pos: 50%;
}
.cmh-ba-slider:focus-visible {
    outline: 2px solid #1e293b;
    outline-offset: 2px;
}
.cmh-ba-slider__after,
.cmh-ba-slider__before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.cmh-ba-slider__after { z-index: 1; }
.cmh-ba-slider__before {
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--cmh-ba-pos)) 0 0);
}
.cmh-ba-slider__divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
    left: var(--cmh-ba-pos);
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
}
.cmh-ba-slider__handle {
    /* Bundle Br-1 (2026-05-13): transparent center + white ring only.
       SVG arrows now stroked white with drop-shadow for legibility on
       light backgrounds. */
    position: absolute;
    top: 50%;
    left: var(--cmh-ba-pos);
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
}
.cmh-ba-slider__handle svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.cmh-ba-slider--small {
    max-width: 320px;
}
@media (max-width: 480px) {
    .cmh-ba-slider__handle { width: 40px; height: 40px; }
    .cmh-ba-slider__handle svg { width: 18px; height: 18px; }
}

/* --- Fallback when slider disabled --- */
.cmh-gallery-primary-static,
.cmh-gallery-pair-static {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1.5rem 0;
}
.cmh-gallery-primary-static img,
.cmh-gallery-pair-static img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

/* --- Multi-angle strip --- */
.cmh-gallery-multi-angle {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.cmh-gallery-multi-angle__caption {
    text-align: center;
    color: #475569;
    font-size: 0.9rem;
    margin-top: 0.4rem;
    text-transform: capitalize;
}

/* --- Video embed --- */
.cmh-gallery-video {
    max-width: 900px;
    margin: 1rem auto;
    aspect-ratio: 16 / 9;
}
.cmh-gallery-video iframe,
.cmh-gallery-video video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 0;
    display: block;
}

/* --- Metadata + case notes (Cgu-hotfix-1: stacked + centered, no box) --- */
.cmh-gallery-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin: 1.5rem auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    color: #475569;
    font-size: 0.95rem;
    text-align: center;
    max-width: 680px;
}
.cmh-gallery-meta > div {
    display: block;
}
.cmh-gallery-meta a {
    color: var(--primary, #005485);
    text-decoration: none;
}
.cmh-gallery-case-notes p {
    color: #334155;
    line-height: 1.65;
    font-size: 1rem;
    max-width: 760px;
    margin: 0 auto;
}

/* --- CTA --- */
.cmh-gallery-cta {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: #fff;
    padding: 2rem 1.5rem;
    border-radius: 10px;
    text-align: center;
    margin: 2.5rem 0;
}
.cmh-gallery-cta h3 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: 1.3rem;
}
.cmh-gallery-cta-btn {
    display: inline-block;
    background: #fff;
    color: #0d9488;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.15s;
}
.cmh-gallery-cta-btn:hover {
    opacity: 0.9;
}

.cmh-gallery-empty {
    text-align: center;
    color: #94a3b8;
    padding: 3rem 1rem;
    font-style: italic;
}

/* --- Home-page preview partial --- */
.cmh-gallery-preview {
    background: #fff;
    padding: 3rem 20px;
}
.cmh-gallery-preview__container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.cmh-gallery-preview__heading {
    margin: 0 0 0.5rem;
    color: #1e293b;
    font-size: 1.75rem;
}
.cmh-gallery-preview__intro {
    color: #64748b;
    margin: 0 auto 1.5rem;
    max-width: 600px;
    line-height: 1.55;
}
.cmh-gallery-preview__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.cmh-gallery-preview__card {
    position: relative;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s;
}
.cmh-gallery-preview__card:hover {
    transform: translateY(-3px);
}
.cmh-gallery-preview__img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.cmh-gallery-preview__title {
    padding: 0.85rem 1rem 0;
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}
.cmh-gallery-preview__category {
    padding: 0 1rem 0.85rem;
    color: #64748b;
    font-size: 0.85rem;
    margin: 0.15rem 0 0;
}
.cmh-gallery-preview__cta {
    display: inline-block;
    color: #0d9488;
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.5rem;
}
.cmh-gallery-preview__cta:hover {
    text-decoration: underline;
}

/* --- Gallery heading (Cgu-hotfix-1) --- */
.cmh-gallery-heading {
    text-align: center;
    margin: 1.5rem 0 0.5rem;
    color: var(--primary, #005485);
    font-size: 1.6rem;
    font-weight: 700;
}
.cmh-gallery-heading .plan-badge {
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .cmh-gallery-card__img {
        height: 160px;
    }
    .cmh-gallery-meta {
        grid-template-columns: 1fr;
    }
}

/* Bundle Dx 2026-05-12: DEMO badge for is_demo=TRUE cases (marketplace demo content) */
.cmh-gallery-card,
.cmh-gallery-preview__card {
    position: relative;
}
.cmh-gallery-card__demo-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    padding: 0.25rem 0.5rem;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
    text-transform: uppercase;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
