/* ============================================================
   Greenera Southmark — Base & components
   Tailwind (CDN) handles utility layout; this file owns
   resets, typography, and reusable components.
   ============================================================ */

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

/* Ensure [hidden] always wins over Tailwind CDN utility layer (e.g. .grid) */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--gold);
  color: #fff;
}

/* Visible keyboard focus (accessibility) — only for keyboard nav, not mouse */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible,
.section-olive :focus-visible {
  outline-color: var(--gold-soft);
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-wide {
  max-width: var(--container-wide);
}
.section {
  position: relative;
  padding-block: var(--section-y);
}

/* ---- Typography ---- */
.font-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.08;
}
.h-xl {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.2vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.h-lg {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.1;
}
.h-md {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
}
.lede {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--ink-soft);
  font-weight: 300;
}

/* Section eyebrow / kicker */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}
.kicker.center::after {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}
.on-dark .kicker {
  color: var(--gold-soft);
}
.gold-text {
  color: var(--gold);
}

/* ---- Buttons ---- */
.btn {
  --btn-bg: var(--gold);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.8em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1;
  border: none;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
  box-shadow: var(--shadow-gold);
  text-align: center;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(156, 127, 68, 0.45);
}
.btn:active {
  transform: translateY(0);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
}
.btn-moss {
  --btn-bg: var(--moss);
  box-shadow: 0 14px 34px rgba(67, 68, 31, 0.3);
}
.btn-outline {
  background: transparent;
  color: var(--moss-deep);
  border: 1.5px solid var(--gold);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--gold);
  color: #fff;
}
.on-dark .btn-outline {
  color: var(--on-dark);
  border-color: var(--gold-soft);
}
.btn-lg {
  padding: 1.1em 2.3em;
  font-size: 1.02rem;
}
.btn-block {
  width: 100%;
}

/* ---- Cards / surfaces ---- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}
.on-dark .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-dark);
  color: var(--on-dark);
  backdrop-filter: blur(4px);
}

/* ---- Section theming ---- */
.on-dark {
  color: var(--on-dark);
  background-color: var(--moss);
}
.on-dark .lede,
.on-dark p {
  color: var(--on-dark-soft);
}
.bg-cream {
  background: var(--cream);
}
.bg-ivory {
  background: var(--ivory);
}
.bg-sage {
  background: var(--sage-2);
}

/* Olive section with painterly texture (matches the PDF's organic olive bands) */
.section-olive {
  background-color: var(--moss-deep);
  background-image: linear-gradient(rgba(58, 57, 33, 0.9), rgba(46, 45, 26, 0.93)),
    url("../images/bg-olive-wide.webp");
  background-size: cover, cover;
  background-position: center, center;
  background-blend-mode: normal, normal;
  color: var(--on-dark);
}

/* Organic curved divider sitting at a section edge (cream <-> olive) */
.organic-top,
.organic-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
  z-index: 1;
}
.organic-top {
  top: 0;
  transform: translateY(-99%);
}
.organic-bottom {
  bottom: 0;
  transform: translateY(99%);
}
.organic-top svg,
.organic-bottom svg {
  display: block;
  width: 100%;
  height: clamp(34px, 5vw, 68px);
}

/* ---- Stat / number block ---- */
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  color: var(--gold);
}

/* ---- Icon chip ---- */
.icon-chip {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(184, 153, 90, 0.14);
  color: var(--gold-deep);
  flex: none;
}
.on-dark .icon-chip {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-soft);
}
.icon-chip svg {
  width: 28px;
  height: 28px;
}

/* ---- Checklist ---- */
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.check-list li {
  position: relative;
  padding-left: 2rem;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 0.85rem no-repeat;
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header.scrolled {
  background: rgba(250, 249, 243, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(77, 75, 44, 0.1);
}
.site-header__inner {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-logo {
  height: 56px;
  width: auto;
}
.brand-logo.is-light {
  display: block;
}
.brand-logo.is-dark {
  display: none;
}
.site-header.scrolled .brand-logo.is-light {
  display: none;
}
.site-header.scrolled .brand-logo.is-dark {
  display: block;
}
.nav-links {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.nav-links a {
  color: #fff;
  opacity: 0.92;
  transition: opacity 0.2s, color 0.2s;
  position: relative;
}
.nav-links a:hover {
  opacity: 1;
}
.site-header.scrolled .nav-links a {
  color: var(--moss-deep);
}
.header-tel {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.site-header.scrolled .header-tel {
  color: var(--gold-deep);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
  align-items: center;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #fff;
  transition: 0.3s var(--ease);
}
.site-header.scrolled .nav-toggle span {
  background: var(--moss-deep);
}
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--moss);
  color: var(--on-dark);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 2rem var(--gutter);
}
.mobile-nav.open {
  transform: translateX(0);
}
.mobile-nav a {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 1.1rem;
  font-weight: 600;
}
.mobile-nav__close {
  align-self: flex-end;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--on-dark);
  cursor: pointer;
}

/* ============================================================
   Floating contact + scroll top
   ============================================================ */
.float-stack {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.float-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: none;
  transition: transform 0.25s var(--ease);
}
.float-btn:hover {
  transform: scale(1.08);
}
.float-btn svg {
  width: 26px;
  height: 26px;
}
.float-btn.tel {
  background: var(--gold-deep);
  animation: pulse-ring 2.4s infinite;
}
.float-btn.zalo {
  background: #0068ff;
  font-weight: 700;
  font-size: 0.78rem;
}
.float-btn.top {
  background: var(--moss);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.25s var(--ease);
}
.float-btn.top.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   Lead modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal.open {
  opacity: 1;
  pointer-events: auto;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 44, 20, 0.66);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--ivory);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.35s var(--ease);
}
.modal.open .modal__panel {
  transform: translateY(0) scale(1);
}
.modal__head {
  padding: 2rem 2rem 1rem;
  text-align: center;
  background: var(--moss);
  color: var(--on-dark);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.modal__body {
  padding: 1.6rem 2rem 2rem;
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 2;
}

/* ============================================================
   Forms
   ============================================================ */
.field {
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
}
.field input,
.field select {
  width: 100%;
  padding: 0.85em 1em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 153, 90, 0.18);
}
.field .err {
  color: #c0392b;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-group label {
  margin: 0;
}
.chip-group input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.chip-opt {
  display: inline-flex;
  padding: 0.5em 1em;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
}
.chip-group input:checked + .chip-opt {
  background: var(--moss);
  border-color: var(--moss);
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 140%);
  z-index: 90;
  max-width: 90vw;
  background: #fff;
  color: var(--ink);
  border-left: 5px solid var(--gold);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  /* Fully hidden until a message is shown (avoids the empty box peeking up) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.45s var(--ease), opacity 0.3s var(--ease),
    visibility 0.45s var(--ease);
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================================
   Decorative wave divider
   ============================================================ */
