/* The Woodleigh Cats — site styles. All look-and-feel values come from tokens.css. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading);
}

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

a { color: var(--accent-deep); }
a:hover { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 2px var(--line-style, solid) var(--line);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: auto;
  white-space: nowrap;
}
.brand .brand-badge { width: 2.6em; height: 2.6em; flex: none; }
.brand .brand-sub { color: var(--accent-deep); text-transform: lowercase; letter-spacing: normal; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 0.9rem;
  flex-wrap: wrap;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0.2rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.site-nav a.donate-link {
  background: var(--accent-deep);
  color: var(--accent-ink);
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border-bottom: none;
  font-weight: 600;
  font-family: var(--font-display);
}
.site-nav a.donate-link:hover { background: var(--accent-strong); color: var(--accent-ink); }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.prose { max-width: var(--maxw-prose); }
.band { padding: 3rem 0; }
.band-alt { background: var(--surface-alt); }
.center { text-align: center; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; font-weight: 400; }
h1 { font-size: var(--size-h1); margin: 0 0 1rem; }
.section-title {
  font-size: var(--size-h1);
  margin: 0 0 1rem;
  border-bottom: 2px var(--line-style, solid) var(--line);
  padding-bottom: 0.5rem;
}
h2 { font-size: var(--size-h2); margin: 2rem 0 0.6rem; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.8rem;
  font-weight: 400;
  font-family: var(--font-display);
  color: var(--accent);
  margin: 0 0 0.4rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
.hero .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 800px) {
  .hero .inner { grid-template-columns: 1.1fr 0.9fr; padding: 5.5rem 1rem; }
}
.hero h1 {
  font-size: var(--size-hero);
  margin: 0 0 1rem;
}
.hero p.lead { font-size: 1.2rem; color: var(--ink-soft); margin: 0 0 1.6rem; }
.hero-photo {
  border: 10px solid var(--frame, var(--surface));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  transform: rotate(1.5deg);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.photo-frame {
  border: 10px solid var(--frame, var(--surface));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  transform: rotate(1.5deg);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
}
.hero-badge { width: 100%; max-width: 300px; height: auto; }
.photo-print {
  border: 10px solid var(--frame, var(--surface));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  transform: rotate(-1.2deg);
  width: 100%;
  object-fit: cover;
}

/* ---------- Stats band ---------- */
.stats-band {
  background: var(--accent-deep);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 0.95rem;
  padding: 0.9rem 1rem;
  display: flex;
  gap: 0.4rem 1.6rem;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}
.stats-band .stats-dot { opacity: 0.7; }

/* ---------- Who-we-are grid ---------- */
.who-grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 860px) {
  .who-grid { grid-template-columns: 1.2fr 0.8fr; }
  .who-grid .photo-print { margin-top: 2.5rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 400;
  font-family: var(--font-display);
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
}
.btn:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #8a4a2c; }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: none;
  padding: calc(0.8rem - 2px) calc(1.7rem - 2px);
}
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 2rem 0;
}
.card {
  background: var(--surface);
  border: 1.5px var(--line-style, solid) var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}
.card h3 { margin: 0 0 0.5rem; }
.card-no {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 0.4rem;
}
.card p { margin: 0 0 0.8rem; color: var(--ink-soft); }
.card a.more { font-weight: 600; text-decoration: none; }

/* ---------- Project cards ---------- */
.project {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 2rem 0;
  display: grid;
}
@media (min-width: 760px) {
  .project { grid-template-columns: 1fr 1fr; }
  .project:nth-child(even of .project) .project-media { order: 2; }
}
.project-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; cursor: zoom-in; }
.project-body { padding: 1.6rem; align-self: center; }
.project-body h2 { margin-top: 0; }
.project-thumbs { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.project-thumbs img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
}
.project-thumbs img:hover { border-color: var(--accent); }

/* ---------- Gallery ---------- */
.gallery {
  columns: 3 240px;
  column-gap: 1rem;
  margin: 2rem 0;
}
.gallery figure {
  margin: 0 0 1rem;
  break-inside: avoid;
  background: var(--frame, var(--surface));
  border: 8px solid var(--frame, var(--surface));
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.gallery img { width: 100%; }
.gallery figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.gallery-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  margin: 2rem 0;
}

