/* ==========================================================================
   The Big Dog Cancer Foundation
   Palette is pulled from the photos: bay water, shepherd tan, beach sand.
   Red is reserved for data about the disease itself.
   ========================================================================== */

:root {
  --bay: #1d3b45;        /* headings, buttons, bands */
  --bay-deep: #142b33;   /* footer */
  --ink: #22323a;        /* body text */
  --muted: #4e5f66;      /* secondary text */
  --fog: #edf2f1;        /* alternate section background */
  --line: #d3dcdb;       /* rules and borders */
  --paper: #ffffff;
  --tan: #b8742f;        /* German Shepherd tan: early detection, focus */
  --tan-deep: #8a531c;   /* tan that passes contrast as text */
  --sand: #f2e4cf;       /* closing band */
  --blood: #a12b3b;      /* disease data only */

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--bay);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--tan-deep); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--tan);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2 {
  margin: 0 0 0.5em;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--bay);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 4.5vw + 1rem, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.75rem, 2vw + 1.1rem, 2.25rem); }
h3 {
  margin: 0 0 0.5em;
  font-size: 1.3125rem;
  line-height: 1.3;
  color: var(--bay);
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: 38em; }
.prose h3 { margin-top: 1.75em; }

.lead {
  font-size: clamp(1.1875rem, 0.5vw + 1.05rem, 1.3125rem);
  line-height: 1.5;
}

.small { font-size: 1rem; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--bay);
  color: #fff;
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 22px;
  border: 2px solid var(--bay);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  background: var(--bay);
  color: #fff;
}
.button:hover { background: var(--bay-deep); border-color: var(--bay-deep); color: #fff; }

.button--quiet { background: transparent; color: var(--bay); }
.button--quiet:hover { background: var(--bay); color: #fff; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.1;
  color: var(--bay);
  text-decoration: none;
}
.brand:hover { color: var(--bay); }
.brand svg { flex: none; width: 30px; height: 30px; color: var(--tan); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 8px 0 5px;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav a:hover { color: var(--bay); border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--tan);
  font-weight: 700;
  color: var(--bay);
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--fog { background: var(--fog); }

.section-intro { max-width: 38em; margin-bottom: 40px; }

.split { display: grid; gap: 40px; }

@media (min-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 72px;
    align-items: start;
  }
}

.photo { margin: 0; }
.photo img { width: 100%; border-radius: var(--radius); }
.photo figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--muted); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(40px, 7vw, 88px); }

.hero .wrap { display: grid; gap: 40px; align-items: center; }

@media (min-width: 860px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    gap: 64px;
  }
}

.hero h1 { max-width: 12em; }
.hero .lead { max-width: 32em; }
.hero .photo { max-width: 420px; }

/* ---------- Statement band ---------- */

.statement {
  padding-block: clamp(48px, 7vw, 88px);
  background: var(--bay);
  color: #fff;
}
.statement p {
  max-width: 22em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.625rem, 2.6vw + 0.9rem, 2.5rem);
  line-height: 1.25;
  text-wrap: balance;
}

/* ---------- Breed risk (icon arrays) ---------- */

.breeds { display: grid; gap: 40px; }

.risk {
  display: grid;
  gap: 32px 56px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .risk { grid-template-columns: repeat(2, minmax(0, max-content)); }
}

@media (min-width: 960px) {
  .breeds {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 96px;
    align-items: center;
  }
  .risk { grid-template-columns: max-content; gap: 40px; }
}

.risk-ratio {
  display: block;
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--bay);
}
.risk-breed { display: block; margin-top: 4px; font-weight: 700; }
.risk-note { display: block; font-size: 1rem; color: var(--muted); }

.dots {
  display: grid;
  grid-template-columns: repeat(10, 18px);
  gap: 8px;
  margin-bottom: 16px;
}
.dots span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c4d0cf;
}
.dots .hit { background: var(--blood); }

/* ---------- Ruled lists (symptoms, diagnostics) ---------- */

.ruled {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 40px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.ruled li { padding: 14px 0; border-top: 1px solid var(--line); }
.ruled strong { display: block; color: var(--bay); }
.ruled span { display: block; font-size: 1rem; color: var(--muted); }

.callout {
  max-width: 38em;
  margin: 40px 0 24px;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--blood);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.5;
}

/* ---------- Lifeline: screening vs. risk by age ---------- */

