/**
 * Section + inside padding law, ALL Ready themes (theme-t1 … theme-tN).
 * Loaded absolute last so density / refine / chrome / T22 cannot flush type to edges.
 */

body.atelier[class*="theme-t"] {
  --pad-x: clamp(1rem, 2.8vw, 2rem) !important;
  --pad-y: clamp(1.35rem, 3.2vw, 2.15rem) !important;
  --pad-y-tight: clamp(1rem, 2.4vw, 1.5rem) !important;
  --pad-card: clamp(0.9rem, 1.8vw, 1.15rem) !important;
  --section-y: var(--pad-y) !important;
  --section-y-tight: var(--pad-y-tight) !important;
  --gutter: var(--pad-x) !important;
}

/* , ,  90vw shell keeps width; padding lives INSIDE , ,  */
body.atelier[class*="theme-t"] .an-wrap,
body.atelier[class*="theme-t"] .an-dest,
body.atelier[class*="theme-t"] .an-topbar__in,
body.atelier[class*="theme-t"] .an-header .an-wrap,
body.atelier[class*="theme-t"] .an-footer .an-wrap,
body.atelier[class*="theme-t"] .an-checkout-stage__in,
body.atelier[class*="theme-t"] .b02-stage,
body.atelier[class*="theme-t"] .b03-stage,
body.atelier[class*="theme-t"] .b04-stage,
body.atelier[class*="theme-t"] .b05-stage,
body.atelier[class*="theme-t"] .b06-stage,
body.atelier[class*="theme-t"] .b07-stage,
body.atelier[class*="theme-t"] .b08-stage,
body.atelier[class*="theme-t"] .b09-stage,
body.atelier[class*="theme-t"] .b10-stage,
body.atelier[class*="theme-t"] .b11-stage,
body.atelier[class*="theme-t"] .b12-stage,
body.atelier[class*="theme-t"] .b13-stage,
body.atelier[class*="theme-t"] .hx .an-wrap,
body.atelier[class*="theme-t"] .hx__stage.an-wrap,
body.atelier[class*="theme-t"] .b03-nav__index-top.an-wrap,
body.atelier[class*="theme-t"] .b03-nav__index-strip-in.an-wrap {
  width: min(90vw, 100%) !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  padding-inline: var(--pad-x) !important;
  box-sizing: border-box !important;
}

/* Nested wraps inside stages fill the padded stage content box */
body.atelier[class*="theme-t"] :is(
  .b02-stage, .b03-stage, .b04-stage, .b05-stage, .b06-stage,
  .b07-stage, .b08-stage, .b09-stage, .b10-stage, .b11-stage,
  .b12-stage, .b13-stage
) :is(.an-wrap, .hx .an-wrap, .hx__stage.an-wrap) {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
}

