/* CheaperVetGuide: warm, friendly, readable. System fonts only; no JS. */
:root {
  --bg: #fffaf3; --surface: #ffffff; --surface-2: #fdf3e4;
  --text: #26323a; --muted: #55616a; --line: #eadfcd;
  --brand: #0b6e63; --brand-dark: #08524a; --brand-tint: #e3f3ef;
  --accent: #b83c0a; --accent-dark: #962f07;
  --link: #0a6459; --focus: #1d4ed8;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 8px 24px rgba(60, 40, 10, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px; --read: 760px;
  /* category badge colors (text on tint, all AA) */
  --c-vaccines: #0b5c52;   --c-vaccines-bg: #def2ee;
  --c-spayneuter: #7a2e6b; --c-spayneuter-bg: #f7e6f3;
  --c-costs: #7a4a00;      --c-costs-bg: #fdecc8;
  --c-payment: #1e3f8f;    --c-payment-bg: #e2eafc;
  --c-insurance: #4c3a9e;  --c-insurance-bg: #ebe7fb;
  --c-telehealth: #0b5d78; --c-telehealth-bg: #dcf0f8;
  --c-emergency: #a31d1d;  --c-emergency-bg: #fde6e3;
  --c-gear: #3f5a12;       --c-gear-bg: #eaf3d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191c; --surface: #1d2428; --surface-2: #232c31;
    --text: #eef1f2; --muted: #b4bec4; --line: #34413f;
    --brand: #5fd0bf; --brand-dark: #3fb8a6; --brand-tint: #17332f;
    --accent: #ffb084; --accent-dark: #ffc9a8; --link: #7fdccd; --focus: #9db8ff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    --c-vaccines: #8fe0d2; --c-vaccines-bg: #15332f;
    --c-spayneuter: #f0b6e3; --c-spayneuter-bg: #3a1f35;
    --c-costs: #f6cf86; --c-costs-bg: #3a2c10;
    --c-payment: #b6c9ff; --c-payment-bg: #1d2a4d;
    --c-insurance: #cfc4ff; --c-insurance-bg: #2c2750;
    --c-telehealth: #9bdcf2; --c-telehealth-bg: #153240;
    --c-emergency: #ffb4ab; --c-emergency-bg: #44201d;
    --c-gear: #c8e29a; --c-gear-bg: #27330f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 1.125rem; line-height: 1.7; display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
picture { display: block; }
a { color: var(--link); text-underline-offset: .15em; text-decoration-thickness: .08em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: .6rem 1rem; z-index: 20; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* header / footer */
header.site { background: var(--surface); border-top: 6px solid var(--brand); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.25rem; color: var(--brand); text-decoration: none; letter-spacing: -.01em; }
.brand:hover { color: var(--brand-dark); }
.brand img { border-radius: 8px; }
nav.main { display: flex; gap: .25rem; flex-wrap: wrap; }
nav.main a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 1rem; padding: .5rem .85rem; border-radius: 999px; }
nav.main a:hover { background: var(--brand-tint); color: var(--brand-dark); }
footer.site { background: #0b4f48; color: #eef8f6; margin-top: 4rem; padding: 2.5rem 0 3rem; font-size: 1rem; }
footer.site a { color: #ffffff; }
footer.site nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1rem; font-weight: 600; }
footer.site p { margin: 0; max-width: 62rem; color: #d8ece8; line-height: 1.6; }
main > .wrap { padding-top: 2rem; padding-bottom: 1rem; }

/* typography */
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: .4rem 0 .6rem; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.4vw, 1.95rem); margin: 2.6rem 0 .8rem; font-weight: 800; }
h3 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; }
p { margin: 0 0 1.1rem; }
.lead { font-size: 1.3rem; line-height: 1.6; color: var(--muted); }
.meta { color: var(--muted); font-size: .95rem; margin: 0 0 1.25rem; }
.small { font-size: .95rem; color: var(--muted); }
article.guide, article.static { max-width: var(--read); margin: 0 auto; }
.prose h2 { padding-top: .4rem; border-top: 3px solid var(--line); margin-top: 3rem; }
.prose h2:first-child { border-top: 0; margin-top: 1.5rem; }
.prose ul:not(.credits), .prose ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.prose li { margin: .5rem 0; padding-left: .2rem; }
.prose .credit { margin: 0; padding: .9rem; }
.prose li::marker { color: var(--brand); font-weight: 700; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 6px; font-size: .92em; }
hr { border: 0; border-top: 2px dashed var(--line); margin: 2.5rem 0; }
.prose p:last-child { margin-bottom: 0; }
/* sources list at the end of guides: keep it compact */
.prose h2#sources + ul, .prose h2#sources-and-further-reading + ul { font-size: .95rem; overflow-wrap: anywhere; }
.prose a { overflow-wrap: anywhere; }

