/* Madison Ferret Rescue: public site styles.
   All values trace to MFR_Design_System.md. Change a token here, not inline. */

:root {
  /* Color */
  --mfr-cream: #FBF6EE;
  --mfr-paper: #FFFFFF;
  --mfr-chestnut: #6B3A2A;
  --mfr-chestnut-dark: #4E2A1E;
  --mfr-tan: #D9B99B;
  --mfr-sand: #EFE3D2;
  --mfr-ink: #2B2622;
  --mfr-ink-soft: #6F655D;
  --mfr-sage: #5E7D5A;
  --mfr-amber: #B8862B;
  --mfr-rose: #9C4B5A;
  --mfr-input-border: #CFC3B5;

  /* Type */
  --mfr-font-head: "Nunito", "Segoe UI", Arial, sans-serif;
  --mfr-font-body: "Source Sans 3", Arial, sans-serif;

  /* Spacing (8px base) */
  --mfr-space-1: 8px;
  --mfr-space-2: 16px;
  --mfr-space-3: 24px;
  --mfr-space-4: 32px;
  --mfr-space-5: 40px;
  --mfr-space-8: 64px;

  /* Layout */
  --mfr-max: 1100px;
  --mfr-text-max: 720px;
  --mfr-radius-card: 14px;
  --mfr-radius-ctl: 10px;
  --mfr-radius-badge: 999px;
  --mfr-card-shadow: 0 2px 10px rgba(43, 38, 34, 0.08);
  --mfr-card-w: 320px;
}

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

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

body {
  margin: 0;
  background: var(--mfr-cream);
  color: var(--mfr-ink);
  font-family: var(--mfr-font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
}

/* ---------- Headings ---------- */
h1, h2, h3 {
  font-family: var(--mfr-font-head);
  line-height: 1.2;
  margin: 0 0 var(--mfr-space-2);
}
h1 { font-size: 40px; font-weight: 800; color: var(--mfr-chestnut); }
h2 { font-size: 28px; font-weight: 700; color: var(--mfr-chestnut); }
h3 { font-size: 20px; font-weight: 700; color: var(--mfr-ink); }

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
}

p { margin: 0 0 var(--mfr-space-2); }
small, .mfr-caption { font-size: 14px; color: var(--mfr-ink-soft); }

a { color: var(--mfr-chestnut); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--mfr-chestnut-dark); }

/* ---------- Layout ---------- */
.mfr-wrap { max-width: var(--mfr-max); margin: 0 auto; padding: 0 var(--mfr-space-3); }
.mfr-text { max-width: var(--mfr-text-max); margin: 0 auto; padding: 0 var(--mfr-space-3); }
.mfr-section { padding: var(--mfr-space-8) 0; }
@media (max-width: 640px) { .mfr-section { padding: var(--mfr-space-5) 0; } }
.mfr-section--sand { background: var(--mfr-sand); }

.mfr-center { text-align: center; }
.mfr-lede { font-size: 19px; color: var(--mfr-ink-soft); }
@media (max-width: 640px) { .mfr-lede { font-size: 17px; } }

/* ---------- Header / nav ---------- */
.mfr-header {
  background: var(--mfr-paper);
  border-bottom: 1px solid var(--mfr-sand);
  position: sticky; top: 0; z-index: 20;
}
.mfr-header__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--mfr-space-3);
  min-height: 72px;
}
.mfr-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.mfr-brand img, .mfr-brand svg { display: block; height: 44px; width: auto; }
.mfr-brand__word {
  font-family: var(--mfr-font-head); font-weight: 800; font-size: 20px;
  color: var(--mfr-chestnut); line-height: 1.05; letter-spacing: 0.1px;
}
@media (max-width: 520px) { .mfr-brand__word { display: none; } }

.mfr-nav { display: flex; gap: var(--mfr-space-3); align-items: center; }
.mfr-nav a {
  font-family: var(--mfr-font-head); font-weight: 700; font-size: 16px;
  text-decoration: none; color: var(--mfr-ink);
}
.mfr-nav a:hover, .mfr-nav a[aria-current="page"] { color: var(--mfr-chestnut); }
@media (max-width: 640px) {
  .mfr-nav { gap: var(--mfr-space-2); }
  .mfr-nav a { font-size: 15px; }
}

