/* =========================================================
   Callies Homes — Shared Site Styles
   ========================================================= */

:root {
    /* Brand colors (from logo) */
    --clr-primary:       #184181;
    --clr-primary-dark:  #102c58;
    --clr-primary-light: #2c5aa8;
    --clr-accent:        #FEDA2E;
    --clr-accent-dark:   #e0bd12;

    /* Neutrals */
    --clr-text:        #1c2333;
    --clr-text-muted:  #56607a;
    --clr-bg:          #ffffff;
    --clr-bg-alt:      #f3f6fb;
    --clr-bg-dark:     #10233f;
    --clr-border:      #dfe4ee;

    /* Type */
    --font-heading: 'Archivo', Arial, sans-serif;
    --font-body:    'Inter', Arial, sans-serif;

    /* Spacing scale */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-8: 3rem;
    --sp-10: 4rem;
    --sp-12: 5rem;
    --sp-16: 6rem;

    /* Layout */
    --container-w: 1200px;
    --radius: 10px;
    --shadow-sm: 0 2px 8px rgba(16, 35, 63, 0.08);
    --shadow-md: 0 8px 24px rgba(16, 35, 63, 0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--clr-text);
    background: var(--clr-bg);
    line-height: 1.6;
    font-size: 1rem;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--clr-primary-dark); }
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--clr-primary);
    line-height: 1.2;
    margin: 0 0 var(--sp-4);
    font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 var(--sp-4); }
ul, ol { padding-left: 1.25rem; }
button { font-family: inherit; }

/* ---------- Accessibility ---------- */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: absolute;
    left: var(--sp-4);
    top: -60px;
    background: var(--clr-primary);
    color: #fff;
    padding: var(--sp-3) var(--sp-5);
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
    color: #fff;
}
:focus-visible {
    outline: 3px solid var(--clr-accent);
    outline-offset: 2px;
}

/* ---------- Layout helpers ---------- */
.container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}
.text-center { text-align: center; }
.section {
    padding: var(--sp-12) 0;
}
.section--alt { background: var(--clr-bg-alt); }
.section-eyebrow {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clr-accent-dark);
    font-size: 0.85rem;
    margin-bottom: var(--sp-2);
}
.section-desc {
    color: var(--clr-text-muted);
    max-width: 640px;
}
.section-header { margin-bottom: var(--sp-8); }
.section-header.text-center .section-desc { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--clr-primary); color: #fff; }
.btn-primary:hover { background: var(--clr-primary-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-accent { background: var(--clr-accent); color: var(--clr-primary-dark); }
.btn-accent:hover { background: var(--clr-accent-dark); color: var(--clr-primary-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-outline-primary { background: transparent; color: var(--clr-primary); border-color: var(--clr-primary); }
.btn-outline-primary:hover { background: var(--clr-primary); color: #fff; }

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
    gap: var(--sp-5);
}
.site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.site-logo__img {
    height: 128px;
    width: auto;
    aspect-ratio: 4 / 3;
    max-width: none;
    display: block;
}
.site-logo--footer .site-logo__img { height: 96px; }
@media (max-width: 600px) {
    .site-logo__img { height: 96px; }
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--clr-primary);
    color: #fff;
    border: none;
    width: 46px; height: 46px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
}
.primary-nav__list {
    display: flex;
    list-style: none;
    margin: 0; padding: 0;
    gap: var(--sp-5);
}
.primary-nav__list a {
    text-decoration: none;
    color: var(--clr-text);
    font-weight: 600;
    padding: var(--sp-2) 0;
    border-bottom: 3px solid transparent;
}
.primary-nav__list a:hover,
.primary-nav__list a.is-active {
    color: var(--clr-primary);
    border-bottom-color: var(--clr-accent);
}
.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--clr-accent);
    color: var(--clr-primary-dark);
    font-weight: 700;
    padding: 0.6rem 1.1rem;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
}
.nav-phone:hover { background: var(--clr-accent-dark); color: var(--clr-primary-dark); }

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .primary-nav {
        position: fixed;
        inset: 0 0 0 auto;
        width: min(320px, 85vw);
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: var(--sp-6);
        padding: var(--sp-10) var(--sp-6) var(--sp-6);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        box-shadow: var(--shadow-md);
    }
    .primary-nav.is-open { transform: translateX(0); }
    .primary-nav__list {
        flex-direction: column;
        gap: var(--sp-4);
    }
    .nav-phone { justify-content: center; }
}

