/* ============================================================
   Rosies — Typography System
   File:  /wp-content/themes/rosies/assets/css/typography.css
   Depends on: fonts.css (must load first — enforced in functions.php)

   Stack (UPDATED — now uses real RTKids fonts):
     • Roboto           — body, UI, forms  (variable font, 100-900)
     • Rift Soft        — headings, buttons, program titles (500/600)
     • Verveine         — script accent  (.rosies-script)
     • Skippy Sharpie   — marker accent  (.rosies-marker)
     • Captain Comic    — hand accent    (.rosies-hand)

   Notes:
     • Fluid sizing via clamp() — mobile → desktop scale
     • Root remains 16px; sizes expressed in rem for accessibility
     • Overrides Salient/WPBakery defaults using specificity + priority
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS custom properties (design tokens)
   ------------------------------------------------------------ */
:root {
  /* Font families with system fallbacks (real fonts, replaced placeholders) */
  --rosies-font-body:
    'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --rosies-font-display:
    'Rift Soft', 'Impact', 'Arial Narrow', 'Roboto', sans-serif;
  --rosies-font-script: 'Verveine', 'Brush Script MT', cursive;
  --rosies-font-marker: 'Skippy Sharpie', 'Comic Sans MS', cursive;
  --rosies-font-hand: 'Captain Comic', 'Comic Sans MS', cursive;

  /* Text color tokens (adjust when color system is finalized) */
  --rosies-color-ink: #2a2a2a;
  --rosies-color-ink-soft: #4a4a4a;
}

/* ------------------------------------------------------------
   2. Body & long-form reading

   NOTE: font-size and line-height are managed by Salient Options >
   Typography (Body). Salient writes those to `body` directly, so we
   deliberately do NOT set them here — doing so would win the
   specificity fight against Salient's panel output and silently
   ignore the editor's setting. Same philosophy as headings above:
   Salient's panel is source of truth for size/weight, this file only
   supplies the fallback family, color, and font-smoothing.

   If you need to change body size or line-height:
     WP Admin → Salient Options → Typography → Body
   (Currently: 20px / 30px line-height per editor's setup.)
   ------------------------------------------------------------ */
body,
.container-wrap,
p,
li,
dd,
blockquote {
  font-family: var(--rosies-font-body);
  color: var(--rosies-color-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   3. Headings — fluid sizing (mobile → desktop)

   NOTE: weights updated for Rift Soft
   Rift Soft ships as Medium (500) and Demi (600) only.
   700 requests would trigger synthetic bolding — avoid.
   ------------------------------------------------------------ */
/* NOTE: h1–h6 typography (font-family, weight, size, line-height)
   is now fully managed by Salient Options > Typography. Rift Soft
   is registered via includes/functions/fonts.php.

   Panel settings (source of truth):
     H1  Rift Soft   Medium 500   60/62
     H2  Rift Soft   Medium 500   50/52
     H3  Rift Soft   Medium 500   40/42
     H4  Rift Soft   Medium 500   30/32
     H5  Roboto      Bold 700     20/22
     H6  Roboto      Bold 700     16/18

   Only visual details Salient doesn't own (letter-spacing on H1/H2,
   uppercase on H6, brand color) remain here. If you need a size or
   weight change, change it in the panel — not in this file. */
h1,
.h1,
body .h1,
body h1 {
  letter-spacing: -0.01em;
  color: var(--rosies-color-ink);
}

h2,
.h2,
body .h2,
body h2 {
  letter-spacing: -0.005em;
  color: var(--rosies-color-ink);
}

h3,
.h3,
body .h3,
body h3 {
  color: var(--rosies-color-ink);
}

h4,
.h4,
body .h4,
body h4 {
  color: var(--rosies-color-ink);
}

h5,
.h5,
body .h5,
body h5 {
  letter-spacing: 0.01em;
  color: var(--rosies-color-ink);
}

h6,
.h6,
body .h6,
body h6 {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rosies-color-ink-soft);
}

/* ------------------------------------------------------------
   4. Buttons — Salient .nectar-button + WPBakery + native
   ------------------------------------------------------------ */
/* NOTE: Button font-family and weight managed by Salient Options >
   Typography > Buttons. Only visual details Salient doesn't own
   (letter-spacing, uppercase) remain here. */
.nectar-button,
.vc_btn3,
button,
input[type='submit'],
input[type='button'],
.wp-block-button__link {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Small/secondary text buttons */
.nectar-button.small,
.vc_btn3.vc_btn3-size-sm {
  font-family: var(--rosies-font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------
   5. Navigation
   ------------------------------------------------------------ */
#header-outer #top nav > ul > li > a {
  font-family: var(--rosies-font-body);
  font-weight: 500;
  /* font-size: 15px; */
  letter-spacing: 0.02em;
}
#header-outer #top nav > ul > li > a:hover {
  color: #ea9320;
}
#header-outer #top nav ul.sub-menu li a {
  font-family: var(--rosies-font-body);
  font-weight: 400;
  /* font-size: 14px; */
  letter-spacing: 0;
}

/* ------------------------------------------------------------
   6. Forms
   ------------------------------------------------------------ */
input,
textarea,
select {
  font-family: var(--rosies-font-body);
  font-size: 16px; /* prevents iOS zoom on focus */
  font-weight: 400;
}

label {
  font-family: var(--rosies-font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--rosies-color-ink);
}

/* ------------------------------------------------------------
   7. Utility text sizes
   ------------------------------------------------------------ */
.rosies-meta,
.rosies-caption {
  font-family: var(--rosies-font-body);
  font-weight: 400;
  font-size: 0.8125rem; /* 13px */
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--rosies-color-ink-soft);
}

