/* ComplementaryColors.online - Main Stylesheet */
/* Design system: Blue (#185FA5) + Orange (#EF9F27) complementary palette */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Primary complementary palette */
  --blue: #185FA5;
  --blue-light: #3d8ad4;
  --orange: #EF9F27;
  --orange-light: #f5b84d;
  
  /* Neutrals */
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --bg-muted: #f0f2f5;
  --text: #1a1a1a;
  --text-muted: #4a4a4a;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  
  /* Semantic */
  --accent: var(--orange);
  --accent-alt: var(--blue);
  --link: var(--blue);
  --link-hover: var(--orange);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: Georgia, 'Times New Roman', serif;
  
  /* Layout */
  --sidebar-width: 280px;
  --header-height: 64px;
  --touch-min: 44px;
  --swatch-min: 80px;
  
  /* Breakpoints (for reference) */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--link-hover);
}

/* Layout */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) var(--space-lg);
  width: 100%;
}

.header-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}
.logo span { color: var(--orange); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.main-nav a {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}
.main-nav a:hover {
  color: var(--link);
  background: var(--bg-muted);
}

main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  min-height: calc(100vh - 200px);
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: var(--space-xl) var(--space-lg);
}

article {
  max-width: 720px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
}

.sidebar h3 {
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: var(--space-xs);
}

.sidebar-nav a {
  display: block;
  padding: var(--space-sm) 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.sidebar-nav a:hover {
  color: var(--link);
}

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) var(--space-lg);
  margin-top: var(--space-3xl);
  width: 100%;
}

.footer-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.footer-nav a {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.footer-nav a:hover { color: var(--link); }

.footer-hubs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.footer-hubs a {
  font-size: 0.875rem;
  color: var(--text-light);
}
.footer-hubs a:hover { color: var(--link); }

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-light);
}

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

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 1.5rem;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--orange);
}

h3 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

h4 {
  font-size: 1.0625rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}
li { margin-bottom: var(--space-xs); }

/* Color swatches - min 80x80px */
.color-swatch {
  min-width: var(--swatch-min);
  min-height: var(--swatch-min);
  width: var(--swatch-min);
  height: var(--swatch-min);
  border-radius: 8px;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.swatch-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin: var(--space-md) 0;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.swatch-item .color-swatch {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.swatch-item .color-swatch:hover {
  transform: scale(1.05);
}
.swatch-item .hex-code {
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Buttons - min 44x44px touch target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  min-height: var(--touch-min);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-primary {
  background: var(--orange);
  color: white;
}
.btn-primary:hover {
  background: var(--orange-light);
  color: white;
}
.btn-secondary {
  background: var(--blue);
  color: white;
}
.btn-secondary:hover {
  background: var(--blue-light);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--link);
}
.btn-copy {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8125rem;
  min-height: 36px;
}

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(24, 95, 165, 0.08);
}
.card h3 {
  margin-top: 0;
  font-size: 1.125rem;
}
.card p {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

/* Hero section */
.hero {
  padding: var(--space-2xl) 0;
  margin-bottom: var(--space-2xl);
}
.hero p {
  font-size: 1.125rem;
  max-width: 640px;
}

/* Tool containers */
.tool-container {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--space-xl);
  margin: var(--space-xl) 0;
}

.tool-container h3 {
  margin-top: 0;
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

/* Form elements */
input[type="text"],
input[type="email"],
input[type="color"],
textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: 8px;
  min-height: var(--touch-min);
  width: 100%;
  max-width: 100%;
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
}
input[type="color"] {
  padding: 4px;
  cursor: pointer;
  min-width: 60px;
  min-height: 44px;
}

.form-group {
  margin-bottom: var(--space-md);
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  font-size: 0.9375rem;
}

/* FAQ */
.faq-list { list-style: none; padding-left: 0; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg) 0;
}
.faq-item:first-child { padding-top: 0; }
.faq-item h4 {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
  color: var(--text);
}
.faq-item p { margin: 0; font-size: 0.9375rem; }

/* Author & meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-xl);
}
.article-meta time { font-style: normal; }

/* Breadcrumbs */
.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb span { margin: 0 var(--space-xs); }

/* Responsive */
@media (max-width: 1024px) {
  main {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    order: 0;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: var(--space-md);
  }
  .header-inner {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  .logo {
    font-size: 1.125rem;
  }
  .main-content {
    padding: var(--space-lg) var(--space-md);
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile: hamburger menu — show icon, collapse nav until clicked */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
  }
  .logo {
    font-size: 1rem;
    flex: 1;
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-toggle:hover {
    border-color: var(--blue);
    background: var(--bg-muted);
  }
  .nav-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .nav-toggle-icon span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
  }
  .main-nav {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }
  #nav-toggle:checked ~ .main-nav {
    max-height: 400px;
    opacity: 1;
  }
  #nav-toggle:checked ~ .nav-toggle .nav-toggle-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  #nav-toggle:checked ~ .nav-toggle .nav-toggle-icon span:nth-child(2) {
    opacity: 0;
  }
  #nav-toggle:checked ~ .nav-toggle .nav-toggle-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .main-nav a {
    padding: var(--space-md);
    border-radius: 6px;
    border-bottom: 1px solid var(--border-light);
  }
  .main-nav a:last-child {
    border-bottom: none;
  }
}

/* Desktop: hide hamburger, show horizontal nav */
@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle-hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Color wheel */
.color-wheel-svg { max-width: 100%; height: auto; }
.wheel-segment.selected { stroke: #185FA5 !important; stroke-width: 3 !important; filter: brightness(1.1); }
.wheel-segment.complement { stroke: #EF9F27 !important; stroke-width: 3 !important; filter: brightness(1.1); }

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