/* base.css
   Copyright © 2026 LexPro. All rights reserved.

   The fonts (bundled with the app, copied by tool/prepare.dart, never fetched
   from Google), the reset, and the controls every page shares: buttons in
   UiButton's variants and sizes, the icon button, the segmented choice. The
   values are the Flutter design system's (app/lib/shared/ui/). */

@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap; src: url("/site-assets/fonts/HankenGrotesk-400.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap; src: url("/site-assets/fonts/HankenGrotesk-500.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap; src: url("/site-assets/fonts/HankenGrotesk-600.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-display: swap; src: url("/site-assets/fonts/HankenGrotesk-700.ttf") format("truetype"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 800; font-display: swap; src: url("/site-assets/fonts/HankenGrotesk-800.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque Display"; font-weight: 800; font-display: swap; src: url("/site-assets/fonts/BricolageGrotesqueDisplay-800.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("/site-assets/fonts/BricolageGrotesque-600.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("/site-assets/fonts/BricolageGrotesque-700.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("/site-assets/fonts/BricolageGrotesque-800.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("/site-assets/fonts/Figtree-400.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("/site-assets/fonts/Figtree-500.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("/site-assets/fonts/Figtree-600.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("/site-assets/fonts/Figtree-700.ttf") format("truetype"); }
@font-face { font-family: "Nunito"; font-weight: 200 1000; font-display: swap; src: url("/site-assets/fonts/Nunito-Variable.ttf") format("truetype"); }

:root {
  --font: "Hanken Grotesk", system-ui, sans-serif;
  --font-numeral: "Bricolage Grotesque Display", "Hanken Grotesk", sans-serif;
  --font-wordmark: "Nunito", "Hanken Grotesk", sans-serif;
  /* Breakpoints (Flutter's): phone 600 (NavBreakpoints.phone, Ed.phone), the
     editorial grid's wide 900 (Ed.wide, HomeKit.wide), the footer's 980. Media
     queries can't read custom properties, so these are written out where used:
     (max-width: 600px) phone, (max-width: 900px) narrow, (min-width: 901px) wide. */
  --shadow-control: 0 1px 2px rgba(12, 29, 58, 0.122);
  --shadow-control-raised: 0 8px 20px -8px rgba(12, 29, 58, 0.349);
  --shadow-card: 0 1px 2px rgba(12, 29, 58, 0.059), 0 12px 32px -12px rgba(12, 29, 58, 0.18);
  --radius-control: 12px;
  --radius-card: 20px;
  --focus-ring: var(--navy-800);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* A stop the browser scrolls to on Tab stays clear of the floating "Ask a
   question" button in the corner (keyboard shakedown, 2026-11-13). */
html { scroll-padding-bottom: 88px; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
/* An image narrowed by max-width keeps its shape (the height attribute alone
   squashed the Sunporch FAQ and contact drawings by a fifth on a phone). */
img { height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
main:focus, main:focus-visible { outline: none; box-shadow: none !important; }
/* After the skip link (site.js): the content area is ringed until focus moves on. */
main.is-skip-target:focus { outline: 3px solid var(--focus-ring); outline-offset: -3px; }
/* A white halo fills the gap inside the ring, so focus shows on navy bands and
   cards as well as on paper (keyboard shakedown, 2026-11-13: a navy ring on a
   navy band was all but invisible). Important: a button's own shadow rule would
   otherwise replace the halo while it has focus. */
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; box-shadow: 0 0 0 3px #fff !important; }
.on-dark :focus-visible { outline-color: var(--accent-300); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--navy-800); color: #fff;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 16px; }

.icon { flex: none; }

/* A store badge that links to its listing (ui/store_badges.dart): the ring and
   its halo wrap the badge's artwork exactly, never the line box around it. */
.store-link { display: inline-flex; border-radius: 8px; line-height: 0; }

/* ---- A balanced last row (.grid-balance) ----
   A card grid whose last row would hold one card alone under fuller rows
   shows that card centred under them instead of at the left. The grid
   states its column count now in --cols (1 to 4: set it beside each
   grid-template-columns, so it follows the breakpoints) and its column gap
   in --gap. The card keeps its cell, width and height and is only moved
   sideways (position: relative; a grid item's % is of its own cell), so
   nothing else in the grid moves. --c2..--c4 say whether the last card
   starts a new row at 2, 3 or 4 across; the sum picks the one for --cols
   (each term is 1 at its own count and 0 at the others), and (--cols - 1)
   x half of (cell + gap) is the way to the centre. A grid whose last card
   spans the row must not take the class. */
.grid-balance > * { --c2: 0; --c3: 0; --c4: 0; }
.grid-balance > :last-child:nth-child(2n + 1) { --c2: 1; }
.grid-balance > :last-child:nth-child(3n + 1) { --c3: 1; }
.grid-balance > :last-child:nth-child(4n + 1) { --c4: 1; }
.grid-balance > :last-child:not(:first-child) {
  --n: var(--cols, 1);
  position: relative;
  left: calc(
    (var(--c2) * (var(--n) - 3) * (var(--n) - 4) / 2
      - var(--c3) * (var(--n) - 2) * (var(--n) - 4)
      + var(--c4) * (var(--n) - 2) * (var(--n) - 3) / 2)
    * (var(--n) - 1) * (100% + var(--gap, 0px)) / 2
  );
}

/* ---- Buttons (UiButton) ---- */
.btn {
  --btn-bg: var(--accent-400); --btn-fg: var(--gray-950); --btn-border: var(--accent-400);
  --btn-hover: var(--accent-300);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); min-width: var(--btn-h); padding: 0 var(--btn-pad);
  border: 1px solid var(--btn-border); border-radius: var(--radius-control);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--font); font-weight: 700; font-size: var(--btn-fs); line-height: 1;
  letter-spacing: 0; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-control);
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--btn-hover); transform: translateY(-1px); box-shadow: var(--shadow-control-raised); }
.btn--xs { --btn-h: 32px; --btn-pad: 10px; --btn-fs: 13px; }
.btn--sm { --btn-h: 38px; --btn-pad: 14px; --btn-fs: 14px; }
.btn--md { --btn-h: 44px; --btn-pad: 18px; --btn-fs: 15px; }
.btn--lg { --btn-h: 50px; --btn-pad: 22px; --btn-fs: 16px; }
.btn--xl { --btn-h: 58px; --btn-pad: 26px; --btn-fs: 18px; }
.btn--solid { --btn-bg: var(--navy-800); --btn-fg: #fff; --btn-border: var(--navy-800); --btn-hover: var(--navy-900); }
.btn--secondary { --btn-bg: #fff; --btn-fg: var(--gray-950); --btn-border: var(--gray-300); --btn-hover: var(--gray-50); }
.btn--tertiary { --btn-bg: transparent; --btn-fg: var(--navy-700); --btn-border: transparent; --btn-hover: var(--navy-50); box-shadow: none; }
.btn--tertiary:hover { box-shadow: none; }
/* On a navy band (UiSurface.dark / deep). */
.on-dark .btn--solid { --btn-bg: #fff; --btn-fg: var(--navy-950); --btn-border: #fff; --btn-hover: var(--navy-100); }
.on-dark .btn--secondary { --btn-bg: transparent; --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .5); --btn-hover: rgba(255, 255, 255, .12); }
.on-dark .btn--tertiary { --btn-fg: var(--navy-100); --btn-hover: rgba(255, 255, 255, .1); }
/* On the product's colour (UiSurface.bright): the main action turns navy. */
.on-bright .btn--primary { --btn-bg: var(--navy-800); --btn-fg: #fff; --btn-border: var(--navy-800); --btn-hover: var(--navy-900); }
.on-bright .btn--secondary { --btn-bg: transparent; --btn-fg: var(--gray-950); --btn-border: var(--navy-800); --btn-hover: rgba(12, 29, 58, .12); }
/* A white button on any band (EdWhiteButton: secondary on the light surface). */
.btn--white { --btn-bg: #fff !important; --btn-fg: var(--gray-950) !important; --btn-border: var(--gray-300) !important; --btn-hover: var(--gray-50) !important; }

.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--gray-300); border-radius: 12px; background: #fff; color: var(--ink);
}
.icon-button:hover { background: var(--navy-25); }

/* UiSegmentedChoice */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
}
.segmented__option {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--gray-700);
}
.segmented__option.is-selected { background: #fff; color: var(--ink); box-shadow: var(--shadow-control); }

/* Text fields (UiTextField, as the ask panel and forms use them). */
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.field input, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: 12px;
  background: #fff; font-size: 16px; font-weight: 500; line-height: 1.4;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.field__error { color: var(--red-700); font-size: 13.5px; }