.wave-top,
.wave-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  line-height: 0;
  pointer-events: none;
}
.wave-top {
  top: -1px;
}
.wave-bottom {
  bottom: -1px;
}
.wave-top svg,
.wave-bottom svg {
  width: 100%;
  height: clamp(40px, 6vw, 90px);
  display: block;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  background:
    linear-gradient(rgba(43, 44, 20, 0.88), rgba(43, 44, 20, 0.94)),
    url("../images/bg-contact.webp") center / cover no-repeat;
  color: var(--on-dark-soft);
}
.site-footer a:hover {
  color: var(--gold-soft);
}

/* ============================================================
   Lightbox (click image to view large)
   ============================================================ */
.zoomable {
  cursor: zoom-in;
}
.zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.8em;
  border-radius: var(--r-pill);
  background: rgba(43, 44, 20, 0.62);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.zoom-hint svg {
  width: 14px;
  height: 14px;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(20, 21, 10, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  /* White backing so transparent-background graphics (floor plans, map,
     payment tables) don't show the dark backdrop through their alpha. */
  background: #fff;
  transform: scale(0.96);
  transition: transform 0.3s var(--ease);
  cursor: zoom-out;
}
.lightbox.open img {
  transform: scale(1);
}
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.lightbox__cap {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--on-dark-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============================================================
   FAQ accordion
   ============================================================ */
.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}
.faq-item + .faq-item {
  margin-top: 0.85rem;
}
.faq-item.open {
  border-color: var(--gold-soft);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(var(--ivory), #fff);
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 1.15rem 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.faq-q-text {
  flex: 1;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--moss-deep);
  line-height: 1.4;
}
.faq-toggle {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(173, 143, 79, 0.12);
  color: var(--gold-deep);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    transform 0.3s var(--ease);
}
.faq-item.open .faq-toggle {
  background: var(--gold);
  color: #fff;
  transform: rotate(45deg);
}
.faq-toggle svg {
  width: 18px;
  height: 18px;
}
.faq-a > div {
  overflow: hidden;
}
.faq-a-inner {
  padding: 0 1.4rem 1.3rem 1.4rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.65;
}
.faq-a-inner::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--line);
  margin-bottom: 0.9rem;
}

/* ============================================================
   Slider
   ============================================================ */
[data-slider] {
  position: relative;
}
.slider-track {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.5rem;
  cursor: grab;
  overscroll-behavior-x: contain;
}
/* Uniform card media so mixed source ratios don't create height gaps */
.slider-track > figure > img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.slider-track::-webkit-scrollbar {
  display: none;
}
.slider-track.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.slider-track > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--moss-deep);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.slider-arrow:hover {
  background: var(--gold);
  color: #fff;
}
.slider-arrow.prev {
  left: -10px;
}
.slider-arrow.next {
  right: -10px;
}
.slider-arrow svg {
  width: 22px;
  height: 22px;
}
[data-slider-dots] {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.4rem;
}
.slider-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  cursor: pointer;
  transition: width 0.25s var(--ease), background 0.25s;
}
.slider-dot.active {
  width: 26px;
  border-radius: var(--r-pill);
  background: var(--gold);
}
.on-dark .slider-dot {
  background: rgba(255, 255, 255, 0.28);
}
.on-dark .slider-dot.active {
  background: var(--gold-soft);
}

/* Misc */
.divider-dot {
  color: var(--gold);
  padding-inline: 0.5rem;
}
.media-rounded {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ratio {
  position: relative;
  overflow: hidden;
}
.ratio > img,
.ratio > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ratio-16x9 {
  aspect-ratio: 16 / 9;
}
.ratio-4x3 {
  aspect-ratio: 4 / 3;
}
.ratio-3x4 {
  aspect-ratio: 3 / 4;
}
.ratio-1x1 {
  aspect-ratio: 1 / 1;
}
