/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* Bunny Video custom element */
.brxe-bunny-video {
  position: relative;
  width: 100%;
}

/* Unframed embed: iframe takes the chosen aspect ratio */
.brxe-bunny-video:not(.has-frame) iframe {
  display: block;
  width: 100%;
  aspect-ratio: var(--bunny-ar, 16 / 9);
  border: 0;
}

/* Unframed background: fill a root you size via Bricks height/min-height */
.brxe-bunny-video.is-background:not(.has-frame) {
  overflow: hidden;
}

.brxe-bunny-video.is-background:not(.has-frame) .bunny-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Device frame: phone --- */
.brxe-bunny-video.has-frame {
  display: block;
}

.bunny-frame {
  --_bezel: clamp(8px, 3.2%, 14px);
  --_radius: clamp(30px, 12%, 52px);
  position: relative;
  width: 100%;
  max-width: var(--bunny-frame-width, 300px);
  margin-inline: auto;
  aspect-ratio: 9 / 19.5;
  padding: var(--_bezel);
  background: var(--bunny-frame-color, #1c1330);
  border-radius: var(--_radius);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 24px 48px -16px rgba(0, 0, 0, 0.45);
}

.bunny-frame__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  border-radius: calc(var(--_radius) - var(--_bezel));
}

.bunny-frame__screen iframe,
.bunny-frame__screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* Notch */
.bunny-frame::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: var(--_bezel);
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: clamp(14px, 4%, 22px);
  background: var(--bunny-frame-color, #1c1330);
  border-radius: 0 0 14px 14px;
}

/* Home indicator */
.bunny-frame::after {
  content: "";
  position: absolute;
  z-index: 4;
  bottom: calc(var(--_bezel) + 7px);
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.6);
}

/* Status bar (time + signal / wifi / battery), split by the notch */
.bunny-frame__status {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: clamp(24px, 8.5%, 36px);
  padding: 0 clamp(11px, 6.5%, 22px);
  color: var(--bunny-status-color, #fff);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: clamp(9px, 3.7%, 13px);
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.bunny-frame__time {
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.bunny-frame__icons {
  display: inline-flex;
  align-items: center;
  gap: clamp(3px, 1.7%, 6px);
}

.bunny-frame__icons .sb-ic {
  display: block;
  width: auto;
  height: clamp(9px, 3.4%, 12px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.bunny-frame__icons .sb-battery {
  height: clamp(9px, 3.2%, 11px);
}

/* Journey section — full-bleed background: the stage lives inside the section's
   content container (.brxe-container, ~15px side gutters), which capped the bg short
   of the window. Neutralise the gutters for this section so the stage goes edge-to-edge;
   the content column inside stays centred at the body width. */
#brxe-pqdltz > .brxe-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* The stage shows the active step's photo (set by JS from each slide) as a full cover. */
#brxe-qgqtvl {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Two crossfading background layers behind the overlay + content, so the per-step photo
   transition is smooth (JS toggles .is-shown; background-image itself can't animate). */
#brxe-qgqtvl .journey-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
}

/* Journey slider (implant-system P6) — native nestable Slider, pagination styled as a
   left vertical dot-rail with dashed connectors + active ring. */
#brxe-jslidr .splide__slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  /* Each slide carries its step photo as a native Bricks Background → Image, but the
     JS paints it full-bleed on the stage instead. Hide the slide's own body-width paint
     (size 0) while keeping the URL readable via getComputedStyle in journey-slider.js. */
  background-size: 0;
}
#brxe-jslidr .splide__pagination {
  position: absolute;
  left: calc(-1 * var(--space-2xl));
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  gap: 46px;
  margin: 0;
  padding: 0;
  width: -moz-fit-content;
  width: fit-content;
  height: auto;
  max-height: none;
  background: none;
}
#brxe-jslidr .splide__pagination li {
  display: block;
  line-height: 0;
  margin: 0;
}
#brxe-jslidr .splide__pagination__page {
  position: relative;
  width: 7px;
  height: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  opacity: .85;
  transition: opacity .25s ease;
}
#brxe-jslidr .splide__pagination li:not(:last-child) .splide__pagination__page::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: 2px;
  height: 38px;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, .8) 0 2px, transparent 2px 7px);
}
#brxe-jslidr .splide__pagination__page.is-active {
  opacity: 1;
  transform: none;
  background: #fff;
  outline: 1px solid rgba(255, 255, 255, .92);
  outline-offset: 5px;
}

/* ao4-smile-implants S2 (Key Advantages grid) + S7 (Journey step slider) are styled
   entirely via native Bricks element settings + each element's own CSS panel — nothing
   for them lives in this file. The step slider's behaviour layer is js/step-slider.js. */
/* Homepage Pillars grid: the 3-column layout is fixed-width and overflows the mobile
   viewport (§6 accessibility — 0 horizontal overflow). Collapse it responsively: two
   columns on small screens, one on mobile portrait. Scoped to the pillar grid only. */
@media (max-width: 767px) {
  .brx-grid:has(> .pillar-card) { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 478px) {
  .brx-grid:has(> .pillar-card) { grid-template-columns: 1fr !important; }
}

/* ------------------------------------------------------------------ *
 * Read More — collapsible long-form copy (clinician bios, etc.)
 *
 * Reusable behaviour. Markup: a wrapper `.readmore` containing a
 * `.readmore__body` (the long copy) and a `.readmore__toggle` button.
 * Progressive enhancement: with no JS the copy stays fully visible.
 * js/readmore.js measures each block and adds `.is-collapsible` only when
 * the content actually overflows `--readmore-max`; the toggle then flips
 * `.is-open`. Because clamping is opt-in via `.is-collapsible`, short bios
 * render in full with no dead toggle. Tune the collapsed height per
 * instance with `--readmore-max` (e.g. on the wrapper).
 * ------------------------------------------------------------------ */
.readmore {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 20px);
}