.rosies-lede {
  font-family: var(--rosies-font-body);
  font-weight: 400;
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.25rem); /* 18 → 20 */
  line-height: 1.55;
  color: var(--rosies-color-ink);
}

/* ------------------------------------------------------------
   8. Footer
   ------------------------------------------------------------ */
#footer-outer,
#footer-outer p,
#footer-outer li,
#footer-outer a {
  font-family: var(--rosies-font-body);
  font-weight: 400;
  font-size: 14px;
}

/* ------------------------------------------------------------
   9. Accent typography — intentional-use classes
   Applied via WPBakery "Extra Class" or inline in text blocks.
   Rules of use:
     • Never for body copy or nav
     • Never combine two accents in the same section
     • Never below 22px effective size
     • Always paired with a semantic heading nearby
   ------------------------------------------------------------ */
.rosies-script {
  font-family: var(--rosies-font-script);
  font-weight: 400;
  font-size: clamp(1.75rem, 1rem + 2vw, 3.5rem); /* 28 → 56 */
  line-height: 1.15;
  color: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rosies-marker {
  font-family: var(--rosies-font-marker);
  font-weight: 400;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.75rem); /* 24 → 44 */
  line-height: 1.2;
  color: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rosies-hand {
  font-family: var(--rosies-font-hand);
  font-weight: 400; /* Captain Comic ships as 400 only */
  font-size: clamp(1.375rem, 1rem + 1vw, 2rem); /* 22 → 32 */
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--rosies-color-ink-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   10. Accessibility & motion
   ------------------------------------------------------------ */
::selection {
  background: var(--rosies-color-ink);
  color: #ffffff;
}

/* Respect users who prefer reduced motion — no auto-animating type */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------
   1. Brand-color image placeholders

   Salient's image_with_animation renders our el_class onto the
   <img> element itself. When image_url is empty (placeholder
   mode), src="" causes a broken-image icon and no natural
   dimensions.

   These rules:
     • Hide the broken img itself
     • Style its parent wrapper (.hover-wrap-inner) as the
       colored rectangle at the correct aspect ratio
     • Use :has() to scope the wrapper styling to placeholders

   Once real image_url values are set, the placeholder classes
   are simply removed from el_class and the CSS becomes dormant.
   ------------------------------------------------------------ */

/* Hide the empty img and neutralize its inline height/width */
img.rosies-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  opacity: 0;
}

/* Style the parent wrapper as the visible colored block */
.hover-wrap-inner:has(img.rosies-placeholder) {
  display: block;
  width: 100%;
  overflow: hidden;
}

/* Aspect ratios — applied to the wrapper */
.hover-wrap-inner:has(.rosies-placeholder-4-3) {
  aspect-ratio: 4 / 3;
}
.hover-wrap-inner:has(.rosies-placeholder-3-2) {
  aspect-ratio: 3 / 2;
}
.hover-wrap-inner:has(.rosies-placeholder-1-1) {
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 50% !important;
  overflow: hidden !important;
}

/* Higher-specificity backup — Salient's baseline .hover-wrap-inner
   rule may zero out border-radius. This overrides via attribute+class
   chain matching Salient's own specificity pattern. */
.img-with-aniamtion-wrap[data-border-radius='500px'] .hover-wrap-inner {
  border-radius: 50%;
  overflow: hidden;
}

/* Color variants — applied to the wrapper */
.hover-wrap-inner:has(.rosies-placeholder-navy) {
  background-color: #004671;
}
.hover-wrap-inner:has(.rosies-placeholder-orange) {
  background-color: #f58221;
}
.hover-wrap-inner:has(.rosies-placeholder-yellow) {
  background-color: #e8d833;
}

/* ------------------------------------------------------------
   2. Neutralize WPBakery vc_custom_heading inline font-family

   WPBakery's [vc_custom_heading] injects a hardcoded inline
   style="font-family: Abril Fatface" on every heading, pulled
   from a WPBakery global default. This bypasses our typography.css
   because inline styles win by specificity.

   Force our own H1/H2/H3 font stacks (set in typography.css) to
   take over. This is one of the rare cases where !important is
   the correct tool: we are neutralizing a plugin's inline default.
   ------------------------------------------------------------ */
.vc_custom_heading,
h1.vc_custom_heading,
h2.vc_custom_heading,
h3.vc_custom_heading,
h4.vc_custom_heading,
h5.vc_custom_heading,
h6.vc_custom_heading {
  font-family: inherit !important;
}

/* ------------------------------------------------------------
   3. Eyebrow text — small uppercase section label
   Reusable across pages; no native Salient "eyebrow" preset
   exists in WPBakery Classic Mode. This is a genuine site-wide
   micro-typography style, so it may migrate to typography.css
   later if reused often.
   ------------------------------------------------------------ */
.rosies-eyebrow {
  color: #b85c10;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: clamp(13px, 1vw, 15px);
  margin-bottom: 8px;
}

/* ============================================================
   4. RTKids brand primitives (site-wide)

   Reusable class-based typography + UI primitives for use in
   WPBakery [vc_column_text] blocks anywhere in the site.
   No page-scoping — drop the class on any page and it works.

   Homepage-specific layout (hero photo/tagline sizing, alumni
   curly line, sunburst decorator, section spacing) stays in
   homepage.css scoped to `.rtk-home`.
   ============================================================ */

/* Brand H2 — cyan uppercase section heading (left-aligned).
   Positioned relative so decorator ::before pseudos can attach.
   NOTE: font-family, font-weight, font-size, line-height all
   inherit from the <h2> tag rules — which inherit from Salient's
   Typography panel. This class only adds brand-specific overrides:
   color, uppercase, tracking, spacing. Applied to <h2 class="rtk-h2">. */
.rtk-h2 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rosies-cyan-text);
  margin: 0 0 24px;
  position: relative;
}

