/* ==========================================================================
   White-label website designs (sites.theme.template → body classes tpl-*, sh-<hero>, sc-<cards>; hero sections use hero-*).
   Variables set per site in views/site/_header.ejs: --primary --accent --accent-text --on-accent
   --on-primary --font-h --font-b --site-radius. Colors are contrast-checked in lib/sites.js.
   ========================================================================== */

/* ---- Shared foundations (all designs) ---- */
.site-body { font-family: var(--font-b); -webkit-font-smoothing: antialiased; }
.site-body h1, .site-body h2, .site-body h3, .site-body .section-header h2, .site-body .site-name { font-family: var(--font-h); }
.site-body .btn { background: var(--accent); color: var(--on-accent); border-radius: calc(var(--site-radius) * .6 + 4px); }
.site-body .btn-outline { background: transparent; color: inherit; border: 1.5px solid currentColor; }
:root[data-theme="light"] .site-body main a:not(.btn):not(.property-card), :root[data-theme="light"] .site-body .prose a { color: var(--accent-text); }
.site-body .section-tag { color: var(--accent-text); }
:root[data-theme="dark"] .site-body .section-tag { color: var(--accent); }
.site-body .property-card { border-radius: var(--site-radius); }
.site-body .search-bar { border-radius: calc(var(--site-radius) * .8 + 6px); }
.site-body :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.site-body .properties-section, .site-body .about-section, .site-body .team-section, .site-body .reviews-section, .site-body .site-map-section { padding-block: clamp(48px, 7vw, 88px); }
@media (prefers-reduced-motion: reduce) { .site-body *, .site-body *::before, .site-body *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; opacity: .85; margin-bottom: 14px; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.6; opacity: .88; max-width: 58ch; margin: 0 0 22px; }

/* Trust strip under every hero */
.trust-strip { background: var(--primary); color: var(--on-primary); font-size: .88rem; }
.trust-strip .container { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; padding-block: 12px; }
.trust-strip span:first-child { font-weight: 600; }

/* Mobile contact bar (WhatsApp + call), the #1 conversion action for MX real estate */
.mobile-cta { display: none; }
@media (max-width: 768px) {
  .mobile-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(10,10,10,.92); backdrop-filter: blur(8px); }
  .mobile-cta a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 10px; font-weight: 700; text-decoration: none; }
  .mobile-cta .wa { background: #25d366; color: #073b1c; } .mobile-cta .call { background: var(--accent); color: var(--on-accent); }
  .site-body.has-mobile-cta { padding-bottom: 76px; }
}

/* ---- Hero: split (Modern, Coastal) ---- */
.hero-split { padding: clamp(96px, 12vw, 140px) 0 clamp(40px, 6vw, 72px); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--bg)) 0%, var(--bg) 100%); }
.hs-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-split h1 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); line-height: 1.08; margin: 0 0 14px; color: var(--text); }
.hero-split .hero-badge { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); border: 0; }
.hero-split .hero-stats .stat-number { color: var(--text); } .hero-split .hero-stats .stat-label { color: var(--text-light); }
.hs-media img, .hs-placeholder { width: 100%; aspect-ratio: 4/3.4; object-fit: cover; border-radius: calc(var(--site-radius) * 1.4 + 6px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); display: block; }
.hs-placeholder { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.tpl-coastal .hs-media img { border-radius: 40% 12% 40% 12% / 20% 12% 20% 12%; }
@media (max-width: 900px) { .hs-grid { grid-template-columns: 1fr; } .hs-media { order: -1; } .hs-media img { aspect-ratio: 16/10; } }

/* ---- Hero: minimal ---- */
.hero-minimal { padding: clamp(110px, 14vw, 160px) 0 clamp(40px, 6vw, 64px); border-bottom: 1px solid var(--border); }
.hero-minimal h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 0 0 16px; max-width: 18ch; color: var(--text); }
.hero-minimal .eyebrow { color: var(--text-light); }

