/*
 * PRODUCT PAGE SECTIONS 2 & 3 — "Crafted with intention" + "The Story"
 * ------------------------------------------------------------------
 * Lifted from the Sacred page so other product pages can use the same
 * two layouts. On Sacred these rules still live inline and are scoped
 * to body.sacred-page; here they are de-scoped to .ca-details / .ca-story.
 *
 * Colours come from four variables so each page keeps its own scheme:
 *   --ca-accent        the ink used for the dot, the selected tab, the
 *                      mobile "back to buy" button          (default #231f20)
 *   --ca-accent-soft   the halo around the dot              (default 10% ink)
 *   --ca-tab-bg        the pill track behind the tabs        (default #eeedeb)
 *   --ca-tab-on-text   text on the selected tab              (default #f7f5f0)
 *
 * Desktop/tablet: copy + tabs beside a large jar photo with a moving dot.
 * Phones (<=699px): photo on top with a gliding marker pin, tabs become an
 * underlined row, plus dots and swipe — built by assets/scripts/ca-sections.js.
 */

/* ==================================================================
   2. CRAFTED WITH INTENTION
   ================================================================== */

.ca-details {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  box-sizing: border-box;
  padding: 96px 64px;
  background: #fff;
  color: #231f20;
  font-family: Montserrat, 'Helvetica Neue', Arial, sans-serif;
}
.ca-details__inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 48px 96px;
}
.ca-details__copy { flex: 1 1 380px; min-width: 0; max-width: 440px; display: flex; flex-direction: column; gap: 32px; }
.ca-details__heading {
  margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 500;
  font-size: 56px; line-height: 60px; letter-spacing: -0.02em; color: #231f20;
}
.ca-details__tabs {
  display: inline-flex; align-self: flex-start; flex-wrap: wrap;
  padding: 4px; gap: 2px; border-radius: 999px;
  background: var(--ca-tab-bg, #eeedeb);
}
.ca-details__tab {
  min-height: 40px; padding: 10px 22px; border: 0; border-radius: 999px;
  background: transparent; color: #66625f; font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 200ms ease, color 200ms ease;
}
.ca-details__tab:hover { color: var(--ca-accent, #231f20); }
.ca-details__tab[aria-selected="true"] { background: var(--ca-accent, #231f20); color: var(--ca-tab-on-text, #f7f5f0); }
.ca-details__tab:focus-visible { outline: 2px solid var(--ca-accent, #231f20); outline-offset: 2px; }
.ca-details__panel { display: flex; flex-direction: column; gap: 6px; min-height: 76px; }
.ca-details__title { margin: 0; font-size: 16px; line-height: 26px; font-weight: 500; }
.ca-details__body { margin: 0; font-size: 14px; line-height: 24px; color: #66625f; }
.ca-details__media { flex: 1.2 1 480px; min-width: 0; position: relative; height: 640px; display: flex; align-items: center; justify-content: center; }
/* The frame hugs the photo so the dot's % positions land on the jar */
.ca-details__frame { position: relative; height: 94%; max-width: 96%; aspect-ratio: var(--ca-frame-ratio, 979 / 1200); }
.ca-details__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ca-details__dot {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 999px; background: var(--ca-accent, #231f20);
  transition: left 250ms ease, top 250ms ease;
}
/* ring, not a soft halo, so it reads like the photo rail and the about
   page's hotspots (matches Sacred) */
.ca-details__dot::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; border: 2px solid var(--ca-accent, #231f20);
  opacity: .5;
}
/* No divider line under this section */
.ca-details + * .sacred-story-heading::before,
.ca-details ~ .ca-story .sacred-story-heading::before { display: none !important; }

/* Tighten the run-in from the product section (desktop only) */
@media (min-width: 700px) {
  .ca-details { padding-top: 24px; padding-bottom: 40px; }
}

@media (max-width: 749px) {
  .ca-details { padding: 64px 20px; }
  .ca-details__inner { gap: 32px; }
  .ca-details__heading { font-size: 36px; line-height: 42px; }
  .ca-details__media { order: -1; flex-basis: 100%; height: 420px; }
}

/* ==================================================================
   3. THE STORY
   ================================================================== */

.ca-story {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  box-sizing: border-box;
  padding: 0 64px 120px;
  background: #fff;
  color: #231f20;
  font-family: Montserrat, 'Helvetica Neue', Arial, sans-serif;
}
.ca-story .sacred-details-heading { background: transparent; }
.ca-story .sacred-details-heading_subtitle {
  margin-top: .75rem;
  font-family: Montserrat, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px; color: #2b2a28;
}
.ca-story__inner {
  max-width: 1240px; margin: 72px auto 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 48px 96px;
}
.ca-story__copy { flex: 1 1 400px; max-width: 460px; padding-left: 0; }
.ca-story__title {
  margin: 0 0 20px; font-family: 'Playfair Display', Georgia, serif; font-weight: 500;
  font-size: 56px; line-height: 1.1; letter-spacing: -0.02em; color: #231f20;
}
.ca-story__text { margin: 0 0 36px; font-size: 14.5px; line-height: 1.75; color: #2b2a28; }
.ca-story__media { flex: 1 1 420px; max-width: 560px; display: flex; justify-content: center; }
.ca-story__media img { display: block; width: 100%; max-width: 480px; height: auto; }

/* Sits the candle and copy closer under the heading, as on Sacred */
@media (min-width: 700px) {
  .ca-story__inner { margin-top: 32px; }
  .ca-story { padding-bottom: 48px; }
}

@media (max-width: 749px) {
  .ca-story { padding: 0 20px 72px; }
  .ca-story__inner { margin-top: 32px; gap: 32px; }
  .ca-story__title { font-size: 40px; }
  .ca-story__media { order: -1; flex-basis: 100%; }
  .ca-story__media img { max-width: 300px; }
}

/* ==================================================================
   PHONES (<=699px) — the pieces the script builds
   ================================================================== */

.ca-details .ca-m-only, .ca-details .ca-sdots,
.ca-story .ca-m-only, .ca-story .ca-sdots,
.ca-details__marker, .ca-details__swipe, .ca-story__ftag { display: none; }

@media (max-width: 699px) {
  /* Heading fades up once, when scrolled into view */
  html.has-js .ca-details .ca-fadeup,
  html.has-js .ca-story .ca-fadeup {
    opacity: 0; transform: translateY(26px);
    transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  }
  html.has-js .ca-details .ca-fadeup.-late,
  html.has-js .ca-story .ca-fadeup.-late { transition-delay: .16s; }
  html.has-js .ca-details .ca-fadeup.is-in,
  html.has-js .ca-story .ca-fadeup.is-in { opacity: 1; transform: none; }

  /* Stretching dots */
  .ca-details .ca-sdots {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; margin: 0; padding: 0; list-style: none;
  }
  .ca-details .ca-sdots li { display: flex; }
  .ca-details .ca-sdots button {
    width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px;
    background: #c9c7cb; cursor: pointer;
    transition: width .4s cubic-bezier(.2,.7,.2,1), background-color .4s;
  }
  .ca-details .ca-sdots button[aria-current="true"] { width: 26px; background: #231f20; }
  .ca-details .ca-sdots button:focus-visible { outline: 1px solid #231f20; outline-offset: 2px; }

  /* ---------- 2. CRAFTED WITH INTENTION ---------- */
  .ca-details { padding: 24px 20px 56px; }
  .ca-details .ca-details__inner { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 18px; }
  .ca-details .ca-details__copy { display: contents; }
  .ca-details .ca-details__heading {
    order: 0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-weight: 700;
    font-size: 52px; line-height: 50px; letter-spacing: -0.045em; color: #9e9b97; text-align: left;
  }
  .ca-details .ca-details__hline { display: block; }

  .ca-details .ca-details__media { order: 1; flex-basis: auto; width: 100%; height: 280px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
  .ca-details .ca-details__media img { -webkit-user-drag: none; }
  .ca-details .ca-details__frame { height: 100%; width: auto; }
  .ca-details .ca-details__dot { display: none; }

  /* Marker: white circle, line icon, pulsing ring, gliding between details */
  .ca-details .ca-details__marker { display: block; position: absolute; width: 0; height: 0; transition: left .6s cubic-bezier(.2,.7,.2,1), top .6s cubic-bezier(.2,.7,.2,1); }
  .ca-details__marker-pin { position: absolute; left: -5.5px; top: -5.5px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 6px 20px rgba(35,31,32,.16); display: flex; align-items: center; justify-content: center; color: #231f20; }
  .ca-details__marker-pin::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; animation: ca-pulse 2s ease-out infinite; }
  /* ring, matching the desktop hotspot */
  .ca-details__marker-pin::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 28px; height: 28px; margin: -14px 0 0 -14px;
    border-radius: 50%; border: 2px solid var(--ca-accent, #231f20); opacity: .5;
  }
  /* icons removed: the pin is a plain dot */
  .ca-details__marker-pin svg { display: none !important; }
  .ca-details__marker-tag { position: absolute; left: 16px; top: 0; transform: translateY(-50%); height: 26px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; background: #fff; box-shadow: 0 6px 20px rgba(35,31,32,.16); font-size: 12px; font-weight: 500; color: #231f20; white-space: nowrap; }
  .ca-details__marker.-flip .ca-details__marker-tag { left: auto; right: 16px; }

  /* dots row with an arrow at each end (matches Sacred) */
  .ca-details .ca-details__nav {
    order: 2; display: flex; align-items: center; justify-content: center;
    gap: 14px; margin: 2px 0 0;
  }
  .ca-details .ca-details__nav .ca-sdots { order: 0; }
  .ca-details__arrow {
    flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: #000; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .3s ease, transform .3s cubic-bezier(.4,0,0,1);
  }
  .ca-details__arrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .ca-details__arrow.is-end { opacity: .25; cursor: default; }
  .ca-details__arrow:not(.is-end):active { transform: scale(.9); }
  .ca-details__arrow:focus-visible { outline: 1px solid #231f20; outline-offset: 2px; }

  .ca-details .ca-sdots { order: 2; }

  /* Tabs: a spread row over a hairline, ink underline on the active one */
  .ca-details .ca-details__tabs { order: 3; align-self: stretch; display: flex; flex-wrap: nowrap; justify-content: space-between; gap: 0; padding: 0; border-radius: 0; background: transparent !important; border-bottom: 1px solid #e6e4e0; }
  .ca-details .ca-details__tab { flex: 1; min-height: 0; padding: 12px 2px; border-radius: 0; background: transparent !important; font-size: 13px; font-weight: 500; color: #9e9b97; }
  .ca-details .ca-details__tab[aria-selected="true"] { color: #231f20; box-shadow: 0 1px 0 #231f20; }

  .ca-details .ca-details__panel { order: 4; min-height: 64px; transition: opacity .4s; }
  .ca-details .ca-details__panel.is-swap { opacity: 0; transition: none; }
  .ca-details .ca-details__title { font-size: 15px; font-weight: 500; }
  .ca-details .ca-details__body { font-size: 14px; line-height: 22px; color: #66625f; }
  .ca-details__swipe { display: block; order: 5; margin: 6px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #b5b2ad; text-align: center; }

  /* ---------- 3. THE STORY ---------- */
  .ca-story { padding: 40px 20px 56px; }
  .ca-story .sacred-details-heading { padding: 0; text-align: left; }
  .ca-story .sacred-details-heading_title { font-size: 52px; line-height: 1; letter-spacing: -0.045em; }
  .ca-story .sacred-details-heading_subtitle { display: none; }
  .ca-story .ca-story__inner { margin-top: 24px; gap: 24px; }
  .ca-story .ca-story__media { position: relative; order: -1; flex-basis: 100%; height: 340px; display: flex; align-items: center; justify-content: center; }
  .ca-story .ca-story__media img { height: 280px; width: auto; max-width: none; mix-blend-mode: multiply; position: relative; z-index: 1; }
  .ca-story .ca-story__ftag { display: inline-flex; position: absolute; z-index: 2; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; background: #fff; box-shadow: 0 6px 20px rgba(35,31,32,.16); font-size: 12px; font-weight: 500; color: #231f20; opacity: 0; }
  .ca-story .ca-story__ftag.-one { left: 6%; top: 24%; animation: ca-pop .6s .7s cubic-bezier(.2,.7,.2,1) both, ca-float 5s 1.3s ease-in-out infinite; }
  .ca-story .ca-story__ftag.-two { left: 72%; top: 60%; animation: ca-pop .6s .9s cubic-bezier(.2,.7,.2,1) both, ca-float 6s 1.5s ease-in-out infinite; }

  .ca-story .ca-story__copy { max-width: none; }
  .ca-story .ca-story__title { display: none; }
  .ca-story .c-product_button { display: none; }
  .ca-story .ca-story__text { margin-bottom: 18px; font-size: 15px; line-height: 26px; color: #3c4043; }
  .ca-story .ca-story__more { display: block; max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; font-size: 14px; line-height: 24px; color: #66625f; transition: max-height .6s cubic-bezier(.2,.7,.2,1), opacity .45s, margin-top .6s cubic-bezier(.2,.7,.2,1); }
  .ca-story .ca-story__text.is-open .ca-story__more { max-height: 480px; opacity: 1; margin-top: 10px; }

  /* .ca-m-only is hidden by default above, so this needs to out-weigh it */
  .ca-story .ca-story__actions.ca-m-only { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .ca-story .ca-story__read { padding: 0; border: 0; background: none; font-family: inherit; font-size: 13px; font-weight: 500; color: #231f20; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; cursor: pointer; }
  .ca-story .ca-story__buy { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: #231f20; }
  .ca-story .ca-story__up { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ca-accent, #231f20); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .ca-story .ca-story__up svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
}

@keyframes ca-pulse { 0% { box-shadow: 0 0 0 0 rgba(35,31,32,.25); } 100% { box-shadow: 0 0 0 12px rgba(35,31,32,0); } }
@keyframes ca-pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes ca-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

@media (prefers-reduced-motion: reduce) {
  .ca-details__tab, .ca-details__dot, .ca-details__marker,
  .ca-details__panel, .ca-story__more { transition: none !important; }
  .ca-details__marker-pin::before, .ca-story__ftag { animation: none !important; }
  .ca-story__ftag { opacity: 1 !important; }
  html.has-js .ca-details .ca-fadeup,
  html.has-js .ca-story .ca-fadeup { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ==================================================
   PHONE PHOTO RAIL
   The desktop dot rail laid out horizontally: a 10px dot on a hairline,
   the current one opening a ring (the same scale(.26) -> scale(1) move
   .c-dots_dot uses). Built by assets/scripts/ca-photo-rail.js.
   ================================================== */
.ca-mdots { display: none; }

@media (max-width: 699px) {
  .ca-mdots {
    /* max-content so the row is exactly as wide as its dots; the hairline
       is sized off that, so it can never run past the outer rings. */
    position: relative; width: max-content; max-width: 100%; height: 44px;
    margin: 6px auto 26px; padding: 0; list-style: none;
    display: flex; justify-content: center; align-items: center; gap: 0;
  }
  .ca-mdots::before {
    content: ""; position: absolute; top: 50%; left: 50%;
    /* one half-button in from each end = first dot centre to last dot centre */
    transform: translateX(-50%); width: calc(100% - 58px);
    height: 1px; background: #7f7f7f; opacity: .25;
  }
  .ca-mdots li { display: flex; }
  .ca-mdots button {
    position: relative; z-index: 1; width: 58px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; padding: 0; cursor: pointer;
  }
  .ca-mdots button span {
    position: relative; width: 10px; height: 10px;
    border-radius: 50%; background: #7f7f7f;
  }
  .ca-mdots button span::before {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 38px; height: 38px; margin: -19px 0 0 -19px;
    border-radius: 50%; border: 2px solid #7f7f7f;
    transform: scale(.26);
    transition: transform .4s cubic-bezier(.4,0,0,1);
  }
  .ca-mdots button[aria-current="true"] span::before,
  .ca-mdots button:hover span::before,
  .ca-mdots button:focus-visible span::before { transform: scale(1); }
  .ca-mdots button:focus-visible { outline: 1px solid #231f20; outline-offset: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ca-mdots button span::before { transition: none !important; }
}
