:root {
  /* Moroccan Flag Color Palette */
  --color-morocco-red: #C1272D;
  --color-morocco-green: #006233;
  --color-cream: #FDF5E6;
  --color-white: #FFFFFF;
  --color-dark-text: #1C1B1F;

  /* Material Design 3 System Colors */

  /* Primary: Used for Actions (Buttons) -> Green */
  --md-sys-color-primary: var(--color-morocco-green);
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #A6F5C6;
  /* Lighter green for containers if needed */
  --md-sys-color-on-primary-container: #00210E;

  /* Secondary: Used for Emphasis (Headers/Accents) -> Red */
  --md-sys-color-secondary: var(--color-morocco-red);
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #FFDAD6;
  --md-sys-color-on-secondary-container: #410002;

  /* Tertiary: Used for Icons -> Green */
  --md-sys-color-tertiary: var(--color-morocco-green);

  /* Backgrounds: Warm Cream / White */
  --md-sys-color-background: var(--color-cream);
  --md-sys-color-on-background: var(--color-dark-text);

  --md-sys-color-surface: #FFFFFF;
  --md-sys-color-on-surface: var(--color-dark-text);

  --md-sys-color-surface-variant: #F2E8D9;
  /* Slightly darker cream for cards/sections */
  --md-sys-color-on-surface-variant: #49454F;
  --md-sys-color-outline: #857375;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Outfit', sans-serif;

  /* Spacing */
  --spacing-small: 8px;
  --spacing-medium: 16px;
  --spacing-large: 24px;
  --spacing-xlarge: 48px;
  --spacing-xxlarge: 96px;

  /* Border Radius */
  --border-radius-small: 8px;
  --border-radius-medium: 16px;
  --border-radius-large: 24px;

  /* Elevation (Shadows) */
  --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--border-radius-medium);
}

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

ul {
  list-style: none;
}

/* Typography Classes */
.display-large {
  font-family: var(--font-display);
  font-size: 3.5rem;
  /* 57px */
  font-weight: 700;
  line-height: 1.1;
  color: #FFFFFF;
  /* Keep white on Hero images */
}

.display-medium {
  font-family: var(--font-display);
  font-size: 2.8rem;
  /* 45px */
  font-weight: 600;
  line-height: 1.15;
  color: var(--md-sys-color-secondary);
  /* RED for major headers */
}

.display-small {
  font-family: var(--font-display);
  font-size: 2.25rem;
  /* 36px */
  font-weight: 400;
  color: #FFFFFF;
  /* Footer often */
  line-height: 1.2;
}

.headline-medium {
  font-family: var(--font-display);
  font-size: 1.75rem;
  /* 28px */
  font-weight: 600;
  line-height: 1.3;
  color: var(--md-sys-color-secondary);
  /* RED for Subheaders/Card titles */
}

.headline-small {
  font-family: var(--font-body);
  font-size: 1.5rem;
  /* 24px */
  font-weight: 400;
  line-height: 1.4;
  color: #FFFFFF;
}

.body-large {
  font-family: var(--font-body);
  font-size: 1.125rem;
  /* 16px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.body-medium {
  font-family: var(--font-body);
  font-size: 1rem;
  /* 14px */
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.25px;
}

