/* Shared colours and page layout. No external fonts or libraries are needed. */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8f6ef;
  color: #23372e;
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

a {
  color: #245139;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1, h2, h3 {
  line-height: 1.25;
}

h1 {
  margin: 0 0 20px;
  font-size: 2.5rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.15rem;
}

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

header, footer {
  background: #e9f1e9;
}

header {
  border-bottom: 1px solid #cad7ca;
}

.header-inner, .footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-name {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}

.site-name a {
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

header nav a {
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}

header nav a:hover {
  background: #dbe7da;
}

header nav a[aria-current="page"] {
  color: white;
  background: #31684d;
  font-weight: bold;
}

main {
  width: 100%;
  max-width: 1040px;
  flex: 1;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.page-intro {
  max-width: 760px;
  margin-bottom: 24px;
}

.page-intro p {
  font-size: 1.1rem;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

.footer-title {
  font-weight: bold;
}

.footer-inner > a {
  padding: 10px 0;
}

/* Keep visible outlines for people who navigate with the keyboard. */
:focus-visible {
  outline: 3px solid #9c4c0b;
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 1;
  padding: 12px;
  color: #23372e;
  background: white;
}

.skip-link:focus {
  top: 8px;
}

[id] {
  scroll-margin-top: 20px;
}

/* Homepage: a simple introduction and three next steps. */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 32px;
  padding: 12px 0 40px;
}

.hero h1 {
  font-size: 3rem;
}

.eyebrow {
  color: #455f4c;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-photo {
  min-width: 0;
  margin: 0;
}

.hero-photo img {
  width: 100%;
  border-radius: 16px;
}

figcaption, .small-note {
  color: #45564c;
  font-size: 0.9rem;
}

figcaption {
  margin-top: 10px;
}

.home-explore {
  margin: 12px 0 32px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.step-number {
  color: #31684d;
  font-size: 1.3rem;
  font-weight: bold;
}

/* Animal cards and in-page links. */
.animal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.animal-card, .quiz-card, .checklist-card, .info-note {
  min-width: 0;
  padding: 24px;
  border: 1px solid #cad7ca;
  border-radius: 12px;
  background: white;
}

.animal-card p:last-child, .info-note p:last-child {
  margin-bottom: 0;
}

.animal-icon {
  font-size: 2rem;
}

.animal-card h2 {
  margin: 8px 0 12px;
}

.animal-card ul {
  padding-left: 20px;
}

.animal-card li {
  margin-bottom: 8px;
}

.animal-links a {
  padding: 9px 14px;
  border: 1px solid #809780;
  border-radius: 24px;
  background: white;
}

.animal-links a:hover {
  background: #e9f1e9;
}

.animal-card:target {
  border-color: #31684d;
  outline: 2px solid #31684d;
  outline-offset: 3px;
}

.animal-next-steps {
  margin-top: 28px;
  padding: 24px;
  border-radius: 12px;
  background: #e9f1e9;
}

/* Shared buttons are large enough to tap on a phone. */
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.quiz-button, .primary-link, .secondary-button {
  display: inline-block;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #31684d;
  border-radius: 8px;
  font: inherit;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.quiz-button, .primary-link {
  background: #31684d;
  color: white;
}

.quiz-button:hover, .primary-link:hover {
  background: #245139;
}

.secondary-button {
  background: white;
  color: #245139;
}

.secondary-button:hover {
  background: #e9f1e9;
}

/* Quiz choices and result cards. */
.quiz-card {
  max-width: 760px;
  margin: 20px 0;
}

.quiz-card fieldset {
  min-width: 0;
  margin: 0 0 28px;
  padding: 0;
  border: 0;
}

.quiz-card legend {
  max-width: 100%;
  margin-bottom: 12px;
  font-size: 1.1rem;
  font-weight: bold;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #809780;
  border-radius: 8px;
  cursor: pointer;
}

.quiz-option:hover, .quiz-option:has(input:checked) {
  background: #e9f1e9;
}

.quiz-option:has(input:checked) {
  border-color: #31684d;
}

.quiz-option input, .check-row input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  accent-color: #31684d;
}

#quiz-progress {
  font-weight: bold;
}

#quiz-message:not(:empty) {
  margin-bottom: 0;
  padding: 12px;
  border-left: 4px solid #9c4c0b;
  background: #fff4e7;
}

.match-result {
  margin: 32px 0;
}

.match-result .animal-grid {
  grid-template-columns: 1fr;
}

.match-result .animal-card p {
  overflow-wrap: anywhere;
}

/* Preparation checklist: saved by care.js in this browser. */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 8px;
  border-bottom: 1px solid #cad7ca;
  cursor: pointer;
}