.lifeline {
  max-width: 920px;
  margin: 8px 0 56px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.lifeline-title {
  margin-bottom: 24px;
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.3;
  color: var(--bay);
}

.lifeline-chart {
  /* faint gridline at each year */
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0 1px,
    transparent 1px calc(100% / 12)
  );
  border-right: 1px solid var(--line);
}

.lifeline-row { padding: 12px 0; }

.lifeline-bar {
  display: block;
  height: 14px;
  margin-left: calc(var(--from) / 12 * 100%);
  width: calc((var(--to) - var(--from)) / 12 * 100%);
  border-radius: 7px;
}

.lifeline-label {
  display: block;
  margin-top: 8px;
  padding-left: calc(var(--from) / 12 * 100%);
  font-size: 1rem;
  line-height: 1.4;
}
.lifeline-label strong { display: block; }

/* screening fades in across "4 or 5", then holds every year after */
.lifeline-row--screen .lifeline-bar {
  background: linear-gradient(to right, #e3c5a3 0, var(--tan) 12.5%, var(--tan) 100%);
}
.lifeline-row--screen strong { color: var(--tan-deep); }

/* risk is solid from 5 to 8, then continues as the dog ages */
.lifeline-row--risk .lifeline-bar {
  background: linear-gradient(to right, var(--blood) 0, var(--blood) 43%, rgba(161, 43, 59, 0.25) 100%);
}
.lifeline-row--risk strong { color: var(--blood); }

.lifeline-axis {
  position: relative;
  height: 2.25em;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--bay);
  font-size: 0.875rem;
  color: var(--muted);
}
.lifeline-axis li {
  position: absolute;
  top: 10px;
  left: calc(var(--n) / 12 * 100%);
  transform: translateX(-50%);
}
.lifeline-axis li::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 2px;
  height: 6px;
  background: var(--bay);
}
.lifeline-axis li:first-child { transform: none; }
.lifeline-axis li:first-child::before { left: 0; }
.lifeline-axis li:last-child { transform: translateX(-100%); }
.lifeline-axis li:last-child::before { left: auto; right: 0; }

.lifeline-unit { margin: 0; font-size: 0.875rem; color: var(--muted); }

@media (max-width: 520px) {
  .lifeline-axis li:nth-child(even) { visibility: hidden; }
}

/* ---------- Closing band ---------- */

.closing { padding-block: clamp(56px, 7vw, 88px); background: var(--sand); }
.closing .actions { margin-top: 20px; }

/* ---------- Sub-page header ---------- */

.page-head { padding-block: clamp(40px, 6vw, 80px) clamp(16px, 3vw, 32px); }
.page-head .lead { max-width: 34em; }

/* ---------- Our Story ---------- */

.todo {
  margin: 0 0 1.5em;
  padding: 20px 24px;
  border: 2px dashed var(--tan);
  border-radius: var(--radius);
  background: #fbf3e8;
}

/* 3:4 photos in a grid; the tall Puma and Osa shot spans two rows */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

.gallery .photo { display: flex; flex-direction: column; height: 100%; }
.gallery img { aspect-ratio: 3 / 4; object-fit: cover; }

.gallery .tall { grid-row: span 2; }
.gallery .tall img {
  flex: 1 1 0;
  min-height: 0;
  aspect-ratio: auto;
  object-position: center 70%;
}

/* ---------- Resources ---------- */

.resource-group + .resource-group { margin-top: 56px; }

.resources {
  max-width: 46em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.resources li { padding: 20px 0; border-top: 1px solid var(--line); }
.resources li:last-child { border-bottom: 1px solid var(--line); }
.resources a { font-weight: 700; font-size: 1.1875rem; }
.resource-source { display: block; margin: 2px 0 6px; font-size: 1rem; color: var(--tan-deep); }
.resources p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 56px 32px;
  background: var(--bay-deep);
  color: #d9e4e3;
  font-size: 1rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f0c896; }
.site-footer h2 {
  margin-bottom: 12px;
  font-size: 1.3125rem;
  color: #fff;
}

.footer-grid { display: grid; gap: 40px; }

@media (min-width: 860px) {
  .footer-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 80px; }
}

.footer-grid .disclaimer { max-width: 40em; }

.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav li + li { margin-top: 8px; }

.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.9375rem;
  color: #b4c4c3;
}

/* ---------- Print ---------- */

@media print {
  .site-nav, .actions, .skip-link { display: none; }
  .statement, .site-footer { background: none; color: #000; }
  .statement p { color: #000; }
}

/* ---------- Small screens: keep side photos from dominating the scroll ---------- */

@media (max-width: 859px) {
  .split .photo img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center 72%;
  }
}
