/* ============================================================================
   Claire Organics — add-on home sections: Promo carousel, Before & After,
   Reel (YouTube Shorts). Loaded from each of those section files (not from the
   layout), so a store that never adds them never downloads this sheet.
   Speaks the redesign's own grammar: --rd-* tokens, .rd-eyebrow,
   .section-header__title, .rd-section-head / .rd-edit-head, sage .btn.
   ========================================================================== */

/* ---- shared band: the section's Background select → local --rs-* palette.
   "Theme background" follows the Colors tab (--rd-bg); Sand, White and Forest
   green are fixed colours, so each option always looks like its name (the
   Colors tab re-points --rd-sand / --rd-forest at other settings). ---- */
.rd-band {
  --rs-bg: var(--rd-bg);
  --rs-ink: var(--rd-ink);
  --rs-soft: var(--rd-ink-soft);
  --rs-line: var(--rd-line);
  --rs-eyebrow: var(--rd-eyebrow-color);
  --rs-bed: rgba(44, 52, 42, .06);
  position: relative;
  padding: var(--rd-section) 24px;
  background: var(--rs-bg);
  color: var(--rs-ink);
}
.rd-band--sand { --rs-bg: #EFE6D5; --rs-line: #DDD1BA; --rs-bed: #E5DAC4; }
.rd-band--white { --rs-bg: #FFFFFF; }
.rd-band--forest {
  --rs-bg: #333D2C;
  --rs-ink: #F3EEE2;
  --rs-soft: rgba(237, 231, 216, .82);
  --rs-line: rgba(237, 231, 216, .24);
  --rs-eyebrow: #A9C0A6;
  --rs-bed: rgba(237, 231, 216, .08);
}
.rd-band__inner { max-width: var(--rd-page); margin: 0 auto; }
.rd-band .rd-eyebrow { color: var(--rs-eyebrow); }
.rd-band .section-header__title { color: var(--rs-ink); }
.rd-band .rd-section-head p,
.rd-band .rd-edit-head__note { color: var(--rs-soft); }

/* ---- round arrow button (carousel / reel nav) ---- */
.rd-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--rs-line);
  border-radius: 50%;
  background: transparent;
  color: var(--rs-ink);
  cursor: pointer;
  transition: background-color var(--rd-dur) var(--rd-ease), border-color var(--rd-dur) var(--rd-ease),
              color var(--rd-dur) var(--rd-ease), opacity var(--rd-dur) var(--rd-ease);
}
.rd-arrow svg { width: 18px; height: 18px; display: block; }
.rd-arrow:hover:not(:disabled) { background: var(--rd-sage); border-color: var(--rd-sage); color: var(--rd-btn-ink); }
.rd-arrow:disabled { opacity: .35; cursor: default; }

/* ---- horizontal scroller shared by the carousel and the reel ---- */
.rd-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--rd-track-col, 30%);
  gap: var(--rd-track-gap, 24px);
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rd-track::-webkit-scrollbar { display: none; }
.rd-track > * { min-width: 0; margin: 0; scroll-snap-align: start; }
@media (prefers-reduced-motion: reduce) { .rd-track { scroll-behavior: auto; } }
/* phones: the row runs to the screen edges, the first card still lines up */
@media (max-width: 749px) {
  .rd-track { margin: 0 -24px; padding: 0 24px 4px; scroll-padding-inline: 24px; }
}

/* progress bar + arrows under a track */
.rd-carousel__controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: clamp(24px, 3vw, 36px);
}
.rd-carousel__controls[hidden] { display: none; }
.rd-carousel__bar {
  position: relative;
  flex: 1 1 auto;
  max-width: 280px;
  height: 2px;
  border-radius: 2px;
  background: var(--rs-line);
  overflow: hidden;
}
.rd-carousel__bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  border-radius: 2px;
  background: var(--rs-ink);
  transition: left .2s linear, width .2s linear;
}
.rd-carousel__nav { display: flex; gap: 10px; margin-left: auto; }
@media (max-width: 749px) { .rd-carousel__nav { display: none; } }

/* ============================================================================
   Promo carousel — image cards (label pill, serif title, note) in a snap row
   ========================================================================== */
