/* Henry's Haven Cat Rescue
   Layout: phone < 600px, tablet 600-1099px, desktop >= 1100px */

:root {
  --purple: #74459b;
  --purple-hover: #5e3786;
  --purple-dark: #210f35;
  --menu-bg: #3b2058;
  --lavender: #e6e6fa;
  --tint: #f6f2fa;
  --ink: #2b2233;
  --muted: #5a4e66;
  --line: #e3d9ee;
  --panel-line: #d6cbe6;
  --on-dark-link: #c4e4ef;
  --gradient: linear-gradient(to bottom right, var(--purple), var(--purple-dark));

  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-script: 'Charm', 'Brush Script MT', cursive;
  --font-label: 'Squada One', 'Barlow', sans-serif;
  --font-quote: 'Indie Flower', 'Comic Sans MS', cursive;

  --nav-h: 68px;
}

@media (min-width: 1100px) {
  :root { --nav-h: 80px; }
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
}

@media (min-width: 600px) {
  body { font-size: 20px; }
}

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

a { color: var(--purple); }
a:hover { color: var(--purple-hover); }

p { margin: 0; }

h1, h2, h3 { margin: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

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

/* ---------- Accessibility: skip link and focus ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(33, 15, 53, 0.3);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible,
.lightbox :focus-visible { outline-color: var(--on-dark-link); }

main:focus { outline: none; }
.form-panel:focus { outline: none; }

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: 1188px;
  margin-inline: auto;
  padding-inline: 24px;
}
.container--narrow { max-width: 1000px; }

.section { padding: 64px 0; }
.section--tint { background: var(--tint); }
.section--lavender { background: var(--lavender); }

@media (min-width: 600px) {
  .section { padding: 88px 0; }
}

.section__head { text-align: center; }

.section__title {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.15;
  color: var(--ink);
}
@media (min-width: 600px) {
  .section__title { font-size: 52px; }
}

.paws {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 10px 0 20px;
  color: var(--purple);
}
.paws svg { width: 22px; height: 22px; }
.paws--spaced { margin-bottom: 36px; }

.section__intro {
  max-width: 720px;
  margin: 0 auto 36px;
  font-size: 20px;
}
@media (min-width: 600px) {
  .section__intro { font-size: 22px; }
}

.actions { margin-top: 28px; text-align: center; }

.muted { color: var(--muted); font-size: 18px; }
.strong-link { font-weight: 600; overflow-wrap: anywhere; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: 2px solid var(--purple);
  border-radius: 8px;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-label);
  font-size: 22px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--purple-hover); border-color: var(--purple-hover); color: #fff; }
.btn--outline { background: #fff; color: var(--purple); }
.btn--outline:hover { background: var(--lavender); border-color: var(--purple); color: var(--purple); }
.btn--small { padding: 0 22px; font-size: 21px; }

/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--gradient);
  color: #fff;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  min-height: var(--nav-h);
  padding-block: 10px;
}
@media (max-width: 599px) {
  .nav-bar { padding-inline: 16px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand img { width: auto; height: 44px; }
.brand__name {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.1;
}
@media (min-width: 600px) {
  .brand { gap: 12px; }
  .brand img { height: 46px; }
  .brand__name { font-size: 28px; }
}
@media (min-width: 1100px) {
  .brand { gap: 14px; }
  .brand img { height: 60px; }
  .brand__name { font-size: 30px; }
}

.nav__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.nav__toggle-close { display: none; }
.nav__toggle[aria-expanded="true"] .nav__toggle-open { display: none; }
.nav__toggle[aria-expanded="true"] .nav__toggle-close { display: block; }

/* Without JavaScript the toggle can't work, so the links stay visible. */
html:not(.js) .nav__toggle { display: none; }

.nav__links {
  margin: 0;
  padding: 4px 16px 12px;
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--menu-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 24px rgba(33, 15, 53, 0.35);
}
.js .nav__links:not(.is-open) { display: none; }
html:not(.js) .nav__links { position: static; box-shadow: none; }
html:not(.js) .nav-bar { flex-wrap: wrap; }

.nav__links a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  text-decoration: none;
}
.nav__links li:last-child a { border-bottom: 0; }
.nav__links a:hover,
.nav__links a[aria-current="true"] { color: var(--on-dark-link); }

@media (min-width: 1100px) {
  .nav__toggle { display: none; }
  .js .nav__links:not(.is-open),
  .nav__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
    position: static;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav__links a,
  .nav__links li:last-child a {
    min-height: 48px;
    padding: 0;
    border-bottom: 2px solid transparent;
    font-size: 21px;
  }
  .nav__links a[aria-current="true"] { border-bottom-color: var(--on-dark-link); }
}

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