/* badges */
.badge-row { margin: 0 0 .25rem; }
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 700; line-height: 1; padding: .4rem .7rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); width: fit-content; letter-spacing: .01em; }
.badge.cat-vaccines { background: var(--c-vaccines-bg); color: var(--c-vaccines); }
.badge.cat-spayneuter { background: var(--c-spayneuter-bg); color: var(--c-spayneuter); }
.badge.cat-costs { background: var(--c-costs-bg); color: var(--c-costs); }
.badge.cat-payment { background: var(--c-payment-bg); color: var(--c-payment); }
.badge.cat-insurance { background: var(--c-insurance-bg); color: var(--c-insurance); }
.badge.cat-telehealth { background: var(--c-telehealth-bg); color: var(--c-telehealth); }
.badge.cat-emergency { background: var(--c-emergency-bg); color: var(--c-emergency); }
.badge.cat-gear { background: var(--c-gear-bg); color: var(--c-gear); }

/* guide hero image */
.guide-hero { margin: 0 0 1.75rem; }
.guide-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface-2); }
.guide-hero figcaption, .hero-media figcaption, .photo-credit { font-size: .85rem; color: var(--muted); margin-top: .5rem; line-height: 1.5; }
.photo-credit { margin: 1rem 0 0; }

/* quick answer + callouts */
.quick-answer { background: var(--brand-tint); border: 2px solid var(--brand); border-radius: var(--radius); padding: 1.1rem 1.4rem; margin: 0 0 1.5rem; }
.quick-answer p { margin: 0; font-size: 1.15rem; }
.qa-title { font-weight: 800; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .06em; font-size: .9rem !important; margin-bottom: .4rem !important; }
.disclosure { font-size: .92rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: .7rem 1rem; margin: 0 0 1.5rem; line-height: 1.55; }
.disclosure p { margin: 0; }
.callout { border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0; border: 1px solid var(--line); border-left-width: 6px; background: var(--surface); }
.callout p { margin: 0 0 .6rem; } .callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 800; font-size: .95rem; letter-spacing: .02em; text-transform: uppercase; }
.callout.tip { background: var(--brand-tint); border-color: var(--brand); } .callout.tip .callout-title { color: var(--brand-dark); }
.callout.cost { background: var(--c-costs-bg); border-color: #c98a00; } .callout.cost .callout-title { color: var(--c-costs); }
.callout.note { background: var(--surface-2); border-color: #c9a46a; } .callout.note .callout-title { color: var(--muted); }
.callout.warn { background: var(--c-emergency-bg); border-color: #c0392b; } .callout.warn .callout-title { color: var(--c-emergency); }
blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 5px solid var(--line); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 1rem; line-height: 1.5; }
caption { text-align: left; }
th, td { padding: .8rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: var(--brand); color: #fff; font-size: .9rem; letter-spacing: .02em; position: sticky; top: 0; white-space: nowrap; }
@media (prefers-color-scheme: dark) { thead th { background: #0f4a43; } }
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { font-weight: 600; min-width: 9rem; }

/* buttons */
.btn { display: inline-block; font-weight: 700; font-size: 1.05rem; padding: .8rem 1.4rem; border-radius: 999px; text-decoration: none; border: 2px solid transparent; line-height: 1.2; transition: transform .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #1b1008; } .btn-primary:hover { color: #1b1008; } }
.btn-secondary { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-tint); color: var(--brand-dark); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* home hero */
.hero { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; padding: .5rem 0 1rem; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; margin: 0 0 .5rem; }
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--accent); } }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-top: 0; }
.hero-media { margin: 0; }
.hero-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); background: var(--surface-2); }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr .9fr; gap: 3rem; padding: 1.5rem 0 2rem; } }