/* , ,  Section outer rhythm , ,  */
body.atelier[class*="theme-t"] .an-section,
body.atelier[class*="theme-t"] .an-rail-block,
body.atelier[class*="theme-t"] .an-block,
body.atelier[class*="theme-t"][class*="chrome-space-"] .an-section,
body.atelier[class*="theme-t"][class*="chrome-shell-"] .an-section {
  padding-block: var(--pad-y) !important;
  padding-inline: 0 !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

body.atelier[class*="theme-t"] .an-section--tight {
  padding-block: var(--pad-y-tight) !important;
}

/* CRO / merch bands, real vertical air */
body.atelier[class*="theme-t"] .an-desire,
body.atelier[class*="theme-t"] .an-pain,
body.atelier[class*="theme-t"] .an-fomo,
body.atelier[class*="theme-t"] .an-trust-convert,
body.atelier[class*="theme-t"] .an-complete,
body.atelier[class*="theme-t"] .an-reviews,
body.atelier[class*="theme-t"] .an-promo,
body.atelier[class*="theme-t"] .an-lookbook,
body.atelier[class*="theme-t"] .an-press {
  padding-block: var(--pad-y) !important;
}

/* Full-bleed dark/colored bands: pad inside via wrap, not flush type */
body.atelier[class*="theme-t"] .an-cta-band,
body.atelier[class*="theme-t"] .an-cta-band--urgency,
body.atelier[class*="theme-t"] .an-news,
body.atelier[class*="theme-t"] .an-sale-banner,
body.atelier[class*="theme-t"] .an-dual-cta,
body.atelier[class*="theme-t"] .an-promo-split,
body.atelier[class*="theme-t"] .an-footer-cta,
body.atelier[class*="theme-t"] .an-retain,
body.atelier[class*="theme-t"] .an-section.an-retain,
body.atelier[class*="theme-t"] .an-signup,
body.atelier[class*="theme-t"] .an-global {
  padding-block: clamp(1.75rem, 4.5vw, 2.75rem) !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

body.atelier[class*="theme-t"] .an-cta-band__in,
body.atelier[class*="theme-t"] .an-news__in,
body.atelier[class*="theme-t"] .an-sale-banner__in,
body.atelier[class*="theme-t"] .an-dual-cta__in,
body.atelier[class*="theme-t"] .an-footer-cta__in,
body.atelier[class*="theme-t"] .an-retain__in,
body.atelier[class*="theme-t"] .an-signup__in,
body.atelier[class*="theme-t"] .an-global__in {
  padding-block: 0.35rem !important;
  gap: 1rem 1.35rem !important;
}

/* Heads need breathing room before grids */
body.atelier[class*="theme-t"] .an-head,
body.atelier[class*="theme-t"] .an-rail__head,
body.atelier[class*="theme-t"] .an-fomo__head,
body.atelier[class*="theme-t"] .an-complete__head,
body.atelier[class*="theme-t"] .an-desire__copy,
body.atelier[class*="theme-t"] .an-pain__copy,
body.atelier[class*="theme-t"] .an-trust-convert__copy {
  margin: 0 0 1rem !important;
  gap: 0.4rem !important;
}

body.atelier[class*="theme-t"] .an-section__cta,
body.atelier[class*="theme-t"] .an-desire__actions,
body.atelier[class*="theme-t"] .an-pain__actions,
body.atelier[class*="theme-t"] .an-trust-convert__actions {
  margin-top: 1rem !important;
  gap: 0.55rem !important;
}

/* , ,  Product / card INNER padding (the “inside” crash) , ,  */
body.atelier[class*="theme-t"] .an-product__meta {
  padding: var(--pad-card) !important;
  gap: 0.35rem !important;
  box-sizing: border-box !important;
}

/* Catalog / index rows keep compact meta pad but never zero */
body.atelier[class*="theme-t"].chrome-card-catalog-row .an-product {
  padding: 0.95rem 1.1rem !important;
  box-sizing: border-box !important;
}
body.atelier[class*="theme-t"].chrome-card-catalog-row .an-product__meta,
body.atelier[class*="theme-t"].chrome-card-catalog-row .an-product__meta--row {
  padding: 0 !important;
}

body.atelier[class*="theme-t"] .an-fomo__body,
body.atelier[class*="theme-t"] .an-complete__meta,
body.atelier[class*="theme-t"] .an-review,
body.atelier[class*="theme-t"] .an-journal article,
body.atelier[class*="theme-t"] .an-takeaway,
body.atelier[class*="theme-t"] .an-press__card {
  padding: 0.95rem 1.05rem !important;
  box-sizing: border-box !important;
}

body.atelier[class*="theme-t"] .an-desire__moment,
body.atelier[class*="theme-t"] .an-pain__levers li,
body.atelier[class*="theme-t"] .an-trust-convert__row li {
  padding: 0.75rem 0.95rem !important;
  box-sizing: border-box !important;
}

body.atelier[class*="theme-t"] .an-coll-hero {
  padding-block: 1.35rem !important;
}

body.atelier[class*="theme-t"] .an-pdp {
  gap: 1rem !important;
  padding-block: 1.15rem 1.5rem !important;
}

body.atelier[class*="theme-t"] .an-checkout {
  padding-block: 1.15rem 1.35rem !important;
}

body.atelier[class*="theme-t"] .an-grid {
  gap: 0.95rem 0.85rem !important;
}

@media (max-width: 700px) {
  body.atelier[class*="theme-t"] {
    --pad-x: clamp(0.85rem, 4vw, 1.25rem) !important;
    --pad-y: 1.25rem !important;
    --pad-y-tight: 1rem !important;
  }

  body.atelier[class*="theme-t"] .an-section,
  body.atelier[class*="theme-t"] .an-rail-block {
    padding-block: 1.25rem !important;
  }

  body.atelier[class*="theme-t"] .an-product__meta {
    padding: 0.85rem !important;
  }

  body.atelier[class*="theme-t"].chrome-card-catalog-row .an-product {
    padding: 0.85rem !important;
  }
}

/* T22 ledger: keep taller sections, still honor pad-x inside 90vw */
body.atelier.theme-t22 {
  --pad-y: 2rem !important;
  --pad-y-tight: 1.5rem !important;
}
body.atelier.theme-t22 .an-section,
body.atelier.theme-t22 .an-rail-block {
  padding-block: var(--pad-y) !important;
}
body.atelier.theme-t22.chrome-card-catalog-row .an-product__meta,
body.atelier.theme-t22.chrome-card-catalog-row .an-product__meta--row {
  padding: 0 !important;
}
