/* ============================================================
   SOY ALHAMA — Design System
   Média local premium — Alhama de Almería
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Custom Properties --- */
:root {
  /* Brand Palette */
  --terracotta: #C46A3A;
  --terracotta-light: #D4896A;
  --terracotta-dark: #A85530;
  --sand: #F5E6D3;
  --sand-dark: #E8D5BE;
  --blue-med: #2E6F95;
  --blue-med-light: #3D8AB4;
  --blue-med-dark: #1E5A7A;
  --black-soft: #1A1A1A;
  --off-white: #FAFAFA;

  /* Extended Palette */
  --cream: #FFF8F0;
  --warm-gray: #F0EBE3;
  --gold: #C8A96E;
  --gold-light: #D4BA85;
  --olive: #6B7C4E;

  /* Neutrals */
  --gray-50: #F9F9F9;
  --gray-100: #F3F3F3;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Typography */
  --ff-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --fs-hero: clamp(3rem, 7vw, 5.5rem);
  --fs-h1: clamp(2.2rem, 4.5vw, 3.5rem);
  --fs-h2: clamp(1.8rem, 3vw, 2.8rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.6rem);
  --fs-h4: clamp(1.05rem, 1.4vw, 1.25rem);
  --fs-body: clamp(0.95rem, 1.1vw, 1.0625rem);
  --fs-body-lg: clamp(1.05rem, 1.3vw, 1.2rem);
  --fs-small: 0.875rem;
  --fs-xs: 0.75rem;
  --fs-xxs: 0.6875rem;

  /* Spacing (8px base) */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;
  --space-5xl: 10rem;

  /* Borders & Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.06), 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 26, 26, 0.1);
  --shadow-xl: 0 16px 48px rgba(26, 26, 26, 0.14);
  --shadow-terracotta: 0 8px 24px rgba(196, 106, 58, 0.25);
  --shadow-blue: 0 8px 24px rgba(46, 111, 149, 0.2);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 800ms;

  /* Layout */
  --max-width: 1280px;
  --max-width-narrow: 900px;
  --max-width-wide: 1440px;
  --nav-height: 80px;
  --nav-height-scrolled: 64px;
}

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

/* ============================================================
   MOBILE-FIRST UI/UX OPTIMIZATIONS
   ============================================================ */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-height);
  touch-action: manipulation;
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--black-soft);
  background-color: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  /* Support for notched devices iPhone X+ */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Minimum Touch Targets for Accessibility & UX (Apple Standards) */
button, 
a.nav-link,
a.btn,
.tab-btn,
.lang-btn {
  min-height: 44px;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-heading);
  line-height: 1.2;
  text-wrap: balance;
  color: var(--black-soft);
}

p {
  text-wrap: pretty;
  max-inline-size: 72ch;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--blue-med);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Selection colour */
::selection {
  background: rgba(196, 106, 58, 0.2);
  color: var(--black-soft);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.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;
}

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

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--terracotta);
  margin-bottom: var(--space-sm);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--terracotta);
}

.section-title {
  font-size: var(--fs-h2);
  color: var(--black-soft);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.section-subtitle {
  font-size: var(--fs-body);
  color: var(--gray-500);
  max-width: 600px;
  line-height: 1.8;
}

.text-center .section-subtitle {
  margin-inline: auto;
}

/* --- Keyframe Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.3); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Reveal on Scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out-expo),
              transform var(--duration-slower) var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slower) var(--ease-out-expo),
              transform var(--duration-slower) var(--ease-out-expo);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slower) var(--ease-out-expo),
              transform var(--duration-slower) var(--ease-out-expo);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 560ms; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 640ms; }