.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  background: var(--gradient);
  color: #fff;
}

.hero__media {
  position: relative;
  flex: 1 1 0px;
  min-height: 120px;
  overflow: hidden;
  background: #111;
}
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 44% 40%;
}

.hero__panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  text-align: center;
}

.hero__logo { display: none; width: auto; margin: 0 0 14px; }

.hero h1 {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.1;
}

.hero__tagline { margin-top: 8px; font-size: 19px; line-height: 1.35; }

.hero__about {
  display: none;
  max-width: 620px;
  margin-top: 18px;
  color: #f3eff8;
  font-size: 19px;
  line-height: 1.5;
}

.hero__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 600px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.hero-card:hover { color: var(--ink); background: #faf8fd; }

.hero-card__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple);
}
.hero-card__icon svg { width: 20px; height: 20px; }

.hero-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-card__title { font-family: var(--font-label); font-size: 21px; line-height: 1.1; }
.hero-card__text { color: var(--muted); font-size: 16px; line-height: 1.35; }
.hero-card__link { display: none; margin-top: 4px; color: var(--purple); font-size: 17px; font-weight: 600; }
.hero-card__chevron { flex: none; width: 22px; height: 22px; color: var(--purple); }

.hero__charity { margin-top: 14px; color: #e6e0ee; font-size: 16px; }

/* Tablet: photo on top, panel underneath, cards stacked */
@media (min-width: 600px) {
  .hero__media { min-height: 220px; }
  .hero__panel { padding: 32px 48px; }
  .hero__logo { display: block; height: 64px; }
  .hero h1 { font-size: 52px; }
  .hero__tagline { font-size: 24px; }
  .hero__about { display: block; }
  .hero__cards { gap: 12px; max-width: 620px; margin-top: 24px; }
  .hero-card { gap: 16px; padding: 14px 20px; }
  .hero-card__icon { width: 46px; height: 46px; }
  .hero-card__icon svg { width: 24px; height: 24px; }
  .hero-card__title { font-size: 25px; }
  .hero-card__text { font-size: 17px; }
  .hero__charity { margin-top: 16px; }
}

/* Desktop: photo on the left, panel on the right, cards side by side */
@media (min-width: 1100px) {
  .hero { flex-direction: row; }
  .hero__media { flex: 1 1 420px; min-height: 340px; }
  .hero__panel { flex: 1.3 1 520px; min-width: 0; padding: 40px clamp(24px, 4vw, 80px); }
  .hero__logo { height: 84px; }
  .hero h1 { font-size: 60px; }
  .hero__tagline { font-size: 25px; }
  .hero__about { font-size: 20px; }
  .hero__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 920px; margin-top: 28px; }
  .hero-card { flex-direction: column; gap: 8px; padding: 22px 18px; text-align: center; }
  .hero-card__icon { width: 56px; height: 56px; }
  .hero-card__icon svg { width: 28px; height: 28px; }
  .hero-card__title { font-size: 26px; }
  .hero-card__link { display: block; }
  .hero-card__chevron { display: none; }
  .hero__charity { margin-top: 20px; }
}

/* On phones the About paragraph sits under the hero instead of in it */
.about-mobile { padding: 36px 24px; text-align: center; }
.about-mobile p { max-width: 560px; margin-inline: auto; }
@media (min-width: 600px) {
  .about-mobile { display: none; }
}

/* ---------- Adopt ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-label);
  font-size: 24px;
}
.step__title { font-family: var(--font-label); font-weight: 400; font-size: 26px; line-height: 1.1; }
.step p { color: var(--muted); font-size: 19px; }
.step a { font-weight: 600; }

.note {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 19px;
  text-align: center;
}
.note strong { color: var(--ink); font-weight: 600; }

/* ---------- Donate ---------- */

.donate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple);
}
.card__icon svg { width: 26px; height: 26px; }
.card__title { font-family: var(--font-label); font-weight: 400; font-size: 28px; line-height: 1.15; color: var(--ink); }
.card strong { font-weight: 600; }
.card .btn { align-self: flex-start; margin-top: auto; }

.bank {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 19px;
}
.bank div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; }
.bank dt { color: var(--muted); }
.bank dd { margin: 0; font-weight: 600; }

.fb-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 20px;
  padding: 24px 28px;
  border-radius: 12px;
  background: var(--lavender);
}
.fb-strip__text { flex: 1 1 320px; }
.fb-strip__text .muted { margin-top: 4px; }
.fb-strip__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Volunteering ---------- */

