/* Paws & Whiskers — warm, plain and easy to read.
   Big type, strong contrast, underlined links, large buttons. Nothing flashy. */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:    #a8482a;   /* terracotta: white text on it passes WCAG AA */
  --primary-dk: #8a3a21;
  --teal:       #4f6f45;   /* sage green (name kept so templates keep working) */
  --teal-dk:    #3f5a37;
  --bg:         #fbf7f0;   /* warm paper */
  --bg-warm:    #f3ebdd;   /* oatmeal, for alternate sections */
  --surface:    #ffffff;
  --border:     #e2d8c8;
  --text:       #2b2622;   /* soft black-brown */
  --muted:      #5e554c;   /* still 7:1 on the paper background */
  --honey:      #b7791f;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(60, 40, 20, .06);
  --shadow-md:  0 3px 10px rgba(60, 40, 20, .10);
  --serif:      'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:       'Atkinson Hyperlegible', Verdana, system-ui, sans-serif;
  font-size: 18px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-dk); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; border-radius: 4px; }
hr { border: none; border-top: 1px solid var(--border); margin: .75rem 0; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
main { flex: 1; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.3rem; font-weight: 500; }
p { margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: .95rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: .75rem auto 0; }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--primary); text-decoration: none; }
.nav-logo span { font-size: 1.5rem; }
.nav-links { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  color: var(--text);
  font-size: .95rem;
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Hamburger (mobile) ────────────────────────────────────── */
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: .5rem .6rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: var(--bg-warm);
  padding: 4.5rem 1.25rem 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-block;
  color: var(--teal-dk);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 1rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .6rem 1.4rem;
  border-radius: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dk); color: #fff; }
