/* vtw-about-page-story.css */
/* VendTheWeb Section Library — vendtheweb.com */
/* Version: 1.0.0 */

/* ── Variable resolution ─────────────────────────────── */
.vtw-about-page-story {
  --_bg:           var(--vtw-section-bg,     var(--vtw-brand-bg,     #faf9f7));
  --_text:         var(--vtw-section-text,   var(--vtw-brand-text,   #1a1a1a));
  --_accent:       var(--vtw-section-accent, var(--vtw-brand-accent, #5c6b3a));
  --_accent-text:  var(--vtw-section-accent-text, var(--vtw-brand-accent-text, #ffffff));
  --_surface:      var(--vtw-section-surface,     var(--vtw-brand-surface, #f0ede8));
  --_border:       var(--vtw-section-border,      var(--vtw-brand-border,  #e8e3dc));
  --_heading-font: var(--vtw-section-heading-font,
                   var(--vtw-brand-heading-font, Georgia, serif));
  --_body-font:    var(--vtw-section-body-font,
                   var(--vtw-brand-body-font, 'Assistant', Georgia, serif));
  --_radius:       var(--vtw-brand-radius-md, 8px);
  --_max-width:    var(--vtw-brand-container-width, 1280px);
  --_speed:        var(--vtw-brand-speed, 280ms);
}

/* ── Base layout ─────────────────────────────────────── */
.vtw-about-page-story {
  background-color: var(--_bg);
  color: var(--_text);
  padding-top: var(--_pad-y-start, 96px);
  padding-bottom: var(--_pad-y-end, 96px);
  font-family: var(--_body-font);
}

.vtw-about-page-story__inner {
  margin-inline: auto;
  padding-inline: clamp(24px, 4vw, 48px);
}

.vtw-about-page-story__inner--contained {
  max-width: var(--_max-width);
}

.vtw-about-page-story__inner--full {
  max-width: none;
  padding-inline: clamp(24px, 6vw, 80px);
}

/* ── Hero strip ──────────────────────────────────────── */
.vtw-about-page-story__hero {
  /* min-width: 0 keeps long names from breaking the inner container's intrinsic
     min size and triggering horizontal overflow on narrow viewports. */
  min-width: 0;
  min-height: var(--_hero-min-height, 0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: clamp(48px, 6vw, 72px);
}

.vtw-about-page-story[data-hero-align="center"] .vtw-about-page-story__hero {
  text-align: center;
  align-items: center;
}

.vtw-about-page-story__hero-label {
  font-family: var(--_body-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--_accent);
  margin: 0 0 18px;
}

.vtw-about-page-story__hero-name {
  font-family: var(--_heading-font);
  font-size: clamp(36px, 5.4vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--_text);
  margin: 0 0 18px;
  max-width: 16ch;
}

.vtw-about-page-story[data-hero-align="center"] .vtw-about-page-story__hero-name {
  margin-inline: auto;
}

.vtw-about-page-story__hero-meta {
  font-family: var(--_body-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--_text);
  opacity: 0.72;
  margin: 0;
}

.vtw-about-page-story__hero-meta-sep {
  margin-inline: 6px;
  opacity: 0.5;
}

/* ── Stats row (optional) ────────────────────────────── */
.vtw-about-page-story__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px 40px;
  align-items: start;
  list-style: none;
  padding: 32px 0;
  margin: 0 0 var(--_block-spacing, 96px);
  border-top: 1px solid var(--_border);
  border-bottom: 1px solid var(--_border);
}

.vtw-about-page-story__stat {
  /* min-width: 0 prevents long values from making cells overflow auto-fit. */
  min-width: 0;
}

.vtw-about-page-story__stat-value {
  font-family: var(--_heading-font);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1;
  color: var(--_accent);
  margin: 0 0 8px;
}

.vtw-about-page-story__stat-label {
  font-family: var(--_body-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--_text);
  opacity: 0.72;
  line-height: 1.4;
  margin: 0;
}

/* ── Blocks container ────────────────────────────────── */
.vtw-about-page-story__blocks {
  display: flex;
  flex-direction: column;
  gap: var(--_block-spacing, 96px);
}

/* ── Story block — base ──────────────────────────────── */
.vtw-about-page-story__block {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
}

.vtw-about-page-story__block-content {
  /* min-width: 0 prevents the content cell from expanding to fit body's max-width
     when the viewport is narrower than that. See css-standards.md Rule 6d. */
  min-width: 0;
}

/* ── Story block — image-left / image-right ────────────
   Two-column grid is gated on data-has-image="true". When the merchant has
   not uploaded an image, the block falls through to the single-column /
   no-image styling instead of leaving a 57% empty dead zone where the
   figure would have been. See design-reviewer pass 1 finding for v1.0. */
@media (min-width: 769px) {
  .vtw-about-page-story__block[data-has-image="true"][data-layout="image-left"],
  .vtw-about-page-story__block[data-has-image="true"][data-layout="image-right"] {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .vtw-about-page-story__block[data-has-image="true"][data-layout="image-right"] .vtw-about-page-story__block-media {
    order: 2;
  }
  .vtw-about-page-story__block[data-has-image="true"][data-layout="image-right"] .vtw-about-page-story__block-content {
    order: 1;
  }
}

/* When an image-left or image-right block has no image, fall through to a
   centered narrow column. Deliberately NOT shifted by data-text-align:
   the merchant chose image-X expecting an image alongside their content;
   the missing image is a content gap, not a layout intent. Centering keeps
   the block looking intentional regardless of the global text_alignment
   preference. (No-image blocks below DO honor text_alignment — that's an
   explicit merchant choice for centered/left/right body placement.) */
.vtw-about-page-story__block[data-has-image="false"][data-layout="image-left"],
.vtw-about-page-story__block[data-has-image="false"][data-layout="image-right"] {
  grid-template-columns: 1fr;
  justify-items: center;
}

.vtw-about-page-story__block[data-has-image="false"][data-layout="image-left"] .vtw-about-page-story__block-content,
.vtw-about-page-story__block[data-has-image="false"][data-layout="image-right"] .vtw-about-page-story__block-content {
  max-width: 720px;
  width: 100%;
}

/* ── Story block — no-image ──────────────────────────── */
.vtw-about-page-story__block[data-layout="no-image"] {
  grid-template-columns: 1fr;
  justify-items: center;
}

.vtw-about-page-story__block[data-layout="no-image"] .vtw-about-page-story__block-content {
  max-width: 720px;
  width: 100%;
}

/* Left/right alignment for no-image blocks: align the centered content column.
   Centered alignment is the default visual; left/right shifts the box itself. */
.vtw-about-page-story[data-text-align="left"] .vtw-about-page-story__block[data-layout="no-image"] {
  justify-items: start;
}
.vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__block[data-layout="no-image"] {
  justify-items: end;
}

/* ── Story block — image-full-width ──────────────────── */
.vtw-about-page-story__block[data-layout="image-full-width"] {
  grid-template-columns: 1fr;
  gap: clamp(28px, 3.5vw, 48px);
}

.vtw-about-page-story__block[data-layout="image-full-width"] .vtw-about-page-story__block-content {
  max-width: 720px;
  width: 100%;
  margin-inline: auto;
}

/* ── Block media ─────────────────────────────────────── */
.vtw-about-page-story__block-media {
  /* See learnings.md 2026-04 "grid item max-width overflow" — without min-width:0,
     a 1fr cell expands to fit the figure's intrinsic size and overflows on narrow
     viewports. */
  min-width: 0;
  max-width: min(100%, 640px);
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: var(--_radius);
  background-color: var(--_surface);
  border: 1px solid var(--_border);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--_text) 8%, transparent);
}

.vtw-about-page-story__block-media--full {
  max-width: 100%;
}

.vtw-about-page-story__block-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--_media-aspect, 4 / 5);
  object-fit: cover;
}

.vtw-about-page-story__block-media--full .vtw-about-page-story__block-img {
  aspect-ratio: 16 / 9;
}

/* ── Editor-only hint ────────────────────────────────── */
/* Renders only inside the Shopify theme editor (request.design_mode = true)
   when an image-X layout has no uploaded image. Visible to merchants only,
   never to live-site visitors. Dashed warm border + accent color so it reads
   as an instructional note, not an error. */
.vtw-about-page-story__editor-hint {
  grid-column: 1 / -1;
  margin: 0 0 16px;
  padding: 10px 14px;
  font-family: var(--_body-font);
  font-size: 13px;
  font-style: italic;
  line-height: 1.5;
  color: var(--_text);
  background-color: var(--_surface);
  border: 1px dashed var(--_accent);
  border-radius: var(--_radius);
  opacity: 0.85;
}

/* ── Block content typography ────────────────────────── */
.vtw-about-page-story__block-label {
  font-family: var(--_body-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--_accent);
  padding-bottom: 12px;
  margin: 0 0 22px;
  border-bottom: 1.5px solid var(--_accent);
  display: inline-block;
}

.vtw-about-page-story__block-label--invite {
  font-size: 14px;
}

.vtw-about-page-story__block-body {
  font-family: var(--_body-font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--_text);
  max-width: 60ch;
}

.vtw-about-page-story__block-body p {
  margin: 0 0 24px;
}

.vtw-about-page-story__block-body > *:last-child {
  margin-bottom: 0;
}

.vtw-about-page-story__block-body a {
  color: var(--_accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* ── Pull-quote ──────────────────────────────────────── */
.vtw-about-page-story__pull-quote {
  position: relative;
  padding: 6px 0 6px 28px;
  margin: 32px 0 0;
  max-width: 560px;
  border-left: 3px solid var(--_accent);
}

.vtw-about-page-story__pull-quote p {
  font-family: var(--_heading-font);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.4;
  color: var(--_text);
  margin: 0;
}

/* ── Signature ───────────────────────────────────────── */
.vtw-about-page-story__signature {
  display: block;
  max-width: 180px;
  width: auto;
  height: auto;
  margin: 28px 0 8px;
  opacity: 0.88;
  mix-blend-mode: multiply;
  transform: rotate(var(--_signature-rotate, -2deg));
}

/* ── Invitation CTA (block 5) ────────────────────────── */
.vtw-about-page-story__invite-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 28px;
}

.vtw-about-page-story__cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background-color: var(--_accent);
  color: var(--_accent-text);
  font-family: var(--_body-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--vtw-brand-button-radius, var(--_radius));
  transition: transform var(--_speed) ease, box-shadow var(--_speed) ease;
}

.vtw-about-page-story__cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--_accent) 60%, transparent);
}

.vtw-about-page-story__cta-button:focus-visible {
  outline: 2px solid var(--_accent);
  outline-offset: 3px;
}

.vtw-about-page-story__cta-arrow {
  width: 18px;
  height: 18px;
  transition: transform var(--_speed) ease;
}

.vtw-about-page-story__cta-button:hover .vtw-about-page-story__cta-arrow {
  transform: translateX(4px);
}

.vtw-about-page-story__cta-link {
  font-family: var(--_body-font);
  font-size: 15px;
  color: var(--_text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--_border);
  transition: text-decoration-color var(--_speed) ease;
}

.vtw-about-page-story__cta-link:hover {
  text-decoration-color: var(--_accent);
}

/* ── Text alignment cascade ──────────────────────────── */
/* Desktop. Cascade pattern from #04 founder story: text-align governs inline
   children, but block-level max-width children (body at 60ch, pull-quote at
   560px) must also switch their margin-inline auto/0 pair to physically shift
   the constrained box. The pull-quote also flips its accent-bar from left-edge
   to top or right depending on alignment. See learnings.md 2026-04
   "text-align doesn't center max-width children". */
@media (min-width: 769px) {
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__block-content {
    text-align: center;
  }
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__block-body,
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__pull-quote {
    margin-inline: auto;
  }
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__pull-quote {
    padding-left: 0;
    border-left: 0;
    border-top: 2px solid var(--_accent);
    padding-top: 16px;
  }
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__block-label {
    border-bottom-color: var(--_accent);
  }
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__signature,
  .vtw-about-page-story[data-text-align="center"] .vtw-about-page-story__invite-cta {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__block-content {
    text-align: right;
  }
  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__block-body,
  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__pull-quote {
    margin-inline-start: auto;
    margin-inline-end: 0;
  }
  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__pull-quote {
    padding-left: 0;
    padding-right: 28px;
    border-left: 0;
    border-right: 3px solid var(--_accent);
  }
  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__signature {
    margin-left: auto;
    margin-right: 0;
  }
  .vtw-about-page-story[data-text-align="right"] .vtw-about-page-story__invite-cta {
    justify-content: flex-end;
  }
}

/* Mobile alignment cascade — independent from desktop via the "match" sentinel. */
@media (max-width: 768px) {
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__block-content {
    text-align: center;
  }
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__block-body,
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__pull-quote {
    margin-inline: auto;
  }
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__pull-quote {
    padding-left: 0;
    border-left: 0;
    border-top: 2px solid var(--_accent);
    padding-top: 14px;
  }
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__signature,
  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__invite-cta {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__block-content {
    text-align: right;
  }
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__block-body,
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__pull-quote {
    margin-inline-start: auto;
    margin-inline-end: 0;
  }
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__pull-quote {
    padding-left: 0;
    padding-right: 18px;
    border-left: 0;
    border-right: 3px solid var(--_accent);
  }
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__signature {
    margin-left: auto;
    margin-right: 0;
  }
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__invite-cta {
    justify-content: flex-end;
  }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  /* Mobile gap is 75% of merchant-set desktop block_spacing — chosen because
     0.75 keeps the result on the 4px design-rhythm scale for every step-8
     value the slider produces (96 → 72, 80 → 60, 64 → 48). */
  .vtw-about-page-story__blocks {
    gap: calc(var(--_block-spacing, 96px) * 0.75);
  }

  /* Stats wrap is data-count driven on mobile to avoid the orphaned-third
     stat that auto-fit produces in narrow viewports. 1/2 stats stay full,
     3 forces three tight columns, 4 wraps to 2×2. */
  .vtw-about-page-story__stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 18px 20px;
    padding: 22px 0;
    margin-bottom: calc(var(--_block-spacing, 96px) * 0.75);
  }
  .vtw-about-page-story__stats[data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 12px;
  }
  .vtw-about-page-story__stats[data-count="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vtw-about-page-story__hero {
    margin-bottom: 40px;
  }

  .vtw-about-page-story__hero-name {
    font-size: clamp(32px, 9vw, 48px);
  }

  .vtw-about-page-story__block {
    gap: 28px;
  }

  .vtw-about-page-story__block-body {
    font-size: 16px;
    line-height: 1.7;
  }

  .vtw-about-page-story__block-body p {
    margin-bottom: 20px;
  }

  .vtw-about-page-story__pull-quote {
    margin-top: 24px;
    padding-left: 18px;
  }

  .vtw-about-page-story__cta-button {
    width: 100%;
    justify-content: center;
  }

  .vtw-about-page-story__invite-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .vtw-about-page-story[data-text-align-mobile="center"] .vtw-about-page-story__invite-cta,
  .vtw-about-page-story[data-text-align-mobile="right"] .vtw-about-page-story__invite-cta {
    align-items: center;
  }
}

/* ── Scroll-entry reveal ─────────────────────────────── */
/*
  Per learnings.md 2026-04 (#04 Founder Story). No-JS default: blocks render
  fully visible. JS adds .vtw-animate-ready synchronously to gate the hidden
  state; per-block IntersectionObserver adds .vtw-is-visible to each block as
  it enters the viewport, letting the merchant scroll through revelations
  rather than having all five flash in at once.
*/
.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__hero,
.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__stats,
.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__hero.vtw-is-visible,
.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__stats.vtw-is-visible,
.vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__block.vtw-is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Motion reduction ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vtw-about-page-story *,
  .vtw-about-page-story *::before,
  .vtw-about-page-story *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__hero,
  .vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__stats,
  .vtw-about-page-story[data-animate="true"].vtw-animate-ready .vtw-about-page-story__block {
    opacity: 1;
    transform: none;
  }
}
