/* home-widget.css — "Schools for this home" listing widget (home-widget.html) and its
   builder page (listing-widget.html, .hw-b-* rules at the end). Prefix hw-.
   The widget itself loads only this file: system fonts, no pages.css, so it paints fast. */
:root {
  --hw-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hw-bg: #fff; --hw-bg-2: #F5F7FA; --hw-text: #1B2633; --hw-ink: #12304D; --hw-muted: #56657A;
  --hw-border: #DFE5EC; --hw-track: #E4E9EF; --hw-link: var(--hw-accent, #2468A8); --hw-bar: var(--hw-accent, #2468A8);
  --hw-gold: #F2B33D; --hw-focus: #1F5F9E;   /* focus ring: 3:1+ against the light card (WCAG 1.4.11) */
}
:root[data-theme="dark"] {
  --hw-bg: #121F2D; --hw-bg-2: #172736; --hw-text: #E3EAF2; --hw-ink: #EAF2FA; --hw-muted: #A3B2C2;
  --hw-border: #2A3E52; --hw-track: #24384C; --hw-link: var(--hw-accent, #7DB9F2); --hw-bar: var(--hw-accent, #6CB0F0);
  --hw-focus: #F2B33D;
}

.hw-body { margin: 0; background: transparent; font-family: var(--hw-font); font-size: 14px; line-height: 1.45; color: var(--hw-text); }
.hw-body *, .hw-body *::before, .hw-body *::after { box-sizing: border-box; }
.hw-body .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hw-body :focus-visible { outline: 3px solid var(--hw-focus); outline-offset: 2px; border-radius: 3px; }

.hw { color-scheme: light; background: var(--hw-bg); border: 1px solid var(--hw-border); border-radius: 14px; padding: 14px 16px 10px; }
:root[data-theme="dark"] .hw { color-scheme: dark; }
.hw [hidden] { display: none !important; }

.hw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.hw-mark { flex-shrink: 0; }
.hw-logo { max-height: 32px; max-width: 110px; width: auto; object-fit: contain; flex-shrink: 0; }
.hw-titles { min-width: 0; display: flex; flex-direction: column; }
.hw-brand { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--hw-accent, var(--hw-muted)); overflow-wrap: anywhere; }
.hw-title { font-size: 1rem; margin: 0; color: var(--hw-ink); line-height: 1.25; }
.hw-addr { margin: 1px 0 0; font-size: .8rem; color: var(--hw-muted); overflow-wrap: anywhere; }

.hw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hw-school { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-radius: 10px; background: var(--hw-bg-2); border: 1px solid var(--hw-border); }
.hw-shape { padding-top: 2px; line-height: 0; }
.hw-body-s { min-width: 0; }
.hw-name { font-size: .95rem; margin: 0; line-height: 1.3; color: var(--hw-ink); overflow-wrap: anywhere; }
.hw-name a { color: inherit; text-decoration: none; }
.hw-name a:hover { text-decoration: underline; color: var(--hw-link); }
.hw-meta { margin: 2px 0 0; font-size: .78rem; color: var(--hw-muted); }
.hw-note { font-style: italic; }
.hw-stats { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; }
.hw-stats li { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.hw-stats b { color: var(--hw-ink); }
.hw-k { color: var(--hw-muted); }
.hw-vs { color: var(--hw-muted); font-size: .74rem; }
.hw-none { color: var(--hw-muted); font-style: italic; }
.hw-bar { position: relative; display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--hw-track); align-self: center; }
.hw-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--hw-bar); }
.hw-bar u { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--hw-ink); text-decoration: none; }
.hw-legend { margin: 8px 0 0; font-size: .72rem; color: var(--hw-muted); }

