/* Over the Edge Design System
   - Light/Dark via CSS variables on html[data-theme]
   - Typography: Serif headlines, Inter UI/body
   - Components: buttons, chips, cards, tabs, fields, calendar
   - Polished visuals: gradients, shadows, focus rings, motion
*/

/* -------------------- Fonts -------------------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Serif+4:wght@400;600;700&display=swap");

/* -------------------- Tokens -------------------- */
/* Note: Colors are now defined in color-tokens.css */
/* This file only contains layout, spacing, and typography tokens */
:root {
  --radius-xs: 6px;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --trans-fast: 160ms cubic-bezier(.2,.6,.2,1);
  --trans-med: 240ms cubic-bezier(.2,.6,.2,1);

  /* Typography */
  --font-ui: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-serif: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Theme overrides are now handled in color-tokens.css */
html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

/* -------------------- Base -------------------- */
*,
*::before,
*::after { 
  box-sizing: border-box; 
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { 
  display: inline-block; 
}

a { 
  color: inherit; 
  text-decoration: none;
  transition: color var(--trans-fast);
}

a:hover {
  opacity: 0.8;
}

button, input { 
  font-family: inherit; 
  color: inherit; 
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.text-secondary { 
  color: var(--text-sec); 
}

/* Typography Classes */
.headline-xl {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.headline-l {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.01em;
}

.headline-s {
  font-family: var(--font-serif);
  font-size: 18px;
}

.body-l { 
  font-size: 18px; 
  color: var(--text-sec); 
}

.body-m { 
  font-size: 16px; 
}

.body-s { 
  font-size: 14px; 
  color: var(--text-sec); 
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-s);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
}

.btn--primary {
  background: var(--brand);
  color: white;
}

.btn--primary:hover {
  background: color-mix(in oklab, var(--brand), black 10%);
  transform: translateY(-1px);
  box-shadow: var(--elev-2);
}

.btn--outline {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn--outline:hover {
  background: var(--brand);
  color: white;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.icon-btn:hover {
  background: var(--muted);
  color: var(--brand);
}

.icon-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------- Chips -------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
}

.chip--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.chip--outline:hover {
  background: var(--muted);
  border-color: var(--brand);
  color: var(--brand);
}

.chip.is-active {
  background: var(--brand);
  color: white;
}

/* -------------------- Brand -------------------- */
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.brand__logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand__name {
  font-family: var(--font-serif);
}

/* -------------------- Navigation -------------------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius-s);
  transition: all var(--trans-fast);
  text-decoration: none;
}

.nav-link:hover {
  background: var(--muted);
  color: var(--brand);
}

.nav-link.is-active {
  background: var(--brand);
  color: white;
}

/* -------------------- Sections -------------------- */
.section {
  padding: var(--space-12) 0;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}

.section__head--between {
  align-items: flex-start;
}

.section-title {
  margin: 0;
}

/* -------------------- Theme Toggle -------------------- */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.theme-toggle:hover {
  background: var(--muted);
  color: var(--brand);
}

.theme-toggle__icon {
  position: absolute;
  transition: all var(--trans-med);
}

.theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* -------------------- WordPress Block Overrides -------------------- */
.wp-block-group.is-style-ote-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  padding: var(--space-12) var(--space-6);
  border-radius: var(--radius-l);
  text-align: center;
}

.wp-block-group.is-style-ote-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 48px);
  margin: 0 0 var(--space-4) 0;
}

.wp-block-group.is-style-ote-section {
  padding: var(--space-8) 0;
}

/* OTE Primary button hover/active styles are now in the consolidated section above */

.wp-block-button.is-style-ote-outline .wp-block-button__link {
  background: transparent !important;
  color: var(--brand) !important;
  border: 2px solid var(--brand) !important;
  border-radius: var(--radius-s) !important;
  padding: var(--space-3) var(--space-5) !important;
  font-weight: 500 !important;
  transition: all var(--trans-fast) !important;
}

.wp-block-button.is-style-ote-outline .wp-block-button__link:hover {
  background: var(--brand) !important;
  color: #ffffff !important;
  border-color: var(--brand) !important;
  transform: translateY(-1px) !important;
}

.wp-block-button.is-style-ote-ghost .wp-block-button__link {
  background: transparent !important;
  color: var(--text) !important;
  border: none !important;
  border-radius: var(--radius-s) !important;
  padding: var(--space-3) var(--space-5) !important;
  font-weight: 500 !important;
  transition: all var(--trans-fast) !important;
}

.wp-block-button.is-style-ote-ghost .wp-block-button__link:hover {
  background: var(--bg-muted) !important;
  color: var(--text) !important;
}

/* Default button styles for all wp-block-button__link elements */
.wp-block-button:not([class*="is-style-"]) .wp-block-button__link,
.wp-block-button:not([class*="is-style-"]) .wp-element-button {
  background: var(--button-primary-bg);
  color: var(--text-inverse);
  border: 1px solid color-mix(in oklab, var(--brand), black 25%);
  border-radius: var(--radius-s);
  padding: 10px 16px;
  font-weight: 500;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: all var(--trans-fast);
}

.wp-block-button:not([class*="is-style-"]) .wp-block-button__link:hover,
.wp-block-button:not([class*="is-style-"]) .wp-element-button:hover {
  background: var(--button-primary-bg-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* BUTTON STYLING - ONLY FOR OTE PRIMARY BUTTONS AND CLUBS BUTTONS */
body .wp-block-button.is-style-ote-primary .wp-block-button__link,
body .wp-block-button.is-style-ote-primary .wp-element-button,
body .is-style-ote-primary .wp-block-button__link,
body .is-style-ote-primary .wp-element-button,
body .wp-block-button__link.wp-element-button[href*="clubs/"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  background: var(--button-primary-bg) !important;
  color: #ffffff !important;
  border: 1px solid color-mix(in oklab, var(--brand), black 25%) !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  box-shadow: var(--shadow) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  /* transition removed to prevent flash */
}

/* Remove broad arrow rules - arrows are handled in button-animations.css */
/* Arrows are added specifically to:
   - OTE Primary buttons (not linking to clubs)
   - Buttons with href containing "/clubs/"
   This prevents double arrows */

/* Hover states for OTE Primary buttons and clubs buttons */
body .wp-block-button.is-style-ote-primary .wp-block-button__link:hover,
body .wp-block-button.is-style-ote-primary .wp-element-button:hover,
body .is-style-ote-primary .wp-block-button__link:hover,
body .is-style-ote-primary .wp-element-button:hover,
body .wp-block-button__link.wp-element-button[href*="clubs/"]:hover {
  background: var(--button-primary-bg-hover) !important;
  color: #ffffff !important;
  border-color: color-mix(in oklab, var(--brand), black 15%) !important;
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Arrow hover animations are handled in button-animations.css */

/* Active states - only for OTE Primary and clubs buttons */
body .wp-block-button.is-style-ote-primary .wp-block-button__link:active,
body .wp-block-button.is-style-ote-primary .wp-element-button:active,
body .is-style-ote-primary .wp-block-button__link:active,
body .is-style-ote-primary .wp-element-button:active,
body .wp-block-button__link.wp-element-button[href*="clubs/"]:active {
  transform: translateY(1px) scale(0.99) !important;
}

/* Exception for outline and ghost buttons */
.wp-block-button.is-style-ote-outline .wp-block-button__link:not(:hover) {
  color: #ffffff !important;
}

.wp-block-button.is-style-ote-ghost .wp-block-button__link {
  color: var(--text) !important;
}

/* -------------------- Responsive -------------------- */
@media (max-width: 768px) {
  .container {
    padding-inline: var(--space-3);
  }
  
  .section {
    padding: var(--space-8) 0;
  }
  
  .section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
  
  .headline-xl {
    font-size: clamp(24px, 6vw, 32px);
  }
  
  .headline-l {
    font-size: clamp(20px, 4vw, 24px);
  }
}

/* -------------------- Article Page Classes -------------------- */
.article__eyebrow { 
  display: inline-flex; 
  gap: 10px; 
  align-items: center; 
  color: var(--text-secondary, #64748b);
  font-size: var(--text-sm, 0.875rem);
}

.card__tag {
  font-size: 12px;
  color: var(--brand, #2d5f3f);
  background: color-mix(in oklab, var(--brand, #2d5f3f), transparent 90%);
  padding: 2px 8px;
  border-radius: var(--radius-s, 6px);
  border: 1px solid color-mix(in oklab, var(--brand, #2d5f3f), transparent 80%);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 240ms cubic-bezier(.2,.6,.2,1);
}

.card__tag:hover {
  background: color-mix(in oklab, var(--brand, #2d5f3f), transparent 80%);
  border-color: color-mix(in oklab, var(--brand, #2d5f3f), transparent 60%);
}

[data-theme="dark"] .card__tag {
  background: color-mix(in oklab, var(--brand, #4a9d7a), transparent 85%);
  color: var(--brand, #4a9d7a);
  border-color: color-mix(in oklab, var(--brand, #4a9d7a), transparent 70%);
}

[data-theme="dark"] .card__tag:hover {
  background: color-mix(in oklab, var(--brand, #4a9d7a), transparent 75%);
  border-color: color-mix(in oklab, var(--brand, #4a9d7a), transparent 50%);
}

.body-s { 
  font-size: 14px; 
  color: var(--text-secondary, #64748b); 
}

.body-m { 
  font-size: 16px; 
}

.body-l { 
  font-size: 18px; 
  color: var(--text-secondary, #64748b); 
}

/* Author block styling */
.wp-block-post-author {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
}

.wp-block-post-author__avatar {
  margin-right: 0;
}

.wp-block-post-author__avatar img {
  border-radius: 50%;
  border: 2px solid var(--border, #e2e8f0);
  display: block;
}

.wp-block-post-author__name,
.wp-block-post-author__name a {
  font-weight: 700;
  color: var(--foreground, #0f172a);
  text-decoration: none;
}

.wp-block-post-author__name a:hover {
  color: var(--brand, #2d5f3f);
}

[data-theme="dark"] .wp-block-post-author__avatar img {
  border-color: var(--border, #334155);
}

[data-theme="dark"] .wp-block-post-author__name a {
  color: var(--foreground, #f8fafc);
}

[data-theme="dark"] .wp-block-post-author__name a:hover {
  color: var(--brand, #4a9d7a);
}

/* -------------------- 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;
  }
}