/* ==========================================================================
   Living Santa Fe — site styles
   Desktop layout mirrors the original design; responsive rules at the end.
   ========================================================================== */

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

:root {
  --teal:       #2A7276;
  --teal-light: #3d9196;
  --teal-deep:  #1d5e62;
  --teal-pale:  #e8f3f4;
  --yellow:     #FFC845;
  --yellow-dark:#c99a28;
  --gold-deep:  #D69736;   /* golden yellow of the logo's sun rays (neighborhood names) */
  --adobe:      #D49A6A;
  --adobe-dark: #b07d4e;
  --brown:      #5B3921;
  --gray:       #A68068;
  --cream:      #faf7f3;
  --cream-mid:  #f2ece3;
  --cream-dark: #e8dfd3;
  --ink:        #1e1410;
  --ink-mid:    #5c4a3a;
  --ink-light:  #8a7060;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Raleway', 'Helvetica Neue', Arial, sans-serif;
  --rail:  220px;          /* the left sidebar column used throughout */
  --topbar-h: 64px;
}

html { scroll-behavior: smooth; scroll-snap-type: y proximity; scroll-padding-top: 0; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--teal); color: #fff; padding: 10px 16px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.hoods :focus-visible, .cta :focus-visible, .hero :focus-visible { outline-color: var(--yellow); }

/* ── COMPACT TOP BAR ──────────────────
   Hidden on desktop until you scroll past the intro; always on small screens. */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 40px;
  padding: 0 40px 0 24px;
  background: rgba(250, 247, 243, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cream-dark);
  transform: translateY(-100%);
  transition: transform .35s ease;
}
.topbar.is-visible { transform: translateY(0); }

.topbar-logo { display: flex; align-items: center; height: 100%; }
.topbar-logo img { height: 54px; width: auto; display: block; }