/* what you'll find */
.found-grid { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.found-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); }
.found-grid h3 { margin: .4rem 0 .3rem; font-size: 1.15rem; }
.found-grid p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.found-icon { font-size: 1.8rem; line-height: 1; }
@media (min-width: 760px) { .found-grid { grid-template-columns: repeat(3, 1fr); } }
main h2 + .cards, main h2 + .tiles { margin-top: 1.25rem; }

/* cards */
.cards { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1.4rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); } .cards-feature { grid-template-columns: repeat(2, 1fr); } .cards-text { grid-template-columns: repeat(2, 1fr); } }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.card-body { padding: 1.1rem 1.3rem 1.3rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.card h3 a, .card .t { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card is clickable */
.card h3 a:hover { color: var(--brand-dark); text-decoration: underline; }
.card h3 a:focus-visible { outline: 0; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.card .more { margin-top: auto; padding-top: .4rem; color: var(--brand-dark); font-weight: 700; }
.card p:not(.more) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card.soon { background: var(--surface-2); box-shadow: none; }
.card.soon:hover { transform: none; }
.related { max-width: var(--wrap); margin: 3.5rem auto 0; }
.related h2 { margin-top: 0; }
.related .photo-credit, section .photo-credit { max-width: var(--read); }

/* topic tiles */
.tiles { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: 1.1rem 1.1rem 1.2rem; border-radius: var(--radius); text-decoration: none; background: var(--surface); border: 2px solid var(--line); color: var(--text); transition: transform .15s ease, border-color .15s ease; }
.tile:hover { transform: translateY(-3px); color: var(--text); }
.tile-emoji { font-size: 1.9rem; line-height: 1.2; }
.tile-t { font-weight: 800; font-size: 1.1rem; line-height: 1.25; }
.tile-s { font-size: .95rem; color: var(--muted); line-height: 1.4; }
.tile.cat-vaccines { background: var(--c-vaccines-bg); } .tile.cat-spayneuter { background: var(--c-spayneuter-bg); }
.tile.cat-costs { background: var(--c-costs-bg); } .tile.cat-payment { background: var(--c-payment-bg); }
.tile.cat-insurance { background: var(--c-insurance-bg); } .tile.cat-telehealth { background: var(--c-telehealth-bg); }
.tile.cat-emergency { background: var(--c-emergency-bg); } .tile.cat-gear { background: var(--c-gear-bg); }
.tile.cat-vaccines .tile-t { color: var(--c-vaccines); } .tile.cat-spayneuter .tile-t { color: var(--c-spayneuter); }
.tile.cat-costs .tile-t { color: var(--c-costs); } .tile.cat-payment .tile-t { color: var(--c-payment); }
.tile.cat-insurance .tile-t { color: var(--c-insurance); } .tile.cat-telehealth .tile-t { color: var(--c-telehealth); }
.tile.cat-emergency .tile-t { color: var(--c-emergency); } .tile.cat-gear .tile-t { color: var(--c-gear); }
.tile .tile-s { color: var(--text); }

/* how it works */
.how { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem 1.6rem 1.4rem; margin-top: 3rem; }
.how ul { padding-left: 1.3rem; margin: 0; } .how li { margin: .6rem 0; }

/* credits */
.credits { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; }
.credit { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; align-items: start; scroll-margin-top: 90px; }
.credit:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.credit .credit-thumb { width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-sm); }
.credit p { margin: 0 0 .35rem; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 520px) { .credit { grid-template-columns: 1fr; } .credit .credit-thumb { width: 100%; aspect-ratio: 16 / 9; } }

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  th, td { padding: .7rem .8rem; }
  .quick-answer { padding: 1rem 1.1rem; }
  header.site .wrap { padding-top: .35rem; padding-bottom: .35rem; }
  nav.main a { padding: .4rem .6rem; }
  .brand { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { header.site, footer.site nav, .related, .skip { display: none; } body { background: #fff; font-size: 11pt; } .card, .table-wrap { box-shadow: none; } }
