* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #1e293b;
  background: #f1f5f9;
  line-height: 1.6;
}

.site-header {
  background: #175D8C;
  color: #85E5C5;
  padding: 24px;
  text-align: center;
}

.site-header h1,
.site-header p {
  margin: 0;
}

/* Navigation */
.site-nav {
  background: #2479B2; 
  padding: 12px;
}

.site-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  list-style: none;
  margin: 0;
  ;
}

.site-nav a {
  color: white;
  font-weight: bold;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Main content */
main {
  max-width: 1100px;
  min-height: 60vh;
  margin: 24px auto;
  padding: 32px;
  background: white;
  border-radius: 8px;
}

/* Footer */
.site-footer {
  background: #233b5d;
  color: white;
  padding: 20px;
  text-align: center;
}

/* Mobile layout */
@media (max-width: 600px) {
  .site-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  main {
    margin: 12px;
    padding: 20px;
  }
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  align-items: stretch;
}

.cat-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: white;
  color: #1e293b;
  box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
}

.cat-card img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.cat-info {
  padding: 14px;
}

.cat-info h2 {
  margin: 0 0 12px;
}

.cat-info p {
  margin: 8px 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .cat-grid {
    grid-template-columns: 1fr;
  }
}

/* Accessible cat gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding: 0;
  list-style: none;
}

.gallery li {
  min-width: 0;
}

.gallery figure {
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 2px solid #d6ded9;
  border-radius: 12px;
  background: white;
  color: #1e293b;
  box-shadow: 0 2px 6px rgb(0 0 0 / 8%);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.gallery img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery figcaption {
  padding: 14px;
}

.gallery figcaption h3 {
  margin: 0 0 12px;
}

.gallery figcaption p {
  margin: 8px 0;
  overflow-wrap: anywhere;
}

/* Hover for mouse users */
@media (hover: hover) {
  .gallery li:hover figure {
    transform: translateY(-4px);
    border-color: #356859;
    box-shadow: 0 8px 20px rgb(0 0 0 / 18%);
  }

  .gallery li:hover img {
    transform: scale(1.03);
  }
}

/* Keyboard focus for interactive content in a card */
.gallery li:focus-within figure {
  border-color: #175cba;
  box-shadow: 0 0 0 3px #b8d8ff;
}

/* Clearly visible keyboard focus */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
}

/* Responsive gallery */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .gallery figure,
  .gallery img {
    transition: none;
  }

  .gallery li:hover figure,
  .gallery li:hover img {
    transform: none;
  }
}

/* Hover effect for generated cat cards */
#cat-grid .cat-card,
#catslist li figure {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

/* Mouse hover */
@media (hover: hover) {
  #cat-grid .cat-card:hover,
  #catslist li:hover figure {
    transform: translateY(-6px);
    border-color: #356859;
    box-shadow: 0 8px 20px rgb(0 0 0 / 18%);
  }

  #cat-grid .cat-card:hover img,
  #catslist li:hover img {
    filter: brightness(1.04);
  }
}

/* Keyboard focus for cards containing links or buttons */
#cat-grid .cat-card:focus-within,
#catslist li:focus-within figure {
  border-color: #175cba;
  box-shadow: 0 0 0 3px #b8d8ff;
}

/* Visible keyboard focus */
#cat-grid a:focus-visible,
#cat-grid button:focus-visible,
#catslist a:focus-visible,
#catslist button:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  #cat-grid .cat-card,
  #catslist li figure {
    transition: none;
  }

  #cat-grid .cat-card:hover,
  #catslist li:hover figure {
    transform: none;
  }
}

/*Donattion Scroller */ 
#donation-amount {
    display: block;
    width: 100%;
    max-width: 400px;
    margin-top: 10px;
    accent-color: #4b8063;
    cursor: pointer;
}

.slider-number {
    max-width: 400px;
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
}

