/*
Theme Name: Resilience Estate
Theme URI: https://resilienceghana.com
Author: DEE Solutions
Description: Custom WordPress theme for Resilience Estate — minimal, modern luxury real estate developer site.
Version: 1.0.0
Text Domain: resilience-estate
*/

:root {
  --re-green: #0F3D32;
  --re-green-dark: #08251F;
  --re-gold: #D4AF37;
  --re-ivory: #FAF9F6;
  --re-charcoal: #1A1A1A;
  --re-light: #E5E7EB;
  --re-white: #FFFFFF;

  --re-font-heading: 'Playfair Display', Georgia, serif;
  --re-font-body: 'Montserrat', Arial, sans-serif;

  --re-radius: 4px;
  --re-max-width: 1240px;
  --re-transition: 200ms ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--re-font-body);
  color: var(--re-charcoal);
  background: var(--re-ivory);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--re-font-heading);
  color: var(--re-green);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

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

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

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--re-radius);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--re-transition), color var(--re-transition), border-color var(--re-transition);
}
.btn-primary { background: var(--re-gold); color: var(--re-green-dark); }
.btn-primary:hover { background: #c29a2e; }
.btn-outline { background: transparent; color: var(--re-white); border-color: var(--re-white); }
.btn-outline:hover { background: var(--re-white); color: var(--re-green); }
.btn-outline-gold { background: transparent; color: var(--re-gold); border-color: var(--re-gold); }
.btn-outline-gold:hover { background: var(--re-gold); color: var(--re-green-dark); }
.btn-secondary { background: var(--re-green); color: var(--re-white); }
.btn-secondary:hover { background: var(--re-green-dark); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5b; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--re-white);
  border-bottom: 1px solid var(--re-light);
}
.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-logo { grid-column: 1; justify-self: start; }
.site-logo img { height: 48px; width: auto; }
.main-nav { grid-column: 2; display: flex; align-items: center; justify-self: center; }
.site-header-cta { grid-column: 3; justify-self: end; }
.nav-toggle { grid-column: 3; justify-self: end; }
.main-nav ul { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.main-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--re-charcoal);
}
.main-nav a:hover { color: var(--re-green); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 900px) {
  .main-nav ul { display: none; }
  .site-header-cta { display: none; }
  .nav-toggle { display: block; }
  .site-header.nav-open .main-nav ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--re-white);
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--re-light);
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  color: var(--re-white);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.8s ease;
  animation: re-hero-zoom 22s ease-in-out infinite alternate;
}
.hero-bg.is-active { opacity: 1; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8,37,31,0.15) 0%, rgba(8,37,31,0.75) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 60px 0; max-width: 640px; }
.hero-content h1 { color: var(--re-white); }
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; }

@keyframes re-hero-zoom {
  from { transform: scale(1.1); }
  to { transform: scale(1); }
}

/* On phones a wide photo is already cropped into a tall screen and enlarged
   ~2x, so keep the slow zoom gentler to avoid softening it further. */
@keyframes re-hero-zoom-sm {
  from { transform: scale(1.04); }
  to { transform: scale(1); }
}
@media (max-width: 700px) {
  .hero-bg {
    transform: scale(1.04);
    animation-name: re-hero-zoom-sm;
  }
}

/* Hero text entrance — each direct child (eyebrow, heading, copy, buttons)
   fades and slides up in sequence. */
.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: re-fade-up 0.8s ease forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.28s; }
.hero-content > *:nth-child(3) { animation-delay: 0.46s; }
.hero-content > *:nth-child(4) { animation-delay: 0.64s; }

@keyframes re-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-content > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-bg {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 0 !important;
  }
  .hero-bg.is-active { opacity: 1 !important; }
}

/* Sections */
.section { padding: 80px 0; }
.section-dark { background: var(--re-green); color: var(--re-ivory); }
.section-dark h2, .section-dark h3 { color: var(--re-white); }
.section-head { max-width: 640px; margin-bottom: 40px; }

/* Scroll reveal — section intros fade/slide up; grids of cards or stats
   stagger in one after another as they're scrolled into view. */
.section-head {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.section-head.is-visible { opacity: 1; transform: translateY(0); }

.dev-grid > *, .amenities-grid > *, .dev-facts > * {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.6s ease, translate 0.6s ease;
}
.dev-grid.is-visible > *, .amenities-grid.is-visible > *, .dev-facts.is-visible > * {
  opacity: 1;
  translate: 0 0;
}
.dev-grid > *:nth-child(1), .amenities-grid > *:nth-child(1), .dev-facts > *:nth-child(1) { transition-delay: 0.05s; }
.dev-grid > *:nth-child(2), .amenities-grid > *:nth-child(2), .dev-facts > *:nth-child(2) { transition-delay: 0.15s; }
.dev-grid > *:nth-child(3), .amenities-grid > *:nth-child(3), .dev-facts > *:nth-child(3) { transition-delay: 0.25s; }
.dev-grid > *:nth-child(4), .amenities-grid > *:nth-child(4), .dev-facts > *:nth-child(4) { transition-delay: 0.35s; }
.dev-grid > *:nth-child(5), .amenities-grid > *:nth-child(5), .dev-facts > *:nth-child(5) { transition-delay: 0.45s; }
.dev-grid > *:nth-child(6), .amenities-grid > *:nth-child(6), .dev-facts > *:nth-child(6) { transition-delay: 0.55s; }
.dev-grid > *:nth-child(n+7), .amenities-grid > *:nth-child(n+7), .dev-facts > *:nth-child(n+7) { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  .section-head, .dev-grid > *, .amenities-grid > *, .dev-facts > * {
    opacity: 1 !important;
    transform: none !important;
    translate: none !important;
  }
}
.eyebrow {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--re-gold);
  font-weight: 700;
  margin-bottom: 8px;
}

