/* ============================================
   Revive Residential — Shared Styles
   ============================================ */

/* 1. Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* 2. Custom Properties */
:root {
  --bg: #faf8f5;
  --bg-alt: #f3efe9;
  --surface: #ffffff;
  --text: #2c2420;
  --text-muted: #7a6f66;
  --text-light: #a69a8f;
  --accent: #b8860b;
  --accent-light: #f5eed9;
  --accent-dark: #8a6508;
  --blue: #1691ca;
  --blue-light: #e8f4fa;
  --green: #2d6a4f;
  --green-light: #d8f3dc;
  --sale: #c0392b;
  --border: #e5dfd8;
  --shadow: 0 2px 20px rgba(44,36,32,0.06);
  --shadow-lg: 0 8px 40px rgba(44,36,32,0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --max-width: 1120px;
}

/* 3. Typography */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 32px; font-weight: 700; }
h2 { font-size: 26px; font-weight: 600; margin-bottom: 16px; }
h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }

@media (min-width: 768px) {
  h1 { font-size: 48px; }
  h2 { font-size: 36px; }
  h3 { font-size: 24px; }
}

.label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.body-lg {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-muted);
}
@media (min-width: 768px) {
  .body-lg { font-size: 20px; }
}

/* 4. Layout Utilities */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}
@media (min-width: 768px) {
  .section { padding: 96px 0; }
}

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

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 40px; }
}

/* 5. Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo img {
  height: 36px;
  width: auto;
}
.nav-links {
  display: none;
  gap: 32px;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none !important; }
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px 24px;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover,
.nav-mobile a.active { color: var(--text); }

/* Transparent nav variant (home hero) */
.nav.nav-transparent {
  background: transparent;
  border-bottom-color: transparent;
}
.nav.nav-transparent .nav-links a { color: rgba(255,255,255,0.8); }
.nav.nav-transparent .nav-links a:hover,
.nav.nav-transparent .nav-links a.active { color: #fff; }
.nav.nav-transparent .nav-links a.active::after { background: #fff; }
.nav.nav-transparent .nav-toggle span { background: #fff; }

.nav.nav-scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.nav.nav-scrolled .nav-links a { color: var(--text-muted); }
.nav.nav-scrolled .nav-links a:hover,
.nav.nav-scrolled .nav-links a.active { color: var(--text); }
.nav.nav-scrolled .nav-links a.active::after { background: var(--accent); }
.nav.nav-scrolled .nav-toggle span { background: var(--text); }

/* 6. Hero Components */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 120px 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(44,36,32,0.3) 0%,
    rgba(44,36,32,0.55) 60%,
    rgba(44,36,32,0.75) 100%
  );
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero h1 {
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 32px;
}
@media (min-width: 768px) {
  .hero p { font-size: 20px; }
}

/* Short hero (inner pages) */
.hero-short {
  min-height: auto;
  padding: 140px 24px 80px;
}
.hero-short .hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(44,36,32,0.4) 0%,
    rgba(44,36,32,0.65) 100%
  );
}
@media (min-width: 768px) {
  .hero-short { padding: 160px 24px 100px; }
}

/* 7. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}
.btn-white {
  background: #fff;
  color: var(--text);
}
.btn-white:hover { background: var(--bg); }
.btn-hero {
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  padding: 16px 40px;
  border-radius: var(--radius);
}
.btn-hero:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(184,134,11,0.3); }

.text-link {
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}
.text-link:hover { gap: 10px; }
.text-link svg { width: 16px; height: 16px; }

/* 8. Cards & Surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-body { padding: 24px; }
@media (min-width: 768px) {
  .card-body { padding: 32px; }
}

.card-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-img img { transform: scale(1.03); }

/* Feature card (icon + title + text) */
.feature-card {
  text-align: center;
  padding: 32px 24px;
}
.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--accent);
}
.feature-card h3 { margin-bottom: 12px; }
.feature-card p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

/* 9. Listing Components */
.listing-featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
  .listing-featured { grid-template-columns: 1fr 1fr; }
}
.listing-featured-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}
.listing-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-featured-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) {
  .listing-featured-body { padding: 40px; }
}

.listing-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.badge-available {
  background: var(--green-light);
  color: var(--green);
}
.badge-sale {
  background: var(--sale);
  color: #fff;
}

.listing-address {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .listing-address { font-size: 26px; }
}
.listing-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.listing-price {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.listing-price s { opacity: 0.6; margin-right: 6px; }
.listing-price strong {
  color: var(--text);
  font-size: 20px;
}
.listing-price .badge-sale {
  font-size: 9px;
  padding: 3px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* Highlight tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* Photo gallery */
.gallery-main {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.gallery-thumb {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  border: 2px solid transparent;
}
.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: var(--accent);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 10. CTA Banner */
.cta-banner {
  text-align: center;
  padding: 64px 24px;
  position: relative;
  overflow: hidden;
}
.cta-banner-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cta-banner-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cta-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(44,36,32,0.6), rgba(44,36,32,0.75));
  z-index: 1;
}
.cta-banner-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}
.cta-banner h2 { color: #fff; margin-bottom: 12px; }
.cta-banner p { color: rgba(255,255,255,0.8); margin-bottom: 28px; font-size: 17px; }
@media (min-width: 768px) {
  .cta-banner { padding: 96px 24px; }
}

/* 11. Footer */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
  text-align: center;
}
.footer-logo {
  margin-bottom: 12px;
}
.footer-logo img {
  height: 32px;
  width: auto;
  margin: 0 auto;
}
.footer-tagline {
  font-family: var(--font-heading);
  font-size: 16px;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-size: 13px;
  color: var(--text-light);
}
.footer-copy span { display: block; margin-top: 4px; }

/* 12. Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.1s; }
.stagger > *:nth-child(3) { transition-delay: 0.2s; }
.stagger > *:nth-child(4) { transition-delay: 0.3s; }
.stagger > *:nth-child(5) { transition-delay: 0.4s; }
.stagger > *:nth-child(6) { transition-delay: 0.5s; }

/* Body offset for fixed nav */
body { padding-top: 64px; }
.has-hero { padding-top: 0; }

/* 13. Responsive helpers */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hide-desktop { display: none !important; }
}