.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px;
  align-items: stretch;
}

.role {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.role__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.role__img--foster { object-position: center 48%; }
.role__body { padding: 24px; }
@media (min-width: 600px) {
  .role__body { padding: 28px 32px 32px; }
}
.role__title {
  margin-bottom: 16px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.15;
}
.role__extra { margin-top: 16px; color: var(--muted); }

.paw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.paw-list li { display: flex; align-items: flex-start; gap: 12px; }
.paw-list svg { flex: none; width: 18px; height: 18px; margin-top: 6px; color: var(--purple); }
.paw-list strong { font-weight: 600; }

.quote {
  max-width: 880px;
  margin: 32px auto 0;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--lavender);
  text-align: center;
}
@media (min-width: 600px) {
  .quote { padding: 28px 36px; }
}
.quote blockquote { margin: 0; }
.quote p { font-family: var(--font-quote); font-size: 22px; line-height: 1.5; }
@media (min-width: 600px) {
  .quote p { font-size: 24px; }
}
.quote figcaption { margin-top: 10px; color: var(--muted); font-size: 18px; }

/* ---------- Pictures ---------- */

.gallery {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 4 160px;
  column-gap: 16px;
}
.gallery li { break-inside: avoid; padding-bottom: 16px; }
.js .gallery__extra:not(.is-shown) { display: none; }

.gallery__item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery__item img {
  width: 100%;
  border-radius: 10px;
  transition: transform 0.25s ease;
}
.gallery__item:hover img { transform: scale(1.03); }

.gallery__hint { margin-top: 12px; color: var(--muted); font-size: 17px; text-align: center; }
html:not(.js) .gallery__hint { display: none; }

.lightbox {
  max-width: min(94vw, 1200px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(20, 10, 30, 0.88); }
.lightbox__img {
  max-width: min(94vw, 1200px);
  max-height: calc(94vh - 84px);
  margin: 0 auto;
  border-radius: 10px;
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.lightbox__text { flex: 1; min-width: 0; text-align: center; color: #fff; }
.lightbox__caption { font-size: 18px; line-height: 1.35; }
.lightbox__count { margin-top: 2px; color: #d9d2e3; font-size: 16px; }
.lightbox__step {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(20, 10, 30, 0.6);
  color: #fff;
  cursor: pointer;
}
.lightbox__step:hover,
.lightbox__close:hover { background: rgba(255, 255, 255, 0.15); }
.lightbox__step--prev svg { transform: scaleX(-1); }
.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(20, 10, 30, 0.6);
  color: #fff;
  cursor: pointer;
}

/* ---------- Forms and contact ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
html:not(.js) .tabs { display: none; }

.tab {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--purple);
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  font-family: var(--font-label);
  font-size: 22px;
  cursor: pointer;
}
.tab:hover { background: var(--tint); }
.tab[aria-selected="true"] { background: var(--purple); color: #fff; }

.form-panel {
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: #fff;
}
.form-panel + .form-panel { margin-top: 20px; }
.form-panel[hidden] { display: none; }

.form-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 24px;
  border-bottom: 1px solid #ece4f4;
}
.form-panel__title { font-family: var(--font-label); font-weight: 400; font-size: 26px; color: var(--ink); }
.form-panel__open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 19px;
  font-weight: 600;
}
.form-panel__open svg { width: 16px; height: 16px; }

.form-panel__frame {
  display: block;
  width: 100%;
  height: min(85vh, 1200px);
  min-height: 560px;
  border: 0;
}

.form-panel__note {
  margin: 0;
  padding: 16px 24px 20px;
  border-top: 1px solid #ece4f4;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}
.form-panel__note strong { color: var(--ink); font-weight: 600; }

.email-line { margin-top: 24px; font-size: 19px; text-align: center; }

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

.site-footer { background: var(--gradient); color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 32px 48px;
  padding-top: 56px;
}

.footer__title {
  margin-bottom: 14px;
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.footer-grid p { margin-bottom: 10px; font-size: 19px; }

.footer__links { margin: 0; padding: 0; list-style: none; font-size: 19px; }
.footer__links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-dark-link);
  overflow-wrap: anywhere;
}
.footer__links a:hover { color: #fff; }

.social {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 40px 0 0;
  padding: 28px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  list-style: none;
}
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  color: #fff;
}
.social a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.footer-bar {
  padding: 16px 24px;
  background: #1e1229;
  color: #e6e0ee;
  font-size: 17px;
  text-align: center;
}
.footer-bar p + p { margin-top: 4px; }
.footer-bar a { color: var(--on-dark-link); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
