/* ============================================================
   THAI.CONDOS — Redesign 2026 HOMEPAGE layer
   Loaded AFTER redesign-tokens + redesign-components.
   Scope: only the from-scratch homepage (page template
   `homepage-redesign`, rendered under .rd-home).

   Cache-bust by FILE RENAME only (v1 -> v2), never `?v=`
   query strings — Theme::asset() silently drops query-string CSS.
   ============================================================ */

.rd-home {
    background: var(--color-bg-white);
    color: var(--color-text-primary-light);
    font-family: var(--rd-font-body);
}

.rd-home a { text-decoration: none; }
.rd-home img { display: block; max-width: 100%; }

/* Visually-hidden label for screen readers (search input) */
.rd-home .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;
}

/* ── Typography utilities scoped to home ─────────────────── */
.rd-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted-light);
    margin-bottom: 16px;
    display: block;
}

.rd-h2 {
    font-family: var(--rd-font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-accent);
    margin: 0 0 16px;
}

.rd-em {
    font-style: italic;
    font-weight: 600;
    color: var(--color-warm);
}

/* ── Generic section + head + grid ───────────────────────── */
.rd-section {
    max-width: 1440px;
    margin: 0 auto;
    padding: 96px 32px 0;
    position: relative;
}

.rd-section__head {
    margin-bottom: 40px;
    max-width: 720px;
}
.rd-section__head--centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.rd-section__sub {
    font-size: 17px;
    line-height: 1.55;
    color: var(--color-text-secondary-light);
    margin: 0 0 12px;
}

.rd-section__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    transition: color .15s ease;
}
.rd-section__cta:hover { color: var(--color-warm); }

.rd-grid {
    display: grid;
    gap: 24px;
}
.rd-grid-3 { grid-template-columns: repeat(3, 1fr); }
.rd-grid-4 { grid-template-columns: repeat(4, 1fr); }
.rd-grid--tall { min-height: 460px; }

/* ── HERO ────────────────────────────────────────────────── */
.rd-hero {
    position: relative;
    background: var(--color-bg-white);
    overflow: hidden;
    border-bottom: 1px solid var(--color-border-light);
}

.rd-hero__wash {
    position: absolute; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 90% 0%, rgba(168, 49, 60, 0.05), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(30, 44, 92, 0.05), transparent 50%);
}

.rd-hero__inner {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    /* Richard 2026-05-29: trim the gap below the menubar (was 88px top). */
    padding: 40px 32px 72px;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 64px;
    align-items: center;
}

.rd-hero__copy { min-width: 0; }

.rd-hero__eyebrow {
    color: var(--color-warm);
    margin-bottom: 20px;
}

.rd-hero__h1 {
    font-family: var(--rd-font-display);
    font-size: clamp(34px, 5vw, 64px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--color-accent);
    margin: 0 0 0;
    /* Legacy style.css sets `h1,h2,...,h6 { text-transform: capitalize }`
       which renders mockup's sentence-case copy ("A more considered way…")
       as Title Case ("A More Considered Way…"). Cancel it on hero. */
    text-transform: none;
}
.rd-hero__em {
    font-style: italic;
    font-weight: 600;
    color: var(--color-warm);
}

.rd-hero__sub {
    margin: 22px 0 0;
    font-size: 19px;
    line-height: 1.55;
    color: var(--color-text-secondary-light);
    max-width: 580px;
}

/* Search bar */
.rd-hero__search {
    margin-top: 32px;
    max-width: 640px;
    background: #fff;
    border: 1px solid var(--color-border-line);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-card-light);
}
.rd-hero__search-icon {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-muted-light);
    padding-left: 14px;
}
.rd-hero__input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--color-text-primary-light);
    font-size: 15px;
    font-family: var(--rd-font-body);
    padding: 14px 12px;
    min-width: 0;
}
.rd-hero__search .rd-btn-lg { flex: 0 0 auto; }
/* Hero CTA (replaces the keyword bar - Richard 2026-05-29). */
.rd-hero__cta { margin-top: 32px; }

/* Brand emblem + stats column */
.rd-hero__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
}
.rd-hero__emblem {
    width: 82%;
    height: auto;
    filter:
        drop-shadow(0 20px 60px rgba(14, 91, 74, 0.18))
        drop-shadow(0 6px 16px rgba(181, 148, 106, 0.12));
}

.rd-hero__stats {
    margin-top: 24px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border-light);
    width: 100%;
    /* Two stats now (0% Buyer fees removed) - center them under the emblem. */
    display: flex;
    justify-content: center;
    gap: 56px;
}
.rd-stat { text-align: center; }
.rd-stat__n {
    font-family: var(--rd-font-display);
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-accent);
    line-height: 1;
}
.rd-stat__l {
    margin-top: 6px;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted-light);
}

/* ── FEATURED LISTINGS ───────────────────────────────────── */
.rd-featured-listings .rd-grid-3 { gap: 24px; }
/* Reuse Resido restyled item-grid card; just override its outer wrapper width if needed */
.rd-featured-listings .property-listing { margin: 0; }

/* ── FEATURED CITIES ─────────────────────────────────────── */
.rd-city-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background-color: var(--color-bg-light);
    background-size: cover;
    background-position: center;
    display: block;
    cursor: pointer;
    min-height: 460px;
    color: #fff;
    isolation: isolate;
}
.rd-city-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(14, 23, 20, 0.1) 30%, rgba(14, 23, 20, 0.85));
    z-index: 1;
}
.rd-city-card__top {
    position: absolute;
    top: 22px; left: 22px; right: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}
