/* Full-width storefront layout. Loaded after portal.css and before the
   theme's own stylesheet, which sets the colours used here:
     --fw-band       the title bands, "How it works" and the order panel
     --fw-band-ink   text on a band
     --fw-hot        highlights on a band (crumbs, step numbers)
     --fw-btn        buttons on a band
     --fw-tint       the light strip under the home hero
   The page runs edge to edge; what's inside stops growing at --fw-max, and
   lines of text stay a readable length (columns and side panels take the
   rest). Phones keep one column. */
:root {
    --fw-max: 1760px;
    --fw-gutter: 32px;
    --fw-sticky: 110px;
    --fw-band: var(--blue-dark, #0b2545);
    --fw-band-ink: rgba(255, 255, 255, .82);
    --fw-hot: #fff;
    --fw-btn: var(--blue, #003876);
    --fw-tint: var(--blue-tint, #f2f6fa);
}
@media (max-width: 640px) { :root { --fw-gutter: 16px; } }
@media (min-width: 1280px) { :root { --fw-gutter: 56px; } }

/* Header, footer and the shop pages: the wider grid (themed storefronts). */
body.sf-wide .wrap { max-width: var(--fw-max); padding-left: var(--fw-gutter); padding-right: var(--fw-gutter); }

/* Home and site pages: the main area runs edge to edge, and each band pads
   its contents in line with the header. */
main.page:has(> .fw-page), main.page:has(> .fw-home) {
    --fw-pad: max(var(--fw-gutter), calc((100% - var(--fw-max)) / 2 + var(--fw-gutter)));
    max-width: none; padding: 0; gap: 0;
}
main.page:has(> .fw-home) > *, main.page:has(> .fw-page) > :not(.fw-page), .fw-page > * {
    padding-left: var(--fw-pad); padding-right: var(--fw-pad);
}
main.page:has(> .fw-page) > :not(.fw-page) { margin-top: 20px; }

/* ---- Title band ---- */
.site-page.fw-page { max-width: none; display: block; }
.fw-band { background: var(--fw-band); color: #fff; padding-top: 44px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.fw-band > * { position: relative; }
.fw-band .page-title { color: #fff; font-size: clamp(34px, 6vw, 72px); line-height: 1; max-width: 1200px; overflow-wrap: anywhere; }
.fw-band .crumbs a { color: var(--fw-hot); font-weight: 700; font-size: 14px; letter-spacing: .6px; text-transform: uppercase; text-decoration: none; }
.fw-band time, .fw-band .muted { color: var(--fw-band-ink); font-size: 17px; }
.fw-banner { padding: 0 !important; }
.fw-banner .site-post-image { display: block; width: 100%; height: clamp(220px, 30vw, 480px); object-fit: cover; border-radius: 0; }

/* ---- Text, with the panel beside it ---- */
.fw-grid { display: grid; gap: 32px; padding-top: 36px; padding-bottom: 56px; align-items: start; }
.fw-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.fw-main > .prose { max-width: 880px; }
/* The player added under a link to a sound file (App\Support\AudioPlayer). */
.prose audio.audio-player { display: block; width: 100%; max-width: 480px; margin-top: 10px; }
.fw-toc { display: none; }
.fw-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fw-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.fw-card p { color: var(--quiet); }
.fw-card a:not(.btn) { color: var(--blue); font-weight: 700; }
.fw-card-dark { background: var(--fw-band); border-color: var(--fw-band); color: #fff; }
.fw-card-dark p { color: var(--fw-band-ink); }
.fw-card-dark .btn { align-self: flex-start; background: var(--fw-btn); color: #fff; }
.fw-card-title { font-family: var(--font-display, inherit); font-size: 28px; line-height: 1.05; text-transform: uppercase; letter-spacing: .5px; }
.fw-card-h { font-family: var(--font-body, inherit); font-size: 13px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.fw-grid-contact .site-contact form { max-width: none; }

@media (min-width: 900px) {
    .fw-band { padding-top: 72px; padding-bottom: 64px; }
    .fw-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 56px; padding-bottom: 88px; }
    .fw-grid-blog { grid-template-columns: minmax(0, 1fr); }
    .fw-grid-contact { grid-template-columns: minmax(0, 1fr) minmax(340px, 520px); }
    .fw-side, .fw-toc, .fw-grid-contact .site-contact { position: sticky; top: var(--fw-sticky); }
    .fw-grid-faq .site-faq { display: block; columns: 2 320px; column-gap: 20px; }
    .fw-grid-faq .site-faq-item { break-inside: avoid; margin-bottom: 12px; }
    .fw-grid .prose { font-size: 17px; }
}
@media (min-width: 1200px) {
    .fw-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 72px; }
    .fw-grid-blog { grid-template-columns: minmax(0, 1fr); }
    .fw-grid-contact { grid-template-columns: minmax(0, 1fr) 520px; }
    .fw-grid-post.has-toc { grid-template-columns: 240px minmax(0, 1fr) 340px; gap: 56px; }
    .fw-grid .prose { font-size: 18px; line-height: 1.7; }
    .fw-grid-blog .site-posts { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

    .fw-toc { display: block; font-size: 15px; }
    .fw-toc .fw-card-h { margin-bottom: 12px; }
    .fw-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
    .fw-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--quiet); text-decoration: none; line-height: 1.35; }
    .fw-toc a:hover { color: var(--blue); border-left-color: var(--blue); }
}

/* ---- Home: bands across the page ---- */
main.page:has(> .fw-home) > section:not(.fw-home) { padding-top: 48px; padding-bottom: 48px; }
.fw-home { border-radius: 0 !important; }
.fw-strip { background: var(--fw-tint); border-bottom: 1px solid var(--line); padding-top: 24px; padding-bottom: 24px; }
.fw-strip li { background: none !important; border: 0 !important; }
.fw-dark { background: var(--fw-band) !important; color: #fff; border: 0 !important; border-radius: 0 !important; }
.fw-dark h2 { color: #fff !important; }
.fw-dark li { color: var(--fw-band-ink); }
.fw-dark strong { color: var(--fw-hot) !important; }
.fw-columns { max-width: none !important; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fw-video { max-width: none !important; background: var(--surface); }
.fw-video iframe { max-width: 1120px; margin: 0 auto; }

@media (min-width: 900px) {
    /* 56px top and bottom, as the home banners were before going full width. */
    .fw-home { padding-top: 56px !important; padding-bottom: 56px !important; }
    main.page:has(> .fw-home) > section:not(.fw-home) { padding-top: 72px; padding-bottom: 72px; }
    .fw-strip { padding-top: 32px; padding-bottom: 32px; }
}
@media (min-width: 1100px) {
    .fw-columns { columns: 2; column-gap: 80px; }
    .fw-columns > * { break-inside: avoid; margin-top: 0 !important; margin-bottom: 1em; }
    .fw-columns > h2:first-child { column-span: all; margin-bottom: 24px; }
}
@media (min-width: 1200px) {
    .fw-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
    main.page:has(> .fw-home) .products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
    main.page:has(> .fw-home) .products:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    main.page:has(> .fw-home) .products:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    main.page:has(> .fw-home) .product-card .art { height: 260px; }
    /* One card on its own: picture and words side by side. */
    main.page:has(> .fw-home) .products:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
    main.page:has(> .fw-home) .products > .product-card:only-child { flex-direction: row; }
    main.page:has(> .fw-home) .products > .product-card:only-child .art { flex: 0 0 50%; height: 300px; border-bottom: 0; border-right: 1px solid var(--line); }
    main.page:has(> .fw-home) .products > .product-card:only-child .body { justify-content: center; padding: 48px; }
    main.page:has(> .fw-home) .products > .product-card:only-child .name { font-size: 26px; }
}

/* ---- Quote page: the text, with the form beside it (wider than a contact form) ---- */
.site-quote form { max-width: none; display: flex; flex-direction: column; gap: 18px; }
.quote-grid { display: grid; gap: 16px; }
.quote-grid select, .quote-grid input, .quote-grid textarea { width: 100%; }
@media (min-width: 640px) {
    .quote-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .quote-wide { grid-column: 1 / -1; }
    .quote-wide-start { grid-column-start: 1; }
}
@media (min-width: 900px) {
    .fw-grid-quote { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
}
@media (min-width: 1200px) {
    .fw-grid-quote { grid-template-columns: minmax(0, 1fr) minmax(600px, 820px); }
}
