/* ==========================================================================
   MarbellaNext.com — Stylesheet
   Palette:  cream #FBFAF5 · card #F4F1EC · olive #646D50 · olive-dark #545C42
             ink #1C1B17 · muted #6E695E · line #E6E1D8
   Type:     Fraunces (display serif) / Inter (body, nav, ui)
   ========================================================================== */

:root {
  --cream: #FBFAF5;
  --card: #F4F1EC;
  --olive: #646D50;
  --olive-dark: #535A44;
  --ink: #1C1B17;
  --muted: #726C60;
  --line: #E7E2D8;
  --white: #FFFFFF;

  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 1280px;
  --gutter: clamp(24px, 5vw, 64px);

  --radius-lg: 14px;
  --radius-sm: 10px;
  --radius-pill: 100px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 3px;
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  border: none;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
  white-space: nowrap;
}

.btn svg { flex-shrink: 0; transition: transform 0.25s var(--ease); }

.btn-primary {
  background: var(--olive);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--olive-dark);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-small {
  padding: 11px 22px;
  font-size: 13.5px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), gap 0.25s var(--ease);
}

.link-arrow:hover {
  border-color: var(--ink);
  gap: 11px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo-bold { font-weight: 600; }
.logo-light { font-weight: 400; color: var(--muted); }
.logo-dot { font-weight: 400; color: var(--muted); font-size: 0.85em; }

.main-nav {
  display: flex;
  gap: clamp(20px, 3vw, 36px);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.main-nav a {
  position: relative;
  padding: 4px 0;
  color: var(--ink);
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--olive);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--gutter);
  border-top: 0px solid var(--line);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s var(--ease), opacity 0.25s var(--ease), padding 0.35s var(--ease);
}

.mobile-nav.open {
  max-height: 480px;
  padding: 8px var(--gutter) 24px;
  border-top: 1px solid var(--line);
  opacity: 1;
}

.mobile-nav a {
  padding: 14px 0;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}

.mobile-nav .btn {
  margin-top: 16px;
  justify-content: center;
  width: fit-content;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: min(82vh, 700px);
  min-height: 460px;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,12,8,0.46) 0%, rgba(10,12,8,0.22) 42%, rgba(10,12,8,0) 68%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter);
  max-width: 640px;
}

.hero-content h1 {
  color: var(--white);
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.06;
  font-weight: 500;
}

.hero-content p {
  color: rgba(255,255,255,0.92);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.55;
  margin-top: 22px;
  max-width: 420px;
}

.hero-content .btn {
  margin-top: 32px;
  width: fit-content;
}

/* ---------- Section headers ---------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: clamp(28px, 4vw, 40px);
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: clamp(26px, 3vw, 34px);
}

/* ---------- Properties ---------- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.4vw, 28px);
}

.property-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: transform 0.35s var(--ease);
}

.property-card:hover {
  transform: translateY(-4px);
}

.property-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(28,27,23,0.04);
  transition: box-shadow 0.35s var(--ease);
}

.property-card:hover .property-media {
  box-shadow: 0 18px 40px rgba(28, 27, 23, 0.14);
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.property-card:hover .property-media img {
  transform: scale(1.05);
}

.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(28, 27, 23, 0.28);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.25s var(--ease);
}

.fav-btn:hover { background: rgba(28, 27, 23, 0.44); }

.fav-btn svg { transition: fill 0.2s var(--ease), stroke 0.2s var(--ease); }

.fav-btn.active svg {
  fill: #C9645A;
  stroke: #C9645A;
}

.property-body {
  padding: 18px 4px 6px;
}

.property-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--olive);
  text-transform: uppercase;
}

.property-title {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.3;
}

.property-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.property-stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.property-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.property-price {
  font-weight: 600;
  font-size: 14.5px;
}

/* ---------- Why ---------- */
.why-card {
  background: var(--card);
  border-radius: 10px;
  padding: clamp(36px, 5vw, 64px) clamp(24px, 5vw, 56px);
}

.why-card h2 {
  text-align: center;
  font-size: clamp(24px, 2.8vw, 30px);
  margin-bottom: clamp(32px, 4vw, 48px);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.why-item {
  text-align: center;
  padding: 0 8px;
}

.why-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.why-item h3 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 10px;
}

.why-item p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Lifestyle ---------- */
.lifestyle-inner {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

.lifestyle-text h2 {
  font-size: clamp(26px, 3vw, 32px);
  margin-bottom: 18px;
}

.lifestyle-text p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.lifestyle-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.lifestyle-item figure {
  margin: 0;
}

.lifestyle-media {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
}

.lifestyle-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.lifestyle-item:hover .lifestyle-media img {
  transform: scale(1.06);
}

.lifestyle-item figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-inner p {
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .main-nav { display: none; }

  .menu-toggle { display: flex; }

  .mobile-nav { display: flex; }

  .hero { height: 78vh; }

  .property-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 32px;
  }

  .lifestyle-inner {
    grid-template-columns: 1fr;
  }

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

  .section { padding-left: 16px; padding-right: 16px; }
  .header-inner { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 560px) {
  .hero-content { max-width: 100%; }
  .hero-overlay {
    background: linear-gradient(180deg, rgba(10,12,8,0.15) 0%, rgba(10,12,8,0.62) 78%);
  }
  .lifestyle-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
