/* ==========================================================================
   DMG Property Site — shared stylesheet
   Brand colors are injected per-property as CSS custom properties in the
   page <head> (see index.template.html). Everything here reads those vars.
   ========================================================================== */

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

:root {
  /* Fallbacks — real values injected per property in <head> */
  --color-primary: #2e5941;
  --color-secondary: #1f3d2c;
  --color-accent: #c9a86a;
  --color-text: #2b2b2b;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f4f0;
  --header-height: 72px;
  --container-max: 1140px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --font-stack: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  /* Overridable per property via branding.fonts in config */
  --font-body: var(--font-stack);
  --font-heading: var(--font-stack);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
}

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

a {
  color: var(--color-primary);
}

/* Heading treatment is brand-configurable via branding.typography in config */
h1, h2, h3 {
  line-height: 1.2;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: var(--heading-weight, 700);
  text-transform: var(--heading-case, none);
  letter-spacing: var(--heading-ls, normal);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 820px;
}

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 1.25rem + 1.75vw, 2.3rem);
  margin: 0 0 40px;
}

/* --------------------------------- Buttons ------------------------------ */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: var(--btn-case, none);
  letter-spacing: var(--btn-ls, 0.05ch);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--btn-hover-bg, var(--color-secondary));
  border-color: var(--btn-hover-bg, var(--color-secondary));
  color: var(--btn-hover-text, #fff);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --------------------------------- Header ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  box-shadow: none;
  transition: box-shadow 0.2s;
}

.site-header.scrolled {
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 16px;
}

.brand-logo {
  /* Explicit height (not max-height): SVG logos have a 0 min-content size
     in flex layouts, which lets the brand link collapse to zero width.
     Per-property override via branding.logoHeight. */
  height: var(--logo-height, 52px);
  width: auto;
  max-width: none;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--nav-size, 0.95rem);
  text-transform: var(--nav-case, none);
  letter-spacing: var(--nav-ls, normal);
}

/* :not(.btn) — the Apply Now pill keeps its own hover treatment; without
   this, its text takes the link-hover color and vanishes into the fill. */
.site-nav a:not(.btn):hover {
  color: var(--color-primary);
}

.site-nav .btn-nav {
  color: #fff;
  padding: 9px 20px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--color-secondary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------------------------------- Hero -------------------------------- */

.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* With a video, the hero matches the video's aspect ratio (like the source
   sites) instead of a viewport fraction, so the footage is never cropped
   or zoomed on wide screens. Content can still stretch it if taller. */
.hero--video {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.35));
}

.hero-content {
  position: relative;
  color: #fff;
  text-align: center;
  width: 100%;
}

.hero-content h1 {
  color: #fff;
  font-size: clamp(2.2rem, 1.7rem + 3.1vw, 4.5rem);
  line-height: 1;
  margin: 0 0 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero-subhead {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight, 700);
  text-transform: var(--heading-case, none);
  letter-spacing: var(--subhead-ls, var(--heading-ls, normal));
  font-size: clamp(1.05rem, 0.85rem + 0.9vw, 1.6rem);
  margin: 0 0 28px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------------------------------- Intro ------------------------------- */

.intro {
  text-align: center;
}

.intro h2 {
  font-size: 1.8rem;
  margin-top: 0;
}

/* -------------------------------- Amenities ----------------------------- */
/* Full-bleed 50/50 color bands: copy panel on a brand color, photo filling
   the other half edge-to-edge (matches the source sites' design). Band
   colors come from config via --band-bg / --band-text. */

.amenity-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 30vw;
  background: var(--band-bg, var(--color-bg-alt));
  color: var(--band-text, var(--color-text));
}

.amenity-band-reverse .amenity-band-media {
  order: -1;
}

.amenity-band-copy {
  display: flex;
  align-items: center;
}

.amenity-band-inner {
  padding: clamp(2.3rem, 4vw, 4rem) clamp(1.5rem, 6vw, 5.5rem);
}

.amenity-band-inner h3 {
  color: var(--band-text, var(--color-secondary));
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: var(--heading-weight, 600);
  text-transform: var(--heading-case, uppercase);
  letter-spacing: var(--heading-ls, 0.125ch);
  margin: 0 0 1.2em;
}

