/*
Theme Name: GPPR
Theme URI: https://greatpointers.org
Author: Great Plains Pointer Rescue
Description: Custom theme for Great Plains Pointer Rescue (GPPR), a foster-based German Shorthaired Pointer rescue in Nebraska and Iowa. Centered layout with a photo-forward hero. Dog listings wire to the RescueGroups API (added later).
Version: 0.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
*/

:root {
    --forest: #33513a;
    --forest-dark: #22382a;
    --rust: #b45f31;
    --rust-dark: #93491f;
    --cream: #faf7f1;
    --sand: #efe7d8;
    --ink: #2a2a26;
    --muted: #6b6a63;
    --line: #e2dccf;
    --radius: 14px;
    --wrap: 1080px;
    --font-body: "Helvetica Neue", Arial, sans-serif;
    --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rust-dark); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; color: var(--forest-dark); }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 0 0 .75rem; }
h3 { font-size: 1.2rem; margin: 0 0 .4rem; }

/* Buttons */
.btn {
    display: inline-block; padding: .85rem 1.5rem; border-radius: 999px;
    font-weight: 700; text-decoration: none; border: 2px solid transparent;
    transition: transform .05s ease, background .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--rust); color: #fff; }
.btn-primary:hover { background: var(--rust-dark); }
.btn-outline { border-color: var(--forest); color: var(--forest-dark); }
.btn-outline:hover { background: var(--forest); color: #fff; }

/* ---------- Header (centered) ---------- */
.site-header {
    background: var(--cream); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
    display: flex; flex-direction: column; align-items: center; gap: .4rem;
    padding-top: 1rem; padding-bottom: .6rem; text-align: center;
}
.brand {
    font-family: var(--font-head); font-weight: 700; color: var(--forest-dark);
    text-decoration: none; font-size: 1.5rem; letter-spacing: .01em;
}
.brand span { color: var(--rust); }
.brand-logo { display: inline-block; line-height: 0; }
.brand-logo img { height: 104px; width: auto; }
.main-nav ul {
    list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 1.3rem; margin: 0; padding: 0;
}
.main-nav a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.main-nav a:hover { color: var(--rust-dark); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--forest-dark); }

/* ---------- Hero (photo-ready, centered) ---------- */
.hero {
    /* Layers (top to bottom): green overlay for text legibility, the hero photo,
       then a green gradient fallback shown if the photo file is missing. */
    background:
        linear-gradient(rgba(34,56,42,.52), rgba(34,56,42,.68)),
        url('assets/hero.jpg') center 18% / cover no-repeat,
        radial-gradient(120% 120% at 50% 0%, #3c5e43, #223829 70%);
    color: #fff; text-align: center;
    min-height: 82vh;
    display: flex; align-items: center;
    padding: clamp(3rem, 7vw, 5rem) 0;
}
.hero > .wrap { width: 100%; }
.hero .tagline {
    font-family: var(--font-head); font-style: italic;
    color: #f0d9c7; font-size: clamp(1.05rem, 2.4vw, 1.4rem); margin: 0 0 .5rem;
}
.hero h1 { color: #fff; max-width: 20ch; margin-left: auto; margin-right: auto; }
.hero p.lead { font-size: 1.15rem; max-width: 60ch; margin: 1rem auto 0; color: rgba(255,255,255,.92); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.75rem; }
.hero .btn-outline { border-color: rgba(255,255,255,.8); color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--forest-dark); }

/* ---------- Sections (centered) ---------- */
.section { padding: clamp(2.6rem, 6vw, 4rem) 0; text-align: left; }
.section--alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { position: relative; }
.section h2::after {
    content: ""; display: block; width: 56px; height: 3px; background: var(--rust);
    margin: .7rem 0 0; border-radius: 2px;
}
.section p { max-width: 66ch; }

/* The homepage keeps its centered treatment; every other page aligns left. */
.home .section { text-align: center; }
.home .section h2::after { margin: .7rem auto 0; }
.home .section p { margin-left: auto; margin-right: auto; }
.lead-list {
    display: inline-block; text-align: left; margin: 1rem auto 0; padding-left: 1.2rem;
    max-width: 60ch;
}
.lead-list li { margin: .35rem 0; }
.mt-1 { margin-top: 1.25rem; }

/* Content pages (Adoption Info, Volunteer, Surrender, etc.): a centered,
   comfortable reading column with LEFT-aligned text, so the heading and body
   share the same left edge. The homepage stays centered (front-page.php). */
/* Every non-home page's content sits in this centered column with left-aligned
   text: balanced on the page, but reads left. Same width everywhere so pages
   line up with each other. */
/* Text pages use a narrow reading column; gallery/display pages (dogs, carousels,
   the foster form) use a wider column so cards and the form have room. Both are
   centered with left-aligned text. */
.page-article { max-width: 760px; margin: 0 auto; text-align: left; }
.page-wide { max-width: 1040px; margin: 0 auto; }
/* Display pages that center their text (Honors, Successful Adoptions). */
.page-wide--center { text-align: center; }
.page-wide--center p { margin-left: auto; margin-right: auto; }
/* Nudge the narrow text column slightly right of center on wider screens. */
@media (min-width: 1000px) {
    .page-article { transform: translateX(40px); }
}
.page-content { margin-top: 1rem; }
.page-content h2 { margin-top: 1.75rem; }
.page-content h2::after { margin-left: 0; }
.page-content ul, .page-content ol { padding-left: 1.4rem; margin: .75rem 0 0; }
.page-content li { margin: .4rem 0; }
.page-content .btn { margin-top: 1.25rem; }

/* ---------- Dog cards ---------- */
.dog-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem; margin: 1.75rem auto 0; text-align: left; max-width: var(--wrap);
}
.dog-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.dog-card:hover {
    transform: translateY(-3px); box-shadow: 0 8px 20px rgba(34,56,42,.12);
    border-color: var(--rust);
}
.dog-card .photo {
    aspect-ratio: 4 / 3; background: var(--sand); width: 100%;
    display: flex; align-items: center; justify-content: center; font-size: 2rem; opacity: .5;
}
.dog-card .body { padding: 1rem; }
.dog-card h3 { margin-bottom: .25rem; }
.dog-card .meta { color: var(--muted); font-size: .9rem; margin: 0; }
.dog-card__cta { display: inline-block; margin-top: .6rem; color: var(--rust-dark); font-weight: 700; font-size: .9rem; }

