/* ==========================================================================
   HomeFur All — base.css
   --------------------------------------------------------------------------
   Shared foundations used on every page.
   1. Design tokens (colors, fonts, sizes)
   2. Base / reset
   3. Typography
   4.Buttons
   5. Header & navigation
   6. Hero
   7. Leash Divider
   8. Stats band
   10. Section headers and filter pills
   11. Shelter cards
   12. Pet cards
   13. CTA band
   14. Footer
   15. Responsiveness
   16. Print and reduced motion
   ========================================================================== */

/* ---- 1. Design tokens ---- */
:root {
  --moss: #2C4A3B;
  --sand-light: #FAF5E8;
  --coral: #E8785C;
  --ink: #232620;
  --ink-soft: #4A4E43;
  --moss-deep: #1D3229;
  --coral-deep: #D45F42;
  --butter: #F0B94A;
  --line: rgba(35, 38, 32, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
}

/* ---- 2. Base / reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box; /* Makes padding/borders count inside an element's width */
}

/* Elements with the hidden attribute stay hidden even if a class sets display */
[hidden] {
  display: none !important;
}

html {
    scroll-behavior: smooth;
}

/* Adjust 80px to match actual header height */
section[id],
div[id] {
  scroll-margin-top: 80px;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--sand-light);
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* Center content container */
.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- 3. Typography ---- */
h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--moss-deep);
    margin: 0 0 .5em;
    line-height: 1.1;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p {
    margin: 0 0 1em;
    line-height: 1.6;
    color: var(--ink-soft);
}

.eyebrow {
    margin: 0 0 .6em;
    font-family: var(--font-body);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--coral-deep)
}

/* Visible outline when tabbing with a keyboard, for accessibility */
:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 3px;
}

/* ---- 4. Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .85em 1.6em;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

/* Filled coral - main CTA */
.btn-primary {
    background: var(--coral);
    color: #fff;
}
.btn-primary:hover {
    background: var(--coral-deep);
    transform: translateY(-2px);
}

/* Outlined green - secondary action */
.btn-ghost {
    border-color: var(--moss);
    color: var(--moss-deep);
}
.btn-ghost:hover {
    background: var(--moss);
    color: #fff;
}

/* Subtle outline, for grids like "See all shelters" */
.btn-outline {
    display: flex;
    width: fit-content;
    margin: 2.5rem auto 0;
    border-color: var(--line);
    color: var(--moss-deep);
}
.btn-outline:hover {
    border-color: var(--moss);
    background: #fff;
}

/* ---- 5. Header & navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 245, 232, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 76px;
}

.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-right: auto;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--moss-deep);
}
.main-nav {
    display: flex;
    gap: 1.8rem;
}
.main-nav a {
    font-weight: 500;
    font-size: .95rem;
    color: var(--ink);
}
.main-nav a:hover {
    color: var(--coral-deep);
}

/* Mobile CTA button hamburger */
.nav-cta-mobile {
    display: none;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 60;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    margin: 4px 0;
    transition: transform .25s ease, opacity .2s ease;
}

/* Hamburger animation */
.nav-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 6. Hero */
.hero { padding: 4.5rem 0 3rem; }

.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 3.5rem;
    align-items: center;
}
.hero-sub {
    max-width: 46ch;
    font-size: 1.05rem;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.8rem;
    flex-wrap: wrap;
}

/* Photo collage grid design */
.hero-art {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.art-tile {
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--moss);
}
.art-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tile-a {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    aspect-ratio: 3 / 4;
}
.tile-b, .tile-c { aspect-ratio: 1 / 1; }

/* Hero collage slideshow crossfade */
.hero-slideshow {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  width: 100%;
}

.hero-slideshow .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slideshow .slide.active {
  opacity: 1;
}

.stat-chip {
    position: absolute;
    left: 32px;
    bottom: 32px;
    max-width: 168px;
    padding: 1rem 1.3rem;
    background: var(--butter);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(35, 38, 32, 0.18);
}
.stat-chip strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--moss-deep)
}
.stat-chip span {
    font-size: .78rem;
    font-weight: 600;
    color: var(--moss-deep);
}

/* ---- 7. Leash divider ---- */
.leash-divider {
    padding: 14px 0;
    line-height: 0;
}
.leash-divider svg {
    width: 100%;
    height: 40px;
}
.leash-divider.flip svg {
    transform: scaleY(-1);
}

/* ---- 8. Stats band */
.stats {
    max-width: 1180px;
    margin: 0 auto;
    padding: 3rem 24px;
    border-radius: var(--radius);
    background: var(--moss);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    text-align: center;
}
.stat-num {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--butter);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.stat-label { font-size: .85rem; color: #E8E2CF }

/* ---- 9. How to help ---- */
.help { padding: 5rem 0 }
.help h2 { max-width: 20ch; }

.help-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}
.help-card {
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.help-num {
    display: inline-block;
    margin-bottom: .8rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--coral-deep);
}
.link-arrow {
    font-weight: 600;
    font-size: .9rem;
    color: var(--moss-deep)
}
.link-arrow:hover { color:var(--coral-deep); }

/* ---- 10. Section headers & filter pills ---- */
.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.pill {
    padding: .5em 1.1em;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.pill.active {
    background: var(--moss);
    border-color: var(--moss);
    color: #fff;
}

/* ---- 11. Shelter cards ---- */
.shelters { padding: 4rem 0 }
.shelter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.shelter-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}
.shelter-card img { 
    width: 100%; 
    height: 200px;
    object-fit: cover; 
}
.shelter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(35, 38, 32, 0.12);
}