.amenity-band-media {
  position: relative;
}

.amenity-band-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amenity-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}

.amenity-list li + li {
  padding-top: 0.5em;
}

/* --------------------------------- Gallery ------------------------------ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  width: 100%;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.25s;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.04);
}

/* -------------------------------- Location ------------------------------ */
/* Stacked layout: centered copy over a full-width map (matches source
   sites). Section background/text colors come from location.bgColor /
   location.textColor in config. */

.location-copy {
  max-width: 900px;
  margin: 0 auto 40px;
  text-align: center;
}

.location-copy p {
  margin: 0 auto 1em;
}

.location-map iframe {
  width: 100%;
  min-height: 400px;
  border: 0;
  display: block;
}

.property-map {
  width: 100%;
  height: 500px;
}

/* ------------------------------- Floor plans ---------------------------- */

.floorplan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

/* Fixed column counts via floorPlans.columns in config */
@media (min-width: 701px) {
  .fp-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 920px;
    margin: 0 auto;
  }

  .fp-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.floorplan-card {
  margin: 0;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.floorplan-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

.floorplan-card figcaption {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floorplan-embed {
  margin-top: 36px;
}

/* ------------------------------- 3D tours ------------------------------- */

.tours-copy {
  max-width: 780px;
  margin: 0 auto 28px;
  text-align: center;
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.tour-card {
  margin: 0;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Matterport recommends a wide viewport; 16:10 keeps controls reachable */
.tour-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
}

.tour-card figcaption {
  padding: 14px 18px;
}

/* -------------------------------- Contact ------------------------------- */

.contact-intro {
  text-align: center;
  margin-top: -20px;
  margin-bottom: 32px;
}

/* The form sits directly on the section background (no boxed panel) —
   the contact section itself carries the alternate/config color. */
.contact-form {
  background: none;
  padding: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.req {
  color: #b00020;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #c9c9c9;
  border-radius: 6px;
  background: #fff;
  color: var(--color-text);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: var(--color-primary);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.sms-disclosure {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.5;
}

.cf-turnstile {
  margin: 18px 0;
}

.btn-submit {
  width: 100%;
}

.btn-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  min-height: 1.4em;
  margin: 14px 0 0;
  text-align: center;
  font-weight: 600;
}

.form-status.ok {
  color: #1d7a3d;
}

.form-status.err {
  color: #b00020;
}

/* --------------------------------- Footer ------------------------------- */
/* 50/50 split blocks, each on its own brand color, everything centered
   (matches the source sites). Block colors come from footer.property /
   footer.management bgColor/textColor in config. */

.site-footer {
  font-size: 0.95rem;
}

.footer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.footer-block {
  background: var(--band-bg, var(--color-secondary));
  color: var(--band-text, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 24px;
}

.footer-block a {
  color: inherit;
}

.footer-logo {
  max-width: 220px;
  max-height: 160px;
  width: auto;
  height: auto;
  margin-bottom: 30px;
}

.footer-logo-wide {
  max-width: 320px;
}

.footer-lines {
  margin: 0 0 1.1em;
}

.footer-lines span {
  display: block;
}

.eho-logo {
  width: 34px;
  height: auto;
  margin: 4px 0 0;
}

.footer-credit {
  margin: 2.6em 0 0;
}

.footer-privacy {
  margin: 1.6em 0 0;
}

.footer-legal {
  background: var(--color-secondary);
  color: #fff;
  text-align: center;
  padding: 14px 20px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.footer-legal p {
  margin: 0;
}

.listings-copy {
  max-width: 820px;
  margin: 0 auto 18px;
  text-align: center;
}

/* -------------------------------- Lightbox ------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  padding: 12px 18px;
  line-height: 1;
}

.lightbox-close { top: 12px; right: 16px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ------------------------------- Responsive ----------------------------- */

@media (max-width: 900px) {
  .amenity-band {
    grid-template-columns: 1fr;
  }

  .amenity-band-reverse .amenity-band-media {
    order: 0;
  }

  .amenity-band-media {
    min-height: 260px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    box-shadow: var(--shadow);
    display: none;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
  }

  .site-nav li a {
    display: block;
    padding: 12px 24px;
  }

  .site-nav .btn-nav {
    margin: 10px 24px;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 52px 0;
  }
}