/* ---------- Buttons ---------- */
.mfr-btn {
  display: inline-block;
  font-family: var(--mfr-font-body); font-weight: 600; font-size: 16px;
  padding: 12px 22px; border-radius: var(--mfr-radius-ctl);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease;
}
.mfr-btn--primary { background: var(--mfr-chestnut); color: var(--mfr-paper); }
.mfr-btn--primary:hover { background: var(--mfr-chestnut-dark); color: var(--mfr-paper); }
.mfr-btn--secondary {
  background: var(--mfr-paper); color: var(--mfr-chestnut);
  border-color: var(--mfr-chestnut);
}
.mfr-btn--secondary:hover { color: var(--mfr-chestnut-dark); border-color: var(--mfr-chestnut-dark); }

/* ---------- Hero ---------- */
.mfr-hero {
  background: linear-gradient(180deg, var(--mfr-cream) 0%, var(--mfr-sand) 100%);
  padding: var(--mfr-space-8) 0;
  text-align: center;
}
.mfr-hero h1 { margin-bottom: var(--mfr-space-2); }
.mfr-hero__lede { max-width: 600px; margin: 0 auto var(--mfr-space-4); }
.mfr-hero__cta { display: flex; gap: var(--mfr-space-2); justify-content: center; flex-wrap: wrap; }

/* ---------- Card grid (flexbox, centered, never CSS grid) ---------- */
.mfr-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--mfr-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.mfr-card {
  width: var(--mfr-card-w);
  background: var(--mfr-paper);
  border-radius: var(--mfr-radius-card);
  box-shadow: var(--mfr-card-shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.mfr-card:hover { box-shadow: 0 6px 18px rgba(43,38,34,0.14); transform: translateY(-2px); }
.mfr-card:focus-visible { outline: 3px solid var(--mfr-chestnut); outline-offset: 2px; }
.mfr-card__topbar { height: 6px; background: var(--mfr-tan); }
.mfr-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--mfr-sand); }
.mfr-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfr-card__body { padding: var(--mfr-space-2) var(--mfr-space-2) var(--mfr-space-3); }
.mfr-card__name { margin: 0 0 6px; }
.mfr-card__summary { margin: 0; color: var(--mfr-ink-soft); font-size: 15px; }

/* Status badge over the photo, top-right */
.mfr-badge {
  display: inline-block;
  font-family: var(--mfr-font-head); font-weight: 700; font-size: 13px;
  color: var(--mfr-paper);
  padding: 5px 12px; border-radius: var(--mfr-radius-badge);
  line-height: 1;
}
.mfr-badge--available { background: var(--mfr-sage); }
.mfr-badge--pending   { background: var(--mfr-amber); }
.mfr-badge--adopted   { background: var(--mfr-rose); }
.mfr-card__badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }

/* Special-needs tag: sand bg, chestnut text */
.mfr-tag-special {
  display: inline-block;
  font-family: var(--mfr-font-head); font-weight: 700; font-size: 12px;
  background: var(--mfr-sand); color: var(--mfr-chestnut);
  padding: 4px 10px; border-radius: var(--mfr-radius-badge);
  margin-top: var(--mfr-space-1);
}

/* ---------- Detail page ---------- */
.mfr-detail { padding: var(--mfr-space-5) 0; }
.mfr-detail__back { display: inline-block; margin-bottom: var(--mfr-space-3); font-weight: 600; text-decoration: none; }
.mfr-detail__back::before { content: "\2039  "; }
.mfr-detail__head { display: flex; align-items: baseline; gap: var(--mfr-space-2); flex-wrap: wrap; margin-bottom: var(--mfr-space-1); }
.mfr-detail__status { margin-bottom: var(--mfr-space-3); }