/*Cat Finder*/ 
:root {
  --background: #faf7f2;
  --surface: #ffffff;
  --text: #292b26;
  --muted: #77786f;
  --accent: #496b4b;
  --accent-dark: #365338;
  --border: #e9e5dc;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

button, select {
  font: inherit;
}

.navbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.logo {
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero {
  padding: 80px 20px 65px;
  text-align: center;
  background: #f0eee5;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 16px 0;
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -1.5px;
}

.subtitle {
  max-width: 530px;
  margin: 0 auto;
  color: var(--muted);
}

.search-panel {
  max-width: 570px;
  margin: 32px auto 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 35px #292b260a;
  text-align: left;
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.search-panel select {
  width: 100%;
  padding: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
}

.primary-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.results-section {
  max-width: 1200px;
  min-height: 360px;
  margin: auto;
  padding: 55px 24px 75px;
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.results-heading h2 {
  margin: 4px 0 0;
  font-family: Georgia, serif;
  font-size: 2rem;
}

.result-count {
  color: var(--muted);
  font-size: 0.9rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.cat-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px #292b2610;
}

.cat-photo {
  display: block;
  width: 100%;
  height: 235px;
  object-fit: cover;
  background: #eee9df;
}

.cat-info {
  padding: 20px;
}

.cat-info h3 {
  margin: 0 0 5px;
  font-family: Georgia, serif;
  font-size: 1.45rem;
}

.cat-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.cat-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0;
  color: #5d5e56;
  font-size: 0.92rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.adopt-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.adopt-link:hover {
  text-decoration: underline;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 45px 20px;
  border: 1px dashed #d8d2c6;
  border-radius: var(--radius);
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
}

.empty-state h3 {
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--muted);
}

footer {
  padding: 25px 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (max-width: 850px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding-top: 60px;
  }
}

@media (max-width: 560px) {
  .navbar {
    height: 65px;
    padding: 0 20px;
  }

  .nav-label {
    font-size: 0.75rem;
  }

  .cat-grid {
    grid-template-columns: 1fr;
  }

  .cat-photo {
    height: 260px;
  }

  .search-panel {
    padding: 18px;
  }

  .results-section {
    padding: 40px 18px;
  }

  .results-heading h2 {
    font-size: 1.6rem;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 16px;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f3f7f2;
  color: #24352b;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 32px #203c2512;
}

.paw {
  font-size: 40px;
  text-align: center;
}

h1, h2 {
  text-align: center;
}

h1 {
  margin-bottom: 8px;
  font-size: 28px;
}

.intro, #status, .privacy {
  text-align: center;
  line-height: 1.6;
}

#status {
  font-size: 14px;
  min-height: 24px;
}

label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 600;
}

input, select, button {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border-radius: 10px;
  font: inherit;
}

input, select {
  border: 1px solid #ccd7ce;
  background: #fff;
  color: #24352b;
}

button {
  margin-top: 12px;
  border: none;
  background: #175D8C;
  color: white;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: #175D8C;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #e6a23c;
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondary {
  margin-top: 22px;
}

.divider {
  margin: 24px 0 8px;
  text-align: center;
  color: #758278;
  font-size: 13px;
}

#result {
  margin-top: 28px;
  padding: 18px;
  border-radius: 12px;
  background: #eff7ef;
  line-height: 1.6;
}

#result h2 {
  margin-top: 0;
}

.note {
  font-size: 14px;
}

#catsLink {
  display: inline-block;
  color: #175D8C;
  font-weight: 700;
}

.privacy {
  margin-top: 26px;
  color: #68756c;
  font-size: 12px;
}

@media (max-width: 480px) {
  .container {
    padding: 24px 18px;
  }
}

/*Catfinder grid*/
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cat-card {
  overflow: hidden;
  border: 1px solid #e0e8e0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px #203c2510;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px #203c2520;
}

.cat-card img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #eff3ed;
}

.cat-card-content {
  padding: 16px;
}

