/* =====================================================================
   Ontario Design Studio — site-wide layout system (2026-11-26)
   One container + one reading column, used by every page.
     --ods-container  1200px  header, top bar, hero, homepage sections,
                              card grids, footer (all left edges align)
     --ods-read        760px  body copy on every inner page
                              (~70 characters per line at 17px)
     --ods-gutter   20→32px   side padding, scales with the screen
   Selectors start with "html body" so they win over older per-page rules
   regardless of load order.
   ===================================================================== */
:root{
  --ods-container:1200px;
  --ods-read:760px;
  --ods-gutter:clamp(1.25rem,3.2vw,2rem);
}

/* ---------- 1. One container for every full-width band ---------- */
html body .ods-topbar__in,
html body .ods-navrow,
html body .ods-hero__in,
html body .ods-section:not(.ods-section--soft),
html body .ods-section--soft > *,
html body footer .max-w-7xl{
  max-width:var(--ods-container);
  margin-left:auto;margin-right:auto;
  padding-left:var(--ods-gutter);padding-right:var(--ods-gutter);
  box-sizing:border-box;
}
/* nested sections inside a soft band already sit in the container */
html body .ods-section--soft > .ods-section{padding-left:var(--ods-gutter);padding-right:var(--ods-gutter)}

/* ---------- 2. Inner pages: hero title + body share one reading column ---------- */
html body .ods-hero--slim .ods-hero__in{
  max-width:calc(var(--ods-read) + 2 * var(--ods-gutter));
  padding-left:var(--ods-gutter);padding-right:var(--ods-gutter);
}
html body .ods-hero--slim h1{max-width:none}
html body .ods-hero--slim .ods-hero__lead{max-width:none}

html body .ods-main,
html body .ods-main.wide,
html body .ods-main.narrow{
  max-width:calc(var(--ods-read) + 2 * var(--ods-gutter));
  margin-left:auto;margin-right:auto;
  padding-left:var(--ods-gutter);padding-right:var(--ods-gutter);
  box-sizing:border-box;
}
/* everything inside the column uses the full column width — no ragged mix of 68ch / 78ch / full-width blocks */
html body .ods-main > p,
html body .ods-main > ul > li,
html body .ods-main > ol > li,
html body .ods-main > h2,
html body .ods-main > h3,
html body .ods-main .permit-guide,
html body .ods-main #quick-answers > p,
html body .ods-main #quick-answers .ods-qa-row dd{max-width:none}
html body .ods-main .permit-guide{margin-left:0;margin-right:0}
html body .ods-main > *{box-sizing:border-box}
html body .ods-main img,
html body .ods-main picture,
html body .ods-main figure{max-width:100%}

/* tables: scroll sideways inside their own box on small screens (never cut off, never widen the page) */
html body .ods-tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1.5rem 0;max-width:100%}
html body .ods-tablewrap > table{margin:0}
/* form controls may shrink to fit narrow screens */
html body .ods-main input,
html body .ods-main select,
html body .ods-main textarea{min-width:0;max-width:100%;box-sizing:border-box}

/* reading rhythm */
html body .ods-main p,
html body .ods-main li{font-size:1.0625rem;line-height:1.75}
html body .ods-main h2{margin-top:2.6rem}
html body .ods-main > h2:first-child,
html body .ods-main > div:first-child + h2{margin-top:1rem}

/* quote / CTA band after the article lines up with the article column */
html body .ods-quickquote .ods-container{
  max-width:var(--ods-read);margin-left:auto;margin-right:auto;box-sizing:border-box;
}

/* ---------- 3. Homepage text sections use the reading width, grids use the container ---------- */
html body #ods-home-faq{max-width:calc(var(--ods-read) + 2 * var(--ods-gutter))}
html body #ods-testimonials .ods-tslider,
html body #ods-tsummary{max-width:var(--ods-read)}

/* ---------- 3b. Justified body text ----------
   Paragraphs and list items fill the full column width (both edges straight).
   Hyphenation keeps word spacing even. Centred elements, headings, tables,
   buttons and forms are not affected. Applies on all screen sizes, phones included. */
@media all{
  html body .ods-main p,
  html body .ods-main li,
  html body .ods-main dd,
  html body #ods-home-faq details > div,
  html body .ods-hero--slim .ods-hero__lead{
    text-align:justify;
    text-justify:inter-word;
    -webkit-hyphens:auto;hyphens:auto;
    hyphenate-limit-chars:7 3 3;
  }
  html body .ods-main .ods-tcard p,
  html body .ods-main [style*="text-align:center"] p,
  html body .ods-main [style*="text-align: center"] p,
  html body .ods-main p[style*="text-align:center"],
  html body .ods-main p[style*="text-align: center"],
  html body .ods-main .ods-h2c + p{text-align:center;-webkit-hyphens:manual;hyphens:manual}
  html body .ods-main td p,
  html body .ods-main th p,
  html body .ods-main form p{text-align:inherit}
}

/* ---------- 4. Small screens ---------- */
@media (max-width:640px){
  html body .ods-main p,
  html body .ods-main li{font-size:1rem}
  html body .ods-main h2{margin-top:2.1rem}
}