.label-large {
  font-family: var(--font-body);
  font-size: 0.875rem;
  /* 14px */
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

.label-medium {
  font-family: var(--font-body);
  font-size: 0.75rem;
  /* 12px */
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

/* Global text justification for textual content */
p,
.body-large,
.body-medium,
.body-small,
.headline-small,
.label-large,
.label-medium {
  text-align: justify;
  text-justify: inter-word;
}

/* Utility Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-large);
  width: 100%;
}

.section {
  padding: var(--spacing-xxlarge) 0;
}

.section-dark {
  background-color: var(--md-sys-color-secondary);
  /* RED background for Footer? Or sticking to Dark Text? Let's use Red for strong brand footer. */
  color: var(--md-sys-color-on-secondary);
}

.section-dark .body-medium,
.section-dark .body-small {
  color: rgba(255, 255, 255, 0.9);
}

.bg-surface-variant {
  background-color: var(--md-sys-color-surface-variant);
}

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

.mb-large {
  margin-bottom: var(--spacing-large);
}

.mt-small {
  margin-top: var(--spacing-small);
}

.mt-medium {
  margin-top: var(--spacing-medium);
}

.italic {
  font-style: italic;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  background-color: var(--md-sys-color-primary);
  /* GREEN */
  color: var(--md-sys-color-on-primary);
  padding: 12px 24px;
  border-radius: 100px;
  /* Fully rounded */
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--elevation-1);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: var(--elevation-2);
  transform: translateY(-2px);
}

.btn-primary-small {
  background-color: var(--md-sys-color-primary);
  /* GREEN */
  color: var(--md-sys-color-on-primary);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.3s;
}

.btn-primary-small:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(253, 245, 230, 0.95);
  /* Cream background */
  backdrop-filter: blur(5px);
  z-index: 1000;
  box-shadow: var(--elevation-1);
  padding: var(--spacing-medium) 0;
  transition: all 0.3s ease;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-sys-color-secondary);
  line-height: 1.2;
}

.logo-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  font-family: var(--font-body);
  letter-spacing: 0.08em;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: var(--spacing-large);
  align-items: center;
}

.nav-links a:not(.btn-primary-small) {
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  transition: color 0.3s;
}

.nav-links a:not(.btn-primary-small):hover {
  color: var(--md-sys-color-secondary);
  /* Red on hover */
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
}

/* Hero Section */
.hero {
  position: relative;
  height: 90vh;
  min-height: 600px;
  background-image: url('images/hero.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #FFFFFF;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero p {
  margin: var(--spacing-medium) 0 var(--spacing-large);
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xlarge);
  align-items: center;
}

.about-text h2 {
  margin-bottom: var(--spacing-medium);
}

.about-text p {
  margin-bottom: var(--spacing-medium);
  color: var(--md-sys-color-on-surface-variant);
}

.about-stats {
  display: flex;
  gap: var(--spacing-large);
  margin-top: var(--spacing-large);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.icon-large {
  font-size: 36px;
  color: var(--md-sys-color-tertiary);
  /* GREEN Icons */
  margin-bottom: var(--spacing-small);
}

/* Properties / Activities Grid */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-large);
}

.card {
  background: var(--md-sys-color-surface);
  border-radius: var(--border-radius-medium);
  overflow: hidden;
  box-shadow: var(--elevation-1);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(193, 39, 45, 0.1);
  /* Subtle Red border hint */
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--elevation-2);
}

/* Card Images are now handled via <img> tags in HTML */
.card-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: var(--spacing-medium);
}

.card-content h3 {
  margin-bottom: var(--spacing-small);
  color: var(--md-sys-color-secondary);
  /* Red Headlines */
}

.card-content p {
  color: var(--md-sys-color-on-surface-variant);
}

/* Gallery - Masonry-ish Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 250px);
  gap: var(--spacing-small);
}

.gallery-item {
  background-color: #ddd;
  border-radius: var(--border-radius-small);
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: scale(1.02);
  z-index: 10;
}

.item-1 {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  background-image: url('https://images.unsplash.com/photo-1539020140153-e479b8c22e70?auto=format&fit=crop&w=800&q=80');
}

.item-2 {
  background-image: url('https://images.unsplash.com/photo-1524863479829-916d8e77f114?auto=format&fit=crop&w=800&q=80');
}

.item-3 {
  background-image: url('https://images.unsplash.com/photo-1577253313708-cab167d2c474?auto=format&fit=crop&w=800&q=80');
}

.item-4 {
  background-image: url('https://images.unsplash.com/photo-1545389336-cf090694435e?auto=format&fit=crop&w=800&q=80');
}

.item-5 {
  background-image: url('https://images.unsplash.com/photo-1506126613408-eca07ce68773?auto=format&fit=crop&w=800&q=80');
}

/* Testimonials */
.carousel {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  gap: var(--spacing-medium);
  padding-bottom: var(--spacing-medium);
  scroll-snap-type: x mandatory;
}