.cat-card h3 {
  margin: 0 0 8px;
  color: #24352b;
  font-size: 20px;
}

.cat-card p {
  color: #5b695e;
  line-height: 1.5;
  font-size: 14px;
}

.cat-card a {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #175D8C;
  color: white;
  text-decoration: none;
  font-weight: 600;
}

.cat-card a:hover {
  background: #1d5c39;
}

#catCount {
  color: #68756c;
}

.cat-message {
  grid-column: 1 / -1;
  padding: 20px;
  border-radius: 12px;
  background: #eff7ef;
  line-height: 1.6;
}


/* Main adoption form container */

#cats-list {
    width: 100%;
}

#adoption-form {
    width: 100%;
    max-width: 680px;
    margin: 25px auto;
    padding: 0;
}

/* Introductory text */

#cats-list > p {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Fieldsets */

#adoption-form fieldset {
    min-width: 0;
    width: 100%;
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid #d6ded9;
    border-radius: 12px;
    background: #ffffff;
}

#adoption-form legend {
    padding: 0 8px;
    color: #175D8C;
    font-weight: bold;
    font-size: 1.05rem;
}

/* Nested fieldsets */

#adoption-form fieldset fieldset {
    margin-top: 16px;
    padding: 15px;
    background: #f8faf9;
}

/* Labels */

#adoption-form label {
    display: block;
    margin: 10px 0 6px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.5;
}

/* Text-based inputs and dropdowns */

#adoption-form input[type="text"],
#adoption-form input[type="email"],
#adoption-form input[type="tel"],
#adoption-form input[type="date"],
#adoption-form select {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px;
    margin: 5px 0 16px;
    border: 1px solid #b8c6ce;
    border-radius: 7px;
    background: #ffffff;
    color: #1e293b;
    font: inherit;
    font-size: 16px;
}

/* Textarea - fixed size */

#adoption-form textarea {
    display: block;
    width: 100%;
    height: 140px;
    min-height: 140px;
    max-height: 140px;
    padding: 12px;
    margin: 10px 0 16px;
    border: 1px solid #b8c6ce;
    border-radius: 7px;
    background: #ffffff;
    color: #1e293b;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
}

/* Textarea instructions */

#adoption-form #reason-help {
    margin: 5px 0;
    color: #64748b;
    font-size: 0.9rem;
}

/* =========================================
   CHECKBOXES AND RADIO BUTTONS
========================================= */

/* Individual checkbox and radio controls */

#adoption-form input[type="checkbox"],
#adoption-form input[type="radio"] {
    display: inline-block;
    width: 21px;
    height: 21px;
    min-height: 21px;
    margin: 0 10px 0 0;
    padding: 0;
    vertical-align: middle;
    accent-color: #2479B2;
    cursor: pointer;
    flex-shrink: 0;
}

/* Labels next to checkbox and radio controls */

#adoption-form input[type="checkbox"] + label,
#adoption-form input[type="radio"] + label {
    display: inline-flex;
    align-items: center;
    width: calc(100% - 36px);
    min-height: 44px;
    margin: 0;
    padding: 7px 4px;
    vertical-align: middle;
    font-weight: normal;
    cursor: pointer;
}

/* Paragraphs inside choice groups */

#adoption-form fieldset fieldset p {
    margin: 5px 0 12px;
}

/* Other pets conditional section */

#other-pets-details {
    margin: 8px 0;
    padding: 10px;
    border-left: 3px solid #2479B2;
    background: #f1f5f9;
}

/* =========================================
   DONATION SLIDER
========================================= */

#adoption-form input[type="range"] {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 15px 0;
    accent-color: #2479B2;
    cursor: pointer;
}

#adoption-form .slider-number {
    font-weight: bold;
    color: #175D8C;
}

/* =========================================
   BUTTONS
========================================= */

#adoption-form button {
    display: inline-block;
    width: 100%;
    min-height: 48px;
    margin: 8px 0;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: #175D8C;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

