/* ==========================================================================
   Charter Realty — main stylesheet
   Modern, centred, responsive. Brand colours derive from the original logo
   (deep red arch) and the original dark-blue header bar.
   ========================================================================== */

:root {
  --brand:        #8c1c1c;
  --brand-dark:   #6d1414;
  --brand-light:  #b03030;
  --navy:         #14395b;
  --navy-dark:    #0d2740;
  --navy-light:   #2c5b86;
  --sand:         #f7f4ef;
  --sand-dark:    #ece5da;
  --ink:          #1d2328;
  --body:         #38424b;
  --muted:        #6b767f;
  --line:         #dcd5ca;
  --white:        #ffffff;
  --gold:         #b98a2e;

  --radius:   10px;
  --radius-s: 6px;
  --shadow:   0 1px 2px rgba(29, 35, 40, .06), 0 6px 18px rgba(29, 35, 40, .07);
  --shadow-l: 0 2px 4px rgba(29, 35, 40, .07), 0 14px 40px rgba(29, 35, 40, .12);
  --wrap:     1140px;
  --wrap-narrow: 820px;

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", "Iowan Old Style", serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.22; margin: 0 0 .5em; font-weight: 700; }
h1 { font-family: var(--font-head); font-size: clamp(1.85rem, 1.2rem + 2.6vw, 2.75rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem); margin-top: 1.9em; }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); margin-top: 1.5em; }
h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }
p  { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.25em; }
li { margin-bottom: .4em; }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap-narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(2.2rem, 1.4rem + 3vw, 4rem); }
.section--sand { background: var(--sand); }
.section--navy { background: var(--navy); color: #dbe6f0; }
.section--navy h2, .section--navy h3 { color: #fff; }
.section--tight { padding-block: clamp(1.5rem, 1rem + 1.6vw, 2.4rem); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- header ---------- */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--brand);
  position: relative;
  z-index: 20;
}
.header-bar {
  display: flex; align-items: center; gap: 1rem;
  min-height: 76px; padding-block: .6rem;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand__mark { width: 34px; height: 51px; flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-head); font-size: 1.5rem; color: #fff; font-weight: 700; }
.brand__tag  { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #a9c3da; }

.header-phone {
  display: none; align-items: center; gap: .5rem; color: #fff; text-decoration: none;
  font-weight: 600; white-space: nowrap;
}
.header-phone:hover { color: #ffd9a0; }
.header-phone span { font-size: .74rem; display: block; color: #a9c3da; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.28);
  border-radius: var(--radius-s); padding: .5rem .75rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.2); }

.site-nav { background: var(--navy-dark); border-top: 1px solid rgba(255,255,255,.12); }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .15rem 1.4rem; align-items: center;
}
.site-nav a {
  display: block; padding: .7rem .1rem; color: #dbe6f0; text-decoration: none;
  font-size: .95rem; font-weight: 500; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--brand-light); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }

@media (max-width: 899px) {
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding-block: .4rem; }
  .site-nav a { padding: .8rem .2rem; border-bottom: 1px solid rgba(255,255,255,.1); }
  .site-nav li:last-child a { border-bottom: 0; }
  .header-phone { display: none; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .header-phone { display: flex; }
  .site-nav { display: block !important; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: .84rem; color: var(--muted); padding-block: .9rem 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #e7eef5; padding-block: clamp(2.4rem, 1.5rem + 4vw, 4.5rem);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
}
.hero__grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 880px) { .hero__grid { grid-template-columns: 1.35fr .85fr; gap: 3rem; } }
.hero h1 { color: #fff; }
.hero p { font-size: clamp(1.02rem, 1rem + .3vw, 1.18rem); color: #cddceb; max-width: 46ch; margin-bottom: 1.4rem; }
.hero__eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: #ffd9a0; margin-bottom: .8rem; font-weight: 600;
}
.hero__art { display: flex; justify-content: center; }
.hero__art img { width: min(200px, 42vw); border-radius: var(--radius); }
.hero--compact { padding-block: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); }
.hero--compact p { margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: .8rem 1.35rem; border-radius: 999px; font-weight: 600;
  text-decoration: none; border: 2px solid transparent; font-size: .97rem; cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-l); transform: translateY(-2px); }
