/*
Theme Name: ThaiGovCareer
Theme URI: https://example.com/thaigovcareer
Author: ThaiGovCareer
Author URI: https://example.com
Description: Lightweight SEO-focused WordPress theme for Thai government documents, exam news, and practice exams.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thaieasydoc
*/

:root {
  --ted-ink: #17212b;
  --ted-muted: #5b6673;
  --ted-line: #d8e0ea;
  --ted-soft: #f6f8fa;
  --ted-card: #ffffff;
  --ted-primary: #123c69;
  --ted-primary-dark: #0b2b4f;
  --ted-action: #0f766e;
  --ted-action-dark: #115e59;
  --ted-accent: #b45309;
  --ted-warm: #f2c14e;
  --ted-link: #0b4f80;
  --ted-radius: 8px;
  --ted-shadow: 0 1px 3px rgba(18, 60, 105, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ted-ink);
  font-family: "Sarabun", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ted-link);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

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

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ted-container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.ted-site-header {
  border-bottom: 1px solid var(--ted-line);
  background: #ffffff;
  border-top: 5px solid var(--ted-primary);
}

.ted-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.ted-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ted-ink);
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
}

.ted-brand:hover,
.ted-brand:focus {
  text-decoration: none;
}

.ted-brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: var(--ted-radius);
  object-fit: cover;
  flex: 0 0 auto;
}

.ted-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 650;
}

.ted-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ted-nav a {
  color: var(--ted-ink);
}

.ted-nav a:hover,
.ted-nav a:focus {
  color: var(--ted-primary);
}

.ted-hero {
  background:
    linear-gradient(180deg, rgba(246, 248, 250, 0.96) 0%, rgba(255, 255, 255, 1) 100%),
    radial-gradient(circle at top right, rgba(18, 60, 105, 0.08), transparent 34%);
  border-bottom: 1px solid var(--ted-line);
}

.ted-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 36px;
  align-items: center;
  padding: 42px 0 32px;
}

.ted-eyebrow {
  color: var(--ted-primary);
  font-size: 0.92rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.ted-hero h1,
.ted-page-title {
  margin: 0;
  color: var(--ted-ink);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.ted-hero p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--ted-muted);
  font-size: 1.05rem;
}

.ted-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.ted-trust-bar span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid #c9d7e6;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ted-primary-dark);
  padding: 5px 12px;
  font-size: 0.92rem;
  font-weight: 750;
}

.ted-search-panel {
  background: var(--ted-card);
  border: 1px solid var(--ted-line);
  border-radius: var(--ted-radius);
  box-shadow: 0 8px 24px rgba(18, 60, 105, 0.08);
  padding: 18px;
}

.ted-search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--ted-ink);
  font-weight: 750;
}

.ted-search-row {
  display: flex;
  gap: 8px;
}

.ted-search-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--ted-line);
  border-radius: var(--ted-radius);
  padding: 12px 13px;
  font: inherit;
}

.ted-button,
.ted-search-row button,
.ted-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: var(--ted-radius);
  background: var(--ted-action);
  color: #ffffff;
  padding: 10px 16px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.ted-button:hover,
.ted-button:focus,
.ted-search-row button:hover,
.ted-search-row button:focus,
.ted-download-button:hover,
.ted-download-button:focus {
  background: var(--ted-action-dark);
  color: #ffffff;
  text-decoration: none;
}

.ted-download-button-secondary {
  background: var(--ted-primary);
}

.ted-download-button-secondary:hover,
.ted-download-button-secondary:focus {
  background: var(--ted-primary-dark);
}

.ted-main {
  padding: 28px 0 42px;
}

.ted-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.ted-section {
  margin-top: 34px;
}

.ted-section:first-child {
  margin-top: 0;
}

.ted-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.ted-section-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--ted-primary-dark);
}

.ted-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ted-list {
  display: grid;
  gap: 12px;
}

.ted-card,
.ted-article-card {
  background: var(--ted-card);
  border: 1px solid var(--ted-line);
  border-radius: var(--ted-radius);
  box-shadow: var(--ted-shadow);
  padding: 16px;
}

