/* ==========================================================================
   Elysian Estates — Global Styles
   Includes: CSS custom properties, reset, typography, layout utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   Theme Tokens (Public mode defaults)
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --ee-font-primary:   Georgia, 'Times New Roman', serif;
  --ee-font-secondary: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Spacing */
  --ee-space-xs:  0.5rem;
  --ee-space-sm:  1rem;
  --ee-space-md:  1.5rem;
  --ee-space-lg:  2.5rem;
  --ee-space-xl:  4rem;
  --ee-space-2xl: 6rem;

  /* Layout */
  --ee-max-width:    1400px;
  --ee-header-height: 90px;

  /* Transitions */
  --ee-transition-fast: 0.2s ease;
  --ee-transition-base: 0.3s ease;
  --ee-transition-slow: 0.5s ease;

  /* Shadows */
  --ee-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ee-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
  --ee-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);

  /* Audience colours — public (default) */
  --ee-primary:        #684063;
  --ee-primary-light:  #7d5275;
  --ee-primary-dark:   #523350;
  --ee-secondary:      #9088ad;
  --ee-secondary-light:#a8a1c0;
  --ee-accent:         #c9b8a8;
  --ee-bg:             #fdfcfb;
  --ee-bg-alt:         #f7f5f3;
  --ee-surface:        #ffffff;
  --ee-text:           #2d2a2e;
  --ee-text-light:     #6b6670;
  --ee-text-muted:     #9a959d;
  --ee-border:         #e8e4e1;
  --ee-border-light:   #f0ece9;
  --ee-cta:            #684063;
  --ee-cta-hover:      #523350;
  --ee-overlay:        rgba(104, 64, 99, 0.85);
}