.testimonial-card {
  flex: 0 0 300px;
  background: var(--md-sys-color-surface);
  padding: var(--spacing-large);
  border-radius: var(--border-radius-medium);
  box-shadow: var(--elevation-1);
  scroll-snap-align: start;
  border-top: 4px solid var(--md-sys-color-secondary);
  /* Top Red Accent */
}

/* Footer / Contact */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xlarge);
  align-items: start;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-small);
  margin-bottom: var(--spacing-small);
}

.footer-form {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--spacing-large);
  border-radius: var(--border-radius-medium);
}

.form-group {
  margin-bottom: var(--spacing-medium);
}

.form-input {
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius-small);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
  font-size: 1rem;
}

.full-width {
  width: 100%;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: var(--spacing-xlarge);
  padding-top: var(--spacing-medium);
}

/* ============================================================
   ADDITIONS: missing class, focus states, lang switcher,
   form feedback, footer link, accessibility
   ============================================================ */

/* Missing body-small class (used in footer copyright) */
.body-small {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.4px;
}

/* Fix: form input text color was invisible (inherited white from .section-dark) */
.form-input {
  color: var(--color-dark-text);
}

/* Focus states for keyboard accessibility */
:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.btn-primary:focus-visible,
.btn-primary-small:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
}

.form-input:focus {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 0;
  border-color: var(--md-sys-color-primary);
}

/* Utility: hide honeypot field from real users */
.hidden {
  display: none;
}

/* Footer email / phone links */
.footer-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #FFFFFF;
}

/* Language Switcher — Desktop */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
}

.lang-switcher--desktop {
  display: flex;
  margin-left: var(--spacing-medium);
}

.lang-switcher--mobile {
  display: none;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  padding: 4px 6px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.lang-btn:hover {
  color: var(--md-sys-color-secondary);
}

.lang-btn.active {
  color: var(--md-sys-color-secondary);
  font-weight: 700;
}

.lang-switcher span[aria-hidden] {
  color: var(--md-sys-color-outline);
  user-select: none;
  font-size: 0.7rem;
}

/* Form feedback messages (success / error) */
.form-feedback {
  padding: 12px 14px;
  border-radius: var(--border-radius-small);
  margin-top: var(--spacing-medium);
  font-size: 0.9rem;
  font-family: var(--font-body);
  display: none;
  animation: fadeIn 0.3s ease;
}

.form-feedback.visible {
  display: block;
}

.form-feedback--success {
  background: rgba(166, 245, 198, 0.15);
  border: 1px solid rgba(166, 245, 198, 0.7);
  color: #A6F5C6;
}

.form-feedback--error {
  background: rgba(255, 218, 214, 0.15);
  border: 1px solid rgba(255, 218, 214, 0.7);
  color: #FFDAD6;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Submit button disabled state */
.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--elevation-1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .display-large {
    font-size: 2.5rem;
  }

  .display-medium {
    font-size: 2rem;
  }

  .navbar-container {
    padding: 0 var(--spacing-medium);
  }

  .nav-links {
    display: none;
    /* Hidden by default on mobile */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--md-sys-color-background);
    flex-direction: column;
    padding: var(--spacing-medium);
    box-shadow: var(--elevation-2);
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
  }

  .about-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .item-1 {
    grid-column: auto;
    grid-row: auto;
    height: 250px;
  }

  .gallery-item {
    height: 200px;
  }

  /* Lang switcher: hide desktop variant, show inside nav drawer */
  .lang-switcher--desktop {
    display: none;
  }

  .lang-switcher--mobile {
    display: flex;
    padding-top: var(--spacing-small);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: var(--spacing-small);
    justify-content: center;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}