/*
 * CRM Listings. Dark blue text on white by default (Settings → CRM Listings: Text color, Accent color).
 * Rules are scoped under .rpcl and hold their own against theme/Breakdance link colors and image sizing.
 */
.rpcl { --rpcl-text: #0F172A; color: var(--rpcl-text); }
:root .rpcl, :root .rpcl :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd, span, strong, label, figcaption) { color: var(--rpcl-text); }
.rpcl img { max-width: none; }

/* ---------- grid / cards ---------- */
.rpcl-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(var(--rpcl-cols, 3), minmax(0, 1fr)); }
@media (max-width: 900px) { .rpcl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rpcl-grid { grid-template-columns: 1fr; } }
.rpcl a.rpcl-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 10px; background: #fff; color: var(--rpcl-text) !important; text-decoration: none !important; box-shadow: 0 1px 2px rgba(15,23,42,.06), 0 0 0 1px rgba(15,23,42,.08); transition: box-shadow .15s, transform .15s; }
.rpcl a.rpcl-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.12), 0 0 0 1px rgba(15,23,42,.12); transform: translateY(-2px); }
.rpcl .rpcl-card__img { position: relative; height: 0; padding-top: 75%; overflow: hidden; background: #e7e5e4; }
.rpcl .rpcl-card__img img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; margin: 0; }
.rpcl .rpcl-card__body { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.15rem 1.15rem; flex: 1; }
.rpcl .rpcl-card__more { margin-top: auto; padding-top: .6rem; font-size: .9rem; font-weight: 600; }
.rpcl a.rpcl-card * { color: var(--rpcl-text) !important; }
.rpcl a.rpcl-card .rpcl-badge { color: #fff !important; }

/* ---------- shared bits ---------- */
.rpcl .rpcl-badge { position: absolute; top: .75rem; left: .75rem; z-index: 1; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; background: var(--rpcl-accent, #1f3a2e); color: #fff !important; }
.rpcl-info .rpcl-badge { position: static; display: inline-block; }
.rpcl .rpcl-badge--pending { background: #b45309; }
.rpcl .rpcl-badge--accepted_offer { background: #6d28d9; }
.rpcl .rpcl-badge--sold { background: #44403c; }
.rpcl .rpcl-badge--coming_soon { background: #0e7490; }
.rpcl .rpcl-price { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.rpcl .rpcl-price--lg { margin-top: .75rem; font-size: 2rem; }
.rpcl .rpcl-address { line-height: 1.35; }
.rpcl .rpcl-address strong { display: block; font-size: 1.05rem; font-weight: 600; }
.rpcl .rpcl-address span { display: block; font-size: .92rem; opacity: .8; }
.rpcl .rpcl-facts { font-size: .92rem; }
.rpcl .rpcl-mls { margin-top: .5rem; font-size: .85rem; opacity: .7; }
.rpcl .rpcl-button { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.25rem; border: 2px solid var(--rpcl-text); border-radius: 8px; background: var(--rpcl-text); color: #fff !important; font-weight: 600; line-height: 1.2; text-decoration: none !important; cursor: pointer; }
.rpcl .rpcl-button:hover { filter: brightness(1.25); }
.rpcl .rpcl-button--outline { background: #fff; color: var(--rpcl-text) !important; }
.rpcl .rpcl-button--outline:hover { background: var(--rpcl-text); color: #fff !important; filter: none; }
.rpcl a.rpcl-link { color: var(--rpcl-text) !important; font-weight: 600; }

/* ---------- single listing ---------- */
.rpcl-listing { display: grid; gap: 2rem; background: #fff; }
html.rpcl-noscroll { overflow: hidden; }

/* Hero: one large photo + four small (fewer photos → simpler layouts) */
.rpcl .rpcl-hero { position: relative; display: grid; gap: 8px; height: clamp(260px, 42vw, 520px); grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; border-radius: 10px; overflow: hidden; }
.rpcl .rpcl-hero--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.rpcl .rpcl-hero--2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.rpcl .rpcl-hero--3 { grid-template-columns: 2fr 1fr; }
.rpcl .rpcl-hero--4 { grid-template-columns: 2fr 1fr 1fr; }
.rpcl .rpcl-hero__tile { position: relative; display: block; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #e7e5e4; overflow: hidden; cursor: zoom-in; }
.rpcl .rpcl-hero__tile:first-child { grid-row: 1 / -1; }
.rpcl .rpcl-hero--4 .rpcl-hero__tile:nth-child(2) { grid-column: 2 / 4; }
.rpcl .rpcl-hero__tile img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; margin: 0; transition: transform .35s ease, filter .2s; }
.rpcl .rpcl-hero__tile:hover img { transform: scale(1.03); filter: brightness(.95); }
.rpcl .rpcl-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border: 0; border-radius: 999px; background: #fff; color: var(--rpcl-text) !important; font: inherit; font-size: .95rem; font-weight: 600; line-height: 1; text-decoration: none !important; box-shadow: 0 2px 8px rgba(15,23,42,.18); cursor: pointer; }
.rpcl .rpcl-chip:hover { background: #f1f5f9; }
.rpcl .rpcl-hero__actions { position: absolute; left: 1rem; bottom: 1rem; display: flex; gap: .5rem; }
.rpcl .rpcl-hero__count { position: absolute; right: 1rem; bottom: 1rem; }
@media (max-width: 700px) {
  .rpcl .rpcl-hero { height: auto; display: block; border-radius: 10px; }
  .rpcl .rpcl-hero__tile { display: none; }
  .rpcl .rpcl-hero__tile:first-child { display: block; width: 100%; height: 0; padding-top: 70%; }
  .rpcl .rpcl-hero__actions { left: .75rem; bottom: .75rem; }
  .rpcl .rpcl-hero__count { right: .75rem; bottom: .75rem; }
}

/* Info + contact cards */
.rpcl-top { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); align-items: start; }
@media (max-width: 860px) { .rpcl-top { grid-template-columns: 1fr; } }
.rpcl .rpcl-info, .rpcl .rpcl-contact { padding: 1.5rem; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.12); }
.rpcl .rpcl-contact { position: sticky; top: 1.5rem; }
@media (max-width: 860px) { .rpcl .rpcl-contact { position: static; } }
.rpcl .rpcl-status { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; }
.rpcl .rpcl-status > span { width: .6rem; height: .6rem; border-radius: 50%; background: #16a34a; }
.rpcl .rpcl-status--pending > span { background: #d97706; }
.rpcl .rpcl-status--accepted_offer > span { background: #7c3aed; }
.rpcl .rpcl-backups { margin: .35rem 0 0; font-size: .92rem; opacity: .8; }
.rpcl .rpcl-status--coming_soon > span { background: #0891b2; }
.rpcl .rpcl-status--sold > span, .rpcl .rpcl-status--off_market > span { background: #57534e; }
.rpcl .rpcl-price--lg { margin-top: .5rem; font-size: 2.1rem; }
.rpcl .rpcl-bigfacts { margin-top: .35rem; font-size: 1.25rem; font-weight: 700; }
.rpcl .rpcl-title { margin: .75rem 0 0; font-size: 1.1rem; line-height: 1.4; font-weight: 400; }
.rpcl .rpcl-title span { display: inline; margin-left: .3rem; font-size: inherit; opacity: 1; }
.rpcl .rpcl-title span::before { content: ", "; margin-left: -.3rem; }
.rpcl .rpcl-contact__title { margin-bottom: .9rem; font-size: 1.05rem; font-weight: 700; }
.rpcl .rpcl-contact__buttons { display: grid; gap: .6rem; }
.rpcl .rpcl-contact__buttons .rpcl-button { width: 100%; box-sizing: border-box; white-space: nowrap; }

/* Full-screen gallery */
.rpcl.rpcl-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #fff; color: var(--rpcl-text); }
.rpcl.rpcl-modal::backdrop { background: rgba(15,23,42,.6); }
.rpcl .rpcl-modal__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem clamp(1rem, 3vw, 2rem); background: #fff; box-shadow: 0 1px 0 rgba(15,23,42,.1); }
.rpcl .rpcl-modal__summary { font-size: 1.05rem; line-height: 1.35; }
.rpcl .rpcl-modal__sep { margin: 0 .35rem; opacity: .4; }
.rpcl .rpcl-modal__addr { display: block; font-size: .9rem; opacity: .75; }
.rpcl .rpcl-modal__actions { display: flex; align-items: center; gap: .75rem; }
.rpcl .rpcl-modal__close { width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: #f1f5f9; color: var(--rpcl-text); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.rpcl .rpcl-modal__close:hover { background: #e2e8f0; }
.rpcl .rpcl-modal__body { height: calc(100dvh - 4.5rem); overflow-y: auto; padding: 1.25rem clamp(1rem, 3vw, 2rem) 2rem; box-sizing: border-box; }
@media (max-width: 700px) { .rpcl .rpcl-modal__head .rpcl-button { display: none; } .rpcl .rpcl-modal__summary { font-size: .95rem; } }
.rpcl .rpcl-tabs { display: flex; gap: 1rem; margin-bottom: 1.25rem; overflow-x: auto; padding-bottom: .25rem; }
.rpcl .rpcl-tab { flex: 0 0 auto; display: grid; gap: .4rem; width: 150px; padding: 0; border: 0; background: none; color: var(--rpcl-text); font: inherit; font-size: .95rem; text-align: left; cursor: pointer; }
.rpcl .rpcl-tab__img { position: relative; display: block; height: 0; padding-top: 66%; border-radius: 10px; overflow: hidden; border: 3px solid transparent; }
.rpcl .rpcl-tab.is-active .rpcl-tab__img { border-color: var(--rpcl-text); }
.rpcl .rpcl-tab.is-active { font-weight: 700; }
.rpcl .rpcl-tab__img img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.rpcl .rpcl-tab__n { position: absolute; right: .4rem; bottom: .4rem; min-width: 1.6rem; padding: .15rem .45rem; border-radius: 999px; background: rgba(15,23,42,.85); color: #fff !important; font-size: .78rem; font-weight: 700; text-align: center; }
.rpcl .rpcl-grid-photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.rpcl .rpcl-grid-photos__item { position: relative; display: block; height: 0; padding: 66.6667% 0 0; border: 0; border-radius: 10px; background: #e7e5e4; overflow: hidden; cursor: zoom-in; }
.rpcl .rpcl-grid-photos__item[hidden] { display: none; }
.rpcl .rpcl-grid-photos__item img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.rpcl .rpcl-grid-photos__cap { position: absolute; left: .5rem; bottom: .5rem; padding: .2rem .55rem; border-radius: 6px; background: rgba(15,23,42,.75); color: #fff !important; font-size: .82rem; }

/* Single-photo viewer inside the gallery */
.rpcl .rpcl-viewer { position: absolute; inset: 4.5rem 0 0; z-index: 3; display: grid; place-items: center; padding: 3.75rem 4.5rem 1rem; box-sizing: border-box; background: #0b1220; }
.rpcl .rpcl-viewer[hidden] { display: none; }
.rpcl .rpcl-viewer__fig { margin: 0; display: grid; justify-items: center; gap: .75rem; max-width: 100%; }
.rpcl .rpcl-viewer__fig img { display: block; max-width: 100% !important; max-height: calc(100dvh - 13rem) !important; width: auto !important; height: auto !important; object-fit: contain; border-radius: 6px; }
.rpcl .rpcl-viewer__fig figcaption, .rpcl .rpcl-viewer__fig figcaption span { color: #e2e8f0 !important; font-size: .95rem; text-align: center; }
.rpcl .rpcl-viewer__count { margin-left: .5rem; opacity: .7; }
.rpcl .rpcl-viewer__back { position: absolute; top: 1rem; left: 1rem; padding: .5rem .9rem; border: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.rpcl .rpcl-viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--rpcl-text); font-size: 2rem; line-height: 1; cursor: pointer; }
.rpcl .rpcl-viewer__nav--prev { left: 1rem; }
.rpcl .rpcl-viewer__nav--next { right: 1rem; }
@media (max-width: 700px) { .rpcl .rpcl-viewer { padding: 3.75rem .5rem 1rem; } .rpcl .rpcl-viewer__nav { top: auto; bottom: 1rem; transform: none; width: 2.4rem; height: 2.4rem; font-size: 1.6rem; } }

.rpcl-section .rpcl-h { margin: 0 0 .75rem; font-size: 1.25rem; }
.rpcl-details { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rpcl .rpcl-details__title { margin: 0 0 .4rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.rpcl-details dl { margin: 0; }
.rpcl-details dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid rgba(15,23,42,.08); font-size: .95rem; }
.rpcl .rpcl-details dt { opacity: .75; }
.rpcl-details dd { margin: 0; text-align: right; font-weight: 500; }
/* Facts & features: sections in order; groups flow into balanced columns (one column on phones) */
.rpcl .rpcl-fsec { margin-top: 1.25rem; }
.rpcl .rpcl-fsec__title { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 10px; background: #f1f5f9; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; text-transform: none; opacity: 1; }
.rpcl .rpcl-fsec__cols { columns: 2 260px; column-gap: 3rem; padding: 0 .25rem; }
.rpcl .rpcl-fsec__text { margin: 0 0 1.25rem; max-width: 70ch; line-height: 1.6; }
.rpcl .rpcl-fsec__text p { margin: 0 0 .75rem; }
.rpcl .rpcl-fsec__text p:last-child { margin-bottom: 0; }
.rpcl .rpcl-fgroup { break-inside: avoid; margin: 0 0 1.25rem; }
.rpcl .rpcl-fgroup__title { margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; }
.rpcl .rpcl-fgroup ul { margin: 0; padding-left: 1.2rem; list-style: disc; }
.rpcl .rpcl-fgroup li { margin: .2rem 0; line-height: 1.45; }

/* Open houses */
.rpcl .rpcl-oh-list { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.rpcl .rpcl-oh { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .9rem; margin: 0; padding: .8rem 1rem; border-radius: 10px; box-shadow: 0 0 0 1px rgba(15,23,42,.12); }
.rpcl .rpcl-oh__day { font-weight: 700; }
.rpcl .rpcl-oh__note { opacity: .75; }
.rpcl .rpcl-oh__live { padding: .1rem .55rem; border-radius: 999px; background: #065f46; color: #fff; font-size: .8rem; font-weight: 700; }
.rpcl .rpcl-oh-none { margin: 0; }
.rpcl .rpcl-oh-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin: 1rem 0 0; }
.rpcl a.rpcl-oh-next { display: inline-block; margin-top: .75rem; padding: .35rem .75rem; border-radius: 999px; background: #ecfdf5; color: #065f46 !important; font-size: .92rem; font-weight: 600; text-decoration: none !important; }
.rpcl a.rpcl-oh-next.is-live { background: #065f46; color: #fff !important; }
.rpcl .rpcl-card__oh { align-self: flex-start; margin-top: .35rem; padding: .2rem .6rem; border-radius: 999px; background: #ecfdf5; color: #065f46 !important; font-size: .82rem; font-weight: 600; }

/* Schools */
.rpcl .rpcl-schools { padding: 1.5rem; border-radius: 10px; box-shadow: 0 0 0 1px rgba(15,23,42,.12); }
.rpcl .rpcl-schools .rpcl-h { margin-bottom: .5rem; }
.rpcl .rpcl-schools__district { margin: 0 0 .5rem; }
.rpcl .rpcl-schools__district span { opacity: .7; margin-right: .35rem; }
.rpcl .rpcl-schools__list { margin: 0; padding: 0; list-style: none; }
.rpcl .rpcl-school { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin: 0; padding: 1rem 0; border-bottom: 1px solid rgba(15,23,42,.1); }
.rpcl .rpcl-school__text strong { display: block; font-size: 1.1rem; font-weight: 700; }
.rpcl .rpcl-school__text span { display: block; margin-top: .15rem; opacity: .8; }
.rpcl .rpcl-school__text { flex: 1 1 220px; min-width: 0; }
.rpcl .rpcl-school__links { flex: 0 0 auto; display: flex; gap: .5rem; }
.rpcl a.rpcl-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .85rem; border-radius: 999px; background: #f1f5f9; color: var(--rpcl-text) !important; font-size: .9rem; font-weight: 600; text-decoration: none !important; white-space: nowrap; }
.rpcl a.rpcl-pill:hover { background: #e2e8f0; }
.rpcl .rpcl-schools__note { margin: 1rem 0 0; font-size: .85rem; opacity: .75; }
.rpcl .rpcl-schools__note a { color: var(--rpcl-text) !important; font-weight: 600; }
.rpcl-map { position: relative; height: 0; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #e7e5e4; }
.rpcl-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rpcl-enquiry { max-width: 680px; }
.rpcl-form label { display: block; font-weight: 500; font-size: .95rem; }
.rpcl-form input, .rpcl-form textarea { box-sizing: border-box; display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; border: 1px solid rgba(15,23,42,.25); border-radius: 6px; background: #fff; color: var(--rpcl-text); font: inherit; }
.rpcl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .rpcl-two { grid-template-columns: 1fr; } }
.rpcl-hp { position: absolute !important; left: -9999px !important; }
.rpcl .rpcl-ok { padding: .8rem 1rem; border-radius: 8px; background: #ecfdf5; color: #065f46; }
.rpcl .rpcl-error { padding: .8rem 1rem; border-radius: 8px; background: #fef2f2; color: #991b1b; }
.rpcl-empty, .rpcl-note { opacity: .8; }
