/* ══════════════════════════════════════════════════════════════
   DC Behandelresultaten – before/after stage (optional arch) + case panel
   Builds on dc-treatment-page.css (.dc-tp tokens).
   --dc-res-pos (%) / --dc-res-p (number) are driven by JS.
   ══════════════════════════════════════════════════════════════ */

.dc-tp-results {
    --dc-res-pos: 50%;
    --dc-res-p: 50;
    --dc-res-ratio: 4 / 5;
    --dc-res-handle: #fff;
    --dc-res-knob-icon: var(--dc-tp-dark);
    --dc-res-tag-bg: rgba(26, 26, 46, 0.42);
    --dc-res-tag-text: #fff;
    --dc-res-ease: cubic-bezier(.65, 0, .15, 1);
    --dc-res-out: cubic-bezier(.16, 1, .3, 1);
    --dc-res-gap: 12px;
    position: relative;
    overflow: hidden;
}

.dc-tp-results__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: clamp(36px, 5.5vw, 88px);
    align-items: center;
}

/* ── Stage: passe-partout card; arch radius = half its own width (cqi) ── */
.dc-tp-results__stage {
    position: relative; isolation: isolate;
    container-type: inline-size;
    width: 100%; max-width: 580px;
    justify-self: center;
    padding: var(--dc-res-gap);
}
.dc-tp-results__stage::before {
    content: '';
    position: absolute; inset: 0 0 34px; z-index: -1;
    background: var(--dc-tp-card);
    border: 1px solid rgba(167, 130, 120, 0.16);
    border-radius: calc(var(--dc-tp-radius) + 6px);
    box-shadow: 0 40px 80px -48px rgba(26, 26, 46, 0.35);
}
/* soft accent glow behind the card */
.dc-tp-results__stage::after {
    content: '';
    position: absolute; z-index: -2;
    width: 70%; aspect-ratio: 1; left: -18%; bottom: -6%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 130, 120, 0.22), transparent 68%);
    pointer-events: none;
}

.dc-tp-results__frame {
    position: relative; isolation: isolate;
    aspect-ratio: var(--dc-res-ratio);
    width: 100%;
    overflow: hidden;
    border-radius: var(--dc-tp-radius);
    background: #f6f0ed;
    touch-action: pan-y;
    cursor: ew-resize;
    user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0); /* keeps radius clipping on Safari */
}
.dc-tp-results--arch .dc-tp-results__stage::before {
    border-radius: 999px 999px calc(var(--dc-tp-radius) + 6px) calc(var(--dc-tp-radius) + 6px);
    border-radius: 50cqi 50cqi calc(var(--dc-tp-radius) + 6px) calc(var(--dc-tp-radius) + 6px);
}
.dc-tp-results--arch .dc-tp-results__frame {
    border-radius: 999px 999px var(--dc-tp-radius) var(--dc-tp-radius);
    border-radius: calc(50cqi - var(--dc-res-gap)) calc(50cqi - var(--dc-res-gap)) var(--dc-tp-radius) var(--dc-tp-radius);
}

/* ── Cases: stacked; the incoming one opens as an iris from the divider ── */
.dc-tp-results__case {
    position: absolute; inset: 0; margin: 0;
    visibility: hidden;
}
.dc-tp-results__case.is-active,
.dc-tp-results__case.is-leaving { visibility: visible; }
.dc-tp-results__case.is-leaving { z-index: 1; }
.dc-tp-results__case.is-active {
    z-index: 2;
    clip-path: circle(150% at var(--dc-res-pos) 50%);
    transition: clip-path 1.05s var(--dc-res-ease);
}
.dc-tp-results__case.is-active.is-entering {
    clip-path: circle(0% at var(--dc-res-pos) 50%);
    transition: none;
}

/* doubled class beats Elementor's `.elementor img { height: auto }` */
.dc-tp-results .dc-tp-results__img {
    position: absolute; inset: 0;
    display: block; width: 100%; height: 100%; max-width: none;
    object-fit: cover;
    border-radius: 0;
    transform: scale(1);
    transition: transform 1.8s var(--dc-res-out);
}
.dc-tp-results__after {
    position: absolute; inset: 0;
    clip-path: inset(0 0 0 var(--dc-res-pos));
}