/* --------------------------------------------------------------------------
   Base / Reset (supplement WordPress's own normalise)
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--ee-font-primary);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ee-text);
  background-color: var(--ee-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: ee-page-in 0.15s ease-out;
}

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

ul, ol { list-style: none; margin: 0; padding: 0; }
dl { margin: 0; }
dt { font-weight: inherit; }
dd { margin-left: 0; }

a {
  color: var(--ee-primary);
  text-decoration: none;
  transition: color var(--ee-transition-fast);
}
a:hover { color: var(--ee-primary-dark); }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ee-font-primary);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ee-text);
}
h1 { font-size: clamp(2.5rem, 5vw, 4rem);   letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem);      letter-spacing: -0.01em; }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

.text-small    { font-size: 0.875rem; }
.text-muted    { color: var(--ee-text-muted); }
.text-center   { text-align: center; }
.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-family: var(--ee-font-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--ee-max-width);
  margin: 0 auto;
  padding: 0 var(--ee-space-md);
}
.container--narrow { max-width: 900px; }
.container--wide   { max-width: 1600px; }

.section { padding: var(--ee-space-2xl) 0; }
.section--alt { background-color: var(--ee-bg-alt); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-family: var(--ee-font-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--ee-transition-base);
  text-decoration: none;
}

.btn--primary,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background-color: var(--ee-cta);
  color: #ffffff;
}
.btn--primary:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background-color: var(--ee-cta-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--ee-shadow-md);
}

.btn--secondary {
  background-color: transparent;
  color: var(--ee-text);
  border: 1px solid var(--ee-border);
}
.btn--secondary:hover { border-color: var(--ee-primary); color: var(--ee-primary); }

.btn--outline-light,
.wp-block-button.is-style-outline .wp-block-button__link {
  background-color: transparent;
  color: var(--ee-primary);
  border: 1px solid var(--ee-primary);
}
.btn--outline-light:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: var(--ee-primary);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--ee-header-height);
  background-color: var(--ee-surface);
  border-bottom: 1px solid var(--ee-border-light);
  z-index: 1000;
  transition: background-color var(--ee-transition-base), box-shadow var(--ee-transition-base);
}
.header--scrolled { box-shadow: var(--ee-shadow-sm); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--ee-max-width);
  margin: 0 auto;
  padding: 0 var(--ee-space-md);
}

.header__logo-text {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ee-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header__logo-link,
.footer__logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.header__logo-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 200px;
}

.footer__logo-img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 180px;
}

.header__nav-link {
  font-family: var(--ee-font-secondary);
  font-size: 0.875rem;
  color: var(--ee-text);
  position: relative;
}
.header__nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background-color: var(--ee-primary);
  transition: width var(--ee-transition-base);
}
.header__nav-link:hover { color: var(--ee-primary); }
.header__nav-link:hover::after { width: 100%; }

.header__cta { padding: 0.75rem 1.5rem; }

/* Audience switcher toggle — single button, label swaps with the audience */
.audience-switcher__toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  font-family: var(--ee-font-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ee-text);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity var(--ee-transition-fast), background var(--ee-transition-fast), color var(--ee-transition-fast), border-color var(--ee-transition-fast);
}
.audience-switcher__toggle:hover {
  opacity: 1;
  background: var(--ee-primary);
  border-color: var(--ee-primary);
  color: #fff;
}
.audience-switcher__toggle:focus-visible {
  outline: 2px solid var(--ee-primary);
  outline-offset: 2px;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background-color: var(--ee-text);
  color: rgba(255, 255, 255, 0.8);
  padding-top: var(--ee-space-2xl);
}
.footer__main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--ee-space-xl);
  padding-bottom: var(--ee-space-xl);
}
.footer__brand { padding-right: var(--ee-space-xl); }
.footer__logo-text { font-size: 1.5rem; color: #ffffff; }
.footer__tagline { font-size: 0.875rem; opacity: 0.7; line-height: 1.7; }

.footer__heading {
  font-family: var(--ee-font-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ffffff;
  margin-bottom: var(--ee-space-md);
}

.footer__link {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}
.footer__link:hover { color: #ffffff; }

.footer__social {
  display: flex;
  gap: var(--ee-space-sm);
  margin-top: var(--ee-space-md);
}
.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  transition: all var(--ee-transition-fast);
}
.footer__social-link:hover {
  background-color: var(--ee-primary);
  border-color: var(--ee-primary);
  color: #ffffff;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--ee-space-md) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */
.section-header { text-align: center; margin-bottom: var(--ee-space-xl); }
.section-header__tagline {
  font-family: var(--ee-font-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ee-primary);
  margin-bottom: var(--ee-space-sm);
}
.section-header__subtitle {
  color: var(--ee-text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 90vh;
  max-height: 900px;
  margin-top: var(--ee-header-height);
  overflow: hidden;
}
.hero__media    { position: absolute; inset: 0; }
.hero__image    { width: 100%; height: 100%; object-fit: cover; }
.hero__overlay  {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.6) 100%);
}
.hero__content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  height: 100%;
  text-align: center;
  color: #ffffff;
  padding: var(--ee-space-lg);
}
.hero__tagline {
  font-family: var(--ee-font-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: var(--ee-space-md);
  opacity: 0.9;
}
.hero__title  { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 400; color: #ffffff; margin-bottom: var(--ee-space-md); max-width: 900px; }
.hero__subtitle { font-size: 1.25rem; font-weight: 300; opacity: 0.9; margin-bottom: var(--ee-space-lg); max-width: 600px; }
.hero__actions { display: flex; gap: var(--ee-space-sm); flex-wrap: wrap; justify-content: center; }

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--ee-space-sm); }
.mb-md { margin-bottom: var(--ee-space-md); }
.mb-lg { margin-bottom: var(--ee-space-lg); }

/* Main content offset for fixed header */
.site-main--landing { padding-top: 0; }

/* --------------------------------------------------------------------------
   Page transitions — prefetch.js + CSS
   Fade-in plays on every page load. Fade-out is triggered by JS adding
   ee-leaving to <html> before navigating to the next (prefetched) page.
   The prefers-reduced-motion rule below suppresses both automatically.
   -------------------------------------------------------------------------- */
@keyframes ee-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

html.ee-leaving {
  opacity: 0;
  transition: opacity 0.1s ease-in;
}

/* --------------------------------------------------------------------------
   Scroll header effect — applied by audience-switcher.js
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------------------------
   Responsive — Header and global layout
   -------------------------------------------------------------------------- */

/* Tablet (≤ 1024px): ease spacing scale */
@media (max-width: 1024px) {
  :root {
    --ee-space-2xl: 4rem;
    --ee-space-xl:  2.5rem;
  }
}

/* Mobile landscape / large phone (≤ 768px): compact header + spacing */
@media (max-width: 768px) {
  :root {
    --ee-header-height: 70px;
    --ee-space-2xl: 3rem;
    --ee-space-xl:  2rem;
  }
  .section { padding: var(--ee-space-xl) 0; }
  .container { padding: 0 1rem; }
  .header__logo-text { font-size: 1.25rem; }
  .header__cta { padding: 0.625rem 1.25rem; font-size: 0.8125rem; }
}

/* Small mobile (≤ 576px): two-row header so all top buttons remain visible */
@media (max-width: 576px) {
  :root {
    /* Taller header to accommodate two rows */
    --ee-header-height: 108px;
    --ee-space-2xl: 2rem;
    --ee-space-xl:  1.5rem;
    --ee-space-lg:  1.5rem;
  }

  /* Allow inner flex container to wrap:
     row 1 = logo + hamburger nav
     row 2 = audience switcher + enquire button */
  .header__inner {
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 0;
    height: auto;
    min-height: var(--ee-header-height);
  }

  /* Logo fills row-1 left side */
  .header__logo {
    flex: 1;
    padding: 0 0 0 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
  }

  /* Nav block (hamburger on mobile) sits right of logo in row 1 */
  .header__nav {
    padding: 0 1rem 0 0;
    min-height: 60px;
    display: flex;
    align-items: center;
  }

  /* Actions wrap to a centred second row */
  .header__actions {
    width: 100%;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.375rem 1rem;
    min-height: 48px;
    border-top: 1px solid var(--ee-border-light);
    background: var(--ee-bg-alt);
  }

  .section { padding: 1.5rem 0; }
}