.btn-sm { min-height: 40px; padding: .4rem 1rem; font-size: .95rem; }
.btn-danger { background: var(--surface); color: #a32020; border-color: #c9a7a0; }
.btn-danger:hover { background: #a32020; color: #fff; border-color: #a32020; }

/* ── Section ───────────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-warm); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-warm { background: var(--bg-warm); border-top: 1px solid var(--border); }
.section-header { text-align: center; margin-bottom: 2.25rem; }
.section-header p { color: var(--muted); max-width: 540px; margin: .5rem auto 0; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

/* ── Feature icons ─────────────────────────────────────────── */
.feature-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ── Events ────────────────────────────────────────────────── */
.event-card { display: flex; gap: 1rem; align-items: flex-start; }
.event-date-badge {
  background: var(--bg-warm);
  color: var(--primary-dk);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .75rem;
  text-align: center;
  min-width: 58px;
  flex-shrink: 0;
}
.event-date-badge .day { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.event-date-badge .mon { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.event-meta { color: var(--muted); font-size: .95rem; margin-top: .25rem; margin-bottom: 0; }

/* ── Stars ─────────────────────────────────────────────────── */
.stars { color: var(--honey); letter-spacing: .1em; font-size: 1.1rem; }
.review-card .reviewer { font-weight: 700; margin-bottom: .25rem; }
.review-card .comment { color: var(--text); font-size: 1rem; font-style: italic; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 700; font-size: 1rem; margin-bottom: .4rem; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .6rem .85rem;
  border: 2px solid #cfc3b0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 72, 42, .18);
}
textarea { min-height: 130px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.3rem; height: 1.3rem; min-height: 0; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1rem; }
.radio-group { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.radio-group label { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: 0; cursor: pointer; }
.hint { color: var(--muted); font-size: .9rem; margin-top: .35rem; margin-bottom: 0; }

/* ── Star rating input ─────────────────────────────────────── */
.star-rating { display: flex; flex-direction: row-reverse; gap: .25rem; width: fit-content; }
.star-rating input { display: none; }
.star-rating label {
  font-size: 2.2rem;
  color: #d6cbb9;
  cursor: pointer;
  margin: 0;
  padding: 0 .1rem;
  width: auto;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--honey); }

/* ── Alerts / Flash ────────────────────────────────────────── */
.flash-messages { padding: 1rem 0 0; }
.alert {
  padding: .9rem 1.1rem;
  border-radius: 8px;
  margin-bottom: .5rem;
  font-size: 1rem;
  border-left-width: 6px;
}
.alert-success { background: #eef4e8; color: #2f4a25; border: 1px solid #c4d6b4; border-left: 6px solid var(--teal); }
.alert-error   { background: #fbeceb; color: #7f1d1d; border: 1px solid #ebc3bf; border-left: 6px solid #a32020; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .15rem .65rem;
  border-radius: 99px;
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 700;
}
.badge-new       { background: #e3ecf6; color: #1e3a5f; }
.badge-reviewed  { background: #f8ecd2; color: #6b4410; }
.badge-resolved  { background: #e6efdf; color: #2f4a25; }
.badge-medicine  { background: #fbeceb; color: #7f1d1d; }
.badge-fostering { background: #f8ecd2; color: #6b4410; }
.badge-adopted   { background: #e6efdf; color: #2f4a25; }
.badge-archived  { background: #eeeae4; color: #4d463f; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .98rem; }
th { text-align: left; padding: .7rem 1rem; background: var(--bg-warm); border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text); font-size: .9rem; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; white-space: nowrap; }

/* ── Admin layout ──────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--bg-warm);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
}
.admin-sidebar .logo {
  padding: 0 1.25rem 1.25rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.admin-sidebar nav { background: none; border: none; position: static; }
.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1.25rem;
  color: var(--text);
  font-size: 1rem;
  text-decoration: none;
  border-left: 4px solid transparent;
}
.admin-sidebar nav a:hover { background: #ebe0cd; color: var(--text); }
.admin-sidebar nav a.active { background: var(--surface); border-left-color: var(--primary); font-weight: 700; }
.admin-sidebar nav a .icon { font-size: 1.1rem; }
.admin-sidebar hr { margin: .75rem 1.25rem; }
.admin-main { flex: 1; padding: 2rem; overflow-x: auto; min-width: 0; }
.admin-header { margin-bottom: 1.75rem; }
.admin-header h1 { font-size: 1.9rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--primary-dk); }
.stat-card .stat-label { font-size: .95rem; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 2rem; align-items: start; }
.inline-form { display: flex; gap: .4rem; align-items: center; }
.inline-form input { width: 6.5rem; min-height: 40px; padding: .35rem .5rem; }
.checkbox-row { display: flex; align-items: center; gap: .6rem; font-weight: 400; cursor: pointer; }
.checkbox-row input { width: 1.3rem; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: #3a2e25;
  color: #e9dfd1;
  text-align: center;
  padding: 2.25rem 1.25rem;
  font-size: .95rem;
  margin-top: auto;
}
footer a { color: #fff; }
footer .footer-logo { font-size: 1.6rem; margin-bottom: .4rem; }
footer .footer-name { font-family: var(--serif); font-size: 1.15rem; color: #fff; }

/* ── Divider ───────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .icon { font-size: 2.6rem; margin-bottom: .75rem; }

/* ── Page hero (inner pages) ───────────────────────────────── */
.page-hero {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
}

/* ── Donate button in nav ──────────────────────────────────── */
.nav-links a.nav-donate { color: #fff; padding: .35rem 1rem; border-bottom: none; min-height: 40px; }
.nav-links a.nav-donate:hover { color: #fff; }

/* ── Animals ───────────────────────────────────────────────── */
.animal-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.animal-card:hover { box-shadow: var(--shadow-md); border-color: #cfc3b0; color: inherit; }
.animal-card:hover h3 { color: var(--primary); text-decoration: underline; }
.animal-card .photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--bg-warm); }
.animal-card .photo-empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: var(--bg-warm); }
.animal-card .body { padding: 1rem 1.25rem 1.25rem; }
.animal-card h3 { margin-bottom: .15rem; font-weight: 700; }
.animal-meta { color: var(--muted); font-size: .95rem; margin-bottom: 0; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.chip { display: inline-block; padding: .2rem .7rem; border-radius: 99px; font-size: .9rem; font-weight: 700; background: #e6efdf; color: var(--teal-dk); margin: 0 .25rem .4rem 0; text-decoration: none; }
.chip:hover { background: #d5e3c9; color: var(--teal-dk); }

/* ── Timeline (activity log) ───────────────────────────────── */
.timeline { list-style: none; border-left: 3px solid var(--border); padding-left: 1.25rem; }
.timeline li { position: relative; padding-bottom: 1.1rem; }
.timeline li::before { content: ''; position: absolute; left: -1.72rem; top: .5rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--teal); border: 2px solid var(--bg); }
.timeline .when { color: var(--muted); font-size: .9rem; font-weight: 700; }

/* ── Progress (care costs covered) ─────────────────────────── */
.progress { height: .75rem; background: #ece3d5; border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* ── Blog ──────────────────────────────────────────────────── */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; align-items: start; }
.post { margin-bottom: 1.5rem; }
.post h2 { font-size: 1.6rem; margin-bottom: .25rem; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--primary); text-decoration: underline; }
.post-body { font-size: 1.05rem; }
.post-body p { margin-bottom: 1rem; }
.post-date { color: var(--muted); font-size: .95rem; margin-bottom: .75rem; }
.sidebar-animal { display: flex; gap: .75rem; align-items: center; margin-bottom: .85rem; color: inherit; text-decoration: none; }
.sidebar-animal:hover strong { color: var(--primary); text-decoration: underline; }
.sidebar-animal img, .sidebar-animal .thumb-empty { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--bg-warm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Get in touch (intake) ─────────────────────────────────── */
.contact-list { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.contact-card { display: flex; gap: 1.25rem; align-items: flex-start; }
.contact-card .feature-icon { font-size: 2.4rem; line-height: 1; margin: .15rem 0 0; width: 3rem; flex-shrink: 0; text-align: center; }
.contact-card h2 { font-size: 1.45rem; margin-bottom: .35rem; }
.contact-card p { color: var(--muted); }
.note-card { background: var(--bg-warm); box-shadow: none; }
.email-address { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; font-size: 1.15rem; margin-bottom: 0; }
.email-address strong { word-break: break-all; }

/* ── Donate ────────────────────────────────────────────────── */
.donate-embed { position: relative; overflow: hidden; height: 1200px; width: 100%; }
.donate-embed iframe { position: absolute; border: 0; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    gap: .5rem;
    align-items: flex-start;
  }
  .nav-links a { font-size: 1.1rem; }
  .nav-links.open { display: flex; }
  nav { position: relative; }
}

@media (max-width: 760px) {
  .form-row, .blog-layout, .admin-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1.25rem 2.75rem; }
  .contact-card { flex-direction: column; gap: .5rem; }
  /* The admin menu becomes a wrapped row of links above the page instead of disappearing. */
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem 0 .5rem; }
  .admin-sidebar .logo { border-bottom: none; padding-bottom: .5rem; margin-bottom: 0; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; padding: 0 .75rem; }
  .admin-sidebar nav a { padding: .5rem .75rem; border-left: none; border-bottom: 3px solid transparent; }
  .admin-sidebar nav a.active { border-bottom-color: var(--primary); background: none; }
  .admin-sidebar hr { display: none; }
  .admin-main { padding: 1.25rem; }
}

/* ── Simple stacked lists (admin activity log) ─────────────── */
.entry-list { list-style: none; border-top: 1px solid var(--border); }
.entry-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.entry-list .entry-head { font-weight: 700; }
.admin-stack { display: grid; gap: 2rem; }

/* ── Embedded photos and videos ────────────────────────────── */
.media { margin: 1rem 0 1.25rem; }
.media img { border-radius: 8px; border: 1px solid var(--border); max-height: 80vh; width: auto; max-width: 100%; }
.media .photo-strip { margin: 0 0 .4rem; }
.media .photo-strip img { width: 100%; max-height: none; }
.media figcaption { font-size: .95rem; }
.media-snap iframe { display: block; width: 360px; max-width: 100%; height: 640px; border: 0; border-radius: 16px; background: #000; }
.link-card { display: flex; gap: .85rem; align-items: center; padding: .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; max-width: 520px; }
.link-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.link-card:hover span { color: var(--primary); text-decoration: underline; }
.media-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.media-row .media { margin: 0; }
.media-row .media img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ── Blog editor ───────────────────────────────────────────── */
.editor { max-width: 900px; }
.post-text { min-height: 420px; font-size: 1.05rem; line-height: 1.6; }
.how-to { margin-top: .6rem; padding: .85rem 1rem; background: var(--bg-warm); border-radius: 8px; font-size: .95rem; }
.how-to ul { margin: .4rem 0 0 1.25rem; }
.fold { margin-bottom: 1.5rem; max-width: 900px; }
.fold summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