/* ── Labels: fade out as the divider approaches them ── */
.dc-tp-results__tag {
    position: absolute; z-index: 4; bottom: 18px;
    padding: 7px 14px 6px;
    font: 500 10.5px/1 'Inter', sans-serif;
    letter-spacing: .22em; text-transform: uppercase;
    color: var(--dc-res-tag-text);
    background: var(--dc-res-tag-bg);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    pointer-events: none;
    transition: opacity .25s ease;
}
.dc-tp-results__tag--before { left: 18px; opacity: clamp(0, calc((var(--dc-res-p) - 12) / 14), 1); }
.dc-tp-results__tag--after { right: 18px; opacity: clamp(0, calc((88 - var(--dc-res-p)) / 14), 1); }

/* ── Divider + knob ── */
.dc-tp-results__handle {
    position: absolute; z-index: 5; top: 0; bottom: 0;
    left: var(--dc-res-pos);
    width: 56px; margin-left: -28px;
    display: flex; align-items: center; justify-content: center;
    cursor: ew-resize;
    outline: none;
    touch-action: none;
}
.dc-tp-results__line {
    position: absolute; top: 0; bottom: 0; left: 50%;
    width: 2px; margin-left: -1px;
    background: linear-gradient(to bottom, transparent 0%, var(--dc-res-handle) 18%, var(--dc-res-handle) 82%, transparent 100%);
    box-shadow: 0 0 14px rgba(26, 26, 46, 0.28);
}
.dc-tp-results__knob {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    border-radius: 50%;
    color: var(--dc-res-knob-icon);
    background: color-mix(in srgb, var(--dc-res-handle) 82%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 28px -8px rgba(26, 26, 46, 0.45);
    transition: transform .35s var(--dc-res-out), box-shadow .35s ease;
}
.dc-tp-results__knob svg { width: 22px; height: 22px; }
/* breathing ring until the visitor interacts */
.dc-tp-results__knob::after {
    content: '';
    position: absolute; inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--dc-res-handle);
    opacity: 0;
    animation: dc-res-ring 2.6s ease-out 1.2s infinite;
    pointer-events: none;
}
.dc-tp-results.has-interacted .dc-tp-results__knob::after { animation: none; }
@keyframes dc-res-ring {
    0%   { transform: scale(1);   opacity: .9; }
    70%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}
.dc-tp-results__handle:hover .dc-tp-results__knob,
.dc-tp-results.is-dragging .dc-tp-results__knob { transform: scale(1.1); }
.dc-tp-results.is-dragging .dc-tp-results__knob { box-shadow: 0 14px 34px -8px rgba(26, 26, 46, 0.55); }
.dc-tp-results__handle:focus-visible .dc-tp-results__knob {
    outline: 2px solid var(--dc-tp-dark);
    outline-offset: 3px;
}

.dc-tp-results__hint {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 34px; margin: 0;
    padding-top: 12px;
    font-size: 12px; letter-spacing: .04em;
    color: var(--dc-tp-muted);
    transition: opacity .5s ease;
}
.dc-tp-results__hint-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--dc-tp-accent);
    box-shadow: 0 0 0 0 rgba(167, 130, 120, .5);
    animation: dc-res-dot 2s ease-out infinite;
}
@keyframes dc-res-dot {
    0%   { box-shadow: 0 0 0 0 rgba(167, 130, 120, .5); }
    80%, 100% { box-shadow: 0 0 0 8px rgba(167, 130, 120, 0); }
}
.dc-tp-results.has-interacted .dc-tp-results__hint { opacity: .45; }
.dc-tp-results.has-interacted .dc-tp-results__hint-dot { animation: none; }

