/* Labels shown in capitals by design. The text itself is stored in normal title case. */
.ql-tab-btn,
.ql-feature-eyebrow,
.ql-feature-cta-btn,
.ql-ha-badge-title,
.ql-search-close-label {
  text-transform: uppercase;
}

/* ==========================================================================
   Scroll-in animations (assets/mr-inview.js)
   ========================================================================== */
.mr-iv-ready .mr-iv {
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--mr-iv-delay, 0ms),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--mr-iv-delay, 0ms);
}
.mr-iv-ready .mr-iv:not(.mr-in) {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}
/* Photos settle from a slight zoom as their card appears. */
.mr-iv-ready .mr-iv img {
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1) var(--mr-iv-delay, 0ms);
}
.mr-iv-ready .mr-iv:not(.mr-in) img {
  transform: scale(1.06);
}
.mr-iv-ready .mr-iv.mr-instant,
.mr-iv-ready .mr-iv.mr-instant img {
  transition: none;
}
/* The older styles kept these hidden until revealed; inside an animated block the block itself animates. */
.mr-iv-ready .mr-iv.mr-in .ql-revealed,
.mr-iv-ready .mr-iv.mr-in.ql-revealed {
  transition-delay: 0ms;
}
@media (prefers-reduced-motion: reduce) {
  .mr-iv-ready .mr-iv,
  .mr-iv-ready .mr-iv img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Closed FAQ answers kept the old theme's 22px padding, leaving a blank strip under every question.
   The inner wrapper already pads the open answer. */
.ql-faqs-list .ql-accordion-content {
  padding: 0 !important;
}
.ql-faqs-list .ql-accordion-item:not(.open) .ql-accordion-content-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ==========================================================================
   Phone spacing: desktop padding stacked into 120–200px gaps on small screens.
   ========================================================================== */
@media (max-width: 767px) {
  /* Section padding. "html body" outranks the sections' own built-in styles. */
  html body #MainContent .ql-archetypes-v2,
  html body #MainContent .ql-construction-tabs-section,
  html body #MainContent .mr-tl,
  html body #MainContent .ql-heritage-atelier,
  html body #MainContent .ql-showcase-v2,
  html body #MainContent .ql-featured-collections-section,
  html body #MainContent .ql-master-weaver-section,
  html body #MainContent .mr-process-section,
  html body #MainContent .mr-rv,
  html body #MainContent .ql-info-panel,
  html body #MainContent .ql-about-section,
  html body #MainContent .mr-page,
  html body #MainContent .related-products,
  html body #MainContent [id^="shopify-section-modern-constructions"] > section,
  html body #MainContent [id^="shopify-section-modern-faqs-contact"] > section {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  html body #MainContent > section:not(.mr-page):not(.related-products) {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  /* Headings above grids */
  html body #MainContent .ql-section-header,
  html body #MainContent .mr-tl-head,
  html body #MainContent .mr-rv-head,
  html body #MainContent [style*="margin-bottom: 48px"],
  html body #MainContent [style*="margin-bottom: 40px"],
  html body #MainContent [style*="margin-bottom:40px"] {
    margin-bottom: 24px !important;
  }
  html body #MainContent [style*="margin-top: 48px"],
  html body #MainContent .ql-about-hero-grid {
    margin-top: 24px !important;
  }
  html body #MainContent [style*="margin: 0 auto 48px auto"] {
    margin-bottom: 24px !important;
  }
  /* Weaves page material cards */
  html body #MainContent [id^="shopify-section-modern-constructions"] [style*="padding: 28px"] {
    padding: 20px !important;
  }

  /* Collections directory */
  html body #shopify-section-main-list-collections > div {
    padding-bottom: 36px !important;
  }
  html body #shopify-section-main-list-collections section {
    padding-top: 32px !important;
    padding-bottom: 24px !important;
  }
  html body #MainContent .ql-collections-dir-grid {
    gap: 16px !important;
  }

  /* Product page */
  html body #MainContent .ql-pdp-wrapper {
    padding-bottom: 32px !important;
  }
  html body #MainContent .related-products h2 {
    margin-bottom: 18px !important;
  }

  /* Weave timelines: shorter on phones */
  html body #MainContent .mr-tl-card {
    margin-bottom: 16px;
  }
  html body #MainContent .mr-tl-media {
    min-height: 190px;
  }
  html body #MainContent .mr-tl-body {
    padding: 18px 16px 20px;
    gap: 14px;
  }
  html body #MainContent .mr-tl-steps {
    gap: 12px;
  }

  /* Footer */
  html body .ql-footer-main {
    padding-top: 32px !important;
    padding-bottom: 28px !important;
  }

  /* FAQ rows */
  html body #MainContent .ql-faqs-list .ql-accordion-trigger {
    padding: 16px 16px;
  }
  html body #MainContent .ql-faqs-list .ql-accordion-content-inner {
    padding: 0 16px 16px 16px;
  }

  /* Heritage buttons sit at the end of their section */
  html body #MainContent .ql-ha-actions {
    margin-bottom: 0 !important;
  }

  /* Timeline steps: number on the same line as the title */
  html body #MainContent .mr-tl-step {
    display: block;
  }
  html body #MainContent .mr-tl-num {
    display: inline;
    margin: 0 6px 0 0;
  }
  html body #MainContent .mr-tl-step-title {
    display: inline;
  }
  html body #MainContent .mr-tl-step-text {
    display: block;
    margin-top: 4px;
  }
  html body #MainContent .mr-tl-step:not(:last-child)::after {
    top: 46px;
  }

  /* Contact cards: WhatsApp and email full width, so the email fits on one line */
  html body #MainContent .ql-contact-meta-grid > div:nth-child(1),
  html body #MainContent .ql-contact-meta-grid > div:nth-child(2) {
    grid-column: 1 / -1;
  }
}
