/*
 * Interaction kit: the working parts of each piece. Colours and type come from the
 * site's own design system (the --rl-* custom properties), so every site looks its own.
 */

/* Before and after slider */
.rl-compare { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rl-compare img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rl-compare.is-ready { display: block; overflow: hidden; border-radius: var(--rl-radius, 6px); aspect-ratio: var(--rl-compare-ratio, 16 / 10); }
.rl-compare.is-ready > img, .rl-compare.is-ready .rl-compare-after { position: absolute; inset: 0; }
.rl-compare.is-ready .rl-compare-after { clip-path: inset(0 0 0 var(--rl-pos, 50%)); }
.rl-compare.is-ready::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--rl-pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; }
.rl-compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 2; }
.rl-compare:focus-within::after { box-shadow: 0 0 0 3px var(--rl-accent, #f0b429); }
.rl-compare.is-ready::before { content: ""; position: absolute; z-index: 1; top: 50%; left: var(--rl-pos, 50%); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.25); pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E"); background-size: 22px 22px; background-repeat: no-repeat; background-position: center; }
.rl-compare-label { position: absolute; z-index: 1; bottom: 14px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: .82rem; font-weight: 600; pointer-events: none; }
.rl-compare-tag-before { left: 14px; }
.rl-compare-tag-after { right: 14px; }

/* Carousel */
.rl-carousel { --rl-per-view: 1; position: relative; }
.rl-carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--rl-per-view) - 1) * 24px) / var(--rl-per-view)); column-gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.rl-carousel-track::-webkit-scrollbar { display: none; }
.rl-carousel-track > * { scroll-snap-align: start; min-width: 0; }
.rl-carousel-track:focus-visible { outline: 3px solid var(--rl-accent, #f0b429); outline-offset: 4px; }
.rl-carousel-nav { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.rl-carousel-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; }
.rl-carousel-nav button:disabled { opacity: .35; cursor: default; }
.rl-carousel-status { font-size: .9rem; opacity: .75; min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .rl-carousel { --rl-per-view: 1 !important; } .rl-carousel-track { grid-auto-columns: 86%; } }

/* Tabs */
.rl-tab-list { display: none; }
.rl-tabs.is-ready .rl-tab-list { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.rl-tab-list > button { font: inherit; font-weight: 600; padding: .7em 1.2em; border-radius: var(--rl-radius, 6px); border: 1.5px solid var(--rl-line, #ddd); background: transparent; color: inherit; cursor: pointer; }
.rl-tab-list > button[aria-selected="true"] { background: var(--rl-ink, #222); border-color: var(--rl-ink, #222); color: var(--rl-surface, #fff); }
.rl-tab-panel + .rl-tab-panel { margin-top: 24px; }
.rl-tabs.is-ready .rl-tab-panel + .rl-tab-panel { margin-top: 0; }
.rl-tab-panel:focus-visible { outline: 3px solid var(--rl-accent, #f0b429); outline-offset: 4px; }

/* Gallery (a page can restyle it; this keeps it tidy if it does not) */
.rl-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.rl-gallery > a, .rl-gallery > figure { display: block; margin: 0; overflow: hidden; border-radius: var(--rl-radius, 6px); aspect-ratio: 4 / 3; }
.rl-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.rl-gallery > a { cursor: zoom-in; }
.rl-gallery > a:hover img { transform: scale(1.04); }
.rl-gallery > a:focus-visible { outline: 3px solid var(--rl-accent, #f0b429); outline-offset: 3px; }

/* Lightbox */
.rl-lightbox { border: 0; padding: 0; background: transparent; max-width: min(1200px, 94vw); max-height: 92vh; overflow: visible; }
.rl-lightbox::backdrop { background: rgba(8, 10, 14, .88); }
.rl-lightbox figure { margin: 0; }
.rl-lightbox img { max-width: 100%; max-height: 84vh; display: block; margin: 0 auto; border-radius: 4px; }
.rl-lightbox figcaption { color: #e9ecef; text-align: center; margin-top: 10px; font-size: .95rem; }
.rl-lightbox button { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; cursor: pointer; }
.rl-lightbox button:hover { background: rgba(255,255,255,.26); }
.rl-lightbox-close { top: 18px; right: 18px; }
.rl-lightbox-prev { left: 18px; top: 50%; }
.rl-lightbox-next { right: 18px; top: 50%; }

/* Marquee */
.rl-marquee { display: flex; overflow: hidden; gap: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.rl-marquee-track { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-right: 56px; flex-shrink: 0; }
.rl-marquee.is-running .rl-marquee-track { flex-wrap: nowrap; animation: rl-marquee var(--rl-marquee-speed, 40s) linear infinite; }
.rl-marquee.is-running:hover .rl-marquee-track { animation-play-state: paused; }
@keyframes rl-marquee { to { transform: translateX(-100%); } }

/* Parallax */
[data-rl-parallax] { overflow: hidden; }
[data-rl-parallax] img { transform: translateY(var(--rl-parallax, 0)) scale(1.08); will-change: transform; }

/* Process steps */
.rl-steps { list-style: none; margin: 0; padding: 0; counter-reset: rl-step; position: relative; }
.rl-steps > li { counter-increment: rl-step; position: relative; padding: 0 0 36px 64px; }
.rl-steps > li::before { content: counter(rl-step); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--rl-primary, #1f4e79); color: #fff; }
.rl-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 21px; top: 50px; bottom: 6px; width: 2px; background: var(--rl-line, #ddd); }
.rl-steps.is-ready > li { opacity: .25; transition: opacity .6s ease; }
.rl-steps.is-ready > li.is-visible { opacity: 1; }

/* Sticky call bar on phones */
.rl-callbar { display: none; }
@media (max-width: 767px) {
	.rl-callbar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; box-shadow: 0 -6px 24px rgba(0,0,0,.14); padding-bottom: env(safe-area-inset-bottom); background: var(--rl-surface, #fff); }
	.rl-callbar a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; font-weight: 700; text-decoration: none; }
	.rl-callbar-call { background: var(--rl-primary, #1f4e79); color: #fff; }
	.rl-callbar-quote { background: var(--rl-accent, #f0b429); color: var(--rl-ink, #111); }
	.rl-callbar a:only-child { grid-column: 1 / -1; }
	body.rl-has-callbar { padding-bottom: 56px; }
}

/* Consistent photo treatment, chosen in the plan, so stock, AI and own photos look like one shoot */
.rl-photo-warm .rl-main img:not([src^="data:"]) { filter: sepia(.12) saturate(1.06) contrast(1.02); }
.rl-photo-cool .rl-main img:not([src^="data:"]) { filter: saturate(.9) contrast(1.04) brightness(1.02) hue-rotate(-6deg); }
.rl-photo-muted .rl-main img:not([src^="data:"]) { filter: saturate(.78) contrast(1.06); }
.rl-photo-crisp .rl-main img:not([src^="data:"]) { filter: contrast(1.06) saturate(1.08); }
.rl-photo-mono .rl-main img:not([src^="data:"]) { filter: grayscale(1) contrast(1.08); }

@media (prefers-reduced-motion: reduce) {
	.rl-marquee-track { animation: none !important; }
	[data-rl-parallax] img { transform: none; }
	.rl-gallery img { transition: none; }
	.rl-steps.is-ready > li { opacity: 1; transition: none; }
}