/* ---- Hero: full-bleed (Luxury) ---- */
.hero-fullbleed { position: relative; min-height: min(88vh, 900px); display: flex; align-items: flex-end; background: var(--primary) center/cover no-repeat; color: #fff; }
.hf-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.15) 30%, rgba(0,0,0,.72) 100%); }
.hf-copy { position: relative; padding-bottom: clamp(90px, 12vw, 140px); }
.hero-fullbleed h1 { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 500; line-height: 1.02; margin: 0 0 14px; max-width: 16ch; color: #fff; }
.hero-fullbleed .lead { color: rgba(255,255,255,.9); }
.hf-search { position: relative; margin-top: -48px; z-index: 5; }
.hf-search .search-bar { box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* ---- Hero: bold (Urban) ---- */
.hero-bold { padding: clamp(100px, 12vw, 140px) 0 clamp(40px, 6vw, 72px); background: var(--bg); }
.hb-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(24px, 4vw, 48px); align-items: stretch; }
.hero-bold h1 { font-size: clamp(2.6rem, 7vw, 5.6rem); font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; line-height: .92; margin: 0 0 18px; color: var(--text); }
.hero-bold .eyebrow { background: var(--accent); color: var(--on-accent); padding: 4px 10px; opacity: 1; }
.hb-media { position: relative; min-height: 320px; }
.hb-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(.15) contrast(1.05); }
.hb-block { position: absolute; left: -18px; bottom: -18px; background: var(--accent); color: var(--on-accent); padding: 18px 22px; display: flex; flex-direction: column; }
.hb-block b { font-family: var(--font-h); font-size: 2.4rem; font-weight: 900; line-height: 1; } .hb-block span { text-transform: uppercase; font-size: .75rem; letter-spacing: .12em; font-weight: 700; }
@media (max-width: 900px) { .hb-grid { grid-template-columns: 1fr; } .hb-media { min-height: 240px; } .hb-block { left: 12px; bottom: 12px; } }

/* ---- Hero: editorial ---- */
.hero-editorial { padding: clamp(100px, 12vw, 130px) 0 clamp(32px, 5vw, 56px); }
.he-top { text-align: center; max-width: 820px; margin: 0 auto 28px; } .he-top .lead { margin-inline: auto; }
.hero-editorial h1 { font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: 1.05; margin: 0 0 12px; color: var(--text); font-weight: 400; }
.he-feature { position: relative; display: block; border-radius: var(--site-radius); overflow: hidden; color: #fff; text-decoration: none; }
.he-feature img { width: 100%; aspect-ratio: 21/9; object-fit: cover; display: block; }
.he-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(18px, 3vw, 36px); background: linear-gradient(180deg, transparent, rgba(0,0,0,.75)); }
.he-caption h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2.2rem); margin: 4px 0; font-weight: 400; } .he-caption p { margin: 0 0 6px; opacity: .9; }
.he-price { font-size: 1.2rem; }
.he-search { margin-top: -30px; position: relative; padding-inline: clamp(0px, 4vw, 48px); }
@media (max-width: 700px) { .he-feature img { aspect-ratio: 4/3; } .he-search { margin-top: 16px; padding: 0; } }

/* ---- Cards: soft ---- */
.sc-soft .property-card { box-shadow: 0 8px 30px -12px rgba(0,0,0,.18); border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.sc-soft .property-price .price { color: var(--accent-text); }

/* ---- Cards: flat ---- */
.sc-flat .property-card { box-shadow: none; border: 1px solid var(--border); animation: none; }
.sc-flat .property-card:hover { transform: none; border-color: var(--text); box-shadow: none; }
.sc-flat .property-card:hover .property-image img { transform: none; }

/* ---- Cards: large (Luxury) — two columns, tall photos, quiet text ---- */
.sc-large .property-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 36px; }
.sc-large .property-image { height: auto; aspect-ratio: 4/3; }
.sc-large .property-card { box-shadow: none; background: transparent; }
.sc-large .property-info { padding: 16px 2px 0; }
.sc-large .property-info h3 { font-family: var(--font-h); font-size: 1.45rem; font-weight: 500; }
.sc-large .detail-chip { background: transparent; border: 0; padding: 0 12px 0 0; letter-spacing: .06em; text-transform: uppercase; font-size: .72rem; }