.topbar-nav { display: flex; gap: 32px; margin-left: auto; }
.topbar-nav a, .topbar-phone {
  font-size: 10.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-mid); text-decoration: none; transition: color .2s;
}
.topbar-nav a:hover, .topbar-phone:hover { color: var(--teal); }
.topbar-phone { color: var(--teal-deep); letter-spacing: .12em; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px; margin-left: auto; margin-right: -10px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.menu-toggle span {
  display: block; width: 22px; height: 1.5px; background: var(--ink);
  transition: transform .3s, opacity .2s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 49;
  background: var(--teal);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 24px calc(40px + env(safe-area-inset-bottom));
  opacity: 0; transition: opacity .25s ease;
}
.mobile-menu.is-open { opacity: 1; }
.mobile-menu { overflow-y: auto; }   /* very short screens can scroll the menu */
.mobile-menu nav { gap: 2px !important; }
@media (max-height: 620px) { #mobile-menu nav a { font-size: 28px; padding: 4px 0; } #mobile-menu { padding-top: 28px; } }
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu nav a {
  font-family: var(--serif); font-size: 34px; font-weight: 500;
  color: var(--cream); text-decoration: none; padding: 6px 0;
}
.mobile-menu-footer { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu-footer .sf-name { color: #fff; }
.mobile-menu-footer .sf-detail { color: rgba(255,255,255,.86); text-decoration: none; }

/* ── HERO ─────────────────────────── */
.hero {
  display: flex;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  scroll-snap-align: start;
}

.sidebar {
  width: var(--rail);
  flex-shrink: 0;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 36px 20px 36px;
  position: relative;
  z-index: 10;
  border-right: 1px solid var(--cream-dark);
}

.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.logo-wrap img { width: 220px; height: auto; display: block; }

.sidebar-nav { display: flex; flex-direction: column; gap: 18px; align-items: center; }
.sidebar-nav a {
  font-size: 11px; font-weight: 650; letter-spacing: 0.22em; text-transform: uppercase;   /* between semibold and bold */
  color: var(--ink-mid); text-decoration: none; transition: color 0.2s;
  white-space: nowrap;   /* each of the seven links stays on one line */
}
.sidebar-nav a:hover { color: var(--teal); }

.sidebar-footer {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; text-align: center; padding-top: 20px;
}
.sf-name {
  font-size: 15.5px; font-weight: 600; letter-spacing: 0.13em;
  color: var(--teal-deep); margin-bottom: 3px;
}
.sf-detail {
  font-size: 12.5px; font-weight: 500; letter-spacing: 0.10em;
  color: #2e2e2e; line-height: 1.6; text-decoration: none;
}
a.sf-detail:hover { color: var(--teal); }

.hero-image { flex: 1; position: relative; overflow: hidden; }

.hero-bg {
  position: absolute; inset: 0;
  background-color: #7a3d1c;
  background-image: url('../images/hero.jpg');
  background-image: image-set(url('../images/hero.webp') type('image/webp'), url('../images/hero.jpg') type('image/jpeg'));
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  animation: hero-in 1.6s ease-out both;
}
@keyframes hero-in { from { transform: scale(1.04); opacity: .6; } to { transform: scale(1); opacity: 1; } }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.22) 100%);
}

.hero-lower-left {
  position: absolute; bottom: 60px; left: 60px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 48px;
}

.hero-tagline {
  text-align: left; color: #fff;
  text-shadow: 0 1px 16px rgba(0,0,0,0.28);
  display: flex; flex-direction: column; gap: 6px;
  font-weight: 400;
}
.hero-tagline span {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(36px, 4.2vw, 58px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.btn-ghost {
  display: inline-block;
  padding: 17px 46px;
  background: rgba(0,0,0,0.35);
  border: 3px solid rgba(255,255,255,0.55);
  color: rgba(255,255,255,0.95);
  font-family: var(--sans);
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s, border-color 0.25s;
  cursor: pointer;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.20); border-color: #fff; }

/* ── INTRO ─────────────────────────── */
.intro {
  display: flex; align-items: stretch;
  background: var(--cream);
  /* grows when the content needs it, so nothing (like the button) is ever clipped */
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start;
}
.intro .sidebar, .about-philip .sidebar, .gallery-section .sidebar {
  background: var(--teal);
  border-right: 1px solid rgba(255,255,255,0.10);
  padding: 28px 20px 28px;
  gap: 18px;
}
.intro .logo-wrap, .about-philip .logo-wrap, .gallery-section .logo-wrap { background: var(--cream); padding: 14px 0; width: 100%; }
.intro .logo-wrap img, .about-philip .logo-wrap img, .gallery-section .logo-wrap img { width: 200px; }
.intro .sidebar-nav, .about-philip .sidebar-nav, .gallery-section .sidebar-nav { gap: 14px; }
.intro .sidebar-nav a, .about-philip .sidebar-nav a, .gallery-section .sidebar-nav a { color: rgba(255,255,255,0.85); }
.intro .sidebar-nav a:hover, .about-philip .sidebar-nav a:hover, .gallery-section .sidebar-nav a:hover { color: #fff; }
.intro .sf-name, .about-philip .sf-name, .gallery-section .sf-name { color: #fff; }
.intro .sf-detail, .about-philip .sf-detail, .gallery-section .sf-detail { color: rgba(255,255,255,0.86); }
.intro a.sf-detail:hover, .about-philip a.sf-detail:hover, .gallery-section a.sf-detail:hover { color: #fff; }
.intro :focus-visible, .about-philip .sidebar :focus-visible, .gallery-section .sidebar :focus-visible { outline-color: var(--yellow); }
.intro-body :focus-visible { outline-color: var(--teal); }

.intro-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 42%;
  gap: 56px;
  padding: 40px 64px;
  align-items: center;
}
.intro-text { max-width: 560px; }

.eyebrow {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 18px;
}

.intro-body h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 3.8vw, 56px);
  font-weight: 300; line-height: 1.15; color: var(--ink);
  margin-bottom: 14px;
}
.intro-body h2 em { font-style: italic; color: var(--teal); }

/* as in the original design, these paragraph rules also style the eyebrow */
.intro-text p { font-size: 14px; line-height: 1.65; margin-top: 10px; }
.intro-body p { font-size: 17px; font-weight: 300; line-height: 1.68; color: var(--ink-mid); }
.intro-text p.eyebrow { margin-top: 0; margin-bottom: 12px; }
.intro-text p.intro-quote {
  font-family: var(--serif); font-style: italic; font-size: 23px;
  color: #1a5256; font-weight: 500; margin-top: 12px;
}

.intro-image-col { align-self: stretch; display: flex; align-items: center; }
.intro-image-col picture { width: 100%; display: block; }
.intro-image-col img {
  width: 100%; height: auto; max-height: 64vh; object-fit: cover; display: block;
}

.intro-cta {
  display: inline-block;
  margin-top: 24px;
  padding: 13px 32px;
  background: var(--teal);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--teal);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.intro-cta:hover { background: transparent; color: var(--teal); }
.intro-text .intro-cta { margin-top: 20px; }

/* ── NEIGHBORHOODS ─────────────────── */
/* Same full-screen frame as the hero and intro: 220px sidebar + content */
.hoods {
  display: flex; align-items: stretch;
  background: var(--brown);
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start;
}
.hoods .sidebar, .listings .sidebar {
  background: var(--cream);              /* same cream sidebar as the hero */
  border-right: 1px solid var(--cream-dark);
  padding: 28px 20px 28px;
  gap: 18px;
}
.hoods .logo-wrap, .listings .logo-wrap { background: var(--cream); padding: 14px 0; width: 100%; }
.hoods .logo-wrap img, .listings .logo-wrap img { width: 200px; }
.hoods .sidebar-nav, .listings .sidebar-nav { gap: 14px; }
.hoods .sidebar :focus-visible, .listings .sidebar :focus-visible { outline-color: var(--teal); }
.hoods-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 72px 80px 72px 64px;
}
.hoods-content .eyebrow { color: var(--yellow); margin-bottom: 14px; }
.hoods-content h2 {
  font-family: var(--serif); font-size: 38px; font-weight: 300;
  color: var(--cream); margin-bottom: 22px; line-height: 1.2;
}

/* Heading + introduction on the left, photograph on the right, tops aligned */
.hoods-intro {
  display: grid; grid-template-columns: 1fr 42%; gap: 56px; align-items: start;
  /* separation from the tabs grows with screen height, which lifts the heading
     and photo and lowers the tabs while trimming empty space above and below */
  margin-bottom: clamp(72px, 15vh, 160px);
}
.hoods-intro-text { min-width: 0; }
.hoods-intro-text .hoods-lead {
  font-size: 17px; font-weight: 300; line-height: 1.68;
  color: rgba(250, 247, 243, 0.85); max-width: 560px;
}
.hoods-photo img { width: 100%; height: auto; display: block; } /* natural proportions, no crop */

/* Ten cream rectangular tabs, two rows of five */
.hoods-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

/* Teal tabs in the style of the "Explore Santa Fe Events" button */
.hood-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 10px 12px;   /* room for two-line names, so every tab matches */
  text-align: center;
  background: var(--teal);
  border: 2px solid var(--teal);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.hood-item:hover { background: var(--teal-light); border-color: var(--teal-light); }
.hood-item[aria-expanded="true"] {
  background: var(--teal-deep); border-color: var(--teal-deep);
  box-shadow: inset 0 -3px 0 var(--cream);
}
.hood-name {
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  line-height: 1.5; color: #fff;
  text-wrap: balance;
}

/* Description panel: opens beneath the row of the selected card */
.hood-panel {
  grid-column: 1 / -1;
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 0.35s ease, opacity 0.3s ease;
}
.hood-panel[hidden] { display: none; }
.hood-panel.is-open { grid-template-rows: 1fr; opacity: 1; }
.hood-panel-inner {
  min-height: 0; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px;
  grid-template-areas: "body close" "homes homes";
  background: var(--cream);
  border-left: 3px solid var(--teal);
}
.hood-panel-body { grid-area: body; padding: 26px 0 0 30px; min-width: 0; }
.hood-panel-name {
  font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--gold-deep);
  line-height: 1.2; margin-bottom: 10px;
}
.hood-panel-desc { font-size: 16px; font-weight: 400; line-height: 1.8; color: var(--ink-mid); max-width: 70ch; text-wrap: pretty; }
.hood-panel .hood-homes {
  grid-area: homes; justify-self: end;
  margin: 24px 30px 28px 30px;
  background: var(--cream); color: var(--teal);
  border: 1.5px solid var(--teal);
  font-weight: 700;
}
.hood-panel .hood-homes:hover { background: var(--teal); color: #fff; }
.hood-panel-close {
  grid-area: close; align-self: start; margin: 22px 22px 0 0; padding: 6px 2px;
  background: none; border: 0; cursor: pointer;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal);
}
.hood-panel-close:hover { color: var(--brown); }
.hoods-grid :focus-visible { outline-color: var(--yellow); }

/* ── ABOUT: two partner profiles ──────
   Photos share one column and the text shares another, so both profiles align.
   Both portraits are the same size; the two profiles alternate sides. */
.about-philip {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  /* full screen like the hero, intro and neighborhoods, which share this sidebar */
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start;
  /* teal under the sidebar column, cream under the profiles */
  background: linear-gradient(to right, var(--teal) var(--rail), var(--cream) var(--rail));
}
/* This section is taller than one screen, so its sidebar stays put while the
   profiles scroll, keeping the logo, links and contact details where they sit
   in every other section. */
.about-philip .sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh; height: 100svh;
}
/* Two partners side by side, mirror images of each other:
   heading on top, then [photo / name / title / introduction / Read Full Bio]
   in two equal columns, with Let's Talk at the bottom right. */
