/* =============================================================================
   Custom agency websites - shared structure.
   Every theme overrides the variables at the bottom of this file; the layout,
   spacing and components stay identical so a fix lands on all five themes.
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.cs {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.15;
    margin: 0 0 .4em;
    letter-spacing: var(--head-tracking, -0.01em);
}

.cs-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.cs-main { min-height: 50vh; }

/* ---------------------------------------------------------------- preview bar */
.cs-previewbar {
    background: #1f2933;
    color: #fff;
    text-align: center;
    font-size: 13px;
    padding: 8px 12px;
}

/* --------------------------------------------------------------------- header */
.cs-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
}

.cs-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 74px;
}

.cs-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-brand img { max-height: 46px; width: auto; }
.cs-brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: var(--head-tracking, -0.01em);
}

.cs-nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.cs-nav a { white-space: nowrap; color: var(--ink-soft); }
.cs-nav a:hover { color: var(--accent); }

.cs-header-actions { display: flex; align-items: center; gap: 12px; }

.cs-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}
.cs-call:hover { color: var(--accent-ink); filter: brightness(.95); }

.cs-burger {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    padding: 11px;
    cursor: pointer;
}
.cs-burger span {
    display: block;
    height: 2px;
    background: var(--ink);
    margin: 4px 0;
    border-radius: 2px;
}

/* ----------------------------------------------------------------------- hero */
.cs-hero { position: relative; background: var(--hero-bg); color: var(--hero-ink); overflow: hidden; }
.cs-hero-media { position: absolute; inset: 0; }
.cs-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.cs-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--hero-scrim, linear-gradient(120deg, rgba(31,41,51,.78), rgba(31,41,51,.35)));
}
.cs-hero-inner { position: relative; padding: 84px 0 96px; max-width: 720px; }
.cs-hero h1 { font-size: clamp(30px, 4.4vw, 54px); margin-bottom: 14px; }
.cs-hero p { font-size: clamp(16px, 1.8vw, 19px); margin: 0 0 8px; opacity: .94; max-width: 620px; }
.cs-hero--fullbleed .cs-hero-inner { padding-bottom: 120px; }

.cs-hero-kicker {
    display: inline-block;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: .8;
}

/* --------------------------------------------------------------------- search */
.cs-search {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-top: -46px;
    z-index: 5;
}
.cs-search--inline { margin-top: 0; }

.cs-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.cs-tab {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    border: 1px solid transparent;
}
.cs-tab.is-on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft-strong); }

.cs-search-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.cs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cs-field label {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
.cs-field select,
.cs-field input[type="text"],
.cs-field input[type="number"],
.cs-field input[type="email"],
.cs-field input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--field-bg);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    min-height: 46px;
}
.cs-field select:focus,
.cs-field input:focus { outline: 2px solid var(--accent-soft-strong); outline-offset: 1px; border-color: var(--accent); }

.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    min-height: 46px;
}
.cs-btn:hover { filter: brightness(.95); color: var(--accent-ink); }
.cs-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.cs-btn--block { width: 100%; }

/* -------------------------------------------------------------------- section */
.cs-section { padding: 64px 0; }
.cs-section--soft { background: var(--soft); }
.cs-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}
.cs-section-head h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; }
.cs-section-head a { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.cs-eyebrow {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
}

/* ---------------------------------------------------------------------- cards */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.cs-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: var(--card-shadow);
}
.cs-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.cs-card-media { position: relative; aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; }
.cs-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cs-card-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    background: rgba(255,255,255,.94);
    color: var(--ink);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
}

.cs-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cs-price { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.cs-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.cs-card-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0; }
.cs-card-meta { font-size: 14px; color: var(--muted); }
.cs-facts { font-size: 14px; color: var(--ink-soft); }

/* -------------------------------------------------------------------- filters */
.cs-filters {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin: 28px 0 30px;
}
.cs-filters .cs-search-row { grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr auto; }
.cs-result-count { font-size: 14px; color: var(--muted); margin: 0 0 18px; }

.cs-empty {
    text-align: center;
    padding: 72px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-lg);
    color: var(--muted);
}

/* --------------------------------------------------------------------- pager */
.cs-pager { display: flex; gap: 8px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.cs-pager a, .cs-pager span {
    min-width: 42px;
    padding: 10px 14px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.cs-pager .is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.cs-pager-step { font-weight: 600; white-space: nowrap; }
.cs-pager .cs-pager-gap { border: 0; min-width: 0; padding: 10px 2px; opacity: .45; }

/* On an example site the floating panel owns the bottom-right corner, so the pager
   shifts clear of it instead of hiding Next underneath. */
@media (min-width: 900px) {
    body.cs-has-tryit .cs-pager { padding-right: 350px; }
}

@media (max-width: 520px) {
    .cs-pager { gap: 6px; }
    .cs-pager a, .cs-pager span { min-width: 34px; padding: 9px 10px; font-size: 13px; }
    .cs-pager-step { padding: 9px 12px; }
    /* Phones keep Previous, the ends and where you are - not the whole run of numbers. */
    .cs-pager a:not(.cs-pager-step):not(.cs-pager-edge),
    .cs-pager .cs-pager-gap { display: none; }
}

/* -------------------------------------------------------------------- detail */
.cs-detail { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 36px; padding: 36px 0 72px; }
.cs-detail > * { min-width: 0; }
.cs-gallery-main { border-radius: var(--radius-lg); overflow: hidden; background: var(--soft); aspect-ratio: 16 / 10; max-width: 100%; }
.cs-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.cs-thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; min-width: 0; }
.cs-thumbs button {
    flex: 0 0 92px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: none;
    cursor: pointer;
}
.cs-thumbs button.is-on { border-color: var(--accent); }
.cs-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.cs-detail h1 { font-size: clamp(24px, 3vw, 34px); margin: 24px 0 8px; }
.cs-detail-price { font-family: var(--font-head); font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; margin-bottom: 6px; }
.cs-detail-address { color: var(--muted); margin-bottom: 22px; }

.cs-keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin: 22px 0 28px; }
.cs-keyfact { background: var(--soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.cs-keyfact strong { display: block; font-size: 18px; font-family: var(--font-head); }
.cs-keyfact span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.cs-prose { color: var(--ink-soft); }
.cs-prose p { margin: 0 0 14px; }
.cs-prose img { border-radius: var(--radius-sm); margin: 12px 0; }

/* --------------------------------------------------------------------- agent */
.cs-side-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 96px;
}
.cs-agent-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cs-agent-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--accent);
    flex: 0 0 64px;
}
.cs-agent-photo img { width: 100%; height: 100%; object-fit: cover; }

