/* Compare My Care — shared stylesheet.
   House style from Compare My School: warm cream + charcoal, Source Serif 4 headings, system sans body,
   burgundy accent, pill badges. Care-specific: CQC rating colours, tier bar, home rows, filters. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #f6f1e8; --cream-dim: #ece7de; --charcoal: #1e1e2c; --mid: #4a4a5a; --grey: #5b6474;
  --line: #e5e0d8; --accent: #7c2d2c; --brand-2: #8cc5b3;
  /* CQC ratings — always paired with text, never colour alone */
  --r-out: #0f5c3a; --r-good: #2f8a4f; --r-ri: #e3a21a; --r-inad: #b3261e; --r-none: #8a8f99;
  --t1: #0f5c3a; --t2: #2f8a4f; --t3: #7bbf8a; --t4: #c9c26a; --t5: #e3a21a; --t6: #b3261e; --t7: #c8c8d0;
}
html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--cream); color: var(--charcoal); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif; font-weight: 600; line-height: 1.2; }
.muted { color: var(--grey); } .small { font-size: 0.82rem; }
.visually-hidden { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
[hidden] { display: none !important; }

/* ─── HEADER ─── */
.site-header { background: var(--charcoal); color: var(--cream); padding: 18px 24px 14px; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); }
.brand:hover { text-decoration: none; opacity: .85; }
.brand-mark { height: 40px; width: 40px; border-radius: 50%; flex-shrink: 0; }
.brand-text { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-size: 1.32rem; color: var(--cream); white-space: nowrap; }
.brand-text-accent { color: var(--brand-2); }
.header-search { position: relative; flex: 1; max-width: 380px; margin: 0 18px; }
.header-search input { width: 100%; padding: 8px 14px; border-radius: 20px; border: 1px solid #3a3a4a; background: #2a2a3a;
  color: var(--cream); font: inherit; font-size: .85rem; outline: none; }
