/* ==========================================================================
   Global Property Escape — Base Styles
   Design tokens, reset, typography, accessibility helpers and utilities.
   Pure HTML5 + CSS3 + Vanilla JS. IIS-ready.
   ========================================================================== */

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */
:root {
  /* Brand palette */
  --navy: #102A43;
  --primary: #102A43;
  --primary-light: #1B3A63;
  --primary-dark: #081B2E;
  --blue: #1677FF;
  --secondary: #1677FF;
  --secondary-dark: #0E63D6;
  --teal: #00A6A6;
  --accent: #00A6A6;
  --accent-dark: #008F8F;
  --sand: #F5EFE5;
  --white: #FFFFFF;
  --light-grey: #F2F6FA;
  --grey: #E8EAED;
  --dark: #1A1A1A;
  --bg: #F7F9FC;
  --charcoal: #172B3A;
  --text: #172B3A;
  --text-muted: #647587;
  --text-dim: #9AA7B8;
  --border: #DCE4EC;
  --border-light: #E8EDF3;

  /* Feedback */
  --success: #1F9D55;
  --success-bg: #E7F6EE;
  --warning: #E9A23B;
  --warning-bg: #FDF3E2;
  --danger: #D64545;
  --danger-bg: #FDECEB;
  --error: #D64545;
  --error-bg: #FDECEB;
  --info: #1677FF;
  --info-bg: #E8F1FD;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #102A43 0%, #1B3A63 100%);
  --gradient-accent: linear-gradient(135deg, #00A6A6 0%, #008F8F 100%);
  --gradient-blue: linear-gradient(135deg, #1677FF 0%, #0E63D6 100%);
  --gradient-hero: linear-gradient(90deg, rgba(10,30,50,0.64) 0%, rgba(10,30,50,0.46) 32%, rgba(10,30,50,0.20) 58%, rgba(10,30,50,0.06) 100%);
  --gradient-card: linear-gradient(180deg, transparent 0%, rgba(16,42,67,0.78) 100%);

  /* Typography */
  --font-heading: 'Poppins', 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  /* Fluid type scale */
  --text-display: clamp(2.6rem, 5vw, 4rem);
  --text-h1: clamp(2rem, 3.8vw, 3rem);
  --text-h2: clamp(1.7rem, 3.2vw, 2.6rem);
  --text-h3: clamp(1.25rem, 1.8vw, 1.55rem);
  --text-h4: clamp(1.05rem, 1.4vw, 1.2rem);
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-caption: 0.8125rem;
  --text-label: 0.75rem;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 80px;
  --space-9: 96px;
  --space-10: 120px;

  /* Layout */
  --container-xl: 1440px;
  --container-max: 1280px;
  --container-text: 860px;
  --container-small: 600px;
  --section-pad: clamp(64px, 7vw, 112px);
  --header-h: 104px;

  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(16,42,67,0.08);
  --shadow-sm: 0 2px 8px rgba(16,42,67,0.08);
  --shadow-md: 0 8px 24px rgba(16,42,67,0.10);
  --shadow-lg: 0 16px 48px rgba(16,42,67,0.14);
  --shadow-xl: 0 24px 80px rgba(16,42,67,0.18);
  --shadow-accent: 0 8px 24px rgba(0,166,166,0.28);
  --ring-accent: 0 0 0 3px rgba(0,166,166,0.18);

  /* Motion */
  --transition-fast: 0.18s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s ease;
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary); }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

p { margin-bottom: 1rem; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--accent); color: var(--white); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--light-grey); }
::-webkit-scrollbar-thumb { background: #C6CDD8; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* ==========================================================================
   3. Accessibility Helpers
   ========================================================================== */
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 2000;
  background: var(--primary); color: var(--white);
  padding: 12px 24px; border-radius: var(--radius-full);
  font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem;
  transition: top var(--transition);
}
.skip-link:focus { top: 16px; color: var(--white); }

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