.ted-card-thumb {
  display: block;
  aspect-ratio: 1200 / 630;
  margin: -16px -16px 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--ted-line);
  border-radius: var(--ted-radius) var(--ted-radius) 0 0;
  background: #ffffff;
}

.ted-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ted-card h2,
.ted-card h3,
.ted-article-card h2,
.ted-article-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.ted-card h2 a,
.ted-card h3 a,
.ted-article-card h2 a,
.ted-article-card h3 a {
  color: var(--ted-primary-dark);
}

.ted-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 10px;
  color: var(--ted-muted);
  font-size: 0.92rem;
}

.ted-meta span:first-child {
  color: var(--ted-accent);
  font-weight: 800;
}

.ted-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ted-line);
  border-radius: 999px;
  color: var(--ted-muted);
  padding: 2px 9px;
  font-size: 0.84rem;
  font-weight: 700;
}

.ted-entry {
  max-width: 760px;
}

.ted-entry h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.ted-featured-image {
  margin: 20px 0 0;
  border: 1px solid var(--ted-line);
  border-radius: var(--ted-radius);
  background: var(--ted-soft);
  overflow: hidden;
}

.ted-featured-image img {
  display: block;
  width: 100%;
}

.ted-entry-content {
  margin-top: 22px;
}

.ted-entry-content h2,
.ted-entry-content h3 {
  line-height: 1.28;
}

.ted-breadcrumbs {
  margin-bottom: 16px;
  color: var(--ted-muted);
  font-size: 0.9rem;
}

.ted-breadcrumbs a {
  color: var(--ted-muted);
}

.ted-info-box {
  border: 1px solid var(--ted-line);
  border-left: 4px solid var(--ted-primary);
  border-radius: var(--ted-radius);
  background: var(--ted-soft);
  padding: 14px 16px;
  margin: 18px 0;
}

.ted-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.ted-info-grid div {
  min-width: 0;
}

.ted-info-grid dt {
  color: var(--ted-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.ted-info-grid dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.ted-ad-slot {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 250px;
  border: 1px dashed #c4cdd8;
  border-radius: var(--ted-radius);
  background: #f8fafc;
  color: #64748b;
  text-align: center;
  font-size: 0.9rem;
  overflow: hidden;
}

.ted-ad-slot.ted-ad-header {
  min-height: 96px;
  margin: 16px auto 0;
}

.ted-ad-slot.ted-ad-incontent {
  min-height: 280px;
  margin: 24px 0;
}

.ted-sidebar {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 16px;
}

.ted-exam-question {
  border: 1px solid var(--ted-line);
  border-radius: var(--ted-radius);
  padding: 16px;
  margin: 16px 0;
}

.ted-exam-question h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.7;
  letter-spacing: 0;
}

.ted-choice-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  line-height: 1.75;
  letter-spacing: 0;
}

.ted-choice-list li {
  overflow-wrap: anywhere;
  word-break: normal;
}

.ted-answer-toggle {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid var(--ted-action);
  border-radius: var(--ted-radius);
  color: var(--ted-action-dark);
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.ted-answer {
  display: none;
  margin-top: 12px;
  border-radius: var(--ted-radius);
  background: #eef8f6;
  padding: 12px;
}

.ted-answer.is-open {
  display: block;
}

.ted-site-footer {
  border-top: 1px solid var(--ted-line);
  background: #f8fafc;
  color: var(--ted-muted);
  padding: 28px 0;
}

.ted-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .ted-header-inner,
  .ted-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .ted-nav {
    flex-wrap: wrap;
  }

  .ted-menu {
    flex-wrap: wrap;
  }

  .ted-hero-inner,
  .ted-layout {
    grid-template-columns: 1fr;
  }

  .ted-grid {
    grid-template-columns: 1fr;
  }

  .ted-sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .ted-container {
    width: min(100% - 24px, 1120px);
  }

  .ted-entry h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.28;
  }

  .ted-search-row,
  .ted-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ted-info-grid {
    grid-template-columns: 1fr;
  }
}