/* Brand H2 — gold variant (Gala). Same inheritance as .rtk-h2. */
.rtk-h2-yellow {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rosies-yellow-text);
  margin: 0 0 20px;
}

/* Brand H2 — centered variant.
   Displayed as inline-block so the box hugs the text; the parent
   (e.g. .rtk-mint-band) provides text-align:center to center it.
   This is what lets a ::before decorator anchor to the text edge. */
.rtk-h2-centered {
  display: inline-block;
  position: relative;
  color: var(--rosies-cyan-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 48px;
  text-align: left;
}

/* Brand H3 — smaller cyan uppercase (program-card titles, etc.).
   Applied to <h3 class="rtk-h3">; inherits Rift Soft, weight, size,
   line-height from the h3 tag rule (Salient panel). */
.rtk-h3 {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rosies-cyan-text);
  margin: 0 0 14px;
}

/* Body copy — Roboto 16/1.6 */
.rtk-body {
  font-family: var(--rosies-font-body, 'Roboto'), sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--rosies-ink);
  margin: 0 0 18px;
}
.rtk-body-emphasis {
  font-style: italic;
  font-weight: 400;
  color: var(--rosies-ink);
  margin-top: 24px;
}

/* Learn More link — cyan uppercase with hover underline PNG */
.rtk-learnmore {
  display: inline-block;
  font-family: var(--rosies-font-hand, 'Captain Comic'), cursive, sans-serif;
  font-weight: 700; /* Per editor request — synthetic bold (Captain Comic ships 400 only) */
  font-size: 18px; /* handwritten needs a touch more size than Rift 14px */
  letter-spacing: 0.02em; /* looser than geometric 0.08em — lets letterforms breathe */
  text-transform: uppercase;
  color: var(--rosies-cyan-text);
  text-decoration: none;
  padding: 4px 2px 8px;
  background-image: none;
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: 100% 6px;
  transition: color 0.15s ease;
}
.rtk-learnmore:hover,
.rtk-learnmore:focus {
  color: var(--rosies-cyan-text);
  background-image: url('/wp-content/themes/rosies/assets/decorators/learnmore-underline.png');
}