.rd-promo { --rd-track-col: 30%; --rd-track-gap: 24px; }
@media (max-width: 989px) { .rd-promo { --rd-track-col: 44%; --rd-track-gap: 18px; } }
@media (max-width: 749px) { .rd-promo { --rd-track-col: 76%; --rd-track-gap: 12px; } }
.rd-promo__card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.rd-promo__card:hover, .rd-promo__card:focus { color: inherit; }
.rd-promo__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--rd-radius-card);
  overflow: hidden;
  background: var(--rs-bed);
  box-shadow: var(--rd-shadow-sm);
}
.rd-promo__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--rd-ease);
}
.rd-promo__card:hover .rd-promo__media img { transform: scale(1.05); }
.rd-promo__label {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  max-width: calc(100% - 32px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(247, 242, 232, .92);
  color: #2C342A;
  font-family: var(--rd-sans);
  font-size: .64rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.rd-promo__body { display: flex; flex-direction: column; gap: 8px; }
.rd-promo__title {
  margin: 0;
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: clamp(1.22rem, 1.7vw, 1.55rem);
  line-height: 1.22;
  color: var(--rs-ink);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color var(--rd-dur) var(--rd-ease);
}
.rd-promo__card:hover .rd-promo__title { text-decoration-color: currentColor; }
.rd-promo__text { margin: 0; font-family: var(--rd-sans); font-size: .95rem; line-height: 1.6; color: var(--rs-soft); }
@media (max-width: 749px) {
  .rd-promo__media { aspect-ratio: 1 / 1; }
  .rd-promo__card { gap: 14px; }
}

/* ============================================================================
   Before & After — draggable comparison + thumbnail picker + copy column
   ========================================================================== */
.rd-ba__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  grid-template-areas: "media ." "media head" "media thumbs" "media info" "media .";
  column-gap: clamp(36px, 6vw, 96px);
}
.rd-ba--right .rd-ba__grid {
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  grid-template-areas: ". media" "head media" "thumbs media" "info media" ". media";
}
.rd-ba__head { grid-area: head; }
.rd-ba__head .section-header__title { margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
.rd-ba__media { grid-area: media; position: relative; min-width: 0; }
.rd-ba__thumbs {
  grid-area: thumbs;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(22px, 2.6vw, 32px);
  padding-bottom: clamp(22px, 2.6vw, 30px);
  border-bottom: 1px solid var(--rs-line);
}
.rd-ba__thumb {
  flex: none;
  width: 68px;
  height: 68px;
  padding: 3px;
  margin: 0;
  border: 1px solid var(--rs-line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--rd-dur) var(--rd-ease), transform var(--rd-dur) var(--rd-ease);
}
.rd-ba__thumb img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--rs-bed); }
.rd-ba__thumb:hover { transform: translateY(-2px); }
.rd-ba__thumb[aria-pressed="true"] { border-color: var(--rs-ink); box-shadow: inset 0 0 0 1px var(--rs-ink); }
.rd-ba__info { grid-area: info; padding-top: clamp(22px, 2.6vw, 30px); }
.rd-ba__info[hidden], .rd-ba__frame[hidden] { display: none; }
.rd-ba__name { margin: 0 0 18px; font-family: var(--rd-serif); font-weight: 500; font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.2; color: var(--rs-ink); }
.rd-ba__list { display: flex; flex-direction: column; gap: 12px; margin: 0 0 28px; padding: 0; list-style: none; }
.rd-ba__list li { display: flex; align-items: flex-start; gap: 12px; margin: 0; font-family: var(--rd-sans); font-size: .98rem; line-height: 1.55; color: var(--rs-soft); }
.rd-ba__check {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--rd-sage-tint);
  color: var(--rd-sage-deep);
}
.rd-ba__check svg { width: 13px; height: 13px; }
.rd-ba__btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; }
.rd-ba__btn svg { width: 15px; height: 15px; transition: transform var(--rd-dur) var(--rd-ease); }
.rd-ba__btn:hover svg { transform: translateX(4px); }
/* the photo stacks between the thumbnails and the copy on narrow screens */
@media (max-width: 860px) {
  .rd-ba__grid,
  .rd-ba--right .rd-ba__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "thumbs" "media" "info";
  }
  .rd-ba__head { margin-bottom: 20px; }
  .rd-ba__thumbs { border-bottom: 0; margin-top: 0; padding-bottom: 20px; }
  .rd-ba__thumb { width: 60px; height: 60px; }
}

