/* ═══════════════════════════════════════════════
   Your Translation Matters — Design System v2
   Single source of truth for all design tokens.
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Brand Colors */
  --ytm-primary: #123553;
  --ytm-primary-hover: #0d2840;
  --ytm-accent: #1d70b7;
  --ytm-accent-hover: #15558d;
  --ytm-gold: #e89b2c;
  --ytm-gold-dark: #d08a1f;
  --ytm-gold-light: #fff3d6;

  /* Semantic Colors */
  --ytm-dark: #0F172A;
  --ytm-bg: #f5f7fa;
  --ytm-surface: #FFFFFF;
  --ytm-text: #18324a;
  --ytm-muted: #416075;
  --ytm-border: #e2ebee;
  --ytm-focus: #1d70b7;

  /* Typography */
  --ytm-font: "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  --ytm-font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --ytm-space-xs: 4px;
  --ytm-space-sm: 8px;
  --ytm-space-md: 16px;
  --ytm-space-lg: 24px;
  --ytm-space-xl: 32px;
  --ytm-space-2xl: 48px;
  --ytm-space-3xl: 64px;

  /* Border Radius */
  --ytm-radius-sm: 8px;
  --ytm-radius-md: 12px;
  --ytm-radius-lg: 24px;
  --ytm-radius-full: 999px;

  /* Shadows */
  --ytm-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --ytm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --ytm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Layout */
  --ytm-container: 1200px;

  /* Legacy Nav/Footer tokens */
  --ytm-menu: #123553;
  --ytm-menu-hover: #0d2840;
  --ytm-footer: #123553;
  --ytm-footer-text: #ffffff;
  --ytm-footer-muted: rgba(255, 255, 255, 0.72);
  --ytm-ink: #18324a;
  --ytm-navy: #123553;
  --ytm-teal: #1d70b7;
  --ytm-soft: #f5f7fa;
  --ytm-line: #e2ebee;
  --ytm-shadow: 0 10px 28px rgba(18, 53, 83, 0.08);
  --ytm-radius: 14px;
}

/* ── Global Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--ytm-space-md);
  color: var(--ytm-dark);
  font-family: var(--ytm-font);
  font-weight: 700;
  line-height: 1.3;
}
p { margin: 0 0 var(--ytm-space-md); }
a { color: var(--ytm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utility Classes ── */
.ytm-container { width: min(100% - 28px, var(--ytm-container)); margin-inline: auto; }
.ytm-text-center { text-align: center; }
.ytm-text-muted { color: var(--ytm-muted); }
.ytm-text-sm { font-size: 0.875rem; }
.ytm-mt-0 { margin-top: 0; }
.ytm-mb-0 { margin-bottom: 0; }

/* ── Buttons ── */
.ytm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--ytm-radius-full);
  font-family: var(--ytm-font);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.ytm-btn:hover { text-decoration: none; }
.ytm-btn--primary { background: var(--ytm-primary); color: #fff; }
.ytm-btn--primary:hover { background: var(--ytm-primary-hover); }
.ytm-btn--accent { background: var(--ytm-accent); color: #fff; }
.ytm-btn--accent:hover { background: var(--ytm-accent-hover); }
.ytm-btn--gold { background: var(--ytm-gold); color: var(--ytm-dark); }
.ytm-btn--gold:hover { background: var(--ytm-gold-dark); }
.ytm-btn--outline { background: transparent; color: var(--ytm-primary); border: 2px solid var(--ytm-primary); }
.ytm-btn--outline:hover { background: var(--ytm-primary); color: #fff; }
.ytm-btn--dark { background: var(--ytm-dark); color: #fff; }
.ytm-btn--dark:hover { background: #1E293B; }

/* ── Cards ── */
.ytm-card {
  background: var(--ytm-surface);
  border: 1px solid var(--ytm-border);
  border-radius: var(--ytm-radius-md);
  padding: var(--ytm-space-lg);
  box-shadow: var(--ytm-shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.ytm-card:hover { box-shadow: var(--ytm-shadow-md); }

/* ── Badges ── */
.ytm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--ytm-radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}
.ytm-badge--primary { background: rgba(18, 53, 83, 0.1); color: var(--ytm-primary); }
.ytm-badge--accent { background: rgba(15, 118, 110, 0.1); color: var(--ytm-accent); }
.ytm-badge--gold { background: rgba(232, 155, 44, 0.15); color: var(--ytm-gold-dark); }

/* ── Grid System ── */
.ytm-grid {
  display: grid;
  gap: var(--ytm-space-lg);
}
.ytm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ytm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ytm-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 980px) {
  .ytm-grid-3, .ytm-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ytm-grid-2, .ytm-grid-3, .ytm-grid-4 { grid-template-columns: 1fr; }
}

/* ── Section Spacing ── */
.ytm-section {
  padding: var(--ytm-space-3xl) 0;
  background: var(--ytm-surface);
}
.ytm-section--alt {
  background: var(--ytm-bg);
}

/* ── Screen Reader Only ── */
.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; }
.sr-only:focus { position: fixed; top: 8px; left: 8px; z-index: 10000; width: auto; height: auto; padding: 12px 24px; margin: 0; overflow: visible; clip: auto; white-space: normal; background: var(--ytm-primary); color: #fff; font-weight: 700; border-radius: var(--ytm-radius-sm); box-shadow: var(--ytm-shadow-md); }

/* ── Focus Visible ── */
:focus-visible {
  outline: 3px solid var(--ytm-primary);
  outline-offset: 2px;
}

/* ── Scroll Animations ── */
.ytm-animate {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.ytm-animate[data-dir="up"] { transform: translateY(30px); }
.ytm-animate[data-dir="down"] { transform: translateY(-30px); }
.ytm-animate[data-dir="left"] { transform: translateX(30px); }
.ytm-animate[data-dir="right"] { transform: translateX(-30px); }
.ytm-animate[data-dir="fade"] { transform: none; }

.ytm-animate.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

.ytm-animate[data-delay="1"] { transition-delay: 0.1s; }
.ytm-animate[data-delay="2"] { transition-delay: 0.2s; }
.ytm-animate[data-delay="3"] { transition-delay: 0.3s; }
.ytm-animate[data-delay="4"] { transition-delay: 0.4s; }
.ytm-animate[data-delay="5"] { transition-delay: 0.5s; }

/* ── 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;
  }
  .ytm-animate { opacity: 1; transform: none; }
}

/* ── Mobile Touch Targets ── */
@media (max-width: 760px) {
  .ytm-btn,
  .ytm-btn--primary,
  .ytm-btn--accent,
  .ytm-btn--gold,
  .ytm-btn--outline,
  .ytm-btn--dark,
  .site-button,
  .site-navigation a,
  .site-menu-toggle,
  .ytm-mobile-cta a,
  .ytm-back-to-top,
  .faq-question,
  .article-share a,
  .blog_tags a {
    min-height: 48px;
    min-width: 48px;
  }

  .ytm-services .service-card {
    padding: 20px;
  }

  .ytm-process .process-step {
    padding: 20px;
    padding-top: 60px;
  }

  .ytm-faq .faq-question {
    padding: 16px 0;
  }
}