/* ---------- Embedded form (Foster Application) ---------- */
.form-embed { max-width: 840px; margin: 1.5rem 0 0; }
.form-embed iframe {
    width: 100%; height: 1500px; border: 1px solid var(--line);
    border-radius: var(--radius); background: #fff;
}

/* ---------- Single dog detail ---------- */
.dog-back { text-align: left; margin: 0 0 1rem; }
.dog-detail {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2.25rem;
    text-align: left; align-items: start; max-width: 980px; margin: 0 auto;
}
.dog-detail__photo {
    aspect-ratio: 4 / 5; background: var(--sand); border: 1px solid var(--line);
    border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 1.1rem;
}
.dog-detail__info { text-align: left; }
.dog-status {
    display: inline-block; background: #e5efe4; color: var(--forest-dark);
    font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
    padding: .25rem .7rem; border-radius: 999px;
}
.dog-detail h1 { margin: .6rem 0 1rem; }
.dog-facts {
    list-style: none; padding: 0; margin: 0 0 1.25rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.25rem;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0;
}
.dog-facts li { display: flex; flex-direction: column; }
.dog-facts li span { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .1rem; }
.dog-desc p { max-width: none; margin: 0 0 .9rem; }
.dog-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
@media (max-width: 760px) {
    .dog-detail { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Carousels (Honors & Memorials, Successful Adoptions) ---------- */
.carousel-wrap { display: flex; align-items: center; gap: .5rem; margin: 1.5rem 0 1rem; }
.carousel {
    display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: .5rem .25rem 1rem; flex: 1; scroll-behavior: smooth;
}
.carousel > * { scroll-snap-align: start; flex: 0 0 auto; }
.carousel-nav {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--forest-dark);
    font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.carousel-nav:hover { background: var(--forest); color: #fff; border-color: var(--forest); }

.memorial-card, .success-card {
    width: 230px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; text-align: center;
}
.memorial-card .photo, .success-card .photo {
    aspect-ratio: 1 / 1; background: var(--sand); display: flex;
    align-items: center; justify-content: center; font-size: 2rem; opacity: .5;
}
.memorial-card h3, .success-card h3 { margin: .75rem .75rem .25rem; }
.memorial-card p, .success-card .meta { margin: 0 .9rem 1rem; color: var(--muted); font-size: .9rem; }

/* Successful Adoptions: search + A-Z index */
.success-controls { display: flex; flex-direction: column; align-items: center; gap: .75rem; margin-top: 1rem; }
.success-search {
    width: 100%; max-width: 360px; padding: .6rem .9rem; border: 1px solid var(--line);
    border-radius: 999px; font-size: 1rem;
}
.az-index { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; }
.az-letter {
    width: 32px; height: 32px; border: 1px solid var(--line); background: #fff;
    border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--forest-dark);
}
.az-letter:hover:not(:disabled) { background: var(--sand); }
.az-letter.active { background: var(--rust); color: #fff; border-color: var(--rust); }
.az-letter:disabled { opacity: .3; cursor: default; }
.success-empty { margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-dark); color: #e9efe7; margin-top: 3rem; text-align: center; }
.site-footer .wrap { padding: 2.75rem 1.25rem; }
.site-footer p { max-width: 60ch; margin: .5rem auto; }
.site-footer a { color: #f0d9c7; }
.social-link { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; text-decoration: none; }
.social-link:hover { text-decoration: underline; }
.site-footer .fine { color: #a9bfa8; font-size: .85rem; margin-top: 1rem; }

@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: .6rem; padding: .75rem 0 .25rem; }
}