.cs-agent-card { display: flex; gap: 16px; align-items: flex-start; }
.cs-agent-card .cs-agent-photo { width: 74px; height: 74px; flex: 0 0 74px; }

/* ------------------------------------------------------------------ agent grid */
.cs-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

/* --------------------------------------------------------------------- forms */
.cs-form { display: grid; gap: 12px; margin-top: 8px; }
.cs-form textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    background: var(--field-bg);
    color: var(--ink);
}
.cs-form-note { font-size: 13px; color: var(--muted); }
.cs-alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
}
.cs-alert--ok { background: #e7f6ef; color: #16694a; }
.cs-alert--err { background: #fdecea; color: #a3352c; }

/* -------------------------------------------------------------------- footer */
.cs-footer { background: var(--footer-bg); color: var(--footer-ink); padding: 56px 0 24px; margin-top: 40px; }
.cs-footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.cs-footer h4 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-bottom: 12px; }
.cs-footer a { color: inherit; opacity: .86; }
.cs-footer a:hover { opacity: 1; color: var(--accent-on-dark, #fff); }

.cs-social { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.cs-social a {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    opacity: .8;
    border-bottom: 1px solid transparent;
}
.cs-social a:hover { opacity: 1; border-bottom-color: currentColor; }
.cs-footer-brand strong { font-family: var(--font-head); font-size: 20px; display: block; margin-bottom: 8px; }
.cs-footer-brand p { opacity: .7; margin: 0; font-size: 14px; }
.cs-footer-col p { margin: 0 0 8px; font-size: 14px; }
.cs-footer-base {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.12);
    font-size: 13px;
    opacity: .7;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------------ 404 page */
.cs-404 { padding: 100px 0; text-align: center; }
.cs-404 h1 { font-size: clamp(28px, 4vw, 44px); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
    .cs-search-row, .cs-filters .cs-search-row { grid-template-columns: 1fr 1fr; }
    .cs-search-row .cs-field--wide { grid-column: 1 / -1; }
    .cs-detail { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .cs-side-card { position: static; }
    .cs-footer-inner { grid-template-columns: 1fr 1fr; }
    .cs-hero-inner { padding: 56px 0 80px; }
}

@media (max-width: 760px) {
    .cs-burger { display: block; }
    .cs-header-actions { order: 3; }
    .cs-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 74px;
        background: var(--card-bg);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        gap: 0;
        padding: 8px 20px 16px;
        box-shadow: var(--shadow-card);
    }
    .cs-nav.is-open { display: flex; }
    .cs-nav a { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
    .cs-nav a:last-child { border-bottom: 0; }
    .cs-header-inner { min-height: 64px; }
    .cs-nav { top: 64px; }
}

@media (max-width: 640px) {
    .cs-search-row, .cs-filters .cs-search-row { grid-template-columns: 1fr; }
    .cs-section { padding: 44px 0; }
    .cs-grid { grid-template-columns: 1fr; }
    .cs-footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .cs-hero h1 { font-size: 30px; }
    .cs-search { margin-top: -28px; padding: 14px; }
    .cs-detail { padding: 20px 0 48px; }
}

/* Theme variable defaults (Modern). Each theme file overrides these. */
body.cs {
    --font-head: "Manrope", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --ink: #1f2933;
    --ink-soft: #414b56;
    --muted: #6b7580;
    --bg: #ffffff;
    --soft: #f4f6f7;
    --line: #e4e8ea;
    --line-soft: #eef1f2;
    --accent: #0f766e;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15,118,110,.10);
    --accent-soft-strong: rgba(15,118,110,.30);
    --accent-on-dark: #7ce3d8;
    --card-bg: #ffffff;
    --field-bg: #ffffff;
    --header-bg: #ffffff;
    --footer-bg: #1f2933;
    --footer-ink: #eef1f2;
    --hero-bg: #1f2933;
    --hero-ink: #ffffff;
    --radius-sm: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-card: 0 14px 34px rgba(31,41,51,.10);
    --card-shadow: 0 1px 2px rgba(31,41,51,.05);
    --card-border: 1px solid var(--line);
    --head-tracking: -0.02em;
}
