/* Mr. DIY AI Workshop - Main Styles */
/* Flamingo 492 Design System */

:root {
  /* Colors */
  --bg-primary: #FAF9F7;
  --bg-muted: #D7D7CF;
  --text-primary: #2E2E2E;
  --text-accent: #5E7F5B;
  --cta-primary: #E6524A;
  --cta-hover: #F77B72;
  --highlight-info: #3D7AE6;
  --highlight-tip: #E9A74B;
  --highlight-example: #3A8C84;
  --highlight-warning: #E6524A;
  --auto-high: #5E7F5B;
  --auto-medium: #E9A74B;
  --auto-low: #C15E3D;

  /* Typography - System font stack for reliability */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-code: 'SF Mono', 'Monaco', 'Courier New', monospace;

  /* Spacing - 8px base unit system */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;

  /* Spacing aliases for component compatibility */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

/* Base */
html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

/* Thai language spacing */
:lang(th) {
  line-height: 1.75;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-accent);
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

h1 { font-size: 42px; font-weight: 700; }
h2 { font-size: 32px; font-weight: 600; }
h3 { font-size: 24px; font-weight: 500; }

p { margin-bottom: var(--space-2); }

a {
  color: var(--cta-primary);
  text-decoration: none;
}

a:hover {
  color: var(--cta-hover);
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-code);
  font-size: 0.9em;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px; /* Touch target */
}

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

.btn-primary:hover {
  background-color: #D43B33;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(230, 82, 74, 0.3);
}

/* Header */
.site-header {
  background-color: white;
  border-bottom: 1px solid var(--bg-muted);
  padding: var(--space-2) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

/* Language Selector */
.lang-selector {
  display: flex;
  gap: var(--space-2);
  background-color: var(--bg-muted);
  padding: 8px;
  border-radius: 8px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.lang-btn:hover {
  background-color: rgba(230, 82, 74, 0.1);
  text-decoration: none;
}

.lang-btn.active {
  background-color: var(--cta-primary);
  color: white;
  cursor: default;
}

.lang-btn.active:hover {
  background-color: var(--cta-primary);
}

.lang-btn .flag {
  font-size: 1.8rem;
  line-height: 1;
}

.lang-btn .lang-label {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  background-color: var(--bg-muted);
  padding: var(--space-6) 0 var(--space-3);
  margin-top: var(--space-6);
  font-size: 0.9rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  text-align: left;
}

.footer-section h4 {
  color: var(--text-accent);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.footer-section p {
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.footer-section a {
  color: var(--cta-primary);
  text-decoration: none;
}

.footer-section a:hover {
  color: var(--cta-hover);
  text-decoration: underline;
}

.footer-section p a {
  display: inline-block;
  margin-left: 8px;
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  color: var(--cta-primary);
}

.footer-section p a:hover {
  transform: scale(1.15);
  text-decoration: none;
  color: var(--cta-hover);
}

.footer-section p a i {
  display: inline-block;
}

.footer-bottom {
  border-top: 1px solid rgba(46, 46, 46, 0.1);
  padding-top: var(--space-3);
  text-align: center;
  color: var(--text-primary);
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 767px) {
  /* Mobile typography adjustments */
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}