/* Orange button — override Salient's .nectar-button.
   Usage: <a class="nectar-button medium regular rtk-btn-orange"> */
a.nectar-button.rtk-btn-orange,
.nectar-button.rtk-btn-orange {
  background-color: var(--rosies-orange-text) !important;
  border-color: var(--rosies-orange-text) !important;
  color: #fff !important;
}
a.nectar-button.rtk-btn-orange:hover,
.nectar-button.rtk-btn-orange:hover {
  background-color: #9e4e0d !important;
  border-color: #9e4e0d !important;
}

/* Mint band — rounded container with mint background.
   Wrap in <div class="rtk-mint-band"> inside [vc_column_text].
   Any .rtk-h2-centered child centers automatically because the
   band is text-align:center; grids inside restore text-align:left. */
.rtk-mint-band {
  background: var(--rosies-mint);
  padding: 60px 40px;
  margin: 40px 0;
  border-radius: 12px;
  text-align: center;
}
.rtk-mint-band > .rtk-programs-grid,
.rtk-mint-band > .rtk-20years-grid {
  text-align: left;
}
@media (max-width: 768px) {
  .rtk-mint-band {
    padding: 40px 20px;
  }
}

/* Two-column grids for mint-band contents.
   Used instead of [vc_row_inner] because wrapping raw HTML around
   inner-row shortcodes inside [vc_column_text] is inconsistent. */
.rtk-20years-grid,
.rtk-programs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.rtk-programs-grid {
  align-items: start;
  gap: 32px;
}
@media (max-width: 768px) {
  .rtk-20years-grid,
  .rtk-programs-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Circular photo (20 Years, testimonials) */
.rtk-circle-photo {
  display: block;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}
.rtk-circle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Program card — rounded photo + H3 + body + Learn More */
.rtk-program-card {
  background: transparent;
  padding: 12px;
  position: relative;
}
.rtk-program-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 22px;
}

/* Video thumbnail with generated white circle + cyan play triangle.
   Usage: <a class="rtk-video-thumb" href="#"><img ... /></a>
   isolation:isolate creates a new stacking context so the pseudos
   always sit above the <img>. */
a.rtk-video-thumb {
  position: relative;
  display: block;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  isolation: isolate;
}
a.rtk-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
a.rtk-video-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
  z-index: 2;
  pointer-events: none;
}
a.rtk-video-thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + 4px), -50%);
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid var(--rosies-cyan-text);
  z-index: 3;
  pointer-events: none;
}
a.rtk-video-thumb:hover::after {
  transform: translate(-50%, -50%) scale(1.08);
}

/* If WPBakery wraps the <a> in a <p> via wpautop, neutralize it */
.wpb_text_column p:has(> a.rtk-video-thumb) {
  margin: 0;
  text-align: center;
}