.check-row:has(input:checked) {
  background: #e9f1e9;
}

#care-progress {
  display: block;
  width: 100%;
  height: 16px;
  margin-top: 8px;
  accent-color: #31684d;
}

#care-items {
  margin-bottom: 20px;
}

/* Stack the layouts on tablets and phones; no separate mobile menu needed. */
@media (max-width: 760px) {
  .hero, .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 24px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  main {
    padding: 28px 16px 40px;
  }

  .header-inner, .footer-inner {
    padding: 16px;
  }

  header nav {
    width: 100%;
    gap: 4px;
  }

  header nav a {
    padding: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .animal-grid {
    grid-template-columns: 1fr;
  }

  .animal-card, .quiz-card, .checklist-card, .info-note, .animal-next-steps {
    padding: 18px;
  }

  .hero .button-row > a {
    width: 100%;
  }
}

/* Pet photo carousel: one visible slide at a time. */
.pet-carousel { min-width: 0; }
.carousel-slide { margin: 0; }
.carousel-slide img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; }
.carousel-slide figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.carousel-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.carousel-controls button {
  min-width: 44px; min-height: 44px; padding: 8px 12px;
  border: 1px solid #31684d; border-radius: 8px; background: white;
  color: #245139; font: inherit; cursor: pointer;
}
.carousel-controls button:hover { background: #e9f1e9; }
.carousel-controls #carousel-toggle { margin-left: auto; }

/* The overview shows short links. The full care text lives on each detail page. */
.pet-tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.pet-tile { min-width: 0; background: white; border: 1px solid #cad7ca; border-radius: 12px; overflow: hidden; }
.pet-tile-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.pet-tile-link:hover { background: #f2f7f1; }
.pet-tile-link:hover .pet-tile-more { text-decoration: underline; }
.pet-tile:target { outline: 3px solid #31684d; outline-offset: 3px; }
.pet-tile-image { display: block; width: 100%; height: 190px; object-fit: cover; }
.pet-tile-body { display: grid; gap: 10px; padding: 18px; }
.pet-tile-title { font-size: 1.25rem; font-weight: bold; }
.pet-tile-more { color: #245139; font-weight: bold; }

.breadcrumb { margin-bottom: 24px; }
.pet-detail { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 28px; }
.pet-detail-lead { font-size: 1.2rem; }
.pet-detail-image { width: 100%; max-height: 380px; object-fit: cover; border-radius: 16px; }
.pet-care-detail { grid-column: 1 / -1; padding: 24px; border: 1px solid #cad7ca; border-radius: 12px; background: white; }
.pet-care-detail h2 { margin-top: 0; }
.detail-next { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
@media (max-width: 760px) {
  .pet-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-detail { grid-template-columns: 1fr; }
  .pet-care-detail { grid-column: auto; }
}
@media (max-width: 600px) {
  .pet-tile-grid { grid-template-columns: 1fr; }
  .pet-tile-image { height: 210px; }
  .carousel-slide figcaption { display: block; }
  .carousel-slide figcaption a { display: block; }
}

/* Expanded animal guides: short jump links and readable care sections. */
.guide-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}
.guide-jump a {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid #809780;
  border-radius: 24px;
  background: white;
  text-decoration: none;
}
.guide-jump a:hover { background: #e9f1e9; }
.guide-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.guide-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid #cad7ca;
  border-radius: 12px;
  background: white;
}
.guide-panel:target {
  border-color: #31684d;
  outline: 2px solid #31684d;
  outline-offset: 2px;
}
.guide-panel h2 { margin-top: 0; }
.guide-panel h3 { margin-bottom: 8px; }
.guide-panel ul { padding-left: 22px; }
.guide-panel li { margin-bottom: 12px; }
.guide-panel li:last-child { margin-bottom: 0; }
.guide-note { color: #45564c; font-size: .92rem; }
@media (max-width: 760px) {
  .guide-sections { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .guide-panel { padding: 18px; }
}

/* New friends: soft photo entrance; respect visitors who prefer less motion. */
.pet-portrait { margin: 0; min-width: 0; }
.photo-credit { font-size: .8rem; overflow-wrap: anywhere; }
.pet-species { color: #455f4c; font-size: .9rem; }
@media (prefers-reduced-motion: no-preference) {
  .carousel-slide.is-active img { animation: photo-hello .65s ease-out; }
  @keyframes photo-hello { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