/* ── Panel ── */
.dc-tp-results__panel {
    position: relative;
    padding: clamp(24px, 3vw, 40px);
    background: var(--dc-tp-card);
    border: 1px solid var(--dc-tp-line);
    border-radius: var(--dc-tp-radius);
}
.dc-tp-results__panel-top {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    padding-bottom: 20px; margin-bottom: 24px;
    border-bottom: 1px solid var(--dc-tp-line);
}
.dc-tp-results__count {
    display: inline-flex; align-items: baseline; gap: 4px;
    font-size: 13px; letter-spacing: .12em; color: var(--dc-tp-muted);
}
.dc-tp-results__count b {
    display: inline-block;
    font-size: 44px; font-weight: 200; line-height: 1; letter-spacing: -0.02em;
    color: var(--dc-tp-dark);
    font-variant-numeric: tabular-nums;
}
.dc-tp-results__count b.is-ticking { animation: dc-res-tick .6s var(--dc-res-out); }
@keyframes dc-res-tick {
    from { opacity: 0; transform: translateY(40%); }
    to   { opacity: 1; transform: none; }
}

.dc-tp-results__arrows { display: inline-flex; gap: 8px; }
.dc-tp .dc-tp-results__arrow {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0;
    color: var(--dc-tp-dark);
    background: transparent;
    border: 1px solid var(--dc-tp-line);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .3s var(--dc-res-out);
}
.dc-tp .dc-tp-results__arrow:hover { color: #fff; background: var(--dc-tp-dark); border-color: var(--dc-tp-dark); }
.dc-tp .dc-tp-results__arrow:active { transform: scale(.94); }
.dc-tp .dc-tp-results__arrow:focus-visible { border-radius: 50%; }
.dc-tp-results__arrow svg { width: 20px; height: 20px; }

.dc-tp-results__details { display: grid; }
.dc-tp-results__detail { grid-area: 1 / 1; }
/* all details share one cell, so the panel keeps the tallest height and never jumps */
.dc-tp-results__detail:not(.is-active) { visibility: hidden; }
.dc-tp-results__detail > * {
    transition: opacity .55s ease, transform .7s var(--dc-res-out);
}
.dc-tp-results__detail.is-entering > * { opacity: 0; transform: translateY(14px); transition: none; }
.dc-tp-results__detail > :nth-child(2) { transition-delay: .06s; }
.dc-tp-results__detail > :nth-child(3) { transition-delay: .12s; }
.dc-tp-results__detail > :nth-child(4) { transition-delay: .18s; }

.dc-tp-results__timing {
    display: inline-flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
    color: var(--dc-tp-accent-text);
}
.dc-tp-results__timing::before {
    content: ''; width: 18px; height: 1px; background: var(--dc-tp-accent);
}
.dc-tp-results__case-title {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: clamp(21px, 2vw, 26px); font-weight: 400; line-height: 1.25;
    color: var(--dc-tp-dark);
}
.dc-tp-results__tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 16px 0 0; padding: 0; list-style: none;
}
.dc-tp-results__tags li {
    margin: 0; padding: 6px 12px;
    font-size: 12.5px; line-height: 1.3;
    color: var(--dc-tp-dark);
    background: var(--dc-tp-soft);
    border: 1px solid var(--dc-tp-line);
    border-radius: 999px;
}
.dc-tp-results__note { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: var(--dc-tp-text); }