/* ---- Cards: overlay (Urban) — text on the photo ---- */
.sc-overlay .property-card { position: relative; box-shadow: none; }
.sc-overlay .property-image { height: auto; aspect-ratio: 3/4; }
.sc-overlay .property-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; color: #fff; background: linear-gradient(180deg, transparent, rgba(0,0,0,.85) 55%); }
.sc-overlay .property-info h3, .sc-overlay .property-price .price, .sc-overlay .property-location, .sc-overlay .property-agent { color: #fff; }
.sc-overlay .detail-chip { background: rgba(255,255,255,.16); color: #fff; border: 0; }
.sc-overlay .property-price .price { font-family: var(--font-h); font-weight: 900; font-size: 1.35rem; }
.sc-overlay .mls-source { color: rgba(255,255,255,.75); }

/* ---- Cards: list (Editorial) — horizontal rows ---- */
.sc-list .property-grid { grid-template-columns: 1fr; gap: 18px; }
.sc-list .property-card { display: grid; grid-template-columns: minmax(220px, 38%) 1fr; box-shadow: none; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; padding-bottom: 18px; }
.sc-list .property-card:hover { transform: none; }
.sc-list .property-image { height: auto; aspect-ratio: 16/11; border-radius: var(--site-radius); }
.sc-list .property-info { padding: 4px 0 0 24px; }
.sc-list .property-info h3 { font-family: var(--font-h); font-size: 1.5rem; font-weight: 400; }
.sc-list .search-results .property-grid, .sc-list .search-layout .property-grid { grid-template-columns: 1fr; }
@media (max-width: 700px) { .sc-list .property-card { grid-template-columns: 1fr; } .sc-list .property-info { padding: 14px 0 0; } }

/* ---- Design-specific accents ---- */
.tpl-luxury .navbar { background: transparent; }
.tpl-luxury h1, .tpl-luxury h2 { letter-spacing: .01em; }
.tpl-luxury .section-header h2 { font-weight: 500; font-size: clamp(2rem, 3.4vw, 2.8rem); }
.tpl-luxury .btn { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; }
.tpl-coastal .btn { border-radius: 999px; }
.tpl-coastal .section-tag { background: color-mix(in srgb, var(--primary) 12%, transparent); padding: 4px 12px; border-radius: 999px; }
.tpl-urban .section-header h2 { text-transform: uppercase; font-weight: 900; letter-spacing: -.02em; }
.tpl-urban .btn { border-radius: 0; text-transform: uppercase; font-weight: 800; letter-spacing: .04em; }
.tpl-editorial .section-header { text-align: left; border-top: 2px solid var(--text); padding-top: 14px; }
.tpl-editorial .section-header h2 { font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.tpl-warm .reviews-section { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.tpl-warm .review-card { border-radius: 18px; }
.tpl-warm .team-section .person-card img { border-radius: 50%; }
.tpl-minimal .hero-badge, .tpl-minimal .hero-stats { display: none; }
.hero-minimal .search-bar, .hero-split .search-bar, .hero-bold .search-bar { margin-left: 0; margin-right: auto; }

/* Team: firm licence line + per-person licence */
.firm-license { margin: 8px auto 0; font-size: .95rem; color: var(--text-muted, #555); }
.firm-license b { color: var(--text, inherit); }
.person-card .person-license { display: block; font-size: .8rem; line-height: 1.35; color: var(--text-muted, #666); margin: 2px 8px 4px; text-align: center; }
.team-section .people-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 240px)); justify-content: center; }