/* ---------- Hero (generic, used on subpages) ---------- */
.page-hero {
    background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-primary-dark) 100%);
    color: #fff;
    padding: var(--sp-10) 0;
}
.page-hero__eyebrow {
    color: var(--clr-accent);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
    font-weight: 700;
}
.page-hero h1 { color: #fff; margin-bottom: var(--sp-2); }
.page-hero__sub { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0; }

.breadcrumb { background: var(--clr-bg-alt); border-bottom: 1px solid var(--clr-border); }
.breadcrumb__list {
    list-style: none;
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) 0;
    margin: 0;
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.breadcrumb__item a { text-decoration: none; color: var(--clr-text-muted); }
.breadcrumb__item a:hover { color: var(--clr-primary); }
.breadcrumb__item[aria-current="page"] { color: var(--clr-primary); font-weight: 600; }
.breadcrumb__sep { color: var(--clr-text-muted); }

/* ---------- Image utility classes (replaces hardcoded width/height
   attributes; sizing lives here, driven by each image's container) ---------- */
.img-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Any wrapper with this class reserves a fixed 4:3 box before the
   image loads, so there's no layout shift even without width/height
   attributes on the <img> itself. */
.ratio-4-3 {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: var(--sp-6);
    box-shadow: var(--shadow-sm);
    height: 100%;
}
.card--service {
    padding: 0 0 var(--sp-6);
    overflow: hidden;
}
.card--service h3,
.card--service p {
    padding-left: var(--sp-6);
    padding-right: var(--sp-6);
}
.card__media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: var(--sp-5);
}
/* .card__media img sizing comes from the .img-cover class in the markup */
.card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    border-radius: 12px;
    background: var(--clr-bg-alt);
    color: var(--clr-primary);
    font-size: 1.5rem;
    margin-bottom: var(--sp-4);
}
.card h3 { margin-bottom: var(--sp-2); }
.card p:last-child { margin-bottom: 0; }

.grid {
    display: grid;
    gap: var(--sp-6);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- Two-column content layout (used on About/Services) ---------- */
.split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--sp-10);
    align-items: center;
}
.split--reverse { grid-template-columns: 0.9fr 1.1fr; }
@media (max-width: 860px) {
    .split, .split--reverse { grid-template-columns: 1fr; }
    /* On small screens, always show the heading/text before the image,
       regardless of which side it's staggered to on desktop. */
    .split--reverse .split__media { order: 2; }
}
.split__media img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    aspect-ratio: 4 / 3;
    /* width/object-fit come from the .img-cover class in the markup */
}

/* ---------- CTA band ---------- */
.cta-band {
    background: var(--clr-primary);
    color: #fff;
    padding: var(--sp-10) 0;
    text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-band__actions { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-6); }

/* ---------- Footer ---------- */
.site-footer { background: var(--clr-bg-dark); color: rgba(255,255,255,0.8); }
.site-footer__inner {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: var(--sp-8);
    padding: var(--sp-12) 0 var(--sp-8);
}
@media (max-width: 760px) {
    .site-footer__inner { grid-template-columns: 1fr; }
}
.site-footer .site-logo { color: #fff; }
.site-footer .site-logo__name { color: #fff; }
.site-footer p { color: rgba(255,255,255,0.7); }
.site-footer__heading {
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-4);
}
.site-footer__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.site-footer__list a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
}
.site-footer__list a:hover { color: var(--clr-accent); }
.site-footer__list--contact li { display: flex; align-items: center; gap: var(--sp-2); }
.site-footer__list--contact i { color: var(--clr-accent); width: 1.1em; }
.site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: var(--sp-4) 0;
    font-size: 0.85rem;
    text-align: center;
}
.site-footer__bottom p { margin: 0; color: rgba(255,255,255,0.6); }

/* ---------- Forms (shared: contact form) ---------- */
.form-group { margin-bottom: var(--sp-5); }
.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--sp-2);
    color: var(--clr-text);
}
.form-required { color: #b3261e; }
.form-input,
.form-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--clr-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--clr-text);
    background: #fff;
}
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(24, 65, 129, 0.15);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-hint { font-size: 0.85rem; color: var(--clr-text-muted); margin-top: var(--sp-2); }
.form-note {
    background: var(--clr-bg-alt);
    border-left: 4px solid var(--clr-accent);
    padding: var(--sp-3) var(--sp-4);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    margin-top: var(--sp-2);
}
/* Honeypot field — hidden from sighted users AND assistive tech */
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#formStatus[data-state="success"] {
    background: #e6f4ea; color: #1e4620; border: 1px solid #b7dfc0;
    padding: var(--sp-4); border-radius: 8px; margin-bottom: var(--sp-5);
}
#formStatus[data-state="error"] {
    background: #fdecea; color: #611a15; border: 1px solid #f3b8b3;
    padding: var(--sp-4); border-radius: 8px; margin-bottom: var(--sp-5);
}
#formStatus:empty { display: none; }

/* ---------- Misc ---------- */
.empty-state {
    text-align: center;
    padding: var(--sp-12) 0;
    color: var(--clr-text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: var(--sp-4); display: block; color: var(--clr-border); }
