/*
Theme Name: Liberty Equine Rescue
Theme URI: https://libertyequinerescue.org/
Author: Liberty Equine Rescue
Description: A warm, modern theme for Liberty Equine Rescue, a 501(c)(3) nonprofit dedicated to rescuing, rehabilitating, and rehoming unwanted, abused, or neglected horses. Built from the original site content recovered via the Internet Archive.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: liberty-equine-rescue
Tags: nonprofit, charity, responsive, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0;
    font-family: 'Amaranth', 'Helvetica Neue', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: #2b2620;
    background: #faf7f2;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #a3201f; text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: #6f1414; text-decoration: underline; }
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.25; color: #2b2620; margin: 0 0 .5em; }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid #e3dccb; margin: 2rem 0; }
.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute; width: 1px; word-wrap: normal !important;
}

/* ===== Layout ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4.5rem 0; }
.section--alt { background: #fff; }
.section--dark { background: #2b2620; color: #f7f1e6; padding: 4rem 0; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #f7f1e6; }
.section--dark a { color: #f0c98b; }
.section h2 { margin-bottom: 1.25rem; }
/* Consistent vertical rhythm — every section gets ~1rem under its main h2 */
.section > .container > h2:first-child + p { margin-top: 0; }

/* ===== Header ===== */
.site-header {
    background: #fff;
    border-bottom: 4px solid #a3201f;
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 0;
    gap: 1rem;
}
.site-branding { display: flex; align-items: center; gap: .75rem; }
.site-branding img { width: 56px; height: 56px; object-fit: contain; }
.site-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; margin: 0; }
.site-title a { color: #2b2620; }
.site-tagline { font-size: .75rem; color: #6b5a45; letter-spacing: .05em; text-transform: uppercase; }

/* ===== Navigation ===== */
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.main-nav a {
    color: #2b2620;
    font-weight: 600;
    padding: .5rem 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav .current-menu-item > a {
    color: #a3201f;
    border-color: #a3201f;
    text-decoration: none;
}
.nav-toggle {
    display: none;
    background: none; border: 2px solid #a3201f;
    color: #a3201f; padding: .35rem .8rem; border-radius: 4px;
    font-weight: 700; cursor: pointer;
}
/* Mobile-nav rules consolidated in the responsive section at the end of this file. */

/* ===== Hero ===== */
.hero {
    position: relative;
    background: linear-gradient(135deg, #6f1414 0%, #2b2620 100%);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 6rem 0;
    text-align: center;
}
.hero h1 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: .5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero p { font-size: 1.25rem; max-width: 720px; margin: 0 auto 2rem; }
.hero .button { display: inline-block; }

/* ===== Buttons ===== */
.button {
    display: inline-block;
    background: #a3201f;
    color: #fff !important;
    padding: .85rem 1.75rem;
    font-weight: 700;
    border-radius: 4px;
    border: 2px solid #a3201f;
    text-transform: uppercase;
    letter-spacing: .05em;
    transition: all .15s ease;
    cursor: pointer;
}
.button:hover, .button:focus {
    background: #6f1414;
    border-color: #6f1414;
    text-decoration: none;
    transform: translateY(-1px);
}
.button--ghost {
    background: transparent;
    color: #a3201f !important;
}
.button--ghost:hover { background: #a3201f; color: #fff !important; }
.button--large { font-size: 1.1rem; padding: 1rem 2.25rem; }

/* ===== Cards / Grid ===== */
.grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.card__media { aspect-ratio: 4/3; overflow: hidden; background: #f0e9da; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.25rem 1.5rem 1.5rem; }
.card__body h3 { margin-top: 0; }
.card__body p { color: #5e5240; margin-bottom: 1rem; }

/* ===== Wish list table ===== */
.wishlist {
    max-width: 540px;
    margin: 1.5rem auto;
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    overflow: hidden;
}
.wishlist__row {
    display: flex; justify-content: space-between; align-items: center;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #f0e9da;
}
.wishlist__row:last-child { border-bottom: 0; }
.wishlist__row span:last-child { font-weight: 700; color: #a3201f; }

/* ===== Page content ===== */
.page-content { padding: 3rem 0; }
.page-content article { max-width: 800px; margin: 0 auto; }
.entry-title { text-align: center; margin-bottom: 2rem; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.entry-content blockquote {
    border-left: 4px solid #a3201f;
    padding: .5em 1em;
    color: #6b5a45;
    font-style: italic;
    margin: 1.5em 0;
}

/* ===== Mission strip ===== */
.mission-strip {
    background: #a3201f;
    color: #fff;
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* ===== Stats / quick facts ===== */
.facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    text-align: center;
    margin: 2rem 0;
}
.facts__item {
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    padding: 1.5rem 1rem;
}
.facts__item strong {
    display: block;
    font-size: 1.6rem;
    color: #a3201f;
    font-family: 'Playfair Display', Georgia, serif;
}
.facts__item span { font-size: .9rem; color: #6b5a45; }

/* ===== Footer ===== */
.site-footer {
    background: #2b2620;
    color: #d8ccb4;
    padding: 3rem 0 1.5rem;
    font-size: .95rem;
}
.site-footer h4 { color: #f7f1e6; font-family: inherit; font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .75rem; }
.site-footer a { color: #f0c98b; }
.site-footer__grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 2rem;
}
.site-footer__bottom {
    border-top: 1px solid #4a3f2e;
    padding-top: 1.25rem;
    text-align: center;
    font-size: .85rem;
    color: #a3937a;
}
.social-icon { display: inline-flex; align-items: center; gap: .5rem; }
.social-icon img { width: 28px; height: 28px; }

/* ===== Story grid (homepage Our Story) ===== */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem 2.5rem;
    margin-top: 1rem;
}
.story-block h3 {
    color: #a3201f;
    margin-bottom: .5rem;
    font-size: 1.2rem;
}
.story-block p {
    color: #5e5240;
    margin: 0;
}

/* ===== Horse feature cards — unified layout, no left/right alternating ===== */
.horse-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
    margin: 1.5rem 0;
}
.horse-feature {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(43,38,32,.04);
    transition: transform .15s ease, box-shadow .15s ease;
}
.horse-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(43,38,32,.08);
}
.horse-feature__media {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0e9da;
}
.horse-feature__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.horse-feature__body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.horse-feature__body h3 {
    margin: .5rem 0 .35rem;
    font-size: 1.45rem;
}
.horse-feature__body p {
    color: #5e5240;
    margin: 0 0 .75rem;
    font-size: .95rem;
    line-height: 1.55;
}
.horse-feature__body p:last-child {
    margin-bottom: 0;
}
.horse-feature__status {
    align-self: flex-start;
    background: #a3201f;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .25em .7em;
    border-radius: 3px;
}
.horse-feature__status--sanctuary { background: #6b5a45; }
.horse-feature__status--rehab     { background: #c47a2c; }
.horse-group {
    margin-top: 3rem;
}
.horse-group:first-of-type { margin-top: 1.5rem; }
.horse-group__title {
    text-align: center;
    font-size: 1.6rem;
    margin: 0 0 .25rem;
}
.horse-group__intro {
    text-align: center;
    color: #6b5a45;
    max-width: 640px;
    margin: 0 auto 1.5rem;
    font-size: .95rem;
}

/* ===== Pledge grid (Standards section) ===== */
.pledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.pledge-item {
    background: #faf7f2;
    border-left: 3px solid #a3201f;
    padding: 1.1rem 1.25rem;
    border-radius: 0 4px 4px 0;
}
.pledge-item h4 {
    margin: 0 0 .4rem;
    color: #2b2620;
    font-family: 'Amaranth', sans-serif;
    font-size: 1rem;
    font-weight: 700;
}
.pledge-item p {
    margin: 0;
    color: #5e5240;
    font-size: .92rem;
}

/* ===== Support cards (Ways to Help) ===== */
.support-card {
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease;
}
.support-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.support-card__icon {
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: .75rem;
}
.support-card h3 {
    font-size: 1.15rem;
    margin: 0 0 .75rem;
    color: #2b2620;
}
.support-card p {
    color: #5e5240;
    margin: 0 0 .5rem;
    font-size: .95rem;
}
.support-card a { font-weight: 600; }

/* ===== Wishlist bullets ===== */
.wishlist-bullets {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    overflow: hidden;
}
.wishlist-bullets li {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0e9da;
}
.wishlist-bullets li:last-child { border-bottom: 0; }
.wishlist-bullets li span { color: #6b5a45; font-style: italic; }

/* ===== Volunteer roles ===== */
.volunteer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.volunteer-role {
    background: #fff;
    border-top: 4px solid #a3201f;
    padding: 1.25rem 1.5rem 1.5rem;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.volunteer-role h4 {
    margin: 0 0 .5rem;
    color: #2b2620;
    font-family: 'Amaranth', sans-serif;
    font-size: 1.05rem;
}
.volunteer-role p { color: #5e5240; margin: 0; font-size: .95rem; }

/* ===== Contact grid (homepage Get in Touch) ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    text-align: left;
}
.contact-block {
    background: #fff;
    border: 1px solid #e3dccb;
    border-radius: 6px;
    padding: 1.25rem 1.4rem;
}
.contact-block strong {
    display: block;
    color: #a3201f;
    font-family: 'Playfair Display', Georgia, serif;
    margin-bottom: .35rem;
    font-size: 1.05rem;
}
.contact-block p { margin: 0; color: #5e5240; font-size: .95rem; }
.contact-block a { word-break: break-word; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   - PC          : 1025 px and up (default styles above)
   - Tablet      : 641–1024 px
   - Phone       : 481–640 px
   - Small phone : ≤ 480 px
   ============================================================ */

/* ----- Fluid type for the hero (scales smoothly between breakpoints) ----- */
.hero h1 { font-size: clamp(2rem, 5.5vw, 3rem); }
.hero p  { font-size: clamp(1rem, 2.2vw, 1.25rem); }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); }

/* ----- Prevent grid items from overflowing on narrow screens ----- */
.grid                { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.horse-list          { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.story-grid          { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.pledge-grid         { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.support-card,
.volunteer-grid      { /* containers — see below */ }
.volunteer-grid      { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.contact-grid        { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.facts               { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.site-footer__grid   { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

/* Long emails / URLs should never blow out a card */
.contact-block a,
.support-card a,
.site-footer a { word-break: break-word; overflow-wrap: anywhere; }

/* ============================================================
   TABLET — 641 to 1024 px
   ============================================================ */
@media (max-width: 1024px) {
    .container { padding: 0 1.5rem; }
    .section   { padding: 3.5rem 0; }
    .hero      { padding: 5rem 0; }

    /* Force 2-column layouts on tablet for grids that would otherwise have 3-4 items per row */
    .facts            { grid-template-columns: repeat(2, 1fr); }
    .contact-grid     { grid-template-columns: repeat(2, 1fr); }
    .horse-list       { grid-template-columns: repeat(2, 1fr); }
    .story-grid       { grid-template-columns: repeat(2, 1fr); }
    .pledge-grid      { grid-template-columns: repeat(2, 1fr); }
    .volunteer-grid   { grid-template-columns: repeat(2, 1fr); }
    .site-footer__grid{ grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   MOBILE NAVIGATION — when top menu collapses behind hamburger
   ============================================================ */
@media (max-width: 860px) {
    .site-header__inner {
        flex-wrap: wrap;
        padding: .65rem 0;
    }
    .site-branding img { width: 48px; height: 48px; }
    .site-title { font-size: 1.15rem; }
    .site-tagline { font-size: .68rem; }

    .nav-toggle { display: inline-block; }
    .main-nav {
        display: none;
        width: 100%;
        order: 3;
        margin-top: .5rem;
        border-top: 1px solid #f0e9da;
        padding-top: .5rem;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    .main-nav a {
        display: block;
        padding: .85rem .25rem;
        border-bottom: 1px solid #f0e9da;
        min-height: 44px; /* iOS-friendly touch target */
        font-size: 1rem;
    }
    .main-nav li:last-child a { border-bottom: 0; }
    .main-nav a.is-active {
        background: #faf7f2;
        border-bottom-color: #f0e9da; /* keep separator; remove the underline accent */
    }
}

/* ============================================================
   PHONE — 481 to 640 px
   ============================================================ */
@media (max-width: 640px) {
    .container { padding: 0 1rem; }
    .section   { padding: 3rem 0; }
    .section--dark { padding: 2.5rem 0; }
    .hero      { padding: 3.75rem 0; }
    .hero p    { max-width: 100%; }

    /* All multi-column grids collapse to a single column */
    .facts,
    .contact-grid,
    .horse-list,
    .story-grid,
    .pledge-grid,
    .volunteer-grid,
    .grid,
    .site-footer__grid { grid-template-columns: 1fr !important; }

    .horse-feature__body { padding: 1rem 1.25rem 1.25rem; }
    .horse-feature__body h3 { font-size: 1.3rem; }

    .support-card { padding: 1.5rem 1.25rem; }
    .pledge-item, .volunteer-role, .contact-block { padding: 1rem 1.1rem; }

    .button { padding: .85rem 1.5rem; }
    .button--large { padding: .9rem 1.75rem; font-size: 1rem; }

    .mission-strip { font-size: .95rem; padding: 1rem .75rem; }

    /* Quick-fact tables inside imported page content — keep on one line when possible,
       and let the cells stack on very narrow screens. */
    .entry-content table { font-size: .92rem; }
    .entry-content table td { padding: .35em .5em !important; }
}

/* ============================================================
   SMALL PHONE — 480 px and below
   ============================================================ */
@media (max-width: 480px) {
    body { font-size: 16px; }
    .hero { padding: 3rem 0; }
    .hero p { font-size: 1rem; }
    .section { padding: 2.5rem 0; }

    /* Stack the two hero buttons full-width so they don't wrap awkwardly */
    .hero p .button {
        display: block;
        margin: .5rem auto;
        max-width: 280px;
    }
    .hero p .button + .button { margin-top: .5rem; }

    .facts__item strong { font-size: 1.4rem; }
    .facts__item { padding: 1.1rem .75rem; }

    .site-branding img { width: 42px; height: 42px; }
    .site-title { font-size: 1.05rem; }
    .site-tagline { display: none; } /* save space on tiny screens */

    .wishlist-bullets li { padding: .85rem 1rem; }
    .horse-feature__media { aspect-ratio: 3/2; } /* slightly shorter on phones */
}

/* ============================================================
   PRINT / accessibility nice-to-haves
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
@media print {
    .site-header, .nav-toggle, .button { display: none !important; }
    .section { padding: 1rem 0 !important; }
}
