@import "./mobile-inputs.css";

/* One viewport-based frame for the public site, including commerce. */
:root {
  --website-max-width: 1440px;
  --website-outer-gutter: 32px;
  --website-inner-gutter: 48px;
  --website-rail-width: 220px;
  --website-timeline-width: 0px;
  --website-section-top: 40px;
  --website-section-bottom: 48px;
  --website-heading-gap: 20px;
  --website-form-gap: 24px;
  --website-subsection-gap: 32px;
  --website-field-gap: 8px;
  --website-background: #ffffff;
}
.dark {
  --website-background: #111111;
  --website-surface-subtle: #191919;
  --website-surface-muted: #202020;
}

body :is(.website-frame, .commerce-shop, .commerce-account, .commerce-loading, .commerce-preview, .website-footer) {
  box-sizing: border-box;
  width: auto;
  max-width: var(--website-max-width);
  /* The body already reserves the timeline. Only add any remaining page margin. */
  margin-left: max(var(--website-outer-gutter), calc((100vw - var(--website-max-width)) / 2 - var(--website-timeline-width)));
  margin-right: max(var(--website-outer-gutter), calc((100vw - var(--website-max-width)) / 2));
}

body .website-section-layout {
  display: grid;
  grid-template-columns: var(--website-rail-width) minmax(0, 1fr);
  column-gap: 0;
  align-items: start;
}

body .detail-content {
  --section-inline: var(--website-inner-gutter);
  --section-top: var(--website-section-top);
  --section-bottom: var(--website-section-bottom);
}
body .detail-page .form-grid { gap: var(--website-form-gap); }
body .journey-content .demo { margin-inline: calc(-1 * var(--website-inner-gutter)); }
body .website-frame .website-page-heading,
body .detail-content > :is(.detail-section, .detail-cta),
body .journey-content > .wrap,
body .website-section-content,
body :is(.commerce-content, .commerce-account, .commerce-loading, .commerce-preview) {
  padding-inline: var(--website-inner-gutter);
}

body footer.website-footer {
  padding: 32px var(--website-inner-gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
body footer.website-footer > :is(.footer-main, .footer-bottom) {
  width: 100%;
  min-width: 0;
}
body footer.website-footer .footer-bottom { margin-top: 0; }
body footer.website-footer a { overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  :root { --website-inner-gutter: 32px; --website-rail-width: 180px; --website-section-top: 32px; --website-section-bottom: 32px; }
}

@media (max-width: 540px) {
  :root { --website-form-gap: 20px; }
}

@media (max-width: 800px) {
  :root { --website-outer-gutter: 16px; --website-inner-gutter: 16px; }
  body .website-section-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  body .website-section-layout > :is(.detail-rail, .journey-rail) { display: none; }
  html:root { scroll-padding-top: var(--header-height, 98px); }
}

@media (min-width: 1440px) and (min-height: 651px) {
  /* Page structure, not asynchronous timeline discovery, owns the reserved space. */
  body:has(main .website-section-layout) {
    --website-timeline-width: 320px;
    padding-left: var(--website-timeline-width);
    padding-right: 0;
    background: var(--website-background);
  }
  body:has(main .website-section-layout) .header {
    width: calc(100% + var(--website-timeline-width));
    margin-left: calc(-1 * var(--website-timeline-width));
  }
  body:has(main .website-section-layout) .website-section-layout { grid-template-columns: minmax(0, 1fr); }
  body:has(main .website-section-layout) :is(.detail-rail, .journey-rail) { display: none; }
  body:has(main .website-section-layout) .quote-workspace { position: relative; }
  body:has(main .website-section-layout) .quote-workflow-sidebar { position: absolute; right: 0; top: 0; }
  body:has(main .website-section-layout) .quote-workflow-link > a { display: none; }
}