/* Testimonial block — purple heading + italic quote + attribution.
   The header ::before/::after arrow decorators are homepage-specific
   and live in homepage.css scoped to .rtk-home.

   INTENTIONAL FONT OVERRIDE: this <h2> should NOT be Rift Soft.
   Per the live BlueHost site, the "Sharing Experiences" heading
   uses Verveine (script). This is the one place a class needs to
   override the panel-provided family — the design deliberately
   diverges from the site-wide H2 identity. Size/weight follow
   Salient's Blockquote setting shape (Verveine Regular 64/66).
   Works on ANY H-tag (h1–h6) or plain block, not just <h2>. The
   original rule was class-only — which should have won on specificity
   — but Salient's dynamic-styles.css loads after this file and its
   `body hN` rules override same-specificity properties like font-family,
   font-weight, and (on h6) text-transform. `!important` on the identity
   properties (family, weight, transform) makes the class robust when
   applied to h1/h3/h4/h5/h6.

   Usage:
     <h1 class="rtk-testimonial-header"><span style="color: #7a54a3;">Text</span></h1>
     <h2 class="rtk-testimonial-header"><span style="color: #7a54a3;">Text</span></h2>
     ... any H tag works. */
.rtk-testimonial-header {
  font-family:
    var(--rosies-font-script, 'Verveine'), cursive, sans-serif !important;
  font-weight: 400 !important;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: none !important; /* scripts should never be uppercased (defeats Salient's h6 uppercase) */
  color: var(--rosies-purple-text);
  margin: 0 auto 40px;
  display: block;
  text-align: center;
  position: relative;
  max-width: 720px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.rtk-testimonial-photo {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 28px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}
.rtk-testimonial-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rtk-testimonial-photo img[src=''],
.rtk-testimonial-photo img:not([src]) {
  display: none;
}
.rtk-testimonial-quote {
  font-family: var(--rosies-font-body, 'Roboto'), sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--rosies-ink);
  max-width: 640px;
  margin: 0 auto 12px;
  text-align: center;
  font-style: italic;
}
.rtk-testimonial-attribution {
  font-family: var(--rosies-font-body, 'Roboto'), sans-serif;
  font-size: 15px;
  color: var(--rosies-ink-soft);
  margin: 0 auto 24px;
  text-align: center;
}

/* ============================================================
   Testimonial slider — image + text sizing
   ============================================================
   The Salient testimonial style "basic_left_image" renders the
   portrait as a 52×52 <div class="image-icon"> with a background-
   image. Prod (BlueHost) shows the portrait at 275×275. Enlarge
   the icon to match, and give the flex layout breathing room. */

.rtk-testimonial-header
  + .nectar-flickity
  .nectar_single_testimonial
  .image-icon,
.nectar_single_testimonial[data-style='basic_left_image'] .image-icon {
  width: 275px !important;
  height: 275px !important;
  min-width: 275px; /* keep flex sibling from squeezing it */
  border-radius: 50% !important;
  background-size: cover !important;
  background-position: center !important;

  /* Center the photo horizontally within the left half of the 50/50
     split. Left half = 0..535 of the slide. Photo width = 275.
     Photo left = (535 - 275) / 2 = 130. Since .image-icon is
     position:absolute anchored to the blockquote's positioned box
     (which starts at slide x=0), left: 130 places the photo center
     at x = 267.5 — the visual midpoint of the left half. */
  left: 130px !important;
}

/* Make room for the enlarged image.
   Salient's basic_left_image variant absolutely-positions .image-icon
   at left:0 on the parent blockquote (which is position:relative), and
   reserves space with padding-left:90px — sized for its default 50px
   icon. Since we enlarged the icon to 275px, we widen the padding to
   275 (image) + 40 (gap) = 315px so the text clears the image.
   The .inner element is display:block, so flex gap/align-items are
   inert — padding is the right lever. */
.nectar_single_testimonial[data-style='basic_left_image'] {
  padding-left: 535px !important; /* 50/50 split: slide is ~1070 wide; image side gets ~535, text starts at ~535 */
}

/* Vertically center text stack against the 275px image.

   The image is position:absolute at top:5px on the blockquote.
   Text stack (quote + name/title) is ~150px tall; image is 275px.
   To center them against each other, push the text down by half the
   difference: (275 - text_height) / 2. We approximate with padding-top
   on .inner — quote/name land near the vertical middle of the image.

   .inner reverts to display:block so we don't manufacture flex ghost
   space, and we set min-height so the block matches the image height.
   That in turn keeps the flickity-viewport tall enough to show the
   FULL image (otherwise the viewport, which auto-sizes to content,
   is shorter than the image and clips it). */
.nectar_single_testimonial[data-style='basic_left_image'] .inner {
  min-height: 275px;
  display: block;
  padding-top: 60px; /* pushes text toward image's vertical middle */
}

