/*
 * Hilary Repass Real Estate
 * RE/MAX Branded Theme
 * Combining HOFM visual style with MC functionality
 */

:root {
    /* RE/MAX Brand Colors */
    --remax-red: #CC0000;
    --remax-red-dark: #990000;
    --remax-red-light: #ff3333;
    --remax-blue: #003DA5;
    --remax-blue-dark: #002d7a;
    --remax-blue-light: #0052cc;

    /* Neutral Colors */
    --white: #ffffff;
    --off-white: #f8f9fa;
    --light-gray: #e9ecef;
    --medium-gray: #6c757d;
    --dark-gray: #343a40;
    --black: #1a1a1a;

    /* Text Colors */
    --text-dark: #2c3e50;
    --text-gray: #4a5568;
    --text-light: rgba(255, 255, 255, 0.9);

    /* Accent */
    --accent: var(--remax-red);
    --accent-hover: var(--remax-red-dark);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

/* =====================================================================
   SAFETY NET — global rules that prevent whole CLASSES of layout bugs.
   Loose, conservative defaults; nothing here narrows behaviour, it only
   widens what the layout will tolerate. Add new categories here when a
   new class of bug surfaces (rather than per-component patches).
   ===================================================================== */

/* SN-1 Page can never scroll sideways. `clip` over `hidden` so we don't
   establish a containing block (keeps position: sticky / fixed correct). */
html, body {
    overflow-x: clip;
}

/* SN-2 Long unbreakable strings — emails, URLs, phone numbers without
   spaces, code samples — wrap inside their column instead of forcing the
   parent wider than the viewport. Caught a real 320px overflow caused
   by hilaryrepassrealestate@gmail.com on 2026-04-29. */
body {
    overflow-wrap: break-word;
}
a[href^="mailto:"],
a[href^="tel:"],
code, kbd, pre, samp {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* SN-3 Media is never wider than its cell. */
img, video, picture, canvas, svg, iframe {
    max-width: 100%;
    height: auto;
}

/* SN-4 Tables: when content is wider than the viewport, the table
   becomes a horizontal-scroll block. `display: block` on the <table>
   only changes how the OUTER box flows; thead/tbody/tr/td/th keep their
   default table-* displays so the visual rendering is unchanged.
   This was the cleanest fix for charlotte-commute / loan-types where
   long row data was pushing past 320/375 viewports. */
table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* SN-5 min-width: 0 on flex/grid children. Without this, a child's
   min-content (a long word or a wide fixed-size image) can force the
   parent — and through it, the viewport — to be wider than expected.
   Targeted to the layout containers we actually use, not a universal
   `* { min-width: 0 }` that would surprise inline-flex chips/badges. */
.container > *,
.navbar > *,
.hero-grid > *,
.hero-text > *,
.hero-contact > *,
.hero-buttons > *,
.about-grid > *,
.services-grid > *,
.listings-grid > *,
.footer-grid > *,
.ramsey-callout__grid > *,
.page-hero .container > *,
.detail-header > *,
.details-grid > *,
[class*="-grid"] > *,
[class$="-grid"] > *,
[class*="-stats"] > *,
[class*="-cards"] > *,
[class*="-cards-grid"] > * {
    min-width: 0;
}

/* SN-6 Visibility utilities — replace ad-hoc `display: none` rules per
   element with semantic class tagging. Anything tagged `.is-mobile-only`
   or `.is-desktop-only` is invisible outside its tier, full stop. */
.is-mobile-only,
.is-desktop-only {
    display: none;
}

@media (max-width: 1199px) {
    .is-mobile-only { display: revert; }
}

@media (min-width: 1200px) {
    .is-desktop-only { display: revert; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== HEADER ===== */
.header {
    background: var(--white);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    border-bottom: 4px solid var(--remax-red);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--remax-blue);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo-title {
    font-size: 0.75rem;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--remax-red);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--remax-red);
}

/* Nav Dropdown */
.nav-menu .has-dropdown {
    position: relative;
}

.nav-menu .has-dropdown > a::after {
    content: '';
}

.nav-menu .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    min-width: 220px;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1001;
    list-style: none;
}

.nav-menu .has-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-menu .dropdown-menu li {
    border-bottom: none;
}

.nav-menu .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.nav-menu .dropdown-menu a::after {
    display: none;
}

.nav-menu .dropdown-menu a:hover {
    background: var(--off-white);
    color: var(--remax-red);
}

/* Header Contact */
.header-contact {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.header-phone {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-phone span {
    font-size: 0.75rem;
    color: var(--medium-gray);
    white-space: nowrap;
}

.header-phone a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--remax-blue);
    white-space: nowrap;
}

.header-phone a:hover {
    color: var(--remax-red);
}

.btn-header {
    background: var(--remax-red);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-header:hover {
    background: var(--remax-red-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--text-dark);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger span:nth-child(1) { top: 14px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 28px; }

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Backdrop */
.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 998;
}

.mobile-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    /* No more min-height: 100vh — when the content shorter than the
       viewport (typical on a 1280×800 monitor with a short hero), the
       100vh stretch produced a chunk of dead blue gradient below the
       photo. Let the section size to its content + the .hero-content
       padding instead. */
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Solid blue base so the .hero-overlay gradient (which has 0.4–0.85 alpha)
       always has something opaque behind it. Without this base, the bottom-right
       of the gradient (red 0.4 alpha) blended with the white body and became
       a washed-out pink — white hero text was unreadable on it.
       Hillary preferred the all-blue look (Tim 2026-04-27). */
    background: var(--remax-blue-dark);
}

@keyframes heroKenBurns {
    0% { transform: scale(1) translateY(0); }
    100% { transform: scale(1.1) translateY(-2%); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 61, 165, 0.85) 0%,
        rgba(0, 61, 165, 0.6) 50%,
        rgba(204, 0, 0, 0.4) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    /* 140px top clears the fixed 91px header AND drops the content
       into the lower-middle of the gradient so the blue band reads as
       a deliberate canvas above the headline rather than a thin strip.
       80px bottom keeps a calm gap to the white .hero-stats bar without
       a "dead zone" below the photo. */
    padding: 140px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    color: var(--white);
}

.hero-badge {
    display: inline-block;
    background: var(--remax-red);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero-title {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero-tagline {
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1.4;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-contact {
    margin-bottom: 2rem;
}

.hero-contact a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    /* email/tel wrapping handled by SAFETY-NET SN-2 + SN-5 (top of file) */
}

.hero-contact a:hover {
    color: var(--remax-red-light);
}

.hero-contact i {
    width: 25px;
    color: var(--remax-red-light);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--remax-red);
    color: var(--white);
    padding: 15px 35px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--remax-red-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(204, 0, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    padding: 15px 35px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--remax-blue);
}

/* Hero Photo
   Two slots — side photo (right column on desktop) and inline photo
   (between the RE/MAX badge and Hilary's name on tablet/phone). Only one
   is visible at a time; the other carries display:none. The duplicate
   <img> tag uses the same src so the browser's HTTP cache serves both
   from one network round trip. */
.hero-photo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-photo img {
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

/* Default (≥1200): side photo shown, inline photo hidden */
.hero-photo--inline {
    display: none;
}

/* Hero Stats — its own section directly under the hero. White background
   makes the proof bar pop without fighting the gradient overlay above. */
.hero-stats {
    background: var(--white);
    padding: 32px 0;
    border-bottom: 1px solid var(--light-gray);
}

.stats-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--remax-blue);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--medium-gray);
    font-weight: 500;
}

