/* ========================================
   THE CHEDI PRIVATE RESIDENCES
   Base Stylesheet - Shared Styles
   All luxury real estate website styles
   ======================================== */

/* ========================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================== */

:root {
  /* Primary Palette */
  --cream: #F5F0E8;
  --cream-rgb: 245, 240, 232;
  --gold: #AB946B;
  --gold-rgb: 171, 148, 107;
  --gold-dark: #8B7355;        /* WCAG AA compliant on light backgrounds (4.5:1+) */
  --gold-dark-rgb: 139, 115, 85;
  --gold-light: #C4B48A;
  --charcoal: #1E1C19;
  --charcoal-rgb: 30, 28, 25;
  --text-dark: #2C2824;
  --text-dark-rgb: 44, 40, 36;
  --text-muted: #5A5549;
  /* UPDATED from #7A746A for WCAG AA contrast compliance */
  --text-muted-rgb: 90, 85, 73;
  --white: #FDFCFA;
  --white-rgb: 253, 252, 250;
  --light-cream: #FAF8F4;

  /* Status Colors */
  --available: #4A7C59;
  --available-bg: #E8F5E9;
  --booked: #C17D24;
  --booked-bg: #FFF3E0;
  --sold: #A63D40;
  --sold-bg: #FFEBEE;
  --error: #D32F2F;
  --success: #2E7D32;

  /* Spacing Scale (8px base) */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 60px;
  --space-2xl: 80px;
  --space-3xl: 120px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 15px;
  --line-height-base: 1.6;
}


/* ========================================
   2. RESET & BASE TYPOGRAPHY
   ======================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text-dark);
  background-color: var(--white);
  line-height: var(--line-height-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 300;
  line-height: 1.2;
  color: var(--charcoal);
}

/* Responsive typography using clamp() for fluid scaling */
h1 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  letter-spacing: 2px;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

h4 {
  font-size: 1.4rem;
  font-weight: 300;
}

h5 {
  font-size: 1.1rem;
  font-weight: 400;
}

h6 {
  font-size: 1rem;
  font-weight: 400;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--gold-dark);
  text-decoration: none;
  transition: var(--transition);
}

@media (hover: hover) {
  a:hover {
    color: var(--gold);
  }
}
a:active {
  color: var(--gold);
}

strong,
b {
  font-weight: 600;
}

em,
i {
  font-style: italic;
}


/* ========================================
   3. TEXT ALIGNMENT (UNIFIED)
   ======================================== */

/* Justified body text for luxury editorial aesthetic */
section p,
.content-block p,
.text-content p,
.section-text p,
.page-content p,
.brand-story-text p,
.residence-description,
.architecture-text p,
.location-info p,
.detail-desc,
.highlight-text p,
.footer-column p,
.partner-welcome p:not(.section-label),
.amenity-description,
article p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Centered content exceptions */
.text-center,
.hero-content,
.preloader-content,
.cta-section,
.section-label {
  text-align: center;
}

/* Footer legal - centered */
.footer-legal-center {
  text-align: center;
}

/* Text alignment utilities */
.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}


/* ========================================
   4. PRELOADER ANIMATIONS
   ======================================== */

@keyframes preloaderFade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes preloaderLine {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    pointer-events: none;
  }
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lineExpand {
  from {
    width: 0;
    opacity: 1;
  }
  to {
    width: 60px;
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.08);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Preloader container */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.preloader img {
  width: 120px;
  margin-bottom: 32px;
  animation: preloaderFade 1s ease forwards;
}

/* Preloader loading bar */
.preloader-bar {
  width: 120px;
  height: 1px;
  background: rgba(var(--gold-rgb), 0.2);
  position: relative;
  overflow: hidden;
}

.preloader-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--gold);
  animation: preloaderLine 1.5s ease forwards;
}


/* ========================================
   5. NAVIGATION (Shared)
   ======================================== */

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--gold);
  color: #fff;
  padding: 8px 16px;
  z-index: 10001;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Main navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0 var(--space-lg);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background-color: rgba(var(--cream-rgb), 0.95);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Navigation left section */
.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

/* Navigation logo - centered */
.nav-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-logo img {
  height: 36px;
  display: inline-block;
}

/* Navigation center menu */
.nav-center {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-center a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.3s ease;
}

@media (hover: hover) {
  .nav-center a:hover {
    color: var(--gold-dark);
  }
}
.nav-center a:active,
.nav-center a.active {
  color: var(--gold-dark);
}

/* Navigation right section */
.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* CTA button in navigation */
.nav-cta {
  padding: 11px 24px;
  border: 1px solid var(--gold-dark);
  background-color: transparent;
  color: var(--gold-dark);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  font-weight: 400;
}

@media (hover: hover) {
  .nav-cta:hover {
    background: var(--gold);
    color: #fff;
  }
}
.nav-cta:active {
  background: var(--gold);
  color: #fff;
}