/* Tighten the quote paragraph's own bottom padding so the name/title
   sits closer to the last line of the quote. Salient default: 30px. */
.nectar_single_testimonial[data-style='basic_left_image'] .inner p {
  padding-bottom: 8px;
}

/* Widen the .wrap (name + title block) so it fills the text column
   instead of shrinking to inline-block width. Without this the name
   and title render inside a ~105px-wide column, off-center under the
   quote. Salient's default is inline-block — we upgrade to block. */
.nectar_single_testimonial[data-style='basic_left_image'] .wrap {
  display: block;
  width: 100%;
}

/* Salient renders .wrap as:
     <span class="wrap">
       <span>Name</span>            ← bare span, no class
       <span class="title">Title</span>
     </span>
   Bold ONLY the first bare span (the name). The title has .title
   and stays at normal weight. Roboto is a variable font (100–900
   loaded), so 700 renders without any additional font asset. */
.nectar_single_testimonial[data-style='basic_left_image']
  .wrap
  > span:first-child {
  font-weight: 700 !important;
}

/* Push the Learn More text block (a [vc_column_text] sibling of the
   blockquote) below the image's bottom edge and align with the text
   column. Without this, the block starts at the blockquote's OWN left
   edge (which is the slide's left edge, x=0 within the item), so it
   sits under the image — not under the text.
   The image is 275px tall + 5px top offset = clears at ~280px.
   Match the padding-left (315px) of the blockquote so Learn More lines
   up with quote + name below.
   Selector: any .wpb_text_column that immediately follows a
   basic_left_image testimonial. */
.nectar_single_testimonial[data-style='basic_left_image'] + .wpb_text_column {
  padding-left: 535px; /* mirrors blockquote padding for LEARN MORE alignment */
  margin-top: 8px; /* was 20px — tighter to name/title */
  margin-bottom: 60px; /* mirrors .inner padding-top; keeps the
                                    image (275px + 5px offset) fully
                                    inside the flickity-viewport so the
                                    circle isn't clipped at the bottom */
}

/* Drop the blockquote's own margin-bottom — default Salient sets
   30px, which stacks with .wpb_text_column margin-top to inflate the
   gap between name/title and Learn More. */
.nectar_single_testimonial[data-style='basic_left_image'] {
  margin-bottom: 0 !important;
}

/* Push carousel arrows outside the slide content.
   Default Salient/Flickity arrows sit at left:50px / right:50px on
   .nectar-flickity (the arrows' offset parent) — which puts them on
   top of the image (left) and text/Learn More (right).
   The parent section (.wpb_row) is wider than .nectar-flickity by
   ~37px on each side, so we can safely move the arrows into that
   negative space. -35px lands them just outside the carousel wrapper
   and inside the section container.

   Selector scope: target ONLY the testimonial carousel. .rtk-testimonial-header
   is an <h2> wrapped in its own .wpb_text_column div, so it's NOT a
   direct sibling of .nectar-flickity. We use :has() on the common
   parent .wpb_wrapper to find the exact carousel that follows a
   container holding the RTKids testimonial header.
   :has() is supported in all modern browsers. */
/* Arrows are 100px wide. The section container extends ~37px beyond
   the carousel wrapper on each side. Position so the arrow SITS in
   that outer margin as far as it can go, with the inner ~63px of the
   arrow overlapping the carousel edge (matches prod, which places the
   arrows partly over the slide edges). */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button.previous {
  left: -37px !important;
}
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button.next {
  right: -37px !important;
}

/* Replace Flickity's default SVG chevrons with the RTKids purple
   arrow PNGs — the SAME assets prod (BlueHost / RevSlider) uses at
   /wp-content/uploads/2023/03/Home_PurpleArrows{Left,Right}.png.
   Ours are copied into the theme as arrow-purple-{left,right}.png.

   Implementation follows prod's approach: paint the PNG on a
   ::before pseudo-element, NOT on the button's own background.
   Why: Flickity's base CSS sets `background: hsla(0,0%,100%,0.75)`
   on .flickity-button, and setting our own background on the button
   fights that (previous version showed a black dash — leftover paint
   from Flickity's default UI layer). Painting on ::before is what
   prod does and it renders cleanly.

   Native PNG size is 200x100 (2:1 ratio). We render at 100x40, which
   keeps aspect and reads clearly at carousel scale. */