.shelter-body {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.shelter-loc {
    margin-bottom: .6rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--coral-deep)
}
.shelter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: .9rem;
    border-top: 1px solid var(--line);
    font-size: .85rem;
    font-weight: 600;
    color: var(--moss-deep);
}

/* ---- 12. Pet cards */
.pets { padding: 2rem 0 5rem; }
.pet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.3rem;
}
.pet-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .2s ease, box-shadow .2s ease;
}
.pet-card img { 
    width: 100%;
    height: 190px; 
    object-fit: cover; 
}
.pet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(35, 38, 32, 0.12);
}
.pet-body { padding: 1rem 1.2rem 1.3rem; }
.pet-body p { 
    margin: 0; 
    font-size: .85rem;
    color: var(--coral-deep);
    font-weight: 600;
}

/* ---- 13. CTA band */
.cta-band {
    padding: 4.5rem 0;
    background: var(--coral);
}
.cta-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}
.cta-inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}
.cta-inner h2 { color: #fff; }
.cta-inner p { color: #FCE8E1; }
.cta-inner .btn-primary {
    margin-top: .5rem;
    background: var(--moss-deep);
}
.cta-inner .btn-primary:hover { background-color: var(--moss); }

/* ---- 14. Footer ---- */
.site-footer {
    padding: 3.5rem 0 1.5rem;
    background: var(--moss-deep);
    color: #E8E2CF;
}
.footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand .logo { color: #fff }
.footer-brand p {
    margin-top: .6rem;
    font-size: .9rem;
    color: #B9C2B4;
}

.footer-col h4 {
    margin-bottom: 1rem;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08rem;
    color: var(--butter)
}

.footer-col a {
    display: block;
    margin-bottom: .7rem;
    font-size: .9rem;
    color: #D9DED2;
}
.footer-col a:hover { color: #fff; }

.newsletter {
    display: flex;
    gap: .5rem;
}
.newsletter input {
    flex: 1;
    padding: .7em .9em;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: .85rem;
}
.newsletter button {
    background: var(--coral);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .7em 1em;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
}

.footer-bottom {
    padding-top: 1.5rem;
    font-size: .8rem;
    color: #8FA087;
    text-align: center;
}

/* ---- 15. Responsiveness ---- */
@media (max-width: 1024px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .shelter-grid .pet-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .header-inner { gap: 1rem; }
    .logo { font-size: 1.15rem; white-space: nowrap; }
    .main-nav { gap: 1.1rem; }
    .main-nav a { font-size: .85rem; white-space: nowrap; }
    .nav-cta { 
        padding: .7em 1.2em; 
        font-size: .85rem;
        white-space: nowrap; 
    }
}

@media (max-width: 860px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2rem;
    }
    .help-grid {
        grid-template-columns: 1fr;
    }
    .header-inner { gap: .6rem; }
    .logo {
        font-size: 1rem;
        gap: .4rem;
    }
    .logo-mark img {
        width: 26px;
        height: 26px;
    }
    .main-nav { gap: .8rem; }
    .main-nav a { font-size: .78rem; }
    .nav-cta { 
        padding: .65em 1em;
        font-size: .78rem;
    }
}

@media (max-width: 640px) {
    .nav-cta { display: none; }
    .nav-toggle { display: block; }

    .shelter-grid { grid-template-columns: 1fr; }
    .pet-grid { grid-template-columns: 1fr 1fr; }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .stat-chip {
        position: static;
        max-width: none;
        margin-top: 14px;
    }
    /* Mobile dropdown menu */
    .main-nav {
        position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        z-index: 55;
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: .5rem 24px 1.75rem;
        background: rgba(250, 245, 232);
        border-bottom: 1px solid var(--line);
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: 0 24px 30px rgba(35, 38, 32, 0.12);
        opacity: 0;
        visibility: hidden;
        transform: translateY(40px);
        transition: transform .3s ease, opacity .3s ease, visibility .3s;
    }
    .main-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .main-nav a {
        padding: 1.1rem 0;
        font-size: 1.15rem;
        border-bottom: 2px solid var(--line);
    }

    .main-nav a.nav-cta-mobile {
        display: inline-flex;
        margin-top: 1.5rem;
        color: #fff;
    }

    body.nav-open { overflow: hidden }
}

@media (max-width: 480px) {
    .hero-art { grid-template-columns: 1fr; }
    .tile-a {
        grid-column: auto;
        grid-row: auto;
    }
    .tile-a, .tile-b, .tile-c { aspect-ratio: 16 / 10; }
    .footer-inner { grid-template-columns: 1fr; }
}

/* ---- 16. Print & reduced motion ---- */
@media print {
    .site-header,
    .nav-toggle,
    .newsletter {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .btn {
        transition: none;
    }
}

/* ---- Custom Searchable Combobox ---- */
.select-wrapper {
  position: relative;
  width: 100%;
}

.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 99;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
}

.combobox-list[hidden] {
  display: none;
}

.combobox-item {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--ink, #1c2b23);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.combobox-item:hover,
.combobox-item.active {
  background-color: var(--butter, #f4efe2);
  color: var(--moss-deep, #1d3229);
}