/* Language switcher button */
.lang-btn {
  background: none;
  border: none;
  color: var(--charcoal);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Language dropdown menu */
.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  padding: 8px 0;
  min-width: 100px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

@media (hover: hover) {
  .lang-switcher:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}
.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown a,
.lang-dropdown button {
  display: block;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

@media (hover: hover) {
  .lang-dropdown a:hover,
  .lang-dropdown button:hover {
    color: var(--gold-dark);
    background: rgba(var(--gold-rgb), 0.05);
  }
}
.lang-dropdown a:active,
.lang-dropdown button:active {
  color: var(--gold-dark);
}

.lang-dropdown a.active,
.lang-dropdown button.active {
  color: var(--charcoal);
  font-weight: 500;
}

/* Hamburger menu button */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  width: 24px;
  height: 1.5px;
  background: var(--charcoal);
  transition: var(--transition);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 300;
  text-decoration: none;
  color: var(--charcoal);
  letter-spacing: 2px;
  text-transform: uppercase;
}


/* ========================================
   6. SECTION LABELS & HEADINGS
   ======================================== */

.section-label {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 500;
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.section-heading {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  color: var(--charcoal);
  margin-bottom: var(--space-md);
}

.section-padding {
  padding: var(--space-2xl) var(--space-lg);
}


/* ========================================
   7. FOOTER (Shared)
   ======================================== */

footer {
  background-color: #0d0b09;
  color: var(--text-muted);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-column h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.footer-column p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a,
.footer-links button {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

@media (hover: hover) {
  .footer-links a:hover,
  .footer-links button:hover {
    color: var(--gold);
  }
}

/* Footer bottom section */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 20px;
}

.footer-copyright {
  opacity: 0.7;
}

.footer-socials {
  display: flex;
  gap: var(--space-sm);
}

.footer-socials a,
.footer-socials button {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

@media (hover: hover) {
  .footer-socials a:hover,
  .footer-socials button:hover {
    color: var(--gold);
  }
}

.footer-legal {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.footer-legal a,
.footer-legal button {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  transition: var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

@media (hover: hover) {
  .footer-legal a:hover,
  .footer-legal button:hover {
    color: var(--gold);
  }
}

.footer-divider {
  text-align: center;
  margin: var(--space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: var(--space-lg);
}

.footer-legal-center {
  text-align: center;
}


/* ========================================
   8. ACCESSIBILITY
   ======================================== */

/* Focus visible for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ========================================
   9. UTILITY CLASSES
   ======================================== */

/* Gold button style */
.btn-gold {
  display: inline-block;
  padding: 14px 32px;
  background: var(--gold);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--gold);
  transition: var(--transition);
  cursor: pointer;
}

@media (hover: hover) {
  .btn-gold:hover {
    background: transparent;
    color: var(--gold);
  }
}
.btn-gold:active {
  background: transparent;
  color: var(--gold);
}

/* Outline button style */
.btn-outline {
  display: inline-block;
  padding: 14px 32px;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--gold);
  transition: var(--transition);
  cursor: pointer;
}

@media (hover: hover) {
  .btn-outline:hover {
    background: var(--gold);
    color: #fff;
  }
}
.btn-outline:active {
  background: var(--gold);
  color: #fff;
}

/* Table utilities */
.table-header {
  text-align: left;
}

.table-amount {
  text-align: right;
}


/* ========================================
   10. RESPONSIVE BREAKPOINTS
   ======================================== */

/* Laptop/Desktop */
@media (max-width: 1024px) {
  .section-padding {
    padding: var(--space-2xl) 32px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .nav-center {
    display: none;
  }

  .hamburger {
    display: flex;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  :root {
    --space-2xl: 60px;
    --space-3xl: 80px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .nav-right {
    gap: 16px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  nav {
    padding: 0 20px;
    height: 70px;
  }

  .nav-logo img {
    height: 30px;
  }

  .nav-cta {
    padding: 9px 16px;
    font-size: 10px;
  }

  .section-padding {
    padding: var(--space-2xl) 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-legal {
    flex-direction: column;
    gap: 8px;
  }

  h1 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
  }

  h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  }

  h3 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
  }
}

/* Very small phones (Galaxy Fold, etc.) */
@media (max-width: 480px) {
  :root {
    --space-2xl: 40px;
    --space-lg: 24px;
    --space-md: 16px;
  }

  nav {
    padding: 0 16px;
    height: 64px;
  }

  .nav-logo img {
    height: 24px;
  }

  .nav-right {
    gap: 12px;
  }

  .lang-btn {
    padding: 6px 8px;
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .nav-cta {
    padding: 8px 12px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  /* Language switcher button styling */
  .lang-dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-sans);
    font-size: 11px;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
  }

  @media (hover: hover) {
    .lang-dropdown button:hover {
      color: var(--gold-dark) !important;
      background: rgba(var(--gold-rgb), 0.05);
    }
  }

  .lang-dropdown button:active {
    color: var(--gold-dark) !important;
  }

  .lang-dropdown button.active {
    color: var(--charcoal) !important;
    font-weight: 500;
  }

  .section-padding {
    padding: var(--space-2xl) 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .footer-column h3 {
    font-size: 11px;
    margin-bottom: var(--space-sm);
  }

  .footer-column p {
    font-size: 12px;
  }

  .footer-links a,
  .footer-legal a,
  .footer-socials a {
    font-size: 11px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    font-size: 11px;
    gap: 12px;
  }

  .footer-legal {
    gap: 6px;
  }

  .section-label {
    font-size: 10px;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  h1 {
    font-size: clamp(1.5rem, 2.5vw, 1.8rem);
    letter-spacing: 1px;
  }

  h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
  }

  h3 {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
  }

  h4 {
    font-size: 1.1rem;
  }

  h5 {
    font-size: 0.95rem;
  }

  /* Ensure all navigation links work as buttons */
  .nav-link,
  .lang-link,
  .social-link,
  .inline-link {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
  }

  @media (hover: hover) {
    .nav-link:hover,
    .lang-link:hover,
    .social-link:hover,
    .inline-link:hover {
      color: var(--gold);
    }
  }

  .nav-link:active,
  .lang-link:active,
  .social-link:active,
  .inline-link:active {
    color: var(--gold);
  }

  /* CTA buttons remain properly styled */
  .cta-btn,
  .cta-button {
    display: inline-block;
    font-size: 11px;
    padding: 10px 16px;
  }

  .success-cta {
    display: inline-block;
    font-size: 11px;
    padding: 10px 16px;
  }
}