.hw-status { margin: 0 0 8px; font-size: .85rem; color: var(--hw-muted); }
.hw-skel { display: flex; flex-direction: column; gap: 8px; }
.hw-skel span { display: block; height: 58px; border-radius: 10px; background: linear-gradient(90deg, var(--hw-bg-2), var(--hw-track), var(--hw-bg-2)); background-size: 200% 100%; animation: hw-shimmer 1.4s linear infinite; }
@keyframes hw-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .hw-skel span { animation: none; } }

.hw-msg { padding: 12px 14px; border-radius: 10px; background: var(--hw-bg-2); border: 1px solid var(--hw-border); }
.hw-msg h2 { font-size: .95rem; margin: 0 0 4px; color: var(--hw-ink); }
.hw-msg p { margin: 4px 0 0; font-size: .84rem; }

.hw-foot { margin-top: 10px; }
.hw-disc { margin: 0; font-size: .74rem; color: var(--hw-muted); }
.hw-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; }
.hw-links a, .hw-msg a { font-size: .84rem; font-weight: 700; color: var(--hw-link); text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.hw-links a:hover, .hw-msg a:hover { text-decoration: underline; }
.hw-credit { margin: 4px 0 0; font-size: .7rem; color: var(--hw-muted); text-align: right; }
.hw-credit a { color: var(--hw-muted); }

/* compact: one line of facts per school, no enrollment, no bars */
:root[data-layout="compact"] .hw { padding: 10px 12px 8px; }
:root[data-layout="compact"] .hw-head { margin-bottom: 6px; }
:root[data-layout="compact"] .hw-mark { width: 20px; height: 20px; }
:root[data-layout="compact"] .hw-title { font-size: .9rem; }
:root[data-layout="compact"] .hw-list { gap: 0; }
:root[data-layout="compact"] .hw-school { background: none; border: 0; border-bottom: 1px solid var(--hw-border); border-radius: 0; padding: 7px 0; }
:root[data-layout="compact"] .hw-school:last-child { border-bottom: 0; }
:root[data-layout="compact"] .hw-name { font-size: .88rem; }
:root[data-layout="compact"] .hw-stats { margin-top: 2px; font-size: .76rem; }
:root[data-layout="compact"] .hw-bar, :root[data-layout="compact"] .hw-legend { display: none; }

/* row: the three schools side by side on wide listing pages; stacked below 560px */
@media (min-width: 560px) {
  :root[data-layout="row"] .hw-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  :root[data-layout="row"] .hw-school { grid-template-columns: 1fr; gap: 4px; align-content: start; }
  :root[data-layout="row"] .hw-stats { flex-direction: column; gap: 2px; }
  :root[data-layout="row"] .hw-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
  :root[data-layout="row"] .hw-disc { flex: 1 1 260px; }
  :root[data-layout="row"] .hw-links { margin: 0; }
  :root[data-layout="row"] .hw-credit { margin: 0; }
}
@media (max-width: 380px) {
  .hw { padding: 12px 12px 8px; }
  .hw-bar { display: none; }
}

/* ------------------------------------------------------------ builder page (listing-widget.html) */
.hw-b-builder { grid-template-columns: 360px 1fr; }
.hw-b-builder .preview iframe { height: 380px; display: block; }
.hw-b-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.hw-b-tabs button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .84rem; cursor: pointer; }
.hw-b-tabs button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.hw-b-check { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; font-weight: 600; }
.hw-b-check input { margin-top: 3px; }
.hw-b-template[hidden], .hw-b-real[hidden] { display: none; }
.hw-b-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.hw-b-steps .card h3 { margin-top: 0; font-size: 1rem; }
.hw-b-steps pre.code { font-size: .74rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.hw-b-cta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.hw-b-cta p { margin: 4px 0 0; }
.hw-b-price { font-weight: 800; color: var(--ink); }
.hw-b-widths { display: flex; gap: 6px; }
.hw-b .plans { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: 760px; }
.hw-b fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hw-b legend { font-size: .82rem; font-weight: 700; padding: 0 4px; }
@media (max-width: 860px) { .hw-b-builder { grid-template-columns: 1fr; } }