/* the comparison: after photo underneath, before photo clipped at --pos */
.rd-compare {
  --pos: 50%;
  position: relative;
  aspect-ratio: 7 / 6;
  border-radius: var(--rd-radius-card);
  overflow: hidden;
  background: var(--rs-bed);
  box-shadow: var(--rd-shadow-sm);
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.rd-compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.rd-compare__before { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
/* demo only (no photos uploaded): the same picture, muted, stands in for "before" */
.rd-compare__before--demo img { filter: grayscale(.8) sepia(.12) brightness(.93) contrast(.9); }
.rd-compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: rgba(247, 242, 232, .95);
  box-shadow: 0 0 14px rgba(20, 26, 16, .25);
  pointer-events: none;
}
.rd-compare__handle {
  position: absolute;
  top: 50%;
  left: var(--pos);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(247, 242, 232, .96);
  color: #2C342A;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5);
  cursor: ew-resize;
  touch-action: none;
  transition: transform var(--rd-dur) var(--rd-ease);
}
.rd-compare__handle svg { width: 12px; height: 12px; }
.rd-compare.is-dragging .rd-compare__handle,
.rd-compare__handle:hover { transform: scale(1.08); }
.rd-compare__handle:focus-visible { outline: 2px solid var(--rd-sage); outline-offset: 3px; }
.rd-compare__tag {
  position: absolute;
  bottom: 16px;
  z-index: 2;
  max-width: 42%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(44, 52, 42, .58);
  color: #F7F2E8;
  font-family: var(--rd-sans);
  font-size: .64rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.rd-compare__tag--before { left: 16px; }
.rd-compare__tag--after { right: 16px; }
@media (max-width: 749px) { .rd-compare { aspect-ratio: 1 / 1; } }

/* ============================================================================
   Reel — vertical 9:16 YouTube Shorts cards, thumbnail facade until played
   ========================================================================== */
.rd-reel { --rd-track-col: calc((100% - 4 * 20px) / 5); --rd-track-gap: 20px; }
@media (max-width: 1099px) { .rd-reel { --rd-track-col: calc((100% - 3 * 20px) / 4); } }
@media (max-width: 899px) { .rd-reel { --rd-track-col: calc((100% - 2 * 16px) / 2.6); --rd-track-gap: 16px; } }
@media (max-width: 559px) { .rd-reel { --rd-track-col: 62%; --rd-track-gap: 12px; } }
.rd-reel__lede { margin: 14px 0 0; font-family: var(--rd-sans); font-size: 1.02rem; line-height: 1.6; color: var(--rs-soft); }
.rd-reel__nav { display: flex; gap: 10px; }
.rd-reel__nav[hidden] { display: none; }
@media (max-width: 749px) { .rd-reel__nav { display: none; } }
.rd-reel__card { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.rd-reel__media {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--rd-radius-card);
  overflow: hidden;
  background: #1F251D;
  box-shadow: var(--rd-shadow-sm);
}
.rd-reel__facade { position: absolute; inset: 0; display: block; color: #fff; }
.rd-reel__facade[hidden] { display: none; }
.rd-reel__facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* YouTube's 4:3 thumbnail pillarboxes a vertical Short; a slight zoom keeps
     the dark side bars out of the 9:16 crop */
  transform: scale(1.06);
  transition: transform 1.1s var(--rd-ease);
}
.rd-reel__facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 26, 16, .22), rgba(20, 26, 16, 0) 30%, rgba(20, 26, 16, 0) 62%, rgba(20, 26, 16, .4));
  transition: opacity var(--rd-dur) var(--rd-ease);
}
.rd-reel__facade:hover img { transform: scale(1.1); }
.rd-reel__facade:hover::after { opacity: .6; }
.rd-reel__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 26, 16, .55);
  color: #F7F2E8;
  font-family: var(--rd-sans);
  font-size: .6rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.rd-reel__badge svg { width: 10px; height: 10px; fill: currentColor; }
.rd-reel__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(247, 242, 232, .94);
  color: #2C342A;
  box-shadow: 0 14px 36px -14px rgba(0, 0, 0, .6);
  transform: translate(-50%, -50%);
  transition: transform var(--rd-dur) var(--rd-ease), background-color var(--rd-dur) var(--rd-ease);
}
.rd-reel__play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.rd-reel__facade:hover .rd-reel__play,
.rd-reel__facade:focus-visible .rd-reel__play { transform: translate(-50%, -50%) scale(1.09); background: #fff; }
.rd-reel__facade:focus-visible { outline: 2px solid var(--rd-sage); outline-offset: -4px; border-radius: var(--rd-radius-card); }
.rd-reel__media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rd-reel__caption { margin: 0; font-family: var(--rd-sans); font-size: .95rem; line-height: 1.5; color: var(--rs-ink); }
.rd-reel__cta.btn { align-self: flex-start; padding: 11px 20px; font-size: .72rem; }