/* The collapsible copy animates its height open/closed (JS drives the exact
   px values so the transition has real endpoints). */
.readmore__body {
  overflow: hidden;
  transition: max-height .5s cubic-bezier(.4, 0, .2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .readmore__body { transition: none; }
}

/* Collapsed state: clamp height + fade the copy out at the bottom. The fade
   is a mask (background-independent) so it works on any section colour. */
.readmore.is-collapsible:not(.is-open) .readmore__body {
  max-height: var(--readmore-max, 340px);
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}

/* Toggle: quiet brand-purple text button with a caret that flips when open.
   Scoped selector (`.readmore .readmore__toggle`) beats the Bricks button
   preset so it reads as a link, not a filled button. */
.readmore__toggle { display: none; }
.readmore.is-collapsible .readmore__toggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;   /* hug content; don't stretch to column width */
  position: relative;       /* keep the toggle above any sibling so clicks land */
  z-index: 1;
  gap: 8px;
  margin: 0;
  /* Override the Bricks global button preset (.bricks-button:not([...])), which
     is more specific than a plain class selector. A little vertical padding
     gives the text link a comfortable tap/click target. */
  padding: 4px 0 !important;
  border: 0 !important;
  background: none !important;
  color: var(--readmore-accent, #2c2341);
  font: inherit;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1;
  cursor: pointer;
  transition: opacity .2s ease;
}
.readmore .readmore__toggle:hover { opacity: .65; }
.readmore .readmore__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

/* CSS caret — points down when collapsed, up when open. */
.readmore .readmore__toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s ease;
}
.readmore.is-open .readmore__toggle::after {
  transform: translateY(1px) rotate(-135deg);
}

/* ------------------------------------------------------------------ *
 * Finance logo marquee — hero payment/finance badges
 *
 * The row (.hero__finance) is authored in Bricks as a centred flex-wrap
 * row of logos. js/finance-marquee.js moves those logos into a track that
 * holds the set twice and adds .hero__finance--marquee; the animation below
 * then slides the track by exactly one set for a seamless loop.
 *
 * Each set carries its own trailing gap, so the two sets are exactly equal
 * in width and -50% lands precisely on the seam. Only `transform` animates.
 * ------------------------------------------------------------------ */

/* Bricks emits its global classes as compound selectors — `.hero__finance.brxe-block`
   (0,2,0) — inline in the head, i.e. after this stylesheet. So the marquee's own
   overrides must reach (0,3,0) to win; that is what the tripled class below is for.
   We keep Bricks' flex row rather than forcing `display: block`, and only override
   the two properties that actually fight the marquee: wrapping and centring. */
.hero__finance.brxe-block.hero__finance--marquee {
	/* The hero inner is a centred flex column, so children shrink to content:
	   opt out of that, the marquee needs the full inner width to scroll across. */
	align-self: stretch;
	/* One long track instead of a wrapped, centred row. Centring would push the
	   overflowing track left and start the loop part-way through. */
	flex-wrap: nowrap;
	justify-content: flex-start;
	overflow: hidden;
	/* Soften both ends so logos enter and leave instead of being cut off. */
	-webkit-mask-image: linear-gradient( to right, transparent, #000 var(--space-lg), #000 calc( 100% - var(--space-lg) ), transparent );
	mask-image: linear-gradient( to right, transparent, #000 var(--space-lg), #000 calc( 100% - var(--space-lg) ), transparent );
}

.hero__finance-track {
	display: flex;
	flex: 0 0 auto;
	width: max-content;
	animation: hero-finance-scroll var(--hero-finance-duration, 40s) linear infinite;
}

.hero__finance-set {
	display: flex;
	align-items: center;
	/* Each set is a flex item of the track: without this it shrinks below its
	   content width and the logos (flex:0 0 auto) overflow and overlap. */
	flex: 0 0 auto;
	column-gap: var(--space-lg);
	/* Trailing gap belongs to the set, not the track — this is what keeps the
	   two sets identical in width and the -50% seam invisible. */
	padding-right: var(--space-lg);
}

.hero__finance--marquee .hero__finance-logo {
	flex: 0 0 auto;
}

@keyframes hero-finance-scroll {
	from { transform: translateX( 0 ); }
	to   { transform: translateX( -50% ); }
}

/* Let people stop it to read a logo. */
.hero__finance--marquee:hover .hero__finance-track,
.hero__finance--marquee:focus-within .hero__finance-track {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	/* Fall back to the original static, centred, wrapping row. */
	/* Hand the row back to Bricks' own wrapped, centred layout. */
	.hero__finance.brxe-block.hero__finance--marquee {
		flex-wrap: wrap;
		justify-content: center;
		overflow: visible;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.hero__finance-track {
		animation: none;
		/* JS pins an inline width of two sets for the loop; the static fallback
		   needs the natural width back, hence !important over that inline style. */
		width: auto !important;
	}

	.hero__finance-set {
		flex-wrap: wrap;
		justify-content: center;
		row-gap: var(--space-sm);
		padding-right: 0;
	}

	/* The duplicate set exists only to hide the loop seam. */
	.hero__finance-track [aria-hidden="true"] {
		display: none;
	}
}