/* ==========================================================================
   4. Layout Utilities
   ========================================================================== */
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.container--wide { max-width: var(--container-xl); }
.container--narrow { max-width: 1180px; }
.container--text { max-width: var(--container-text); }
.container--small { max-width: var(--container-small); }
.section { padding: var(--section-pad) 0; }
.section--alt { background: var(--light-grey); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--primary); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 40px; flex-wrap: wrap;
}
.section-head--center { flex-direction: column; align-items: center; text-align: center; }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-heading); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--accent); margin-bottom: 12px;
}
.section-label::before { content: ''; width: 28px; height: 2px; background: var(--accent); border-radius: 2px; }

.section-title { font-size: var(--text-h2); margin-bottom: 16px; letter-spacing: -0.02em; }
.section-subtitle { color: var(--text-muted); max-width: 640px; font-size: 1.05rem; }
.section--dark .section-title { color: var(--white); }
.section--dark .section-subtitle { color: rgba(255,255,255,0.75); }
.section--dark .section-label { color: rgba(255,255,255,0.6); }
.section--dark .section-label::before { background: var(--accent); }

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

/* Typography helpers */
.h-display { font-family: var(--font-heading); font-weight: 700; color: var(--primary); line-height: 1.1; letter-spacing: -0.02em; font-size: var(--text-display); }
.h1 { font-family: var(--font-heading); font-weight: 700; color: var(--primary); line-height: 1.15; letter-spacing: -0.02em; font-size: var(--text-h1); }
.h2 { font-family: var(--font-heading); font-weight: 700; color: var(--primary); line-height: 1.2; letter-spacing: -0.01em; font-size: var(--text-h2); }
.h3 { font-family: var(--font-heading); font-weight: 700; color: var(--primary); line-height: 1.25; font-size: var(--text-h3); }
.h4 { font-family: var(--font-heading); font-weight: 700; color: var(--primary); line-height: 1.3; font-size: var(--text-h4); }
.text-body { font-size: var(--text-body); line-height: 1.6; }
.text-sm { font-size: var(--text-sm); }
.text-caption { font-size: var(--text-caption); color: var(--text-muted); }
.text-label { font-size: var(--text-label); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.lead { font-size: 1.125rem; line-height: 1.7; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-white { color: var(--white); }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mx-auto { margin-left: auto; margin-right: auto; }
.nowrap { white-space: nowrap; }
.hide-mobile { display: inherit; }
.show-mobile { display: none; }
[hidden] { display: none !important; }

/* ==========================================================================
   5. Utility components
   ========================================================================== */
.loading-spinner {
  display: none; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 0; color: var(--text-dim);
}
.loading-spinner.active { display: flex; }
.spinner {
  width: 34px; height: 34px; border: 3.5px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-state { text-align: center; padding: 72px 24px; color: var(--text-muted); }
.error-state h3 { font-size: 1.3rem; margin-bottom: 8px; }
.error-state .btn { margin-top: 16px; }

.back-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 1000;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transform: translateY(10px); transition: all var(--transition);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--accent); }
.back-to-top svg { width: 20px; height: 20px; }

/* ==========================================================================
   6. Print
   ========================================================================== */
@media print {
  .site-header, .site-footer, .back-to-top, .hero,
  .newsletter-section, .booking-sidebar, .filter-bar, .results-toolbar { display: none !important; }
  body { background: var(--white); }
  main { padding-top: 0; }
  .details-layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   7. Reduced Motion
   ========================================================================== */
@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;
  }
}

/* ==========================================================================
   8. Analytics consent banner (Phase 5). Inert until GPE_CONFIG.analytics
   is enabled in production; styles kept ready so flipping the flag needs
   no code changes.
   ========================================================================== */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--navy);
  color: var(--white);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(16, 42, 67, 0.35);
}
.consent-banner p {
  flex: 1 1 300px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.consent-banner .btn { white-space: nowrap; }
@media (min-width: 768px) {
  .consent-banner { left: auto; right: 24px; bottom: 24px; }
}