/* 1. Reset the button chrome: kill Flickity's white pill background,
      border, box-shadow, and default width/height. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button {
  width: 100px !important;
  height: 40px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

/* 2. Hide Flickity's default SVG chevron icon. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button
  .flickity-button-icon {
  display: none !important;
}

/* 3. Paint the PNG on ::before (prod-compatible pattern).

   IMPORTANT: Salient's flickity.css ships defaults on both ::before
   (a white circle: background-color:white + border-radius:50%) and
   ::after (a 15x2 black bar — the mini chevron-line). We must
   explicitly reset BOTH or the leftover paint shows through.

   Selector for ::before includes `data-controls*="arrows_overlaid"`
   in the vendor rule, so we match with equal specificity by including
   the same attribute selector. Adding !important on background-color
   and border-radius here beats the vendor rule regardless. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button::before {
  content: '';
  display: block;
  width: 100px;
  height: 40px;
  background-color: transparent !important; /* kills the white pill */
  border-radius: 0 !important; /* kills the circle shape */
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button.previous::before {
  background-image: url('/wp-content/themes/rosies/assets/decorators/arrow-purple-left.png');
}
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button.next::before {
  background-image: url('/wp-content/themes/rosies/assets/decorators/arrow-purple-right.png');
}

/* 3b. Kill Flickity's default ::after (the black 15x2 chevron-line
       remnant from the "arrows_overlaid" skin). */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button::after {
  content: none !important;
  display: none !important;
}

/* 4. Hover: subtle fade. Keep Flickity's -20px baseline transform. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .flickity-prev-next-button:hover {
  opacity: 0.75 !important;
}

/* 4b. Purple line-art speech-bubble decoration behind the testimonial
       photo. Same asset prod (BlueHost) uses. On prod, the bubble
       sits behind and around the circular photo, with its swash tail
       extending right below and past the photo. The bubble PNG is
       1424x790 (RGBA, ~32KB), scaled here to 600px wide (aspect
       preserved => 600 x ~333).

       Placement math (photo is 275x275 at .image-icon):
         bubble width  = 600 (photo + ~325 of extension)
         bubble height = 333
         Anchor bubble so its top-right ~= photo's top-right.
         Photo sits at .image-icon (position:absolute) inside
         .nectar_single_testimonial (position:relative).
         We paint on the blockquote's ::before so it lives in the
         same coordinate space as the photo (blockquote is the
         nearest positioned ancestor of .image-icon).
         Blockquote left edge = photo left edge (0 offset).
         Blockquote top       = photo top - 5px.
         => Position bubble at left:-325px (extends past photo left),
            top:-30px (extends slightly above photo top).
         Photo naturally paints on top of the bubble because
         .image-icon (with its own background photo) is stacked ABOVE
         the blockquote's ::before in source order and DOM depth. */
