/**
 * Supers.ca - Shared Design System
 * Apple-inspired minimalist design with frosted glass effects
 */

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

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #f5f5f7;
  --bg-3: #e8e8ed;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #c41e3a;
  --accent-glow: #e63950;
  --accent-hover: #a8182f;
  --accent-soft: rgba(196, 30, 58, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --rule: rgba(0, 0, 0, 0.08);
  --rule-strong: rgba(0, 0, 0, 0.12);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 16px 32px rgba(0,0,0,0.08);
  --glow: rgba(196, 30, 58, 0.12);
  --nav-bg: rgba(250, 250, 250, 0.8);
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #1c1c1e;
  --bg-3: #2c2c2e;
  --bg-elevated: #1c1c1e;
  --text: #f5f5f7;
  --text-dim: #a1a1a6;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #ff375f;
  --accent-glow: #ff5c7c;
  --accent-hover: #ff5c7c;
  --accent-soft: rgba(255, 55, 95, 0.15);
  --border: rgba(255, 255, 255, 0.1);
  --rule: rgba(255, 255, 255, 0.1);
  --rule-strong: rgba(255, 255, 255, 0.15);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 16px 32px rgba(0,0,0,0.3);
  --glow: rgba(255, 55, 95, 0.15);
  --nav-bg: rgba(0, 0, 0, 0.8);
}

/* ========================================
   FROSTED GLASS NAVIGATION
   ======================================== */
.nav,
.head {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}

/* Brand */
.nav .brand,
.head .brand,
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.nav .brand:hover,
.head .brand:hover,
.nav-brand:hover {
  color: var(--accent);
}

.nav .brand-logo,
.head .brand-logo,
.nav-brand svg {
  width: 28px;
  height: 28px;
  fill: var(--accent);
  transition: transform 0.3s ease;
}

.nav .brand:hover .brand-logo,
.head .brand:hover .brand-logo {
  transform: scale(1.1) rotate(8deg);
}

/* Nav Links */
.nav-links,
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a,
.site-nav a {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.site-nav a:hover {
  color: var(--text);
}

.support-link {
  color: var(--accent) !important;
}

/* ========================================
   FOOTER
   ======================================== */
.footer,
.foot {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a,
.foot a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.foot a:hover {
  color: var(--text);
}

.footer-copy,
.foot p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer-copy .heart,
.foot .heart {
  color: var(--accent);
}

/* ========================================
   THEME TOGGLE
   ======================================== */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glow);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="light"] .theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .moon { display: block; }

/* ========================================
   PAGE LAYOUT ADJUSTMENT FOR FIXED HEADER
   ======================================== */
.page {
  padding-top: 5rem;
}

/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.menu-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--glow);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.menu-toggle .close-icon { display: none; }
.menu-toggle.active .menu-icon { display: none; }
.menu-toggle.active .close-icon { display: block; }

/* ========================================
   MOBILE NAVIGATION DRAWER
   ======================================== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-elevated, var(--bg, #fff));
  z-index: 200;
  padding: 5rem 1.5rem 2rem;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  overflow-y: auto;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-links a {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:focus {
  background: var(--glow);
  color: var(--accent);
}

.mobile-nav-links .support-link {
  color: var(--accent);
  margin-top: 1rem;
  border: 1px solid var(--accent);
  text-align: center;
}

.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .nav-links,
  .site-nav {
    gap: 1.5rem;
  }

  .nav-links a,
  .site-nav a {
    font-size: 0.8rem;
  }
}

@media (max-width: 600px) {
  .nav,
  .head {
    padding: 0.75rem 1.25rem;
  }

  .nav-links,
  .site-nav {
    display: none;
  }

  .share-buttons {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-nav,
  .mobile-nav-overlay {
    display: block;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .page {
    padding-top: 4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    transform: none !important;
  }

  .mobile-nav {
    transition: none;
  }

  .mobile-nav-overlay {
    transition: none;
  }
}