.ap-main {
  --ap-photo-col: 185px;
  min-width: 0;
  padding: 24px 70px 56px;      /* equal sides, so the pair is centered in the cream area */
  border-bottom: 1px solid var(--cream-dark);  /* divider stops at the teal sidebar */
  display: flex; flex-direction: column;   /* top-anchored: an opened biography grows downward only */
}
.ap-heading {
  font-family: var(--serif); font-size: 46px; font-weight: 500; line-height: 1.15;
  color: var(--ink); text-align: center; text-wrap: balance;
  margin: 0 0 32px;
}
.ap-heading em { font-style: italic; color: var(--teal); }   /* same treatment as "art, culture," above */
.ap-people {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 96px; row-gap: 56px;
  width: 100%; max-width: 980px; margin: 0 auto;
  align-items: start;           /* opening one biography never stretches the other */
}
.ap-person { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.ap-photo-frame {
  width: 166px; aspect-ratio: 3/4; overflow: hidden; position: relative;
  background: var(--cream-dark);
}
.ap-photo-frame picture, .ap-photo-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block;
}
.ap-text { min-width: 0; max-width: 430px; }
/* an opened full biography reads left-aligned beneath its partner */
.ap-person .ap-bio { width: 100%; max-width: 460px; text-align: left; margin-top: 18px; }
/* Full-biography panels (and the shared Our Philosophy panel) */
.ap-bio-panel {
  background: var(--cream-mid);
  border-top: 2px solid var(--teal);
  padding: 24px 26px 20px;
}
.ap-bio-panel p { margin-bottom: 14px; }
.ap-bio-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 6px;
}
.ap-bio-close {
  margin-left: auto; padding: 6px 2px;
  background: none; border: 0; cursor: pointer; font-family: var(--sans);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal);
}
.ap-bio-close:hover { color: var(--brown); }
.ap-outline-btn {
  display: inline-block; padding: 8px 18px;
  background: var(--cream); color: var(--teal);
  border: 1.5px solid var(--teal);
  font-family: var(--sans);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.4;
  text-decoration: none;
  transition: background 0.25s, color 0.25s;
}
.ap-outline-btn:hover { background: var(--teal); color: #fff; }
.ap-philosophy { width: 100%; max-width: 800px; margin: 32px auto 0; text-align: left; }
.ap-philosophy-panel p {
  font-family: var(--sans); font-size: 15px; font-weight: 500; line-height: 1.8;
  color: var(--ink-mid); margin-bottom: 0;
}
.ap-philosophy-title {
  font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.2;
  color: var(--ink); margin-bottom: 10px;
}
/* the shared introduction spans both columns, left-aligned for easy reading */
.ap-intro {
  width: 100%; max-width: 800px; margin: 36px auto 0;
  font-size: 15px; font-weight: 600; line-height: 1.8; color: var(--ink-mid); text-align: left;
}
/* Name, title and rule centered beneath each photo. A name wider than the
   photo stays centered and extends evenly to both sides. */
.ap-photo { display: flex; flex-direction: column; align-items: center; }
.ap-caption {
  margin-top: 12px; text-align: center; white-space: nowrap;
  display: flex; flex-direction: column; align-items: center;
}
.ap-caption .ap-rule { margin-bottom: 0; }
/* Read Full Bio: outlined button like "View Homes in This Neighborhood", a size smaller */
.ap-person > .ap-bio-toggle {
  margin-top: 11px;
  display: inline-block;
  padding: 8px 18px;
  background: var(--cream); color: var(--teal);
  border: 1.5px solid var(--teal);
  font-family: var(--sans);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.ap-person > .ap-bio-toggle:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
/* sizes and colors as before; weights raised for easier reading */
.ap-name {
  font-family: var(--serif); font-size: 33px; font-weight: 500;
  color: var(--ink); line-height: 1.1; margin-bottom: 2px;
}
.ap-title {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.20em; text-transform: uppercase;
  line-height: 1.9; color: var(--ink-mid); margin-bottom: 9px;
}
.ap-rule { width: 40px; height: 1.5px; background: var(--adobe); margin-bottom: 18px; }
.ap-text p:not(.ap-eyebrow):not(.ap-title) {
  font-size: 15px; font-weight: 500; line-height: 1.8; color: var(--ink-mid);
  margin-bottom: 10px;
}
.ap-cta { width: 100%; max-width: 980px; margin: 20px auto 0; text-align: right; }
/* Expandable full biographies */
.ap-bio {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 0.4s ease, opacity 0.35s ease;
}
.ap-bio[hidden] { display: none; }
.ap-bio.is-open { grid-template-rows: 1fr; opacity: 1; }
.ap-bio-inner { min-height: 0; overflow: hidden; }
.ap-bio-inner p:first-child { margin-top: 0; }
.ap-bio-toggle {
  margin-top: 6px;
  background: none; border-top: 0; border-left: 0; border-right: 0;
  padding: 0 0 2px; cursor: pointer; font-family: var(--sans);
}

/* ── LISTINGS ──────────────────────── */
.listings {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start;
  background: var(--cream);
}
/* cream sidebar stays in place if the section is ever taller than the screen */
.listings .sidebar { position: sticky; top: 0; align-self: start; height: 100vh; height: 100svh; }
.listings-content {
  min-width: 0;
  padding: 28px 80px 32px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
/* Six cards on one screen: the heading and grid share a width that follows the
   screen height, so the photos stay as large as the screen allows. */
.listings .section-head, .listings-grid {
  width: 100%;
  max-width: clamp(760px, calc(200vh - 800px), 1180px);
  margin-left: auto; margin-right: auto;
}
.listings .section-head { margin-bottom: 18px; }
/* button directly beneath beds / baths / sq ft, and level across each row even when an address wraps */
.listings-grid .card-details { margin-bottom: 14px; }
.listings-grid .card-btn { margin-top: auto; }
.listings-grid .card-photo { margin-bottom: 12px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  margin-bottom: 40px;
}
.section-head h3 { font-family: var(--serif); font-size: 36px; font-weight: 300; color: var(--ink); }

.text-link {
  display: inline-block;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--teal); text-decoration: none;
  border-bottom: 1px solid var(--teal-light);
  padding-bottom: 2px;
  transition: color 0.2s, border-color .2s;
}
.text-link:hover { color: var(--brown); border-color: var(--brown); }

.listings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px 28px; }

.card {
  display: flex; flex-direction: column;
  color: inherit;
  transition: transform 0.3s ease;
}
.card[hidden] { display: none; }
.card:hover { transform: translateY(-5px); }
.card-photo { display: block; aspect-ratio: 4/3; margin-bottom: 16px; position: relative; overflow: hidden; background: var(--cream-dark); }
.card-photo-inner { width: 100%; height: 100%; position: relative; overflow: hidden; }
.card-photo-inner img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.card:hover .card-photo-inner img { transform: scale(1.04); }
.card-price { font-family: var(--serif); font-size: 24px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.card-address { font-size: 12.5px; font-weight: 500; color: var(--ink-mid); margin-bottom: 10px; }
.card-details { display: flex; gap: 18px; }
.card-detail { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: #7d6354; }
.card-detail b { color: var(--ink-mid); font-weight: 600; }
/* Same treatment as the "Explore Art & Culture" button, scaled for the cards */
.card-btn {
  align-self: flex-start;
  margin-top: auto;
  display: inline-block;
  padding: 11px 24px;
  background: var(--teal);
  color: #fff;
  font-family: var(--sans);
  font-size: 9px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--teal);
  transition: background 0.25s, color 0.25s;
}
.card-btn:hover { background: transparent; color: var(--teal); }

/* ── GALLERY ───────────────────────── */
.gallery-section {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh; min-height: 100svh;
  scroll-snap-align: start;
  /* teal under the sidebar column, cream under the gallery */
  background: linear-gradient(to right, var(--teal) var(--rail), var(--cream-mid) var(--rail));
}
.gallery-section .sidebar { position: sticky; top: 0; align-self: start; height: 100vh; height: 100svh; }
.gallery-body { padding: 52px 80px 44px 64px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.gallery-meta { margin-bottom: 28px; }
.gallery-heading {
  font-family: var(--serif); font-size: 46px; font-weight: 600; line-height: 1.1;
  color: var(--teal);
}
.gallery-meta h3 { font-family: var(--serif); font-size: 36px; font-weight: 300; color: var(--ink); margin-bottom: 6px; }

.gallery-grid {
  display: grid; grid-template-columns: 1fr 140px; gap: 10px; align-items: start;
  grid-template-areas: "main thumbs" "info thumbs";
}
.gallery-main { grid-area: main; }
.gallery-side { grid-area: thumbs; min-width: 0; }
/* details on the left, buttons on the far right, vertically centered */
.gallery-info {
  grid-area: info; padding-top: 4px; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap;
}
.gallery-facts { min-width: 0; flex: 1 1 240px; }
.gallery-info .gallery-actions { flex: 0 0 auto; }
.gallery-info .card-price { font-weight: 600; }
.gallery-info .card-address { font-weight: 600; margin-bottom: 6px; }
.gallery-info .card-detail, .gallery-info .card-detail b { font-weight: 700; }
.gallery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.gallery-actions .card-btn { margin-top: 0; }
.gallery-link { display: block; width: 100%; height: 100%; }
.gallery-main.is-cover img { object-position: center top; } /* keeps the photo's banner in frame */
.gallery-credit {
  font-size: 12px; font-weight: 600; font-style: normal; letter-spacing: 0.02em;
  color: var(--ink-mid); margin: 8px 0 0;
}
.gallery-main {
  aspect-ratio: 16/10; overflow: hidden; background: var(--cream-dark);
  position: relative; touch-action: pan-y;
}
.gallery-main picture { display: block; width: 100%; height: 100%; }
/* Desktop: photo frame 20% shorter (16:10 -> 2:1) so the whole section fits one screen; same width, cropped not stretched */
@media (min-width: 961px) {
  .gallery-main { aspect-ratio: 2 / 1; }
  /* cover photo: crop mostly from the top, as far as the For Sale banner allows, to show more of the house and courtyard */
  .gallery-main.is-cover img { object-position: center 40%; }
}
.gallery-main img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity 0.25s ease;
}
.gallery-count {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(30,20,16,.55); color: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: .14em;
  padding: 5px 10px; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.gallery-main:hover .gallery-count { opacity: 1; }

.gallery-thumbs {
  display: flex; flex-direction: column; gap: 8px;
  /* exactly four thumbnails in view: the script sets max-height to end at the
     bottom of the fourth; scrolling snaps a whole thumbnail at a time */
  position: relative; max-height: 444px; overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;            /* a visible scrollbar would narrow (and shorten) the thumbnails */
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumbs .thumb { flex-shrink: 0; scroll-snap-align: start; }
.thumb-nav { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.thumb-step {
  width: 34px; height: 22px; display: grid; place-items: center;
  background: none; border: 1px solid var(--teal); color: var(--teal);
  font-size: 8px; line-height: 1; cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.thumb-step:hover:not(:disabled) { background: var(--teal); color: #fff; }
.thumb-step:disabled { opacity: 0.3; cursor: default; }
.thumb {
  display: block; width: 100%; aspect-ratio: 4/3; overflow: hidden;
  border: 2px solid transparent; background: none; padding: 0;
  cursor: pointer; transition: border-color 0.2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.65; transition: opacity 0.2s; }
.thumb:hover img, .thumb.active img { opacity: 1; }
.thumb.active { border-color: var(--teal); }

/* ── ABOUT ─────────────────────────── */
.about {
  display: grid; grid-template-columns: var(--rail) 1fr 1fr;
  min-height: 100vh; min-height: 100svh;  /* full screen, so the sidebar matches the others */
  align-content: center;                  /* report and tabs stay together, centered */
  scroll-snap-align: start;
  /* the two column colors run the full height of the section */
  background: linear-gradient(to right, var(--cream-mid) calc(var(--rail) + (100% - var(--rail)) / 2), var(--cream) 0);
}
/* thin gold divider where Exclusive Offering ends: from the sidebar's right edge
   to the screen edge; positioned on top, so nothing in the layout moves */
.about { position: relative; }
.about::before {
  content: ""; position: absolute; top: 0; left: var(--rail); right: 0; height: 2px;
  background: var(--adobe); z-index: 2; pointer-events: none;
}
/* cream sidebar like Neighborhoods / Featured Properties, with teal links and contact details */
.about .sidebar {
  grid-row: 1 / span 2;
  position: sticky; top: 0; align-self: start; height: 100vh; height: 100svh;
  background: var(--cream);
  border-right: 1px solid var(--cream-dark);
  padding: 28px 20px 28px;
  gap: 18px;
}
.about .logo-wrap { background: var(--cream); padding: 14px 0; width: 100%; }
.about .logo-wrap img { width: 200px; }
.about .sidebar-nav { gap: 14px; }
.about .sidebar-nav a, .about .sf-name, .about .sf-detail { color: var(--teal); }
.about .sidebar-nav a:hover, .about a.sf-detail:hover { color: var(--teal-deep); }
.about .sidebar :focus-visible { outline-color: var(--teal); }
.about-text { padding: 80px 56px 48px; }
.about-text .eyebrow { margin-bottom: 18px; }
.about-text h2 { font-family: var(--serif); font-size: 38px; font-weight: 300; line-height: 1.25; margin-bottom: 14px; text-wrap: balance; }
.about-text p { font-size: 14.5px; font-weight: 500; line-height: 1.9; color: var(--ink-mid); margin-bottom: 18px; }
.about-text .about-subtitle {
  font-family: var(--serif); font-style: italic; font-size: 21px; font-weight: 500; line-height: 1.4;
  color: var(--teal); margin-bottom: 20px;
}
.about-stats {
  background: var(--cream);
  padding: 80px 56px 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.stat { border-left: 2.5px solid var(--teal); padding-left: 22px; }
.stat-num {
  font-family: var(--serif); font-size: 52px; font-weight: 300; color: var(--teal);
  line-height: 1; margin-bottom: 6px; font-variant-numeric: tabular-nums;
}
.stat-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mid); }
.stat-chg { margin-top: 6px; font-size: 12px; font-weight: 600; color: #7d6354; }
.stat-source { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: #7d6354; }

/* Buying / Selling tabs and their panels, across the bottom of the section */
.market-tabs {
  grid-column: 2 / -1;
  padding: 8px 56px 64px;
  background: linear-gradient(to right, var(--cream-mid) 50%, var(--cream) 50%);
}
.market-tab-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.market-tab {
  min-height: 54px; padding: 12px 16px;
  background: var(--teal); border: 2px solid var(--teal); color: #fff; cursor: pointer;
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.market-tab:hover { background: var(--teal-light); border-color: var(--teal-light); }
.market-tab[aria-expanded="true"] { background: var(--teal-deep); border-color: var(--teal-deep); box-shadow: inset 0 -3px 0 var(--cream); }
.market-panel {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 0.35s ease, opacity 0.3s ease;
}
.market-panel[hidden] { display: none; }
.market-panel.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 12px; }
.market-panel-inner { min-height: 0; overflow: hidden; }
.market-panel-card {
  background: var(--cream); border: 1px solid var(--cream-dark); border-top: 3px solid var(--teal);
  padding: 24px 30px 28px;
}
.market-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.market-panel-head h3 { font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.2; color: var(--ink); }
.market-panel-close {
  flex-shrink: 0; padding: 6px 2px; background: none; border: 0; cursor: pointer; font-family: var(--sans);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--teal);
}
.market-panel-close:hover { color: var(--brown); }
.market-panel-card p { font-size: 15px; font-weight: 500; line-height: 1.8; color: var(--ink-mid); max-width: 70ch; }

/* Buying in Santa Fe panel: intro + photo, eight steps in two columns, closing call to action */
.buy-intro { display: grid; grid-template-columns: minmax(0, 1fr) 43%; gap: 40px; align-items: center; margin-top: 18px; }
.market-panel-card .buy-intro-text p + p { margin-top: 14px; }
.market-panel-card .buy-lead { font-family: var(--serif); font-size: 22px; font-style: italic; font-weight: 500; line-height: 1.45; color: var(--teal); }
.buy-photo { margin: 0; }
.buy-photo img { display: block; width: 100%; height: auto; box-shadow: 0 10px 28px rgba(30, 20, 16, 0.14); }
.buy-process { margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--cream-dark); }
.buy-process-title { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.2; color: var(--ink); margin-bottom: 20px; }
.buy-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); grid-auto-flow: column;
  column-gap: 56px;
}
.buy-step { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px; padding: 20px 0; border-top: 1px solid var(--cream-dark); }
.buy-step:nth-child(1), .buy-step:nth-child(5) { border-top: 0; padding-top: 4px; }
.buy-step-num { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; color: var(--adobe-dark); }
.buy-step h5 { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal); line-height: 1.5; margin: 4px 0 6px; }
.market-panel-card .buy-step p { font-size: 14.5px; line-height: 1.75; max-width: none; }
.buy-cta { margin-top: 36px; padding: 36px 24px 8px; border-top: 1px solid var(--cream-dark); text-align: center; }
.buy-cta h4 { font-family: var(--serif); font-size: 28px; font-weight: 400; font-style: italic; line-height: 1.25; color: var(--ink); margin-bottom: 8px; }
.market-panel-card .buy-cta p { margin: 0 auto; max-width: 52ch; }
.buy-cta-btn:hover { background: transparent; color: var(--teal); }

/* ── CTA ───────────────────────────── */
.cta {
  background: var(--teal);
  padding: 56px 80px 56px calc(var(--rail) + 64px);
  /* text | photo (centered) | button, all vertically centered */
  display: grid; grid-template-columns: auto auto auto; justify-content: space-between; align-items: center; gap: 48px;
}
.cta-photo { margin: 0; width: 170px; transform: translateX(20px); }   /* nudged right for balance; layout unaffected */
.cta-photo img {
  display: block; width: 100%; height: auto;            /* original portrait proportions, no crop */
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.cta > .cta-actions { justify-self: end; transform: translateY(10px); }   /* with the icon row added, the button sits ~15px higher than before */
.cta-text h2 {
  font-family: var(--serif); font-size: 40px; font-weight: 300; font-style: italic;
  color: var(--cream); line-height: 1.25; margin-bottom: 10px;
}
.cta-text p { font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.86); line-height: 1.7; }
.cta-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.btn-cta {
  display: inline-block;
  padding: 16px 44px;
  border: 1.5px solid rgba(255,255,255,0.55);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  background: transparent; white-space: nowrap;
}
.btn-cta:hover { background: rgba(255,255,255,0.14); border-color: #fff; }
.cta-phone {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; color: rgba(255,255,255,.86);
  text-decoration: none;
}
.cta-phone:hover { color: #fff; }
.cta-social { display: flex; justify-content: center; gap: 14px; margin-top: 4px; }
.cta-social a {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.cta-social a:hover { background: var(--cream); transform: translateY(-2px); }
.cta-social svg { width: 16px; height: 16px; fill: currentColor; }

/* ── FOOTER ────────────────────────── */
.site-footer { display: grid; grid-template-columns: var(--rail) 1fr; }
.footer-l {
  background: var(--cream-mid);
  display: flex; align-items: center; justify-content: center;
  padding: 44px 16px;
}
.footer-l img { width: 88px; height: auto; opacity: 0.5; }
.footer-r {
  background: var(--cream);
  padding: 40px 64px 40px 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.footer-links { display: flex; gap: 12px 26px; flex-wrap: wrap; max-width: 600px; }   /* wraps 4 + 3 rather than leaving one link alone */
.footer-links a {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: #5e4a3e; text-decoration: none; transition: color 0.2s; white-space: nowrap;
}
.footer-links a:hover { color: var(--teal); }
.footer-copy { font-size: 10.5px; color: #5e4a3e; font-weight: 500; white-space: nowrap; }
.footer-sep { margin: 0 4px; }
.footer-privacy { color: inherit; font: inherit; text-decoration: none; transition: color 0.2s; }
.footer-privacy:hover { color: var(--teal); text-decoration: underline; }
.footer-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.footer-disclaimer {
  margin: 0; max-width: 640px;
  font-size: 11.5px; font-weight: 500; line-height: 1.6; letter-spacing: 0.02em;
  color: #5e4a3e;
}

/* ── CONTACT DIALOG ────────────────── */
.contact-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  border: 0; padding: 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(30,20,16,.35);
  overflow: auto;
}
.contact-dialog::backdrop { background: rgba(30,20,16,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.contact-dialog[open] { animation: dialog-in .3s ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.dialog-inner { padding: 48px 44px 40px; border-top: 4px solid var(--teal); }
.dialog-inner h2 { font-family: var(--serif); font-size: 32px; font-weight: 300; line-height: 1.2; margin-bottom: 10px; }
.dialog-sub { font-size: 13.5px; font-weight: 500; line-height: 1.7; color: var(--ink-mid); margin-bottom: 26px; }
.dialog-sub a { color: var(--teal); font-weight: 600; text-decoration: none; white-space: nowrap; }
.dialog-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px;
  background: none; border: 0; cursor: pointer; font-size: 16px; color: var(--ink-light);
}
.dialog-close:hover { color: var(--ink); }

.hp { position: absolute; left: -9999px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; border: 0; }
.field > span, .field legend {
  font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-mid);
}
.field > span i { font-style: normal; font-weight: 600; letter-spacing: .08em; text-transform: none; color: var(--ink-light); }
.field input, .field textarea {
  width: 100%;
  font: 500 15px/1.5 var(--sans);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--cream-dark);
  border-radius: 0;
  padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,114,118,.14);
}
.field input.invalid { border-color: #b4472b; }

.chips { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; margin-bottom: 9px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chips label span {
  display: inline-block; padding: 8px 14px;
  border: 1px solid var(--cream-dark); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--ink-mid);
  transition: background .2s, color .2s, border-color .2s;
}
.chips input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.form-error { font-size: 13px; color: #b4472b; margin: -4px 0 12px; }
.form-submit { margin-top: 4px; }
.form-submit[disabled] { opacity: .6; cursor: progress; }
.dialog-thanks { text-align: left; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Laptop: tighten the generous desktop gutters */
@media (max-width: 1280px) {
  .listings-content { padding: 28px 56px 32px 48px; }
  .cta { padding: 52px 56px 52px calc(var(--rail) + 48px); gap: 44px; }
  .hoods-content { padding: 64px 56px 64px 48px; }
  .gallery-body { padding: 48px 56px 40px 48px; }
  .ap-main { padding: 20px 56px 48px; }
  .ap-people { column-gap: 72px; }
  .about-text, .about-stats { padding: 72px 44px 44px; }
  .market-tabs { padding: 8px 44px 56px; }
  .intro-body { padding: 12px 48px; gap: 44px; }
  .footer-r { padding: 40px 56px 40px 48px; }
}

@media (max-width: 1100px) {
  /* narrower sidebar: a little less side padding and letter spacing so the longest links fit */
  .sidebar { padding-left: 12px !important; padding-right: 12px !important; }
  .sidebar-nav a { font-size: 10.5px; letter-spacing: 0.14em; }
  .sidebar-footer .sf-detail { font-size: 11.5px; letter-spacing: 0.06em; }   /* email fits the narrower sidebar */
  /* closing band: text with the button beneath it on the left, photo on the right */
  .cta { grid-template-columns: auto auto; grid-template-areas: "text photo" "actions photo"; row-gap: 26px; }
  .cta-text { grid-area: text; }
  .cta-photo { grid-area: photo; transform: none; }
  .cta > .cta-actions { grid-area: actions; justify-self: start; align-items: flex-start; transform: none; gap: 8px; }
  .cta { row-gap: 12px; }   /* button ~15px higher; band keeps its height with the icon row */
  .cta-social { justify-content: flex-start; margin-top: 2px; gap: 12px; }
  .cta-social a { width: 28px; height: 28px; }
  .cta-social svg { width: 14px; height: 14px; }
  :root { --rail: 180px; }
  .logo-wrap img { width: 170px; }
  .intro .logo-wrap img, .hoods .logo-wrap img, .about-philip .logo-wrap img, .listings .logo-wrap img, .gallery-section .logo-wrap img, .about .logo-wrap img { width: 150px; }
  .ap-people { column-gap: 48px; }
  .ap-photo-frame { width: 140px; }
  .hoods-intro { gap: 40px; }
  .hood-name { font-size: 10px; letter-spacing: 0.14em; }
  .hood-item { padding: 10px 8px; }
  .footer-r { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* Narrow laptops: the longest neighborhood names wrap to three lines */
@media (min-width: 961px) and (max-width: 1040px) {
  .hood-item { min-height: 74px; }
}

/* Tablet & phone: sidebar becomes the top bar + menu */
@media (max-width: 960px) {
  html { scroll-snap-type: none; scroll-padding-top: var(--topbar-h); }
  body { padding-top: var(--topbar-h); }
  .topbar { transform: none; padding: 0 20px 0 12px; }
  .topbar-nav, .topbar-phone { display: none; }
  .menu-toggle { display: flex; }
  .topbar-logo img { height: 52px; }

  .sidebar { display: none; }

  /* Hero */
  .hero {
    height: calc(100vh - var(--topbar-h));
    height: calc(100svh - var(--topbar-h));
    min-height: 520px;
  }
  .hero-bg {
    background-image: url('../images/hero-mobile.jpg');
    background-image: image-set(url('../images/hero-mobile.webp') type('image/webp'), url('../images/hero-mobile.jpg') type('image/jpeg'));
    background-position: 40% center;
  }
  .hero-overlay { background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,.38) 100%); }
  .hero-lower-left { left: 24px; right: 24px; bottom: 44px; gap: 32px; }

  /* Intro */
  .intro { min-height: 0; display: block; }
  .intro-body { grid-template-columns: 1fr; gap: 40px; padding: 72px 32px; }
  .intro-text { max-width: 640px; }
  .intro-image-col img { max-height: none; aspect-ratio: 3/2; }

  /* Neighborhoods */
  .hoods { display: block; min-height: 0; }
  .hoods-content { padding: 64px 32px; }
  .hoods-content h2 { font-size: 34px; margin-bottom: 20px; }
  .hoods-intro { grid-template-columns: 1fr; gap: 28px; margin-bottom: 48px; }
  .hoods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hood-name { font-size: 10.5px; }
  .hood-panel-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "close" "body" "homes"; }
  .hood-panel-body { padding: 4px 22px 0; }
  .hood-panel-close { justify-self: end; margin: 14px 16px 0 0; }
  .hood-panel .hood-homes { margin: 22px 22px 24px; }

  /* About Philip */
  .about-philip { display: block; min-height: 0; background: var(--cream); }
  .ap-main { padding: 28px 32px 44px; }
  .ap-people { column-gap: 32px; }

  /* Listings */
  .listings { display: block; min-height: 0; }
  .listings-content { padding: 64px 32px; }
  .listings .section-head, .listings-grid { max-width: none; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); gap: 48px 24px; }

  /* Gallery */
  .gallery-section { display: block; min-height: 0; background: var(--cream-mid); }
  .gallery-heading { font-size: 38px; }
  .gallery-body { padding: 64px 32px; }
  .gallery-grid { grid-template-columns: 1fr; grid-template-areas: "main" "thumbs" "info"; }
  .gallery-info { padding-top: 14px; justify-content: flex-start; }
  .gallery-thumbs {
    flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory;
    max-height: none !important; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
  }
  .gallery-thumbs::-webkit-scrollbar { display: none; }
  .thumb { flex: 0 0 112px; scroll-snap-align: start; }
  .thumb-nav { display: none; }   /* phones/tablets swipe the strip instead */
  .gallery-count { opacity: 1; }

  /* About */
  .about::before { left: 0; }   /* no sidebar on tablets/phones */
  .about { grid-template-columns: 1fr 1fr; min-height: 0; background: linear-gradient(to right, var(--cream-mid) 50%, var(--cream) 0); }
  .about-text, .about-stats { padding: 64px 32px 40px; }
  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .market-tabs { grid-column: 1 / -1; padding: 8px 32px 56px; }
  .buy-intro { gap: 28px; }
  .buy-steps { column-gap: 36px; }

  /* CTA */
  .cta { padding: 52px 32px; gap: 32px; }
  .cta-photo { width: 160px; }

  /* Footer */
  .site-footer { grid-template-columns: 1fr; }
  .footer-l { padding: 36px 16px 8px; background: var(--cream); }
  .footer-r { padding: 16px 32px 40px; align-items: center; text-align: center; }
  .footer-links { justify-content: center; gap: 14px 24px; }
  .footer-main { align-items: center; }
}

/* Phone */
@media (max-width: 640px) {
  .hero { min-height: 480px; }
  .hero-tagline span { font-size: clamp(30px, 9vw, 44px); }
  .btn-ghost { padding: 15px 34px; }

  .intro-body { padding: 56px 20px; }
  .intro-body h2 br { display: none; }
  .intro-body p { font-size: 15.5px; line-height: 1.75; }

  .hoods-content { padding: 56px 20px; }
  .hoods-content h2 { font-size: 30px; }
  .hoods-content h2 br { display: none; }
  .hood-item { min-height: 58px; padding: 10px 10px; }
  .hood-name { font-size: 10px; letter-spacing: 0.18em; }
  .hoods-intro-text .hoods-lead { font-size: 15.5px; line-height: 1.75; }
  .hood-panel-name { font-size: 24px; }
  .hood-panel-desc { font-size: 15.5px; line-height: 1.75; }

  .ap-main { padding: 40px 20px 48px; }
  .ap-heading { font-size: 38px; margin: 0 0 28px; }
  .ap-intro { margin-top: 32px; font-size: 15.5px; line-height: 1.75; }
  .ap-bio-panel { padding: 20px 18px 16px; }
  .ap-philosophy { margin-top: 28px; }
  .ap-people { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .ap-photo-frame { width: 153px; }
  .ap-name { font-size: 30px; }
  .ap-cta { text-align: left; margin-top: 24px; }

  .listings-content { padding: 56px 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 28px; }
  .section-head h3 { font-size: 32px; }
  .listings-grid { grid-template-columns: 1fr; gap: 48px; }
  .card-btn { align-self: stretch; text-align: center; padding: 14px 24px; }

  .gallery-body { padding: 56px 20px; }
  .gallery-meta h3 { font-size: 32px; }
  .gallery-info .gallery-actions { flex: 1 1 100%; }   /* phones: buttons wrap under the details */
  .gallery-main { aspect-ratio: 4/3; }
  .thumb { flex-basis: 92px; }

  .about { grid-template-columns: 1fr; background: var(--cream); }
  .about-text { background: var(--cream-mid); }
  .about-text { padding: 56px 20px 40px; }
  .about-text h2 { font-size: 32px; }
  .about-stats { padding: 40px 20px 40px; gap: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .stat { padding-left: 14px; }
  .market-tabs { padding: 24px 20px 48px; background: var(--cream); }
  .market-tab { font-size: 9.5px; letter-spacing: 0.16em; padding: 10px 8px; }
  .market-panel-card { padding: 20px 18px 22px; }
  .market-panel-head h3 { font-size: 24px; }
  .buy-intro { grid-template-columns: 1fr; gap: 22px; }
  .buy-steps { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .buy-step:nth-child(5) { border-top: 1px solid var(--cream-dark); padding-top: 20px; }
  .buy-step { grid-template-columns: 44px minmax(0, 1fr); }
  .buy-process { margin-top: 32px; padding-top: 26px; }
  .buy-cta { padding: 28px 0 4px; }
  .buy-cta h4 { font-size: 24px; }
  .stat-num { font-size: 46px; }

  .cta { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "photo" "actions"; justify-items: start; gap: 28px; padding: 56px 20px; }
  .cta > .cta-actions { justify-self: start; }
  .cta-photo { width: 160px; }
  .cta-text h2 { font-size: 34px; }
  .cta-actions { align-items: flex-start; }

  .footer-r { padding: 16px 20px 36px; }
  .footer-copy { white-space: normal; }   /* very narrow phones: Privacy Policy may drop to its own line */
  .footer-privacy-wrap { white-space: nowrap; }

  .contact-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; }
  .dialog-inner { padding: 56px 20px calc(32px + env(safe-area-inset-bottom)); }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field input, .field textarea { font-size: 16px; } /* prevents iOS zoom on focus */
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Clean printing */
@media print {
  .topbar, .mobile-menu, .sidebar, .contact-dialog, .btn-ghost { display: none !important; }
  .hero, .intro { height: auto; min-height: 0; }
  body { padding: 0; }
}

/* Smallest phones: the copyright fills the line, so Privacy Policy sits neatly beneath it */
@media (max-width: 360px) {
  .footer-privacy-wrap { display: block; margin-top: 4px; }
  .footer-sep { display: none; }
}

/* Touch screens: larger tap areas for the small text links (invisible, so their look doesn't change) */
@media (max-width: 960px), (pointer: coarse) {
  a.text-link, .cta-phone, .footer-links a, .footer-privacy { position: relative; }
  a.text-link::after, .cta-phone::after, .footer-links a::after, .footer-privacy::after { content: ''; position: absolute; }
  a.text-link::after { inset: -14px -8px; }
  .cta-phone::after { inset: -6px -8px; }          /* stops short of the button above and the icons below */
  .footer-links a::after { inset: -7px -12px; }    /* half the gap between rows and links, so neighbours never overlap */
  .footer-privacy::after { inset: -10px -6px; }
}

/* Equal Housing Opportunity, at the end of the footer disclaimer */
.footer-eho { white-space: nowrap; margin-left: 4px; }
.eho-icon { display: inline-block; width: 1.2em; height: 1.2em; margin-right: 5px; vertical-align: -0.22em; fill: currentColor; }

/* Brokerage line beneath Philip's contact details (sidebars and phone menu): smaller and set slightly apart */
.sidebar-footer .sf-brokerage, .mobile-menu-footer .sf-brokerage { font-size: 10.5px; letter-spacing: 0.06em; line-height: 1.5; }
.sidebar-footer .sf-brokerage-name, .mobile-menu-footer .sf-brokerage-name { margin-top: 6px; }