.header-search input::placeholder { color: #8b8ba0; }
.header-search input:focus { border-color: var(--brand-2); background: #303045; }
.site-nav { margin-left: auto; }
.nav-cta { background: var(--accent); color: var(--cream); padding: 7px 14px; border-radius: 4px; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.nav-cta:hover { color: var(--cream); text-decoration: none; opacity: .9; }
.compare-count { display: inline-block; margin-left: 6px; background: var(--cream); color: var(--accent); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.crumbs { max-width: 1200px; margin: 10px auto 0; font-size: .74rem; color: #a0a8b8; }
.crumbs a { color: #a0a8b8; } .crumbs a:hover { color: var(--cream); }
.crumb-sep { margin: 0 4px; opacity: .5; } .crumb-current { color: var(--cream); }
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .brand-text { font-size: 1.12rem; } .brand-mark { height: 34px; width: 34px; }
}

/* ─── SEARCH SUGGEST ─── */
.search-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; z-index: 100; text-align: left; }
.search-suggest:empty { display: none; }
.suggest-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: .82rem; color: var(--charcoal);
  border-bottom: 1px solid var(--line); cursor: pointer; }
.suggest-row:last-child { border-bottom: 0; }
.suggest-row:hover, .suggest-active { background: var(--cream-dim); text-decoration: none; }
.suggest-row strong { display: block; font-size: .86rem; }
.suggest-text { flex: 1; min-width: 0; }
.suggest-meta { font-size: .72rem; color: var(--grey); }
.suggest-badge { font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--grey);
  background: var(--cream-dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

/* ─── LAYOUT ─── */
.page { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; }
.hero { padding: 32px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 8px; }
.hero-front h1 { font-size: 2.5rem; max-width: 820px; }
.hero-accent { color: var(--accent); font-style: italic; }
.hero-sub { color: var(--mid); max-width: 760px; }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); margin-bottom: 6px; }
.hero-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 16px; font-weight: 600; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .hero h1 { font-size: 1.7rem; } .hero-front h1 { font-size: 1.9rem; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 20px; }
.card h2 { font-size: 1.25rem; margin-bottom: 12px; }
.card p + p, .card p + .tier-bar, .card .tier-legend + p { margin-top: 10px; }
.btn { display: inline-block; font-weight: 600; font-size: .9rem; color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--cream); border: 0; border-radius: 6px; padding: 10px 16px; cursor: pointer; font: inherit; font-weight: 600; }
.btn-primary:hover { opacity: .9; text-decoration: none; color: var(--cream); }
.btn-primary.is-added { background: var(--charcoal); }

/* ─── RATINGS ─── */
.rating { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  font-weight: 700; white-space: nowrap; color: #fff; background: var(--r-none); }
.rating-big { font-size: 1rem; padding: 6px 16px; }
.r-out { background: var(--r-out); } .r-good { background: var(--r-good); }
.r-ri { background: var(--r-ri); color: #2a1d00; } .r-inad { background: var(--r-inad); } .r-none { background: var(--r-none); }
.r-star { color: #ffd76a; }
.kq-row { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.kq { display: inline-flex; align-items: center; border-radius: 4px; padding: 2px 7px; font-size: .72rem; font-weight: 600; color: #fff; }
.kq.r-ri { color: #2a1d00; }
.home-row .kq { width: 22px; justify-content: center; padding: 2px 0; }
.age { font-size: .72rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); color: var(--mid); white-space: nowrap; }
.age-recent { border-color: #b9dcc4; background: #eef7f1; color: #1d5b36; }
.age-older { border-color: #e6d3a8; background: #fbf5e6; color: #6b4e0e; }
.age-note { margin-top: 12px; font-size: .86rem; background: #fbf5e6; border-left: 3px solid #e6d3a8; padding: 10px 12px; border-radius: 4px; }
.rc-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-date { font-size: .85rem; color: var(--mid); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kq-list { list-style: none; border-top: 1px solid var(--line); }
.kq-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kq-name { font-weight: 600; } .kq-q { display: block; font-weight: 400; font-size: .78rem; color: var(--grey); }
.rating-card .small { margin-top: 12px; }

/* ─── SUMMARY / FACTS ─── */
.summary { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 18px 22px; margin-bottom: 20px; }
.summary p + p { margin-top: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.facts div:last-child { border-bottom: 0; } .facts dt { color: var(--grey); } .facts dd { text-align: right; font-weight: 600; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips li { background: var(--cream-dim); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.qs { padding-left: 18px; font-size: .88rem; } .qs li + li { margin-top: 6px; }

/* ─── STATS + TIER BAR ─── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 16px; }
.stats-front { margin: 0 0 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; }
.stat-v { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.6rem; font-weight: 700; }
.stat-l { font-size: .78rem; color: var(--mid); } .stat-n { font-size: .72rem; color: var(--grey); }
.tier-bar, .mini-bar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; background: var(--cream-dim); }
.mini-bar { height: 8px; margin-top: 8px; }
.tb-seg { display: block; height: 100%; }
.tb-seg.is-hl { outline: 3px solid var(--charcoal); outline-offset: -3px; }
.t1 { background: var(--t1); } .t2 { background: var(--t2); } .t3 { background: var(--t3); } .t4 { background: var(--t4); }
.t5 { background: var(--t5); } .t6 { background: var(--t6); } .t7 { background: var(--t7); }
.tier-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .78rem; color: var(--mid); }
.tier-legend li.is-hl { font-weight: 700; color: var(--charcoal); }
.tb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: baseline; }
.tier-key { list-style: none; } .tier-key li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* ─── LIST TOOLS + HOME ROWS ─── */
.list-tools { position: sticky; top: 0; z-index: 20; background: var(--cream); padding: 12px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.lt-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.lt-row label { display: flex; flex-direction: column; font-size: .72rem; color: var(--grey); gap: 2px; }
.lt-row select { max-width: 230px; }
.lt-row select, .lt-near input { font: inherit; font-size: .86rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--charcoal); }
.lt-near { display: flex; gap: 6px; margin-left: auto; }
.lt-near input { width: 130px; }
.lt-near button { font: inherit; font-size: .84rem; font-weight: 600; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; }
.lt-count { font-size: .8rem; color: var(--grey); margin-top: 6px; }
@media (max-width: 700px) { .lt-near { margin-left: 0; } .list-tools { position: static; } }
.tier-group { margin: 20px 0 8px; }
.tier-h { font-size: 1.15rem; display: flex; align-items: center; }
.tier-desc { font-size: .8rem; color: var(--grey); margin: 2px 0 8px; }
.homes { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.homes.compact { border-radius: 8px; margin-bottom: 12px; }
.home-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.home-row:last-child { border-bottom: 0; }
.hr-main { min-width: 0; }
.hr-name { font-weight: 600; color: var(--charcoal); }
.hr-meta { font-size: .78rem; color: var(--grey); }
.hr-dist { margin-left: 6px; font-weight: 600; color: var(--mid); }
.hr-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
@media (max-width: 700px) { .home-row { flex-direction: column; align-items: flex-start; } .hr-rating { justify-content: flex-start; } }

/* ─── CARDS GRID ─── */
.region-grid, .la-grid-section { margin: 28px 0; }
.region-grid h2, .la-grid-section h2 { font-size: 1.4rem; margin-bottom: 14px; }
.la-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.la-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; color: var(--charcoal); transition: border-color .15s, transform .15s; }
.la-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.la-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.la-stats { display: flex; gap: 14px; font-size: .78rem; color: var(--mid); }
.prov-list { list-style: none; font-size: .88rem; } .prov-list li { padding: 3px 0; break-inside: avoid; }
.cols { columns: 2 320px; column-gap: 28px; }

/* ─── BIG SEARCH ─── */
.big-search { position: relative; display: flex; gap: 8px; max-width: 620px; margin-top: 20px; }
.big-search input { flex: 1; font: inherit; font-size: 1.05rem; padding: 12px 16px; border: 1px solid #cfc8bb; border-radius: 8px; background: #fff; }
.big-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ─── PROSE / TABLES ─── */
.prose { max-width: 760px; padding: 32px 0; }
.prose h1 { font-size: 2rem; margin-bottom: 12px; } .prose h2 { font-size: 1.3rem; margin: 26px 0 8px; }
.prose p, .prose ul, .prose table { margin-bottom: 12px; } .prose ul { padding-left: 20px; }
.lede { font-size: 1.1rem; color: var(--mid); }
table.data { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data .num { text-align: right; }

/* ─── COMPARE ─── */
.compare-app { overflow-x: auto; }
.cmp { border-collapse: collapse; background: #fff; min-width: 640px; width: 100%; font-size: .88rem; border: 1px solid var(--line); }
.cmp th, .cmp td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp thead th { font-family: 'Source Serif 4', Georgia, serif; font-size: 1rem; }
.cmp tbody th { color: var(--grey); font-weight: 500; width: 160px; }
.cmp-remove { background: none; border: 0; color: var(--grey); cursor: pointer; font-size: .78rem; text-decoration: underline; }

/* ─── FOOTER ─── */
.site-footer { background: var(--charcoal); color: #a0a8b8; padding: 28px 24px 22px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 28px; font-size: .78rem; }
.site-footer strong { color: var(--cream); font-family: 'Source Serif 4', Georgia, serif; font-size: .95rem; }
.footer-source { font-size: .74rem; line-height: 1.7; }
.footer-nav { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-nav a { color: #a0a8b8; } .footer-nav a:hover { color: var(--cream); }
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr; } .footer-nav { flex-direction: row; flex-wrap: wrap; text-align: left; } }
.byline { font-size: .85rem; color: var(--grey); margin: -4px 0 14px; }