/* ===== ABOUT SECTION ===== */
.about-section {
    padding: 100px 0;
    background: var(--off-white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.about-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--remax-red);
    color: var(--white);
    padding: 20px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(204, 0, 0, 0.3);
}

.about-badge-number {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}

.about-badge-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

.about-content h2 {
    font-size: 2.5rem;
    color: var(--remax-blue);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-quote {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--remax-blue);
    border-left: 4px solid var(--remax-red);
    padding-left: 2rem;
    margin: 2rem 0;
}

.credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.credential {
    background: var(--remax-blue);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== SERVICES SECTION ===== */
.services-section {
    padding: 100px 0;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--remax-blue);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
    max-width: 700px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Flip Cards */
.flip-card {
    perspective: 1000px;
    height: 350px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card:hover .flip-card-front {
    pointer-events: none;
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
}

.flip-card-back {
    pointer-events: none;
}

.flip-card:hover .flip-card-back {
    pointer-events: auto;
}

.flip-card-front {
    background-size: cover;
    background-position: center;
}

.flip-card-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
}

.flip-card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    color: var(--white);
}

.flip-card-icon {
    width: 70px;
    height: 70px;
    background: var(--remax-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.flip-card-icon i {
    font-size: 1.8rem;
    color: var(--white);
}

.flip-card-front h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.flip-card-front p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.flip-card-back {
    background: var(--remax-blue);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.flip-card-back h4 {
    color: var(--white);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.flip-card-back p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 20px;
    line-height: 1.6;
}

.flip-card-back .btn-flip {
    background: var(--white);
    color: var(--remax-blue);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    display: inline-block;
    position: relative;
    z-index: 10;
    cursor: pointer;
    text-decoration: none;
}

.flip-card-back .btn-flip:hover {
    background: var(--remax-red);
    color: var(--white);
}

/* ===== LISTINGS SECTION ===== */
.listings-section {
    padding: 100px 0;
    background: var(--off-white);
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.listing-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.listing-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.listing-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.listing-card:hover .listing-image img {
    transform: scale(1.05);
}

.listing-status {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.listing-status.active {
    background: var(--remax-red);
    color: var(--white);
}

.listing-status.pending {
    background: #f59e0b;
    color: var(--white);
}

.listing-status.sold {
    background: #10b981;
    color: var(--white);
}

.listing-price {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: var(--remax-blue);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.listing-content {
    padding: 25px;
}

.listing-address {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.listing-details {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.listing-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.listing-detail i {
    color: var(--remax-red);
}

.listing-btn {
    display: block;
    text-align: center;
    background: var(--remax-blue);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
}

.listing-btn:hover {
    background: var(--remax-red);
    color: var(--white);
}

/* ===== SOLD SECTION (homepage) ===== */
.sold-section {
    padding: 100px 0;
    background: var(--white);
}

/* ===== TESTIMONIALS SECTION ===== */
.testimonials-section {
    padding: 100px 0;
    background: var(--white);
}

.testimonials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.google-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--off-white);
    padding: 20px 30px;
    border-radius: 15px;
}

.google-logo {
    font-size: 1.5rem;
    font-weight: 500;
}

.g-blue { color: #4285f4; }
.g-red { color: #ea4335; }
.g-yellow { color: #fbbc05; }
.g-green { color: #34a853; }

.rating-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.rating-stars i {
    color: #fbbc05;
}

.testimonials-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.testimonial-card {
    background: var(--off-white);
    border-radius: 15px;
    padding: 30px;
    min-width: 350px;
    flex-shrink: 0;
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-red) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 1.2rem;
}

.testimonial-info h4 {
    color: var(--text-dark);
    font-size: 1rem;
    margin-bottom: 3px;
}

.testimonial-info span {
    color: var(--medium-gray);
    font-size: 0.85rem;
}

.testimonial-stars {
    margin-bottom: 15px;
}

.testimonial-stars i {
    color: #fbbc05;
}

.testimonial-text {
    color: var(--text-gray);
    line-height: 1.7;
}

/* ===== RAMSEY CALLOUT ===== */
.ramsey-callout {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    color: var(--white);
}

/* Use auto for the badge column so the frame sizes to its content instead of
   stretching into an empty 1fr block (the ~273x216 near-square at 900-1100px
   read as an empty placeholder — Tim 4/28 "renders weird"). */
.ramsey-callout__grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
}

.ramsey-callout__badge-wrap {
    text-align: center;
}

.ramsey-callout__badge {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 32px 36px;
    border: 2px solid rgba(255,255,255,0.2);
    width: 240px;
}

.ramsey-callout__badge i {
    font-size: 3.25rem;
    color: #4CAF50;
    margin-bottom: 12px;
    display: block;
    line-height: 1;
}

.ramsey-callout__badge-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
}

.ramsey-callout__badge-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 6px;
    line-height: 1.3;
}

.ramsey-callout__body h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.ramsey-callout__body p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.ramsey-callout__cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Both Ramsey CTAs share the same height so the wrap row isn't ragged */
.ramsey-callout__cta .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.ramsey-callout__btn--primary {
    background: #4CAF50;
    border-color: #4CAF50;
}

.ramsey-callout__btn--primary:hover {
    background: #3d8b40;
}

.ramsey-callout__btn--ghost {
    background: transparent;
    border: 2px solid var(--white);
}

.ramsey-callout__btn--ghost:hover {
    background: var(--white);
    color: var(--remax-blue);
}

/* ===== CTA SECTION ===== */
.cta-section {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 61, 165, 0.9);
}

.cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-contact {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cta-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-contact-item i {
    font-size: 1.5rem;
    color: var(--remax-red-light);
}

.cta-contact-item a {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
}

.cta-contact-item a:hover {
    color: var(--remax-red-light);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand img {
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(255,255,255,0.7);
    margin: 1rem 0;
    line-height: 1.7;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--remax-red);
    transform: translateY(-3px);
}

.footer h4 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--white);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    color: rgba(255,255,255,0.7);
}

.footer-contact-item i {
    color: var(--remax-red);
    margin-top: 5px;
}

.footer-contact-item a {
    color: rgba(255,255,255,0.7);
}

.footer-contact-item a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-legal a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-left: 20px;
}

.footer-legal a:hover {
    color: var(--white);
}

/* ===== PAGE HEADERS ===== */
.page-header {
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    padding: 150px 0 80px;
    text-align: center;
    color: var(--white);
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== PAGE HERO (narrative pages) ===== */
.page-hero {
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    /* 180px top: clears the fixed header AND seats the H1/subtitle in
       the lower-middle of the gradient (so the blue band has visible
       breathing room above the headline). */
    padding: 180px 0 80px;
    color: var(--white);
}

.page-hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.page-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--white);
}

.page-hero .subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.page-hero .hero-cta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.page-hero-image img {
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    max-width: 100%;
    height: auto;
}

/* Single-column page-hero (no photo) */
.page-hero.page-hero--centered {
    text-align: center;
}

.page-hero.page-hero--centered .container {
    grid-template-columns: 1fr;
}

.page-hero.page-hero--centered .subtitle {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== CONTACT PAGE ===== */
.contact-section {
    padding: 100px 0;
    background: var(--off-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.contact-info-card h3 {
    font-size: 1.5rem;
    color: var(--remax-blue);
    margin-bottom: 2rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-info-item i {
    width: 50px;
    height: 50px;
    background: var(--remax-red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
}

.contact-info-item h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.contact-info-item p,
.contact-info-item a {
    color: var(--text-gray);
}

.contact-info-item a:hover {
    color: var(--remax-red);
}

.contact-form-card {
    background: var(--white);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.contact-form-card h3 {
    font-size: 1.5rem;
    color: var(--remax-blue);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--remax-blue);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-submit {
    background: var(--remax-red);
    color: var(--white);
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.btn-submit:hover {
    background: var(--remax-red-dark);
}

/* ===== ADMIN STYLES ===== */
.admin-header {
    background: var(--dark-gray);
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav {
    display: flex;
    gap: 2rem;
}

.admin-nav a {
    color: rgba(255,255,255,0.8);
}

.admin-nav a:hover,
.admin-nav a.active {
    color: var(--white);
}

.admin-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-card {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.admin-card h2 {
    color: var(--remax-blue);
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.admin-table th {
    background: var(--off-white);
    font-weight: 600;
    color: var(--text-dark);
}

.admin-table tr:hover {
    background: var(--off-white);
}

.btn-admin {
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 5px;
}

.btn-edit {
    background: var(--remax-blue);
    color: var(--white);
}

.btn-delete {
    background: var(--remax-red);
    color: var(--white);
}

/* ===== LISTING DETAIL ===== */
.detail-hero {
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    color: var(--white);
    /* 170px top — listing detail title sits below header in lower-middle of gradient (4/29 rhythm) */
    padding: 170px 0 50px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-bottom: 24px;
    color: rgba(255,255,255,0.85);
}

.breadcrumb a {
    color: var(--white);
    opacity: 0.85;
}

.breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb span {
    opacity: 0.6;
}

.detail-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
}

.detail-title h1 {
    font-size: 2.25rem;
    margin-bottom: 8px;
    color: var(--white);
}

.detail-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.9);
}

.detail-price {
    text-align: right;
}

.detail-price .price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
}

.detail-price .status {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    background: var(--remax-red);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-section {
    padding: 32px 0 16px;
}

.gallery-main {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    background: var(--off-white);
    aspect-ratio: 16 / 10;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--medium-gray);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.gallery-thumb {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.gallery-thumb:hover,
.gallery-thumb.active {
    border-color: var(--remax-red);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.details-section {
    padding: 32px 0 64px;
}

.details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    align-items: start;
}

.details-main {
    min-width: 0;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
    background: var(--off-white);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.quick-stats .stat-item {
    text-align: center;
    padding: 0;
}

.quick-stats .stat-item i {
    font-size: 1.5rem;
    color: var(--remax-red);
    margin-bottom: 8px;
    display: block;
}

.quick-stats .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
}

.quick-stats .stat-label {
    font-size: 0.8rem;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.listing-description {
    margin-bottom: 32px;
}

.listing-description h2,
.features-section h2 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--remax-blue);
}

.listing-description p {
    color: var(--text-gray);
    line-height: 1.7;
}

.features-section {
    margin-bottom: 32px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--off-white);
    border-radius: 8px;
    color: var(--text-dark);
}

.feature-item i {
    color: var(--remax-red);
    flex-shrink: 0;
}

.details-sidebar {
    position: sticky;
    top: 100px;
}

.contact-card {
    background: var(--white);
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border-top: 4px solid var(--remax-red);
}

.contact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--remax-blue);
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.agent-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--remax-blue);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.agent-details h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.agent-details p {
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-contact-primary,
.btn-contact-secondary,
.virtual-tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
}

.btn-contact-primary {
    background: var(--remax-red);
    color: var(--white);
}

.btn-contact-primary:hover {
    background: var(--remax-red-dark);
    transform: translateY(-1px);
}

.btn-contact-secondary {
    background: transparent;
    color: var(--remax-blue);
    border: 2px solid var(--remax-blue);
}

.btn-contact-secondary:hover {
    background: var(--remax-blue);
    color: var(--white);
}

.virtual-tour-btn {
    background: var(--remax-blue);
    color: var(--white);
}

.virtual-tour-btn:hover {
    background: var(--remax-blue-dark);
}

.mls-info {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--light-gray);
    font-size: 0.85rem;
    color: var(--medium-gray);
}

.mls-info p {
    margin-bottom: 4px;
}

.error-container {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 60px auto;
}

.error-container i {
    font-size: 4rem;
    color: var(--medium-gray);
    margin-bottom: 16px;
}

.error-container h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.error-container p {
    color: var(--text-gray);
    margin-bottom: 24px;
}

/* ===== DOWNLOADS PAGE ===== */
.downloads-hero {
    background: linear-gradient(135deg, var(--remax-blue) 0%, var(--remax-blue-dark) 100%);
    color: var(--white);
    /* 170px top — global rhythm (4/29) */
    padding: 170px 0 60px;
    text-align: center;
}

.downloads-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--white);
}

.downloads-hero p {
    font-size: 1.1rem;
    max-width: 720px;
    margin: 0 auto;
    color: rgba(255,255,255,0.9);
}

.downloads-content {
    padding: 56px 0 64px;
}

.coming-soon-notice {
    background: var(--off-white);
    border: 2px dashed var(--remax-blue);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    margin-bottom: 8px;
}

.coming-soon-notice i {
    font-size: 2.5rem;
    color: var(--remax-red);
    margin-bottom: 12px;
}

.coming-soon-notice h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--remax-blue);
}

.coming-soon-notice p {
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

.category-section {
    margin-top: 3rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    color: var(--remax-blue);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light-gray);
}

.category-title i {
    color: var(--remax-red);
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.download-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.download-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--off-white);
    color: var(--remax-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 14px;
}

.download-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.download-card p {
    color: var(--text-gray);
    font-size: 0.92rem;
    margin-bottom: 16px;
    flex-grow: 1;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--remax-red);
    color: var(--white);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    min-height: 44px;
    transition: background 0.2s ease;
}