.nectar_single_testimonial[data-style='basic_left_image']::before {
  content: '';
  display: block !important; /* beats Salient's base .nectar_single_testimonial::before { display:none } */
  position: absolute;

  /* Kill Salient's default blockquote::before decoration: base CSS
     sets border-left: 4px solid #004671 on the same pseudo, painting
     a navy rail at the blockquote's left edge. We want the bubble
     artwork ONLY, no rail. */
  border-left: 0 !important;
  background-color: transparent !important;

  /* Bigger bubble — needs to visibly wrap the 275x275 photo. Native
     asset is 1424x790, scale to 700 wide (~388 tall).

     Horizontal: bubble center matches photo center.
       photo left = 130, photo width = 275 → photo center = 267.5
       bubble left = 267.5 - 700/2 = -82.5 → rounded to -83

     Vertical: bubble anchored so its visible ellipse sits over the
     photo. Iterated with user: -57 too high, +43 too low. -7 lands
     the ellipse over the photo with the swash tail curving below. */
  left: -83px;
  top: -7px;
  width: 700px;
  height: 388px;

  background-image: url('/wp-content/themes/rosies/assets/decorators/home_testimonial.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

/* Make sure the photo (background on .image-icon) sits ABOVE the
   bubble decoration. Blockquote is position:relative, .image-icon
   is position:absolute. Boost the icon's stacking to be safe. */
.nectar_single_testimonial[data-style='basic_left_image'] .image-icon {
  z-index: 1;
}

/* 4c. Add 100px padding above and below the carousel so the
       oversized bubble decoration ::before (which extends past the
       photo top and bottom) doesn't get clipped by the section
       container. This is on the whole .nectar-flickity, scoped to
       the testimonial carousel only. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity {
  padding-top: 0; /* v53: top was too much; only bottom needs room */
  padding-bottom: 100px;
}

/* 5. Add breathing room between arrows and slide content — 50px
      inset on each side.

      IMPORTANT: don't shrink .flickity-viewport (tried in v43; the
      viewport-margin approach broke Flickity's cell positioning math
      and slides drifted rightward by ~91px per index). Instead, keep
      the viewport / slider / cell geometry EXACTLY as Flickity
      computed it, and inset the slide's INNER content with padding
      on .cell. Flickity treats .cell as the slide box for its own
      position math; padding on it doesn't shift transform origins
      or cell widths in Flickity's calculations, but it visually
      pushes the image + text inward. Net: arrows keep their
      breathing room, slides stay perfectly centered slide-to-slide. */
.wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)
  .nectar-flickity
  .cell {
  padding-left: 50px;
  padding-right: 50px;
  box-sizing: border-box; /* keep the cell's outer width unchanged */
}

/* Reusable small-text utility */
.font-size-small,
.font-size-small p,
.font-size-small li {
  font-size: 16px !important;
  line-height: 24px !important;
}

/* Testimonial responsive patch 59 (includes the patch 58 stacked layout).
 * Stack only the sharing-experiences component; desktop remains unchanged.
 * The existing header hook works as-is. rtk-testimonial-carousel is an
 * optional explicit row class for reusable copies of this component.
 */
@media (max-width: 1100px) {
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .rtk-testimonial-header {
    margin-bottom: 28px;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity {
    --subtract-from-col-width: 0px !important;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0 76px !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .flickity-viewport {
    overflow: hidden !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .cell {
    padding: 0 24px !important;
    box-sizing: border-box;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] {
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"]::before {
    content: "" !important;
    display: block !important;
    left: 46.6%;
    top: 0;
    width: min(93%, 520px);
    height: 289px;
    transform: translateX(-50%);
    background-size: 100% 100%;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 16px 0 0;
    text-align: center;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .image-icon {
    order: -1;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 200px !important;
    height: 200px !important;
    min-width: 0;
    flex: 0 0 auto;
    margin: 0 auto 88px !important;
    transform: none !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .inner p {
    width: 100%;
    max-width: 640px;
    font-size: 20px;
    line-height: 1.5;
    padding: 0 0 16px;
    margin: 0;
    overflow-wrap: break-word;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .wrap {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .wrap .title {
    font-size: 16px;
    line-height: 1.4;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] + .wpb_text_column {
    padding: 0;
    margin: 16px 0 0;
    text-align: center;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] + .wpb_text_column p {
    padding-bottom: 0;
    margin-bottom: 0;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .flickity-prev-next-button {
    top: auto !important;
    bottom: 12px !important;
    width: 64px !important;
    height: 44px !important;
    margin: 0 !important;
    transform: none !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .flickity-prev-next-button.previous {
    left: calc(50% - 80px) !important;
    right: auto !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .flickity-prev-next-button.next {
    right: calc(50% - 80px) !important;
    left: auto !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .flickity-prev-next-button::before {
    width: 64px;
    height: 28px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}
@media (max-width: 600px) {
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar-flickity .cell {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .image-icon {
    --rtk-stacked-portrait-size: clamp(128px, 40vw, 160px);
    width: var(--rtk-stacked-portrait-size) !important;
    height: var(--rtk-stacked-portrait-size) !important;
    margin-bottom: calc(260px - var(--rtk-stacked-portrait-size)) !important;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"]::before {
    width: min(93%, 420px);
    height: 260px;
  }
  :is(.rtk-testimonial-carousel, .wpb_wrapper:has(> .wpb_text_column > .rtk-testimonial-header)) .nectar_single_testimonial[data-style="basic_left_image"] .inner p {
    font-size: 18px;
  }
}