.rd-city-card__count {
    color: rgba(255, 255, 255, 0.95);
    font-family: var(--rd-font-mono, monospace);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.rd-pill--light {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text-primary-light);
    border: 0;
}
.rd-city-card__bottom {
    position: absolute;
    bottom: 22px; left: 22px; right: 22px;
    z-index: 2;
    color: #fff;
}
.rd-city-card__name {
    font-family: var(--rd-font-display);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 600;
    color: #fff;
    margin: 0;
}
.rd-city-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
}

/* ── ROLES ───────────────────────────────────────────────── */
.rd-roles {
    padding: 96px 32px;
    margin-top: 96px;
    max-width: none;
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}
.rd-roles__inner {
    max-width: 1440px;
    margin: 0 auto;
}
.rd-role-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-radius: 14px;
    padding: 32px;
    box-shadow: var(--shadow-card-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.rd-role-card__topbar {
    position: absolute;
    top: 0; left: 0;
    width: 60px; height: 4px;
}
.rd-role-card--warm .rd-role-card__topbar { background: var(--color-warm); }
.rd-role-card--accent .rd-role-card__topbar { background: var(--color-accent); }
.rd-role-card--warm .rd-role-card__tag { color: var(--color-warm); }
.rd-role-card--accent .rd-role-card__tag { color: var(--color-accent); }

.rd-role-card__title {
    font-family: var(--rd-font-display);
    font-size: 26px;
    line-height: 1.2;
    color: var(--color-accent);
    margin: 16px 0 12px;
}
.rd-role-card__desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary-light);
    margin: 0 0 28px;
    flex: 1;
}
.rd-role-card__cta { align-self: flex-start; }

/* ── THAI FEATURES (numbered cards) ──────────────────────── */
.rd-feature-card {
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-radius: 14px;
    padding: 28px;
    position: relative;
}
.rd-feature-card__n {
    color: var(--color-warm);
    font-family: var(--rd-font-mono, monospace);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 22px;
}
.rd-feature-card__title {
    font-family: var(--rd-font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}
.rd-feature-card__desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary-light);
    margin: 0;
}

/* ── CTA BAND ────────────────────────────────────────────── */
.rd-cta-band-wrap {
    padding-bottom: 96px;
}
.rd-cta-band {
    position: relative;
    overflow: hidden;
    background: var(--color-accent);
    color: #fff;
    border-radius: 24px;
    padding: 64px 56px;
    display: flex;
    gap: 40px;
    align-items: center;
}
.rd-cta-band__halo {
    position: absolute;
    right: -100px; top: -50px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(181, 148, 106, 0.5), transparent 70%);
    pointer-events: none;
}
.rd-cta-band__copy { flex: 1; position: relative; }
.rd-cta-band__eyebrow {
    color: var(--color-warm);
    margin-bottom: 14px;
}
.rd-cta-band__h2 {
    color: #fff;
    max-width: 640px;
    margin: 0;
}
.rd-cta-band__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}
.rd-btn-on-accent {
    background: #fff;
    color: var(--color-accent);
    border: 1px solid #fff;
}
.rd-btn-on-accent:hover {
    background: var(--color-bg-cream);
    color: var(--color-accent);
    border-color: var(--color-bg-cream);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1023px) {
    .rd-hero__inner { grid-template-columns: 1fr; gap: 40px; padding: 32px 24px 48px; }
    .rd-hero__brand { order: -1; max-width: 360px; align-self: center; }
    .rd-section { padding: 64px 24px 0; }
    .rd-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .rd-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .rd-roles { padding: 72px 24px; margin-top: 72px; }
    .rd-cta-band { flex-direction: column; align-items: flex-start; padding: 48px 32px; gap: 28px; }
    .rd-cta-band__actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .rd-hero__inner { padding: 24px 16px 32px; }
    .rd-hero__h1 { font-size: 34px; }
    .rd-hero__sub { font-size: 16px; }
    .rd-hero__stats { gap: 36px; }
    .rd-section { padding: 48px 16px 0; }
    .rd-grid-3 { grid-template-columns: 1fr; }
    .rd-grid-4 { grid-template-columns: 1fr; }
    .rd-grid--tall { min-height: auto; }
    .rd-city-card { min-height: 320px; }
    .rd-section__head--centered { text-align: left; }
    .rd-cta-band { padding: 36px 22px; }
    .rd-cta-band__actions { flex-direction: column; width: 100%; }
    .rd-cta-band__actions .rd-btn { width: 100%; text-align: center; }
    .rd-roles { padding: 56px 16px; margin-top: 56px; }
    .rd-cta-band-wrap { padding-bottom: 56px; }
}

/* ── Bilingual font swap (Thai) ──────────────────────────── */
:lang(th) .rd-hero__h1,
:lang(th) .rd-h2,
:lang(th) .rd-role-card__title,
:lang(th) .rd-city-card__name,
:lang(th) .rd-feature-card__title,
:lang(th) .rd-stat__n {
    font-family: var(--rd-font-display);
}
:lang(th) .rd-home {
    font-family: var(--rd-font-body);
}
