/* =============================================================
   Redesigned community / subdivision spoke
   (templates/site/neighborhood_spoke_rd.html, page key 'town').
   Loaded after rd.css and town.css: the page is a smaller town page and
   reuses town.css (.rdt-hero, .rdt-cards, .rdt-value, .rdt-faq, .rdt-list,
   .rdt-contact). Only additions here, every one rdk- prefixed or scoped
   under .rdk, so nothing can restyle the town page or any other page.
   ============================================================= */

/* The CMS text was written for site/base.html and still uses its colour names
   in inline styles (the "Membership at a glance" box). Same values as base.html. */
.rdk {
  --teal: var(--brand-primary);
  --teal-light: var(--brand-accent);
  --white: var(--brand-base);
  --dark: var(--brand-primary);
  --text: var(--brand-body);
  --text-muted: #5b6b80;
  --light-bg: var(--brand-tint);
  --border: #e2e8f0;
}

/* ---------- hero ---------- */
.rdk .rdt-hero__h1 { max-width: 24ch; }
.rdk .rdt-crumbs { row-gap: 2px; }
/* 44px tap height for the two breadcrumb links without moving the line. */
.rdk .rdt-crumbs a { padding: 13px 0; margin: -13px 0; }
.rdk .rdt-hero__ctas .rd-btn { white-space: normal; text-align: center; }

/* ---------- columns: text sits on the hero's left edge, 800px wide ---------- */
.rdk-col { max-width: 800px; min-width: 0; }
.rdk-guide__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.rdk-rail { display: none; }
@media (min-width: 1024px) {
  .rdk-guide__grid { grid-template-columns: minmax(0, 800px) 300px; justify-content: space-between; align-items: start; gap: 40px; }
  .rdk-rail { display: flex; position: sticky; top: 24px; padding: 20px; gap: 12px; box-shadow: none; }
  .rdk-rail__who { gap: 2px; min-width: 0; }
}

/* ---------- lead (opening paragraph + membership box, above the listings) ---------- */
.rdk-lead { padding-bottom: 0; }
.rdk-lead + .rdk-homes { padding-top: clamp(32px, 4vw, 48px); }
.rdk-lead .rdk-prose > p:first-child { font-size: 18px; line-height: 1.65; }

/* ---------- homes ---------- */
.rdk-homes .rd-h2, .rdk-sold .rd-h2, .rdk-links .rd-h2 { max-width: none; }

/* ---------- the CMS text ---------- */
.rdk-prose { font-size: 16px; line-height: 1.75; min-width: 0; overflow-wrap: break-word; }
.rdk-prose h2 { font-family: var(--rd-serif); font-weight: 400; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; margin: 32px 0 12px; }
.rdk-prose > h2:first-child, .rdk-prose > h3:first-child { margin-top: 0; }
.rdk-prose > :last-child { margin-bottom: 0; }
.rdk-prose a { font-weight: 600; }
.rdk-prose strong { color: var(--brand-primary); }
.rdk-prose img { border-radius: var(--rd-radius-btn); }
.rdk-prose .membership-at-a-glance { border-radius: 0 var(--rd-radius-btn) var(--rd-radius-btn) 0 !important; border-left: 3px solid var(--brand-warm) !important; }
.rdk-prose .membership-at-a-glance li { margin-bottom: 2px; }

/* A table scrolls inside its own box, never the page (engine.spoke_redesign.wrap_tables). */
.rdk-tablebox { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 24px; border: 1px solid var(--rd-line); border-radius: 12px; background: var(--brand-base); }
.rdk-prose table { width: 100%; border-collapse: collapse; margin: 0; font-size: 15px; line-height: 1.5; }
.rdk-prose th { background: var(--brand-primary); color: var(--brand-base); padding: 12px 16px; text-align: left; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; vertical-align: bottom; }
.rdk-prose td { padding: 12px 16px; border-top: 1px solid var(--rd-line); vertical-align: top; }
.rdk-prose tbody tr:nth-child(even) { background: var(--brand-tint); }
.rdk-prose td:first-child { font-weight: 600; color: var(--brand-primary); }
/* A table the helper could not box (one table inside another): still never wider than the page. */
.rdk-prose > table { display: block; max-width: 100%; overflow-x: auto; }

/* ---------- guide: each section of the text is a native <details> ---------- */
.rdk-guide .rdk-prose + .rdk-parts, .rdk-note + .rdk-parts { margin-top: 28px; }
.rdk .rdk-note { background: var(--brand-base); border-left: 3px solid var(--brand-warm); border-radius: 0 var(--rd-radius-btn) var(--rd-radius-btn) 0; padding: 16px 20px; line-height: 1.6; margin-bottom: 24px; }
.rdk-note a { font-weight: 600; }
.rdk-parts { display: flex; flex-direction: column; gap: 10px; }
.rdk-part { background: var(--brand-base); border-radius: 12px; padding: 4px 20px; }
.rdk-part > summary { min-height: 60px; padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; }
.rdk-part > summary::-webkit-details-marker { display: none; }
.rdk-part > summary::marker { content: ''; }
.rdk-part > summary h2, .rdk-part > summary h3 { font-family: var(--rd-serif); font-weight: 400; font-size: clamp(20px, 2.2vw, 24px); line-height: 1.25; color: var(--brand-primary); margin: 0; min-width: 0; }
.rdk-part > summary .rdt-more__sign { flex: 0 0 auto; }
.rdk-part > .rdk-prose { padding: 4px 0 20px; }

/* ---------- price table + short-term rental notes ---------- */
.rdk-facts__stack { display: flex; flex-direction: column; gap: 36px; }
.rdk-fact { border-top: 1px solid var(--brand-warm); padding-top: 20px; }
.rdk-fact > .rdk-tablebox:first-child { margin-top: 0; }
.rdk-fact > p:first-child > strong:only-child { display: block; font-family: var(--rd-serif); font-weight: 400; font-size: 23px; line-height: 1.3; }

/* ---------- market report box (public/_market_report_box.html): redesign input + tap sizes ---------- */
.rdk .mrb-input { min-height: var(--rd-input-h); font-size: 16px; }
.rdk .mrb-btn { min-height: var(--rd-tap); }

/* ---------- related links ---------- */
.rdk-links { display: flex; flex-direction: column; gap: 8px; }
.rdk-links ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 40px; margin-top: 16px; }
.rdk .rdk-links li, .rdk .rdk-links li:last-child { border-top: 1px solid var(--brand-warm); border-bottom: 0; }
.rdk-links li > a { padding-top: 14px; padding-bottom: 18px; justify-content: flex-start; height: 100%; }
.rdk-links .rdt-list__title { font-family: var(--rd-serif); font-weight: 400; font-size: 20px; line-height: 1.3; }

/* ---------- phone ---------- */
@media (max-width: 560px) {
  /* No market figures in the hero: the one-line subtitle stays above the two buttons. */
  .rdk-hero--plain .rdt-hero__lead { order: 2; }
  .rdk .rdt-hero__h1 { font-size: 30px; }
  .rdk-lead .rdk-prose > p:first-child { font-size: 16px; }
  .rdk-part { padding: 2px 16px; }
  .rdk-prose th { padding: 10px 12px; font-size: 12px; letter-spacing: 0; }
  .rdk-prose td { padding: 10px 12px; font-size: 14px; }
  /* Three or four columns need room to be read: the box scrolls, the page does not. */
  .rdk-tablebox table { min-width: 500px; }
}
