/* Shared ThaiMethod page header — dictionary & lessons */
.tm-hero {
  position: relative;
  padding: 16px 18px 20px;
  border-radius: 20px;
  color: #f8fafc;
  background:
    radial-gradient(900px 380px at 8% -20%, rgba(56, 189, 248, 0.4), transparent 55%),
    radial-gradient(700px 320px at 100% 10%, rgba(45, 212, 191, 0.22), transparent 52%),
    linear-gradient(145deg, #0b1220 0%, #0c4a6e 45%, #0369a1 82%, #0f766e 100%);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  isolation: isolate;
}
.tm-hero > * { position: relative; z-index: 1; }

.tm-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.tm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.tm-brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: #0c4a6e;
  background: #f8fafc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.tm-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.tm-brand-text strong {
  font-size: clamp(1.25rem, 3.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.tm-brand-text em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.92);
  letter-spacing: 0.02em;
}

.tm-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tm-nav a,
.tm-nav button.tm-nav-btn {
  color: rgba(224, 242, 254, 0.92);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  line-height: inherit;
}
.tm-nav a:hover,
.tm-nav button.tm-nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}
.tm-nav a.active,
.tm-nav button.tm-nav-btn.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.tm-hero-body { text-align: left; }
.tm-kicker {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(125, 211, 252, 0.95);
}
.tm-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}
.tm-hero h1 .th {
  display: block;
  margin-top: 4px;
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  font-size: 0.62em;
  font-weight: 600;
  color: rgba(253, 164, 175, 0.95);
}
.tm-lead {
  margin: 0 0 14px;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.92);
}
.tm-lead .th {
  display: block;
  margin-top: 3px;
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  font-size: 0.92em;
  color: rgba(204, 251, 241, 0.9);
}

.tm-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 14px;
}
.tm-progress-bar {
  flex: 1 1 160px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  max-width: 280px;
}
.tm-progress-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7dd3fc, #5eead4);
}
.tm-progress-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(226, 232, 240, 0.9);
}

.tm-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tm-cta a, .tm-cta button {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  line-height: 1.25;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
}
.tm-cta a:hover, .tm-cta button:hover { transform: translateY(-1px); }
.tm-cta .primary {
  background: #f8fafc;
  color: #0c4a6e;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.tm-cta .accent {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(190, 18, 60, 0.3);
}

.tm-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #b8c5d4);
  scroll-margin-top: 12px;
}
.tm-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text, #0f172a);
}
.tm-section-head h2 .th {
  display: block;
  margin-top: 2px;
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--muted, #5b6b7c);
}
.tm-section-head .meta {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted, #5b6b7c);
}

@media (max-width: 560px) {
  .tm-hero { padding: 14px 14px 18px; border-radius: 16px; }
  .tm-brand-mark { width: 38px; height: 38px; }
  .tm-nav a { padding: 6px 9px; font-size: 0.76rem; }
  .tm-cta a, .tm-cta button { flex: 1 1 calc(50% - 8px); font-size: 0.78rem; padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-cta a:hover, .tm-cta button:hover { transform: none; }
}