.mfr-gallery { display: flex; flex-direction: column; gap: var(--mfr-space-2); }
.mfr-gallery__main { border-radius: var(--mfr-radius-card); overflow: hidden; background: var(--mfr-sand); aspect-ratio: 4 / 3; box-shadow: var(--mfr-card-shadow); }
.mfr-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfr-gallery__thumbs { display: flex; flex-wrap: wrap; gap: var(--mfr-space-1); }
.mfr-gallery__thumb {
  width: 84px; height: 63px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; background: var(--mfr-sand); cursor: pointer; padding: 0;
}
.mfr-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mfr-gallery__thumb[aria-current="true"] { border-color: var(--mfr-chestnut); }
.mfr-gallery__thumb:focus-visible { outline: 3px solid var(--mfr-chestnut); outline-offset: 2px; }

.mfr-detail__cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--mfr-space-5); align-items: start; }
@media (max-width: 820px) { .mfr-detail__cols { grid-template-columns: 1fr; gap: var(--mfr-space-4); } }

.mfr-about h2 { margin-top: 0; }
.mfr-member + .mfr-member { margin-top: var(--mfr-space-4); padding-top: var(--mfr-space-4); border-top: 1px solid var(--mfr-sand); }

/* Good-with facts */
.mfr-facts { list-style: none; margin: 0 0 var(--mfr-space-3); padding: 0; }
.mfr-facts li {
  display: flex; justify-content: space-between; gap: var(--mfr-space-2);
  padding: 8px 0; border-bottom: 1px solid var(--mfr-sand);
}
.mfr-facts li:last-child { border-bottom: 0; }
.mfr-facts__k { color: var(--mfr-ink-soft); }
.mfr-facts__v { font-weight: 600; }
.mfr-facts__v--yes { color: var(--mfr-sage); }
.mfr-facts__v--no { color: var(--mfr-rose); }
.mfr-facts__v--unknown { color: var(--mfr-ink-soft); font-weight: 400; }

.mfr-special-note {
  background: var(--mfr-sand); color: var(--mfr-ink);
  border-radius: var(--mfr-radius-ctl); padding: var(--mfr-space-2) var(--mfr-space-3);
  margin: 0 0 var(--mfr-space-3);
}
.mfr-special-note strong { color: var(--mfr-chestnut); }

.mfr-apply { margin-top: var(--mfr-space-3); }

/* Meta rows (sex / age / stage) */
.mfr-meta { display: flex; flex-wrap: wrap; gap: 6px var(--mfr-space-2); margin: 0 0 var(--mfr-space-3); padding: 0; list-style: none; color: var(--mfr-ink-soft); }
.mfr-meta li { position: relative; }
.mfr-meta li + li::before { content: ""; position: absolute; left: calc(var(--mfr-space-1) * -1 - 2px); top: 0.7em; width: 3px; height: 3px; border-radius: 50%; background: var(--mfr-tan); }

/* ---------- Empty state ---------- */
.mfr-empty {
  text-align: center; max-width: 520px; margin: 0 auto;
  padding: var(--mfr-space-5) var(--mfr-space-3);
}

/* ---------- Footer ---------- */
.mfr-footer {
  background: var(--mfr-chestnut-dark);
  color: var(--mfr-cream);
  padding: var(--mfr-space-5) 0;
  margin-top: var(--mfr-space-8);
}
.mfr-footer a { color: var(--mfr-cream); }
.mfr-footer__trust { font-family: var(--mfr-font-head); font-weight: 700; margin-bottom: var(--mfr-space-1); }
.mfr-footer__row { display: flex; justify-content: space-between; gap: var(--mfr-space-3); flex-wrap: wrap; }
.mfr-footer__nav { display: flex; gap: var(--mfr-space-3); flex-wrap: wrap; }
.mfr-footer small { color: var(--mfr-tan); }

/* ---------- Notice strip ---------- */
.mfr-notice {
  background: var(--mfr-sand);
  text-align: center;
  padding: 12px var(--mfr-space-3);
  font-weight: 600;
  color: var(--mfr-chestnut);
  font-family: var(--mfr-font-head);
}

/* ---------- Accessibility / motion ---------- */
:focus-visible { outline: 3px solid var(--mfr-chestnut); outline-offset: 2px; }
.mfr-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--mfr-chestnut); color: var(--mfr-paper);
  padding: 10px 16px; border-radius: 0 0 var(--mfr-radius-ctl) 0; z-index: 100;
}
.mfr-skip:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .mfr-card:hover { transform: none; }
}
