/* ============================================================
   Palouse Arms Apartments — styles.css
   Mobile-first. Warm, trustworthy, residential.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Palette */
  --navy:        #16304f;   /* deep, solid blue — primary brand */
  --navy-dark:   #0f2238;
  --accent:      #c97b3f;   /* warm terracotta/amber — buttons & CTAs */
  --accent-dark: #b0682f;
  --cream:       #faf7f2;   /* warm off-white page background */
  --cream-alt:   #f1ece3;   /* alternating section background */
  --ink:         #26303a;   /* body text */
  --ink-soft:    #5a6571;   /* muted text */
  --line:        #e0d9cd;   /* hairline borders */
  --white:       #ffffff;

  /* Type */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --maxw: 1100px;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(22, 48, 79, 0.10);
  --shadow-sm: 0 2px 10px rgba(22, 48, 79, 0.07);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  color: var(--navy);
  font-weight: 600;
  margin: 0 0 0.4em;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.08s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-dark); color: var(--white); }

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-secondary:hover { background: var(--navy); color: var(--white); }

.btn-lg { padding: 16px 34px; font-size: 1.08rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
}
.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
}
.brand:hover { text-decoration: none; }

.primary-nav { display: none; }
.primary-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.97rem;
  padding: 8px 2px;
}
.primary-nav a:hover { color: var(--accent-dark); text-decoration: none; }
.primary-nav .nav-cta {
  background: var(--navy);
  color: var(--white);
  padding: 9px 18px;
  border-radius: 8px;
}
.primary-nav .nav-cta:hover { background: var(--navy-dark); }

/* Hamburger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav open */
.primary-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px 20px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.primary-nav.open a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.primary-nav.open a:last-child { border-bottom: none; }
.primary-nav.open .nav-cta { text-align: center; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  /* TEMPORARY hero image: virtually staged Unit 3 bedroom (a disclosure badge is shown in the
     hero markup). REPLACE with images/building-exterior.jpg when a real exterior is available
     and remove the .hero-staged badge in index.html. See README. */
  background: var(--navy) url("images/unit3-bedroom-staged-2.jpg") center/cover no-repeat;
  color: var(--white);
  text-align: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 34, 56, 0.55), rgba(15, 34, 56, 0.72));
}
.hero-content { position: relative; padding: 80px 20px; }
.hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 700;
  margin-bottom: 0.3em;
}
.hero-sub {
  font-size: clamp(1.05rem, 3.5vw, 1.4rem);
  max-width: 640px;
  margin: 0 auto 1.8em;
  color: rgba(255, 255, 255, 0.94);
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--cream-alt); }
.section-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  text-align: center;
}
.section-lead {
  text-align: center;
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto 2.4em;
  font-size: 1.08rem;
}

/* ---------- Unit cards ---------- */
.unit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.unit-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.unit-photo-wrap { position: relative; line-height: 0; }
.unit-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--cream-alt);
}
.unit-body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.unit-type { font-size: 1.5rem; margin: 0; }
.unit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}
.unit-beds { font-weight: 600; color: var(--navy); }
.unit-rent { font-size: 1.4rem; font-weight: 600; color: var(--accent-dark); font-family: var(--font-head); }
.unit-sqft { color: var(--ink-soft); font-weight: 500; }
.unit-feature { margin: 0; color: var(--ink-soft); flex: 1; }
.unit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.unit-actions .btn { flex: 1 1 auto; }

/* ---------- Virtual-staging disclosure badge ---------- */
.staged-badge {
  display: inline-block;
  background: rgba(15, 34, 56, 0.85);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  padding: 6px 10px;
  border-radius: 6px;
}
/* badge layered over an image (unit card, gallery thumb, hero) */
.unit-photo-wrap .staged-badge,
.gallery-item .staged-badge,
.hero-staged {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  max-width: max-content;
}
.hero-staged { z-index: 2; }
.staged-badge-thumb { font-size: 0.62rem; padding: 4px 7px; left: 6px; bottom: 6px; right: 6px; }

/* ---------- Amenities ---------- */
.amenity-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}
.amenity {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 500;
}
.amenity-check {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
}
.amenity-empty { opacity: 0.55; border-style: dashed; }
.amenity-empty .amenity-check { background: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery-group { margin-bottom: 36px; }
.gallery-group:last-child { margin-bottom: 0; }
.gallery-group-title {
  font-size: 1.4rem;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.gallery-item {
  position: relative;
  padding: 0;
  border: none;
  background: var(--cream-alt);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ---------- Location ---------- */
.location-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.location-text p { margin: 0 0 1em; }
.location-address {
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-head);
  font-size: 1.1rem;
}
.location-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  line-height: 0;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.contact-info {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.contact-info h3 { color: var(--white); font-size: 1.4rem; }
.contact-info p { color: rgba(255, 255, 255, 0.85); }
.contact-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0 0;
}
.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}
.contact-line a {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-head);
}
.contact-line a:hover { color: var(--accent); text-decoration: none; }

.contact-form-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--ink); }
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--cream);
  color: var(--ink);
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 123, 63, 0.18);
  background: var(--white);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0; }

.form-status {
  margin: 14px 0 0;
  font-weight: 600;
  text-align: center;
  min-height: 1.2em;
}
.form-status.success { color: #1f7a44; }
.form-status.error { color: #b3261e; }

.hidden { display: none !important; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 0;
  text-align: center;
}
.footer-brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--white);
  margin: 0 0 8px;
}
.footer-meta { font-style: normal; line-height: 1.8; }
.footer-meta a { color: rgba(255, 255, 255, 0.9); }
.footer-meta a:hover { color: var(--accent); }
.footer-fine {
  margin: 18px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 20, 33, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  margin: 0;
  background: rgba(201, 123, 63, 0.95);
  color: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 6px;
  text-align: center;
}
.lightbox-caption[hidden] { display: none; }
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
  line-height: 1;
}
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }

/* ============================================================
   RESPONSIVE — tablet & up
   ============================================================ */
@media (min-width: 600px) {
  .field-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  body { font-size: 18px; }
  .section { padding: 84px 0; }

  /* show desktop nav, hide hamburger */
  .nav-toggle { display: none; }
  .primary-nav {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .unit-grid { grid-template-columns: 1fr 1fr; }
  .amenity-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .location-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .contact-grid { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

@media (min-width: 1000px) {
  .amenity-grid { grid-template-columns: repeat(3, 1fr); }
}

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