/* ── Thumbnails: split in before | after; mini arches only with --arch ── */
.dc-tp-results__thumbs {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-top: 28px;
}
.dc-tp .dc-tp-results__thumb {
    position: relative;
    flex: 0 0 auto;
    width: 68px; padding: 0;
    background: none; border: 0;
    cursor: pointer;
    opacity: .6;
    transition: opacity .35s ease, transform .45s var(--dc-res-out);
}
.dc-tp .dc-tp-results__thumb:hover { opacity: .9; }
.dc-tp .dc-tp-results__thumb.is-active { opacity: 1; transform: translateY(-4px); }
.dc-tp .dc-tp-results__thumb:focus-visible { border-radius: 12px; }
.dc-tp.dc-tp-results--arch .dc-tp-results__thumb:focus-visible { border-radius: 36px 36px 12px 12px; }
.dc-tp-results__thumb-media {
    position: relative; display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 10px;
    background: #f6f0ed;
    box-shadow: inset 0 0 0 1px var(--dc-tp-line);
}
.dc-tp-results--arch .dc-tp-results__thumb-media { border-radius: 34px 34px 10px 10px; }
.dc-tp-results__thumb-media::after {
    content: '';
    position: absolute; inset: 0; z-index: 2;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px transparent;
    transition: box-shadow .35s ease;
}
.dc-tp-results__thumb.is-active .dc-tp-results__thumb-media::after { box-shadow: inset 0 0 0 2px var(--dc-tp-accent); }
.dc-tp-results .dc-tp-results__thumb-img {
    position: absolute; inset: 0;
    display: block; width: 100%; height: 100%; max-width: none;
    object-fit: cover; border-radius: 0;
}
.dc-tp-results__thumb-after {
    position: absolute; inset: 0;
    clip-path: inset(0 0 0 50%);
    border-left: 1px solid #fff;
}
.dc-tp-results__thumb-num {
    display: block; margin-top: 8px;
    font-size: 11px; letter-spacing: .14em; text-align: center;
    color: var(--dc-tp-muted);
    transition: color .3s ease;
}
.dc-tp-results__thumb.is-active .dc-tp-results__thumb-num { color: var(--dc-tp-dark); font-weight: 500; }

.dc-tp-results__disclaimer {
    margin: 26px 0 0; padding-top: 16px;
    font-size: 12.5px; line-height: 1.6;
    color: var(--dc-tp-muted);
    border-top: 1px solid var(--dc-tp-line);
}
.dc-tp-results .dc-tp__actions { margin-top: 24px; }

/* ── Scroll reveal (only once JS is running, so no-JS stays visible) ── */
.dc-tp-results.is-ready .dc-tp-results__stage,
.dc-tp-results.is-ready .dc-tp-results__panel > * {
    transition: opacity .9s ease, transform 1.1s var(--dc-res-out);
}
.dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__stage { opacity: 0; transform: translateY(40px) scale(.97); }
.dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__img { transform: scale(1.1); }
.dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__panel > * { opacity: 0; transform: translateY(18px); }
.dc-tp-results.is-ready .dc-tp-results__panel > :nth-child(2) { transition-delay: .12s; }
.dc-tp-results.is-ready .dc-tp-results__panel > :nth-child(3) { transition-delay: .2s; }
.dc-tp-results.is-ready .dc-tp-results__panel > :nth-child(4) { transition-delay: .28s; }
.dc-tp-results.is-ready .dc-tp-results__panel > :nth-child(5) { transition-delay: .36s; }

/* ── Tablet ── */
@media (max-width: 1024px) {
    .dc-tp-results__layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .dc-tp-results__stage { max-width: 520px; }
}

/* ── Mobile ── */
@media (max-width: 767px) {
    .dc-tp-results { --dc-res-gap: 8px; }
    .dc-tp-results__knob { width: 46px; height: 46px; }
    .dc-tp-results__tag { bottom: 14px; }
    .dc-tp-results__tag--before { left: 14px; }
    .dc-tp-results__tag--after { right: 14px; }
    .dc-tp-results__count b { font-size: 36px; }
    .dc-tp-results__thumbs {
        flex-wrap: nowrap; overflow-x: auto;
        margin-inline: -4px; padding: 6px 4px 4px;
        scroll-snap-type: x mandatory; scrollbar-width: none;
    }
    .dc-tp-results__thumbs::-webkit-scrollbar { display: none; }
    .dc-tp .dc-tp-results__thumb { width: 60px; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
    .dc-tp-results__knob::after,
    .dc-tp-results__hint-dot,
    .dc-tp-results__count b.is-ticking { animation: none !important; }
    .dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__stage,
    .dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__panel > *,
    .dc-tp-results.is-ready:not(.is-inview) .dc-tp-results__img { opacity: 1; transform: none; }
}

/* ── "Binnenkort" state (no photos yet): abstract stage, no counter ── */
.dc-tp-results--placeholder .dc-tp-results__frame { background: #f6eeea; }
.dc-tp-results--placeholder .dc-tp-results__note { margin-top: 14px; }
