/* Global Layout & Base Styles */

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

html {
  background: var(--ground);
  color: var(--ink);
}

body {
  font-family: "Noto Sans Thai", "IBM Plex Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Wrap container */
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

@media (min-width: 1400px) {
  .wrap {
    padding: 32px 40px 80px;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.header-badge {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--m2), var(--m3));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-text {
  flex: 1;
  min-width: 200px;
}

.header-text h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.header-text p {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 2px;
}

.header-meta {
  font-size: 12px;
  color: var(--meta);
  text-align: right;
  line-height: 1.6;
}

.header-meta b {
  color: var(--ink);
  font-weight: 600;
}

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 20px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.nav a {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s;
}

.nav a:hover {
  background: var(--rule-2);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  background: var(--nav-c);
  color: #fff;
}

.nav a[aria-current="page"] svg {
  color: #fff;
}

.nav svg {
  color: var(--nav-c);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

@media (max-width: 720px) {
  .nav a {
    flex-basis: calc(50% - 2px);
  }
}

/* Footer */
.foot {
  font-size: 12px;
  color: var(--meta);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

a {
  color: var(--focus);
}

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