.download-btn:hover {
    background: var(--remax-red-dark);
}

.download-btn.disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    opacity: 0.7;
}

.file-status {
    margin-top: 10px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-status.available {
    color: #2d7a3e;
}

.file-status.unavailable {
    color: var(--medium-gray);
}

.help-section {
    background: var(--off-white);
    padding: 56px 0;
    text-align: center;
}

.help-content h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: var(--remax-blue);
}

.help-content p {
    color: var(--text-gray);
    max-width: 640px;
    margin: 0 auto 24px;
}

.help-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .hero-name {
        font-size: 3rem;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

/* Stack the Ramsey callout earlier than the 768 hard break — at 800–1100
   the auto/1fr split was leaving the badge looking marooned on the left.
   This rule fires once the viewport drops below the 1024 desktop tier. */
@media (max-width: 1024px) {
    .ramsey-callout__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .ramsey-callout__badge-wrap {
        margin: 0 auto;
    }

    .ramsey-callout__badge {
        margin: 0 auto;
    }

    .ramsey-callout__cta {
        justify-content: center;
    }
}

@media (max-width: 1199px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        z-index: 999;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--light-gray);
    }

    .nav-menu a {
        display: block;
        padding: 15px 0;
    }

    /* Mobile dropdown */
    .nav-menu .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        background: var(--off-white);
        border-radius: 0;
        display: none;
        padding: 0;
    }

    .nav-menu .has-dropdown.open .dropdown-menu {
        display: block;
    }

    .nav-menu .dropdown-menu a {
        padding: 12px 20px 12px 30px;
        font-size: 0.9rem;
    }

    .nav-menu .dropdown-menu li {
        border-bottom: 1px solid var(--light-gray);
    }

    .header-contact {
        display: none;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Tablet/phone: hide the side photo and show the inline one between
       badge and name. Tim 4/28 + Hilary: photo must sit between the
       "RE/MAX Real Estate" line and the name at every narrow width. */
    .hero-photo--side {
        display: none;
    }

    .hero-photo--inline {
        display: flex;
        justify-content: center;
        margin: 1rem auto 1.25rem;
    }

    .hero-photo--inline img {
        max-width: 220px;
        width: 100%;
        height: auto;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    }

    .hero-tagline {
        max-width: none;
    }

    .hero-buttons {
        justify-content: center;
    }

    /* hero-stats is now its own section below .hero — no bottom buffer needed */

    .stats-grid {
        gap: 2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-tagline {
        font-size: 1.4rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .stats-grid {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .stat-item {
        flex: 1 1 40%;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .flip-card {
        height: 300px;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cta-contact {
        flex-direction: column;
        gap: 1rem;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    /* Page-hero archetype — narrative pages (about, buying, selling, etc.).
       110px top so headline lands in lower-middle of the gradient on phones,
       not crammed against the fixed header. */
    .page-hero {
        padding: 110px 0 56px;
    }

    .page-hero .container,
    .page-hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .page-hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .page-hero .subtitle,
    .page-hero p.subtitle {
        font-size: 1.05rem;
    }

    /* Stack hero CTA buttons full-width */
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-cta .btn,
    .hero-cta .btn-primary,
    .hero-cta .btn-secondary,
    .hero-cta a {
        width: 100%;
        text-align: center;
    }

    /* Listings/sold compact headers */
    .listings-header,
    .sold-header {
        padding: 90px 0 32px;
    }

    .listings-header__title,
    .sold-header__title {
        font-size: 1.65rem;
    }

    /* Navbar: minimal on mobile — only logo (left) and hamburger (right).
       Phone is removed from the navbar and lives in the hero CTA, the
       hamburger drawer (mobile-tel link), and the footer. Cluttering the
       navbar with a tel link pushes the hamburger to the middle and eats
       the limited horizontal space. Senior mobile pattern: navbar stays
       lean, drawer absorbs everything else. */
    .navbar {
        padding: 0.75rem 1rem;
        gap: 12px;
    }

    .logo {
        gap: 0;
    }

    .logo img {
        height: 40px;
    }

    .logo-text {
        display: none;
    }

    /* Hide the entire header-contact bundle on mobile.
       Keeps the navbar to logo + hamburger so .navbar's
       justify-content: space-between puts hamburger flush right. */
    .header-contact {
        display: none;
    }

    /* Mobile drawer tel link — display:revert from .is-mobile-only happens
       in SN-6, so we only style the layout here. */
    .nav-menu .mobile-tel {
        margin-top: 0.5rem;
        border-top: 1px solid var(--light-gray);
        padding-top: 0.5rem;
    }

    .nav-menu .mobile-tel a {
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 600;
        color: var(--remax-red);
    }

    .nav-menu .mobile-tel a i {
        width: 20px;
    }

    /* Hero stats: 2x2 grid on mobile instead of vertical stack — saves
       150px+ of scroll and reads more like a quick scannable proof bar */
    .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex-direction: row;
        gap: 1.25rem;
        padding: 0 1rem;
    }

    .stat-item {
        flex: 0 1 auto;
    }

    /* Touch target floor */
    .footer-social a {
        width: 44px;
        height: 44px;
    }

    /* Quote indent eats too much width on mobile */
    .about-quote {
        padding-left: 1rem;
    }

    /* Stop testimonial cards from forcing horizontal scroll on small screens */
    .testimonial-card {
        min-width: 0;
        padding: 24px;
    }

    .testimonials-grid {
        flex-direction: column;
        overflow-x: visible;
    }

    /* Filter pills tighten on mobile */
    .filter-pills .pill,
    .filter-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Form alert padding works on small screens */
    .alert {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    /* Listing detail collapses to single column with stacked sidebar.
       120px top so the title sits below the fixed header with breathing
       room (matches page-hero rhythm on phones). */
    .detail-hero {
        padding: 120px 0 36px;
    }

    .detail-header {
        grid-template-columns: 1fr;
        gap: 16px;
        align-items: stretch;
    }

    .detail-title h1 {
        font-size: 1.6rem;
    }

    .detail-price {
        text-align: left;
    }

    .detail-price .price {
        font-size: 1.75rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .details-sidebar {
        position: static;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 12px;
    }

    .gallery-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Downloads page collapse */
    .downloads-hero {
        padding: 100px 0 40px;
    }

    .downloads-hero h1 {
        font-size: 1.85rem;
    }

    .downloads-grid {
        grid-template-columns: 1fr;
    }

    .help-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .help-buttons .btn-primary,
    .help-buttons .btn-secondary {
        width: 100%;
    }

    /* ============ HOMEPAGE — full mobile pass ============ */

    /* Hero — kill 100vh + giant padding; bring stats into flow.
       .hero is display:flex row by default; switch to column so .hero-content
       and .hero-stats stack full-width instead of squishing side-by-side. */
    .hero {
        min-height: auto;
        display: block;
    }

    .hero-content {
        /* 120px top so the badge → photo → name cluster lands in the
           lower-middle of the gradient on phones too. */
        padding: 120px 0 56px;
        width: 100%;
    }

    .hero-stats {
        width: 100%;
    }

    .hero-grid {
        gap: 1.5rem;
    }

    /* Inline photo: a touch smaller on phone so the hero stays compact */
    .hero-photo--inline {
        margin: 0.75rem auto 1rem;
    }

    .hero-photo--inline img {
        max-width: 200px;
    }

    .hero-badge {
        font-size: 0.78rem;
        padding: 6px 16px;
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: 1.1rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
        max-width: none;
        margin-bottom: 1.5rem;
    }

    .hero-contact a {
        font-size: 1rem;
    }

    .hero-stats {
        position: static;
        padding: 24px 0;
    }

    .stats-grid {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* About section */
    .about-section {
        padding: 56px 0;
    }

    .about-grid {
        gap: 2.25rem;
    }

    .about-image {
        order: -1;
    }

    .about-image img {
        display: block;
        margin: 0 auto;
        max-width: 320px;
    }

    /* Bring the floating badge into flow on mobile so it doesn't overlap the next section */
    .about-badge {
        position: static;
        display: inline-flex;
        align-items: baseline;
        gap: 8px;
        margin: 16px auto 0;
        padding: 12px 22px;
    }

    .about-badge-number {
        font-size: 1.4rem;
        display: inline;
    }

    .about-content h2 {
        font-size: 1.65rem;
    }

    /* Services section */
    .services-section,
    .listings-section,
    .sold-section,
    .testimonials-section,
    .cta-section {
        padding: 56px 0;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* Flip cards lose hover on touch — make front taller and explicit */
    .flip-card {
        height: 280px;
    }

    .flip-card-content,
    .flip-card-back {
        padding: 22px;
    }

    .flip-card-front h3 {
        font-size: 1.25rem;
    }

    /* Listings on homepage */
    .listings-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-top: 2rem;
    }

    .listing-image {
        height: 220px;
    }

    .listing-content {
        padding: 20px;
    }

    /* Testimonials header */
    .testimonials-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .google-rating {
        padding: 14px 18px;
        gap: 12px;
    }

    .rating-number {
        font-size: 1.25rem;
    }

    /* CTA section */
    .cta-content h2 {
        font-size: 1.75rem;
    }

    .cta-content p {
        font-size: 1.05rem;
    }

    .cta-contact {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cta-contact-item a {
        font-size: 1.05rem;
    }

    /* Footer */
    .footer {
        padding: 48px 0 24px;
    }

    .footer-grid {
        gap: 2rem;
        margin-bottom: 1.5rem;
    }

    /* Ramsey callout — collapse 1:2 grid to single column */
    .ramsey-callout {
        padding: 56px 0;
    }

    .ramsey-callout__grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .ramsey-callout__badge {
        padding: 28px 22px;
        max-width: 280px;
        margin: 0 auto;
    }

    .ramsey-callout__badge i {
        font-size: 2.25rem;
    }

    .ramsey-callout__badge-title {
        font-size: 1.35rem;
    }

    .ramsey-callout__body h2 {
        font-size: 1.65rem;
    }

    .ramsey-callout__body p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .ramsey-callout__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .ramsey-callout__cta .btn-primary {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .stat-item {
        flex: 1 1 100%;
    }

    /* Cards stay inside the container's 16px gutter; full-bleed felt
       overflowed because the surrounding sections didn't match. */
    .listing-card {
        margin: 0;
        border-radius: 12px;
    }

    /* Smaller phones — page-hero still seats below the fixed header
       with a comfortable band of gradient above the H1. */
    .page-hero {
        padding: 100px 0 40px;
    }

    .page-hero h1 {
        font-size: 1.65rem;
    }

    .page-hero .subtitle,
    .page-hero p.subtitle {
        font-size: 1rem;
    }

    .page-header {
        padding: 100px 0 50px;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .section-header h2,
    .section-title {
        font-size: 1.6rem;
    }

    .listings-header,
    .sold-header {
        padding: 80px 0 28px;
    }

    .listings-header__title,
    .sold-header__title {
        font-size: 1.4rem;
    }

    /* Reduce section vertical rhythm on tiny screens */
    .section,
    section.section {
        padding: 48px 0;
    }

    /* ============ HOMEPAGE — tiny phones ============ */
    .hero-content {
        /* 108px top — fixed header is 91 here, so this leaves ~17px of
           gradient above the badge so it doesn't kiss the header */
        padding: 108px 0 44px;
    }

    /* Tighter rhythm at small widths — Tim 4/28: hero "gets too tight" was
       the cluster crammed against itself; small spacing tweaks open it back up */
    .hero-name {
        font-size: 2rem;
        line-height: 1.15;
        margin-bottom: 0.4rem;
    }

    .hero-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .hero-tagline {
        font-size: 1.05rem;
        margin-bottom: 1.25rem;
    }

    .hero-contact {
        margin-bottom: 1.25rem;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    /* Inline photo: smaller and softer shadow on tiny phones */
    .hero-photo--inline {
        margin: 0.5rem auto 0.875rem;
    }

    .hero-photo--inline img {
        max-width: 168px;
        border-radius: 14px;
        box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    }

    .hero-stats {
        padding: 18px 0;
    }

    .stat-number {
        font-size: 1.65rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    .about-section,
    .services-section,
    .listings-section,
    .sold-section,
    .testimonials-section,
    .cta-section {
        padding: 40px 0;
    }

    .about-content h2 {
        font-size: 1.45rem;
    }

    .about-image img {
        max-width: 100%;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .flip-card {
        height: 250px;
    }

    .listing-image {
        height: 200px;
    }

    .footer {
        padding: 36px 0 20px;
    }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg {
        animation: none;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
