/* ═══════════════════════════════════════════════════════════════════
   KW Sports Club — Global Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────────────── */
:root {
  /* Backgammon palette */
  --bg-primary:       #8B4513;
  --bg-primary-dark:  #6B3410;
  --bg-primary-light: #A0522D;
  --bg-accent:        #D4A96A;
  --bg-accent-light:  #F5E6C8;

  /* Neutral */
  --white:   #FFFFFF;
  --off-white: #FAF7F2;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic */
  --success: #2d6a4f;
  --info:    #1d4e89;
  --warning: #c47d10;
  --danger:  #c0392b;
  --purple:  #5c3d8f;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1),  0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.12), 0 8px 10px rgba(0,0,0,.06);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,.18);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-modal:    300;
  --z-toast:    400;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

html { overflow-x: hidden; }

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── Typography ──────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

h1 { font-size: clamp(2rem,   4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem,2vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p  { color: var(--gray-600); margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

.section--alt {
  background: var(--white);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--bg-primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--bg-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--accent {
  background: var(--bg-accent);
  color: var(--gray-900);
}
.btn--accent:hover {
  background: #C4985A;
  transform: translateY(-1px);
}

.btn--outline {
  border: 2px solid var(--bg-primary);
  color: var(--bg-primary);
  background: transparent;
}
.btn--outline:hover {
  background: var(--bg-primary);
  color: var(--white);
}

.btn--ghost {
  color: var(--gray-700);
  background: transparent;
}
.btn--ghost:hover {
  background: var(--gray-100);
}

.btn--sm { padding: 0.375rem 0.875rem; font-size: 0.875rem; }
.btn--lg { padding: 0.875rem 1.75rem;  font-size: 1rem; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ── Badge / Tag ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white);
  background: var(--bg-primary);
}

/* ── Section Header ──────────────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}
.section-header__eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bg-primary);
  margin-bottom: var(--space-3);
}
.section-header__title {
  margin-bottom: var(--space-4);
}
.section-header__subtitle {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.0625rem;
  color: var(--gray-500);
}

/* ── Divider ─────────────────────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--bg-primary), var(--bg-accent));
  border-radius: var(--radius-full);
  margin: var(--space-4) auto 0;
}

/* ── Utilities ───────────────────────────────────────────────────────── */
.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;   }
.text-right  { text-align: right;  }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ── Skeleton loader ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast notifications ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.toast {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  color: var(--white);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toast-in var(--transition-base) ease-out;
  max-width: 340px;
}
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive Helpers ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .container   { padding: 0 var(--space-4); }
  .section     { padding: var(--space-12) 0; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
