/* CompareWide: the shared header, footer and logo, and the few layout rules Tailwind utilities do
   not express well. Colours match the brand scale in brand.js. */

:root {
  --cw-ink: #0f2a3d;
  --cw-brand-50: #effaf6;
  --cw-brand-600: #1b7a65;
  --cw-brand-700: #186253;
  --cw-brand-900: #15413a;
  --cw-wattle: #f5b82e;
  --cw-muted: #4b5563;
  --cw-line: #e5e7eb;
}

[x-cloak] { display: none !important; }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Visible keyboard focus everywhere, in the brand colour. */
:focus-visible { outline: 3px solid var(--cw-brand-600); outline-offset: 2px; border-radius: 6px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
/* `contents` so the header bar can stick to the page while the loan-type row under it scrolls. */
cw-header { display: contents; }
.cw-header { position: sticky; top: 0; z-index: 50; background: #fff;
  border-bottom: 1px solid var(--cw-line); box-shadow: 0 1px 2px rgba(15, 42, 61, .05); }
.cw-subnav { background: #fff; border-bottom: 1px solid var(--cw-line); }
.cw-subnav-in { max-width: 80rem; margin: 0 auto; padding: .4rem 1rem; display: flex;
  gap: .25rem; overflow-x: auto; white-space: nowrap; }
@media (min-width: 640px) { .cw-subnav-in { padding: .4rem 1.5rem; } }
.cw-subnav a { font-size: .92rem; font-weight: 600; color: #4b5563; text-decoration: none;
  padding: .3rem .7rem; border-radius: 999px; }
.cw-subnav a:hover { background: var(--cw-brand-50); color: var(--cw-brand-700); }
.cw-header-in { max-width: 80rem; margin: 0 auto; height: 4rem; padding: 0 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cw-header-in.is-wide { max-width: none; }
@media (min-width: 640px) { .cw-header-in { padding: 0 1.5rem; } }

.cw-logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none;
  color: var(--cw-ink); flex-shrink: 0; border-radius: 10px; }
.cw-mark { width: 2.5rem; height: 2.5rem; flex-shrink: 0; }
.cw-word { display: flex; flex-direction: column; line-height: 1; }
.cw-name { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; color: var(--cw-ink); }
.cw-name span { color: var(--cw-brand-600); font-weight: 800; }
.cw-tag { margin-top: .3rem; font-size: .66rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #6b7280; white-space: nowrap; }
.cw-logo:hover .cw-name span { color: var(--cw-brand-700); }

.cw-nav { display: flex; align-items: center; gap: .25rem; overflow-x: auto; white-space: nowrap; }
.cw-nav-link { font-size: .95rem; font-weight: 600; color: #374151; text-decoration: none;
  padding: .5rem .8rem; border-radius: 999px; transition: background .15s, color .15s; }
.cw-nav-link:hover { background: var(--cw-brand-50); color: var(--cw-brand-700); }
.cw-nav-link.is-active { background: var(--cw-brand-50); color: var(--cw-brand-700); }

/* Phones: the logo and two links have to share ~340px. */
.cw-narrow-only { display: none; }
@media (max-width: 479px) {
  .cw-wide-only { display: none; }
  .cw-narrow-only { display: inline; }
  .cw-mark { width: 2.2rem; height: 2.2rem; }
  .cw-name { font-size: 1.15rem; }
  .cw-tag { font-size: .56rem; letter-spacing: .08em; }
  .cw-nav-link { padding: .45rem .6rem; font-size: .9rem; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
cw-footer { display: block; }
.cw-footer { background: #fff; border-top: 1px solid var(--cw-line); margin-top: 3rem; }
.cw-footer-in { max-width: 80rem; margin: 0 auto; padding: 2.5rem 1rem;
  display: grid; gap: 1.75rem; }
@media (min-width: 768px) {
  .cw-footer-in { padding: 2.5rem 1.5rem; grid-template-columns: 1.4fr 1fr; }
  .cw-footer-legal { grid-column: 1 / -1; }
}
.cw-footer-brand p { margin: .9rem 0 0; max-width: 28rem; color: var(--cw-muted);
  font-size: .95rem; line-height: 1.6; }
/* Two columns: the list grew to eight links (rate pages, guides, about). */
.cw-footer-links { display: grid; grid-template-columns: repeat(2, max-content); gap: .6rem 2rem;
  align-content: start; }
.cw-footer-links a { color: var(--cw-ink); font-weight: 600; text-decoration: none; }
.cw-footer-links a:hover { color: var(--cw-brand-600); text-decoration: underline; }
.cw-footer-legal a { color: var(--cw-brand-700); font-weight: 600; text-decoration: underline; }
.cw-footer-legal strong { color: var(--cw-ink); }
.cw-footer-legal { margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--cw-line);
  color: #6b7280; font-size: .85rem; line-height: 1.6; }

/* ── Page hero (index.html, lenders.html) ───────────────────────────────── */
.hero-bg { background:
  radial-gradient(60rem 30rem at 85% -10%, rgba(75,179,152,.35), transparent 60%),
  radial-gradient(40rem 25rem at -10% 110%, rgba(245,184,46,.12), transparent 60%),
  #15413a; }

/* ── Lender list (lenders.html) ─────────────────────────────────────────── */
/* Header and rows share one template so the columns line up. Below 900px each row stacks and
   labels its own figures (.m-label). */
.lender-grid { display: grid; gap: .5rem 1.25rem; align-items: center; }
.lender-head { display: none; }
@media (min-width: 900px) {
  .lender-grid { grid-template-columns: minmax(0, 2.2fr) 11rem 7rem minmax(0, 1.6fr) 1.5rem; }
  .lender-head { display: grid; }
  .lender-grid .m-label { display: none; }
}

/* ── Rate list (index.html) ─────────────────────────────────────────────── */
/* The header row and every result row use this one template, so their columns line up by
   construction rather than by a table's auto layout. Below md each row is a stacked card. */
.rate-grid { display: grid; gap: .75rem 1.25rem; align-items: center; }
@media (min-width: 900px) {
  .rate-grid { grid-template-columns: minmax(0, 2.4fr) 8rem 9rem minmax(0, 1.4fr) 1.5rem; }
}