/* ---------- Lightbox ---------- */
dialog.lightbox {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: min(92vw, 1000px);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
dialog.lightbox::backdrop { background: rgba(20, 16, 12, 0.75); }
dialog.lightbox img { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
dialog.lightbox .lb-close {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; border-radius: 999px;
  width: 2.2rem; height: 2.2rem; font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Tips listing ---------- */
.tip-list { list-style: none; padding: 0; margin: 2rem 0; display: grid; gap: 1rem; }
.tip-list li {
  background: var(--surface);
  border: 1.5px var(--line-style, solid) var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.4rem;
}
.tip-list a { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.tip-list p { margin: 0.4rem 0 0; color: var(--ink-soft); }

/* ---------- Article prose ---------- */
article.prose { margin: 2.5rem auto; }
article.prose ul, article.prose ol { padding-left: 1.4rem; }
article.prose li { margin: 0.3rem 0; }
article.prose blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.3rem 0 0.3rem 1.2rem;
  color: var(--ink-soft);
}
.sources { font-size: 0.9rem; color: var(--ink-soft); }
.sources li { margin: 0.4rem 0; overflow-wrap: anywhere; }

/* ---------- Donate ---------- */
.donate-page { max-width: 34rem; margin-inline: auto; text-align: center; }
.donate-page h1 { margin-bottom: 0.6rem; }
.donate-lead { color: var(--ink-soft); margin: 0 0 1.6rem; text-wrap: pretty; }
.donate-box {
  background: var(--surface);
  border: 2px var(--line-style, solid) var(--accent);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  box-shadow: var(--shadow-lift);
}
.donate-box .btn { width: 100%; }
.impact-hint {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: -0.2rem 0 1.1rem;
  min-height: 1.3em;
}
.donate-alt {
  margin: 3rem 0;
  padding-top: 0.5rem;
  border-top: 2px var(--line-style, solid) var(--line);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.donate-alt h2 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.donate-alt p { margin: 0; }
.donate-box .btn { font-size: 1.15rem; padding: 0.9rem 2.2rem; }
.donate-note { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.8rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
#pp-form fieldset { border: none; margin: 0 0 1.1rem; padding: 0; }
.freq-toggle, .amount-grid {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem;
}
.freq-toggle label, .amount-grid label { cursor: pointer; }
.freq-toggle input, .amount-grid input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.freq-toggle span, .amount-grid span {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 0.55rem 1.2rem;
  border: 2px var(--line-style, solid) var(--line);
  background: var(--surface);
  color: var(--ink);
  min-width: 4.2rem;
}
.freq-toggle input:checked + span, .amount-grid input[type="radio"]:checked + span {
  background: var(--ink); color: var(--accent-ink); border-color: var(--ink); border-style: solid;
}
.freq-toggle input:focus-visible + span, .amount-grid input[type="radio"]:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.amount-custom input[type="number"] {
  width: 4.5rem; border: none; background: transparent;
  font: inherit; color: inherit; text-align: center; padding: 0;
}
.amount-custom input[type="number"]:focus { outline: none; }
.amount-custom input[type="radio"]:checked + span input[type="number"] { color: var(--accent-ink); }
.amount-custom input[type="number"]::placeholder { color: currentColor; opacity: 0.55; }

/* ---------- Donate popup ---------- */
dialog.donate-modal {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 0;
  width: min(92vw, 420px);
  background: var(--bg);
  box-shadow: var(--shadow-lift);
}
dialog.donate-modal::backdrop { background: rgba(20, 16, 12, 0.6); }
.dm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 2px var(--line-style, solid) var(--line);
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.dm-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink-soft); padding: 0 0.2rem;
}
.dm-close:hover { color: var(--accent); }
.dm-opts { display: grid; gap: 0.8rem; padding: 1.2rem; }
.dm-opt {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1.5px var(--line-style, solid) var(--line);
  text-decoration: none;
  color: var(--ink);
}
.dm-opt:hover { border-color: var(--accent); border-style: solid; color: var(--ink); }
.dm-opt svg { width: 44px; height: 44px; flex: none; }
.dm-opt-text { display: flex; flex-direction: column; gap: 0.15rem; }
.dm-opt-text strong { font-family: var(--font-display); font-weight: 400; font-size: 1.05rem; }
.dm-opt-text small { color: var(--ink-soft); font-size: 0.82rem; }

/* ---------- Dark CTA band ---------- */
.cta-band {
  margin-top: 4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 3rem 0 3.5rem;
  text-align: center;
}
.cta-band h2 { margin: 0 0 0.8rem; font-size: var(--size-h1); }
.cta-band p { color: var(--surface-alt); }
.cta-band a { color: var(--bg); }
.cta-band a:hover { color: var(--accent); }
.cta-band .btn { color: var(--accent-ink); }
.cta-band .btn:hover { color: var(--accent-ink); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  background: var(--ink);
  border-top: none;
  padding: 2.5rem 0;
  color: var(--surface-alt);
  font-size: 0.95rem;
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: 1rem 2.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.site-footer a { color: var(--bg); }
.site-footer a:hover { color: var(--accent); }