.card__media { position: relative; aspect-ratio: 3 / 2; background: var(--sand-dark); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card__title { margin: 0; font-size: 1.06rem; line-height: 1.3; }
.card__title a { text-decoration: none; color: var(--ink); }
.card__title a:hover { color: var(--brand); text-decoration: underline; }
.card__meta { font-size: .87rem; color: var(--muted); margin: 0; }
.card__note { font-size: .93rem; margin: 0; }
.card__price { font-size: 1.22rem; font-weight: 700; color: var(--brand); margin: 0; font-family: var(--font-head); }
.card__foot { margin-top: auto; padding-top: .6rem; display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; font-size: .88rem; }

.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: .2rem .55rem; border-radius: 999px;
  background: var(--sand-dark); color: var(--brand-dark); border: 1px solid var(--line);
}
.badge--navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.badge--gold { background: #fdf3dd; color: #7d5a12; border-color: #ecd9ac; }

/* ---------- feature list ---------- */
.feature-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.feature-list li { position: relative; padding-left: 1.6rem; margin: 0; }
.feature-list li::before {
  content: ""; position: absolute; left: .25rem; top: .62em;
  width: .5rem; height: .5rem; border-radius: 2px; background: var(--brand); transform: rotate(45deg);
}

/* ---------- listing layout ---------- */
.listing-layout { display: grid; gap: 2.2rem; }
@media (min-width: 920px) { .listing-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }

.gallery { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-block: .4rem 1.6rem; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius-s); border: 1px solid var(--line); width: 100%; }
.gallery--hero img { border-radius: var(--radius); }
.specs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.4rem; }
.specs li {
  margin: 0; background: var(--sand); border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .85rem; font-size: .9rem; font-weight: 600; color: var(--ink);
}
.price-tag { font-family: var(--font-head); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); color: var(--brand); margin: 0 0 .2rem; }
.price-note { color: var(--muted); font-size: .95rem; margin: 0 0 1rem; }

/* ---------- sidebar ---------- */
.aside-card {
  background: var(--sand); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
}
.aside-card + .aside-card { margin-top: 1.2rem; }
.aside-card h2, .aside-card h3 { margin-top: 0; font-size: 1.12rem; }
.aside-card p:last-child, .aside-card ul:last-child { margin-bottom: 0; }
.aside-card--agent { display: flex; gap: 1rem; align-items: center; }
.aside-card--agent img { width: 78px; border-radius: var(--radius-s); flex: 0 0 auto; }
.contact-lines { list-style: none; padding: 0; margin: 0; font-size: .96rem; }
.contact-lines li { margin-bottom: .35rem; }

/* ---------- agents ---------- */
.agent-card { text-align: center; align-items: center; }
.agent-card .card__media { aspect-ratio: 3 / 4; background: var(--sand); }
.agent-card .card__media img { object-fit: cover; }
.agent-card .card__body { align-items: center; text-align: center; }
.agent-card__role { font-size: .84rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); font-weight: 700; }
.agent-card__phone { font-size: .95rem; font-weight: 600; color: var(--ink); }
.agent-portrait { width: min(260px, 62%); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- prose / guides ---------- */
.prose { max-width: 72ch; }
.prose h2 { padding-bottom: .3rem; border-bottom: 2px solid var(--sand-dark); }
.prose h3 { color: var(--navy); }
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step; position: relative; padding-left: 3.1rem; margin-bottom: 1.4rem;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .1rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .98rem;
}
.steps h3 { margin-bottom: .25rem; }

.callout {
  border-left: 4px solid var(--gold); background: #fdf9f0; padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-s) var(--radius-s) 0; margin-block: 1.6rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--info { border-left-color: var(--navy-light); background: #f2f6fa; }
.callout--alert { border-left-color: var(--brand); background: #fbf1f1; }

.data-table { width: 100%; border-collapse: collapse; margin-block: 1.2rem; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { background: var(--sand); color: var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

details.faq {
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: .9rem 1.1rem;
  margin-bottom: .7rem; background: var(--white);
}
details.faq[open] { box-shadow: var(--shadow); }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.faq summary::marker { color: var(--brand); }
details.faq p { margin: .8rem 0 0; }

/* ---------- calculator ---------- */
.calc { display: grid; gap: 1.6rem; }
@media (min-width: 800px) { .calc { grid-template-columns: 1fr 1fr; } }
.calc__field { margin-bottom: .9rem; }
.calc__field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: .25rem; }
.calc__field input {
  width: 100%; padding: .6rem .7rem; font: inherit; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: #fff;
}
.calc__out { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.calc__out h3 { color: #fff; margin-top: 0; }
.calc__total { font-family: var(--font-head); font-size: 2.1rem; color: #ffd9a0; margin: 0 0 .2rem; }
.calc__rows { list-style: none; padding: 0; margin: 1rem 0 0; font-size: .95rem; }
.calc__rows li { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255,255,255,.18); padding: .45rem 0; margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-dark); color: #b9cade; padding-block: 2.6rem 1.4rem; margin-top: 3rem; }
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .7rem; }
.footer-grid { display: grid; gap: 1.8rem; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.site-footer ul { list-style: none; padding: 0; margin: 0; font-size: .93rem; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: #cfdcea; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-office { font-style: normal; font-size: .93rem; }
.footer-office strong { color: #fff; display: block; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; font-size: .85rem; color: #93a9bf;
}
.footer-bottom img { width: 40px; height: auto; background: #fff; padding: 3px; border-radius: 3px; }
.footer-bottom p { margin: 0; }

/* ---------- utilities ---------- */
.lede { font-size: clamp(1.04rem, 1rem + .35vw, 1.2rem); color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.stack > * + * { margin-top: 1.1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* stubs that keep legacy frame URLs alive */
.stub { max-width: 640px; margin: 12vh auto; padding: 0 20px; text-align: center; font-family: var(--font); }
.stub h1 { font-size: 1.4rem; }
.stub p { color: var(--muted); }

@media print {
  .site-header, .site-footer, .aside-card, .btn-row { display: none; }
  body { font-size: 12pt; }
}