#adoption-form button:hover {
    background: #2479B2;
}

#adoption-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Clear and review sections */

#adoption-form #clear-confirmation,
#adoption-form #review-section {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid #d6ded9;
    border-radius: 10px;
    background: #f8faf9;
}

/* Form status */

#adoption-form #form-status {
    margin-top: 15px;
    font-weight: bold;
}

/* =========================================
   KEYBOARD ACCESSIBILITY
========================================= */

#adoption-form input:focus-visible,
#adoption-form select:focus-visible,
#adoption-form textarea:focus-visible,
#adoption-form button:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

/* =========================================
   TABLET AND DESKTOP
========================================= */

@media (min-width: 600px) {

    #adoption-form {
        padding: 0 15px;
    }

    #adoption-form fieldset {
        padding: 22px;
    }

    #adoption-form fieldset fieldset {
        padding: 18px;
    }

    #adoption-form button {
        width: auto;
        min-width: 180px;
    }

    #adoption-form textarea {
        height: 150px;
        min-height: 150px;
        max-height: 150px;
    }
}

/* =========================================
   SMALL MOBILE SCREENS
========================================= */

@media (max-width: 400px) {

    #adoption-form fieldset {
        padding: 12px;
    }

    #adoption-form legend {
        font-size: 0.95rem;
    }

    #adoption-form textarea {
        height: 130px;
        min-height: 130px;
        max-height: 130px;
    }

    #adoption-form button {
        font-size: 15px;
    }
}

/* Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
    #adoption-form button {
        transition: none;
    }
}

/* Centre adoption form buttons */

#adoption-form button {
    display: block;
    margin: 12px auto;
}

/* Main cats page */

#cats-list {
    width: 100%;
    max-width: 1100px;
    margin: 20px auto;
    padding: 20px;
}

/* Cat grid - mobile first */
/* Mobile: One column */
.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
    width: 100%;
}

/* Individual cat cards */
.cat-card {
    min-width: 0;
    overflow: hidden;
    border: 2px solid #175D8C;
    border-radius: 12px;
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 3px 8px rgb(0 0 0 / 10%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Cat images */
.cat-card img,
.cat-photo {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Cat information */
.cat-info,
.cat-card-content {
    padding: 16px;
}

.cat-card h2,
.cat-card h3 {
    margin-top: 0;
    color: #175D8C;
}

.cat-card p {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Adoption links */
.cat-card a,
.adopt-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 7px;
    background: #175D8C;
    color: white;
    font-weight: bold;
    text-decoration: none;
}

/* Tablet: Two columns */
@media (min-width: 600px) {
    .cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cat-card img,
    .cat-photo {
        height: 200px;
    }
}

/* Desktop: Three columns */
@media (min-width: 950px) {
    .cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cat-card img,
    .cat-photo {
        height: 220px;
    }
}

/* Hover effects for mouse users */
@media (hover: hover) {
    .cat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 18px rgb(0 0 0 / 15%);
    }
}

/* Keyboard accessibility */
.cat-card:focus-within {
    outline: 3px solid #2479B2;
    outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cat-card {
        transition: none;
    }

    .cat-card:hover {
        transform: none;
    }
}


/* Adoption thank-you message */

#thank-you-section {
    max-width: 650px;
    margin: 30px auto;
    padding: 35px 20px;
    border: 2px solid #175D8C;
    border-radius: 12px;
    background: #f1f5f9;
    text-align: center;
}

#thank-you-section h2 {
    color: #175D8C;
    margin-top: 0;
}

#thank-you-section p {
    line-height: 1.7;
}

/* Hidden sections */

[hidden] {
    display: none !important;
}

#cats-list > h2 {
    margin-bottom: 0;
    text-align: left;
    color: #175D8C;
}

.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 16px;
    width: 100%;
}

/* Tablet */
@media (min-width: 600px) {
    .cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Desktop */
@media (min-width: 950px) {
    .cat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}