/* Status filter tabs */
.dev-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.dev-filter-tab {
  background: var(--re-white);
  border: 1px solid var(--re-light);
  color: var(--re-charcoal);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--re-transition), color var(--re-transition), border-color var(--re-transition);
}
.dev-filter-tab:hover { border-color: var(--re-gold); }
.dev-filter-tab.active { background: var(--re-green); color: var(--re-white); border-color: var(--re-green); }
.dev-card[hidden] { display: none; }

/* Development grid & cards */
.dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 28px;
}
.dev-card {
  background: var(--re-white);
  color: var(--re-charcoal);
  border-radius: var(--re-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15,61,50,0.08);
  transition: transform var(--re-transition), opacity 0.6s ease, translate 0.6s ease;
}
.dev-card:hover { transform: translateY(-4px); }
.dev-card-img { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.dev-card-img img { width: 100%; height: 100%; object-fit: cover; }
.dev-card-img--empty { background: linear-gradient(135deg, var(--re-green) 0%, var(--re-green-dark) 100%); }
.dev-status {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--re-gold);
  color: var(--re-green-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
}
.dev-card-body { padding: 20px; }
.dev-card-body h3 { margin-bottom: 4px; }
.dev-location { font-size: 0.85rem; color: #556; margin-bottom: 8px; }
.dev-card-cta { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.dev-card-cta a { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--re-green); }
.dev-card-cta a:hover { color: var(--re-gold); }

/* Amenities grid */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 24px;
}
.amenity-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.amenity-icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--re-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--re-green);
}
.amenity-icon svg { width: 26px; height: 26px; }
.amenity-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--re-charcoal);
}

/* Auto-sliding gallery carousel (centered "peek" style) */
.re-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.re-carousel-track {
  display: flex;
  height: 100%;
  will-change: transform;
}
.re-carousel-slide {
  flex: 0 0 auto;
  width: 78%;
  height: 100%;
  padding: 0 8px;
  box-sizing: border-box;
  opacity: 0.45;
  transition: opacity 300ms ease;
}
.re-carousel-slide.is-active { opacity: 1; }
.re-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--re-radius);
}
@media (max-width: 700px) {
  .re-carousel { aspect-ratio: 4/3; }
  .re-carousel-slide { width: 86%; }
}

/* Development detail */
.dev-hero { min-height: 55vh; }
.dev-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--re-light); margin-bottom: 32px; flex-wrap: wrap; }
.dev-tabs a { padding: 10px 4px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid transparent; }
.dev-tabs a:hover, .dev-tabs a.active { border-color: var(--re-gold); color: var(--re-green); }
.dev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; margin: 24px 0; }
.dev-fact { border-left: 2px solid var(--re-gold); padding-left: 12px; }
.dev-fact strong { display: block; font-family: var(--re-font-heading); font-size: 1.15rem; color: var(--re-green); }
.dev-fact span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: #667; }
.section-dark .dev-fact strong, .section-dark .dev-fact span { color: var(--re-white); }
.dev-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.dev-gallery img { aspect-ratio: 4/3; object-fit: cover; border-radius: var(--re-radius); }

/* Forms */
.enquiry-form { background: var(--re-white); padding: 32px; border-radius: var(--re-radius); box-shadow: 0 2px 12px rgba(15,61,50,0.08); max-width: 560px; }
.enquiry-form label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; margin-top: 16px; }
.enquiry-form label:first-child { margin-top: 0; }
.enquiry-form input, .enquiry-form select, .enquiry-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--re-light);
  border-radius: var(--re-radius);
  font-family: var(--re-font-body);
  font-size: 0.95rem;
}
.enquiry-form textarea { min-height: 100px; resize: vertical; }
.enquiry-form .btn { margin-top: 20px; width: 100%; justify-content: center; }
.enquiry-form [hidden] { display: none; }

/* Brochure lead-capture modal */
.brochure-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.brochure-modal[hidden] { display: none; }
.brochure-modal-overlay { position: absolute; inset: 0; background: rgba(8,37,31,0.6); }
.brochure-modal-box { position: relative; max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; }
.brochure-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: #556; z-index: 1; }
.brochure-modal-close:hover { color: var(--re-green); }

/* Footer */
.site-footer { background: var(--re-green-dark); color: var(--re-ivory); padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { color: var(--re-white); font-size: 0.95rem; }
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 { color: var(--re-white); }
.footer-grid a { display: block; color: #cdd; font-size: 0.9rem; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--re-gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; font-size: 0.8rem; color: #9ab; text-align: center; }
.footer-bottom a { text-decoration: underline; }
.footer-bottom a:hover { color: var(--re-gold); }
