/* ============================================================
   ThaiLawOnline - Annotated Land Code of Thailand
   Stylesheet v1.0 - 2026
   Namespaced under .tlc-land-code for WordPress embedding
   ============================================================ */

/* --- CSS Variables --- */
.tlc-land-code {
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --secondary: #c8963e;
  --secondary-light: #e8b85e;
  --accent: #d4af37;
  --bg: #f8f6f0;
  --bg-alt: #fff;
  --bg-section: #f0ede4;
  --text: #2c2c2c;
  --text-light: #555;
  --text-muted: #888;
  --border: #d4cfc5;
  --border-light: #e8e4da;
  --thai-gold: #d4af37;
  --thai-red: #a51931;
  --thai-blue: #002868;
  --success: #2e7d32;
  --warning: #f57f17;
  --info: #1565c0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font-en: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-th: 'Sarabun', 'Noto Sans Thai', 'TH Sarabun New', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  --max-width: 1200px;
  --content-width: 900px;
}

/* --- Reset & Base --- */
.tlc-land-code, .tlc-land-code *, .tlc-land-code *::before, .tlc-land-code *::after { box-sizing: border-box; margin: 0; padding: 0; }

.tlc-land-code {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.tlc-land-code {
  font-family: var(--font-en);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
}

.tlc-land-code .thai, .tlc-land-code .text-th, .tlc-land-code [lang="th"] {
  font-family: var(--font-th);
  line-height: 1.9;
}

.tlc-land-code a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s;
}
.tlc-land-code a:hover { color: var(--secondary); text-decoration: underline; }

.tlc-land-code img { max-width: 100%; height: auto; }

/* --- Skip Navigation (Accessibility) --- */
.tlc-land-code .skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 14px;
}
.tlc-land-code .skip-nav:focus { top: 0; }

/* --- Header --- */
.tlc-land-code .site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--thai-blue) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.tlc-land-code .header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

.tlc-land-code .site-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tlc-land-code .site-logo:hover { color: var(--secondary-light); text-decoration: none; }
.tlc-land-code .site-logo .flag { font-size: 1.6rem; }

.tlc-land-code .main-nav { display: flex; gap: 4px; align-items: center; }
.tlc-land-code .main-nav a {
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.tlc-land-code .main-nav a:hover, .tlc-land-code .main-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-decoration: none;
}

/* Mobile nav toggle */
.tlc-land-code .nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 8px; }

/* --- Hero / Page Banner --- */
.tlc-land-code .hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d2137 60%, var(--thai-blue) 100%);
  color: #fff;
  text-align: center;
  padding: 60px 24px 50px;
  position: relative;
  overflow: hidden;
}
.tlc-land-code .hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.tlc-land-code .hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.tlc-land-code .hero h1,
.tlc-land-code .hero .hero-title,
.tlc-land-code .hero h1.hero-title,
body .tlc-land-code .hero h1 {
  font-size: 2.8rem !important;
  font-weight: 800 !important;
  font-style: normal !important;
  font-family: var(--font-en) !important;
  margin-bottom: 10px !important;
  letter-spacing: -0.5px !important;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 40px rgba(255,255,255,0.1) !important;
  line-height: 1.2 !important;
  text-transform: none !important;
  -webkit-text-fill-color: #ffffff !important;
}
.tlc-land-code .hero .hero-title-thai,
.tlc-land-code .hero p.hero-title-thai,
body .tlc-land-code .hero .hero-title-thai {
  font-family: var(--font-th) !important;
  font-size: 1.35rem !important;
  font-weight: 400 !important;
  font-style: normal !important;
  color: rgba(255,255,255,0.8) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.8) !important;
  margin-bottom: 14px !important;
  letter-spacing: 0.5px !important;
}
.tlc-land-code .hero .subtitle,
.tlc-land-code .hero .hero-subtitle,
.tlc-land-code .hero p.hero-subtitle,
body .tlc-land-code .hero .hero-subtitle {
  font-size: 1.1rem !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-family: var(--font-en) !important;
  color: rgba(255,255,255,0.9) !important;
  -webkit-text-fill-color: rgba(255,255,255,0.9) !important;
  margin-bottom: 20px !important;
  line-height: 1.7 !important;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.tlc-land-code .hero .meta {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 24px;
}
.tlc-land-code .hero .badge {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Search Bar --- */
.tlc-land-code .search-container {
  max-width: 600px;
  margin: 24px auto 0;
  position: relative;
}
.tlc-land-code .search-container input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s;
}
.tlc-land-code .search-container input::placeholder { color: rgba(255,255,255,0.5); }
.tlc-land-code .search-container input:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--secondary);
}
.tlc-land-code .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.6;
}

/* --- Breadcrumb --- */
.tlc-land-code .breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tlc-land-code .breadcrumb a { color: var(--text-light); }
.tlc-land-code .breadcrumb span { margin: 0 6px; }

/* --- Main Content --- */
.tlc-land-code .main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* --- Chapter Grid (Hub Page) --- */
.tlc-land-code .chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.tlc-land-code .chapter-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.tlc-land-code .chapter-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
  transform: translateY(-2px);
}
.tlc-land-code .chapter-card .chapter-num {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  text-align: center;
  line-height: 36px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.tlc-land-code .chapter-card h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--primary);
}
.tlc-land-code .chapter-card .thai-title {
  font-family: var(--font-th);
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 10px;
}
.tlc-land-code .chapter-card .sections {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.tlc-land-code .chapter-card .desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}
.tlc-land-code .chapter-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.9rem;
}
.tlc-land-code .chapter-card .card-link:hover { color: var(--primary); }

.tlc-land-code .chapter-card.repealed {
  opacity: 0.6;
  background: var(--bg-section);
}
.tlc-land-code .chapter-card.repealed .chapter-num { background: var(--text-muted); }

/* --- Sidebar + Article Layout --- */
.tlc-land-code .content-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: start;
}

/* --- Sidebar TOC --- */
.tlc-land-code .sidebar {
  position: sticky;
  top: 80px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.tlc-land-code .sidebar h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}
.tlc-land-code .sidebar-nav a {
  display: block;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-light);
  border-radius: 4px;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  transition: all 0.2s;
}
.tlc-land-code .sidebar-nav a:hover {
  background: var(--bg-section);
  color: var(--primary);
  border-left-color: var(--secondary);
  text-decoration: none;
}
.tlc-land-code .sidebar-nav a.active {
  background: rgba(26,58,92,0.08);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.tlc-land-code .sidebar-nav .section-group { margin-bottom: 8px; }
.tlc-land-code .sidebar-nav .section-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  letter-spacing: 0.5px;
}

/* --- Article Content --- */
.tlc-land-code .article {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.tlc-land-code .article h2 {
  font-size: 1.6rem;
  color: var(--primary);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
}
.tlc-land-code .article h2:first-child { margin-top: 0; }

.tlc-land-code .article h3 {
  font-size: 1.2rem;
  color: var(--primary);
  margin: 30px 0 12px;
}

/* --- Section Block (Individual Law Section) --- */
.tlc-land-code .section-block {
  margin: 28px 0;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  position: relative;
}
.tlc-land-code .section-block:target {
  border-left-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(200,150,62,0.15);
  animation: highlight-pulse 2s ease-out;
}
@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0 6px rgba(200,150,62,0.3); }
  100% { box-shadow: 0 0 0 3px rgba(200,150,62,0.15); }
}

.tlc-land-code .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tlc-land-code .section-number {
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.tlc-land-code .section-title-en {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
}
.tlc-land-code .section-title-th {
  font-family: var(--font-th);
  font-size: 0.95rem;
  color: var(--text-light);
}

.tlc-land-code .section-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tlc-land-code .section-status.amended { background: #fff3e0; color: #e65100; }
.tlc-land-code .section-status.repealed { background: #ffebee; color: #c62828; }
.tlc-land-code .section-status.added { background: #e8f5e9; color: #2e7d32; }
.tlc-land-code .section-status.original { background: #e3f2fd; color: #1565c0; }

/* Bilingual text display */
.tlc-land-code .bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 12px 0;
}
.tlc-land-code .text-en, .tlc-land-code .text-th {
  padding: 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.8;
}
.tlc-land-code .text-en {
  background: rgba(26,58,92,0.03);
  border: 1px solid rgba(26,58,92,0.08);
}
.tlc-land-code .text-th {
  background: rgba(212,175,55,0.03);
  border: 1px solid rgba(212,175,55,0.08);
  font-family: var(--font-th);
  font-size: 1rem;
}
.tlc-land-code .lang-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
}
.tlc-land-code .lang-label.en { background: var(--primary); color: #fff; }
.tlc-land-code .lang-label.th { background: var(--thai-gold); color: #fff; }

/* --- Annotation / Commentary Box --- */
.tlc-land-code .annotation {
  margin: 16px 0;
  padding: 16px 20px;
  background: #fffde7;
  border: 1px solid #fff9c4;
  border-radius: var(--radius);
  border-left: 4px solid var(--secondary);
  font-size: 0.9rem;
}
.tlc-land-code .annotation-title {
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Supreme Court Decision Box --- */
.tlc-land-code .court-decision {
  margin: 16px 0;
  padding: 16px 20px;
  background: #f3e5f5;
  border: 1px solid #e1bee7;
  border-radius: var(--radius);
  border-left: 4px solid #7b1fa2;
  font-size: 0.9rem;
}
.tlc-land-code .court-decision .case-number {
  font-weight: 700;
  color: #7b1fa2;
  font-size: 0.85rem;
}
.tlc-land-code .court-decision .case-summary { margin-top: 8px; }
.tlc-land-code .court-decision .case-summary-th {
  font-family: var(--font-th);
  color: var(--text-light);
  margin-top: 6px;
  font-size: 0.9rem;
}

/* --- Amendment Note --- */
.tlc-land-code .amendment-note {
  margin: 12px 0;
  padding: 10px 16px;
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #e65100;
}
.tlc-land-code .amendment-note strong { color: #bf360c; }

/* --- Cross-reference Links --- */
.tlc-land-code .cross-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: rgba(26,58,92,0.06);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--primary-light);
  font-weight: 500;
  transition: all 0.2s;
}
.tlc-land-code .cross-ref:hover {
  background: rgba(26,58,92,0.12);
  text-decoration: none;
}

/* --- FAQ Section --- */
.tlc-land-code .faq-list { margin: 20px 0; }
.tlc-land-code .faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}
.tlc-land-code .faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 50px 18px 20px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  position: relative;
  font-family: var(--font-en);
  transition: background 0.2s;
}
.tlc-land-code .faq-question:hover { background: var(--bg-section); }
.tlc-land-code .faq-question::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: transform 0.3s;
}
.tlc-land-code .faq-item.open .faq-question::after {
  content: '\2212';
}
.tlc-land-code .faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
}
.tlc-land-code .faq-item.open .faq-answer { display: block; }

/* --- Info Cards / Quick Facts --- */
.tlc-land-code .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.tlc-land-code .info-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.tlc-land-code .info-card .icon { font-size: 2rem; margin-bottom: 8px; }
.tlc-land-code .info-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tlc-land-code .info-card .value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

/* --- Amendment History Section & Table --- */
.tlc-land-code .amendments-section {
  padding: 48px 24px;
  background: var(--bg);
}
.tlc-land-code .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tlc-land-code .amendments-table,
.tlc-land-code .amendment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
}
.tlc-land-code .amendments-table thead th,
.tlc-land-code .amendment-table th {
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tlc-land-code .amendments-table td,
.tlc-land-code .amendment-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  line-height: 1.5;
}
.tlc-land-code .amendments-table td:first-child,
.tlc-land-code .amendment-table td:first-child {
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  white-space: nowrap;
  width: 50px;
}
.tlc-land-code .amendments-table td:nth-child(2),
.tlc-land-code .amendments-table td:nth-child(3),
.tlc-land-code .amendment-table td:nth-child(2),
.tlc-land-code .amendment-table td:nth-child(3) {
  white-space: nowrap;
  text-align: center;
  width: 100px;
  font-weight: 600;
}
.tlc-land-code .amendments-table td:last-child,
.tlc-land-code .amendment-table td:last-child {
  color: var(--text-light);
  font-size: 0.88rem;
}
.tlc-land-code .amendments-table tr:nth-child(even),
.tlc-land-code .amendment-table tr:nth-child(even) {
  background: var(--bg-section);
}
.tlc-land-code .amendments-table tr:hover,
.tlc-land-code .amendment-table tr:hover {
  background: rgba(200,150,62,0.08);
}
.tlc-land-code .amendments-table tbody tr:last-child td,
.tlc-land-code .amendment-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Footer --- */
.tlc-land-code .site-footer {
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  padding: 40px 24px;
  margin-top: 60px;
}
.tlc-land-code .footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.tlc-land-code .footer-col h5 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.tlc-land-code .footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  padding: 4px 0;
  font-size: 0.85rem;
}
.tlc-land-code .footer-col a:hover { color: var(--secondary-light); }
.tlc-land-code .footer-bottom {
  max-width: var(--max-width);
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
}

/* --- Back to Top --- */
.tlc-land-code .back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tlc-land-code .back-to-top.visible { opacity: 1; visibility: visible; }
.tlc-land-code .back-to-top:hover { background: var(--secondary); }

/* --- Print Styles --- */
@media print {
  .tlc-land-code .site-header, .tlc-land-code .site-footer, .tlc-land-code .back-to-top, .tlc-land-code .sidebar, .tlc-land-code .search-container, .tlc-land-code .main-nav { display: none !important; }
  .tlc-land-code .content-layout { grid-template-columns: 1fr !important; }
  .tlc-land-code .article { border: none; padding: 0; }
  .tlc-land-code .section-block { break-inside: avoid; }
  .tlc-land-code { font-size: 11pt; }
}

/* --- Language Toggle --- */
.tlc-land-code .lang-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 8px;
  position: sticky;
  top: 60px;
  z-index: 50;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-light);
}
body.admin-bar .tlc-land-code .lang-toggle-bar {
  top: 92px;
}
.tlc-land-code .lang-toggle-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.tlc-land-code .lang-toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.tlc-land-code .lang-toggle-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: var(--bg-alt);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s ease;
  border-right: 1px solid var(--border-light);
  line-height: 1;
}
.tlc-land-code .lang-toggle-btn:last-child {
  border-right: none;
}
.tlc-land-code .lang-toggle-btn:hover {
  background: var(--bg-section);
  color: var(--text);
}
.tlc-land-code .lang-toggle-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ================================================================
   LANGUAGE TOGGLE VISIBILITY
   The body has class="tlc-land-code". JS adds lang-en / lang-th / lang-both.
   Combined selector: body.tlc-land-code.lang-en
   ================================================================ */

/* --- English only: hide ALL Thai content --- */
body.tlc-land-code.lang-en .text-th,
body.tlc-land-code.lang-en .section-title-th,
body.tlc-land-code.lang-en .lang-label.th,
body.tlc-land-code.lang-en .case-summary-th,
body.tlc-land-code.lang-en .chapter-card-title-thai,
body.tlc-land-code.lang-en .chapter-card-description-thai,
body.tlc-land-code.lang-en .hero-title-thai,
body.tlc-land-code.lang-en [lang="th"] {
  display: none !important;
}
body.tlc-land-code.lang-en .bilingual {
  grid-template-columns: 1fr !important;
}

/* --- Thai only: hide ALL English content --- */
body.tlc-land-code.lang-th .text-en,
body.tlc-land-code.lang-th .section-title-en,
body.tlc-land-code.lang-th .lang-label.en,
body.tlc-land-code.lang-th .chapter-card-description,
body.tlc-land-code.lang-th .hero-subtitle {
  display: none !important;
}
body.tlc-land-code.lang-th .bilingual {
  grid-template-columns: 1fr !important;
}

/* --- Both: ensure everything visible --- */
body.tlc-land-code.lang-both .text-en,
body.tlc-land-code.lang-both .text-th,
body.tlc-land-code.lang-both .section-title-en,
body.tlc-land-code.lang-both .section-title-th,
body.tlc-land-code.lang-both .chapter-card-title-thai,
body.tlc-land-code.lang-both .chapter-card-description-thai,
body.tlc-land-code.lang-both .chapter-card-description,
body.tlc-land-code.lang-both [lang="th"] {
  display: block !important;
}
body.tlc-land-code.lang-both .bilingual {
  grid-template-columns: 1fr 1fr !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .tlc-land-code .content-layout {
    grid-template-columns: 1fr;
  }
  .tlc-land-code .sidebar {
    position: static;
    max-height: none;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .tlc-land-code .hero h1,
  body .tlc-land-code .hero h1.hero-title { font-size: 1.8rem !important; }
  .tlc-land-code .hero .subtitle,
  .tlc-land-code .hero .hero-subtitle { font-size: 1rem !important; }
  .tlc-land-code .hero .hero-title-thai { font-size: 1.1rem !important; }
  .tlc-land-code .chapter-grid { grid-template-columns: 1fr; }
  .tlc-land-code .bilingual { grid-template-columns: 1fr; }
  .tlc-land-code .article { padding: 24px 16px; }
  .tlc-land-code .header-inner { flex-wrap: wrap; gap: 8px; }
  .tlc-land-code .main-nav { display: none; flex-direction: column; width: 100%; }
  .tlc-land-code .main-nav.open { display: flex; }
  .tlc-land-code .nav-toggle { display: block; }
  .tlc-land-code .info-grid { grid-template-columns: 1fr 1fr; }
  .tlc-land-code .footer-inner { grid-template-columns: 1fr; }
  .tlc-land-code .resources-grid { grid-template-columns: 1fr; }
  .tlc-land-code .amendments-table td,
  .tlc-land-code .amendments-table th { padding: 10px 12px; font-size: 0.82rem; }
  .tlc-land-code .lang-toggle-bar { justify-content: center; }
}

@media (max-width: 480px) {
  .tlc-land-code .info-grid { grid-template-columns: 1fr; }
  .tlc-land-code .hero { padding: 40px 16px 30px; }
  .tlc-land-code .hero h1,
  body .tlc-land-code .hero h1.hero-title { font-size: 1.5rem !important; }
  .tlc-land-code .hero .hero-title-thai { font-size: 1rem !important; }
  .tlc-land-code .lang-toggle-btn { padding: 6px 10px; font-size: 0.75rem; }
}

/* --- Utility --- */
.tlc-land-code .text-center { text-align: center; }
.tlc-land-code .mt-1 { margin-top: 8px; }
.tlc-land-code .mt-2 { margin-top: 16px; }
.tlc-land-code .mt-3 { margin-top: 24px; }
.tlc-land-code .mt-4 { margin-top: 32px; }
.tlc-land-code .mb-1 { margin-bottom: 8px; }
.tlc-land-code .mb-2 { margin-bottom: 16px; }
.tlc-land-code .mb-3 { margin-bottom: 24px; }
.tlc-land-code .mb-4 { margin-bottom: 32px; }
.tlc-land-code .sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Related Resources Section --- */
.tlc-land-code .resources-section {
  padding: 48px 24px;
  background: var(--bg);
}
.tlc-land-code .resources-section .section-title {
  margin-bottom: 8px;
}
.tlc-land-code .resources-section .section-description {
  margin-bottom: 32px;
}
.tlc-land-code .resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.tlc-land-code .resource-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.tlc-land-code .resource-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
}
.tlc-land-code .resource-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 1.2rem;
}
.tlc-land-code .resource-card-icon.icon-faq { background: #e8f5e9; color: var(--success); }
.tlc-land-code .resource-card-icon.icon-court { background: #e3f2fd; color: var(--info); }
.tlc-land-code .resource-card-icon.icon-property { background: #fff3e0; color: #e65100; }
.tlc-land-code .resource-card-icon.icon-foreign { background: #fce4ec; color: var(--thai-red); }
.tlc-land-code .resource-card-icon.icon-title { background: #f3e5f5; color: #7b1fa2; }
.tlc-land-code .resource-card-icon.icon-lease { background: #e0f2f1; color: #00695c; }
.tlc-land-code .resource-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.tlc-land-code .resource-card-description {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 14px;
}
.tlc-land-code .resource-card-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.tlc-land-code .resource-card-links li {
  font-size: 0.85rem;
}
.tlc-land-code .resource-card-links a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.tlc-land-code .resource-card-links a:hover {
  border-bottom-color: var(--primary-light);
  color: var(--primary);
}
.tlc-land-code .resource-card-links a::before {
  content: '→ ';
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .tlc-land-code .resources-grid { grid-template-columns: 1fr; }
}

/* --- Self-hosted Sarabun Font (Thai subset) --- */
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/sarabun-300-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/sarabun-400-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/sarabun-600-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/sarabun-700-thai.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
/* --- Self-hosted Sarabun Font (Latin subset) --- */
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/sarabun-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/sarabun-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/sarabun-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/sarabun-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- WordPress Admin Bar Compatibility --- */
.tlc-land-code .site-header {
  top: 0;
}
body.admin-bar .tlc-land-code .site-header {
  top: 32px;
}
body.admin-bar .tlc-land-code .sidebar {
  top: 112px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .tlc-land-code .site-header {
    top: 46px;
  }
  body.admin-bar .tlc-land-code .sidebar {
    top: 126px;
  }
}

/* --- Search Section --- */
.tlc-land-code .search-section {
  padding: 24px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-light);
}
.tlc-land-code .search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}
.tlc-land-code .search-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tlc-land-code .search-input-group {
  display: flex;
  position: relative;
}
.tlc-land-code .search-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  transition: border-color 0.2s ease;
  outline: none;
  font-family: var(--font-en);
}
.tlc-land-code .search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42,90,140,0.1);
}
.tlc-land-code .search-btn {
  padding: 12px 16px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}
.tlc-land-code .search-btn:hover {
  background: var(--primary-light);
}

/* --- Search Results --- */
.tlc-land-code #search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
}
.tlc-land-code .search-result-item {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  transition: background 0.15s;
}
.tlc-land-code .search-result-item:hover {
  background: #f5f3ed;
  text-decoration: none;
}
.tlc-land-code .search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a3a5c;
}
.tlc-land-code .search-result-desc {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}
.tlc-land-code .search-no-results {
  padding: 16px 20px;
  color: #999;
  text-align: center;
  font-size: 0.9rem;
}

/* --- Selective Theme Isolation (prevent theme bleed without destroying own styles) --- */
.tlc-land-code {
  font-family: var(--font-en);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: block;
  text-align: left;
  letter-spacing: normal;
  word-spacing: normal;
}
.tlc-land-code h1, .tlc-land-code h2, .tlc-land-code h3,
.tlc-land-code h4, .tlc-land-code h5, .tlc-land-code h6 {
  font-family: var(--font-en);
  color: var(--primary);
  font-style: normal;
  text-transform: none;
  letter-spacing: normal;
}
.tlc-land-code p {
  font-family: inherit;
  font-style: normal;
  color: inherit;
}
.tlc-land-code ul, .tlc-land-code ol {
  list-style: disc;
  padding-left: 1.5em;
}

/* --- Chapter Card Styles --- */
.tlc-land-code .chapter-card {
  display: block;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--text);
}
.tlc-land-code .chapter-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
  transform: translateY(-2px);
  text-decoration: none;
}
.tlc-land-code .chapter-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tlc-land-code .chapter-number {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}
.tlc-land-code .chapter-sections {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tlc-land-code .chapter-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 4px;
}
.tlc-land-code .chapter-card-title-thai {
  font-family: var(--font-th);
  font-size: 1rem;
  color: var(--primary-light);
  font-weight: 600;
  margin: 0 0 8px;
}
.tlc-land-code .chapter-card-description {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0 0 4px;
}
.tlc-land-code .chapter-card-description-thai {
  font-family: var(--font-th);
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.8;
  margin: 0;
}
.tlc-land-code .chapter-card-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  background: rgba(200,150,62,0.12);
  color: var(--secondary);
}
.tlc-land-code .chapter-card-tag-repealed {
  background: rgba(198,40,40,0.08);
  color: #c62828;
}
.tlc-land-code .chapter-card-repealed {
  opacity: 0.7;
  background: var(--bg-section);
}
.tlc-land-code .chapter-card-highlight {
  border-left: 4px solid var(--secondary);
}

/* --- Info Card Number --- */
.tlc-land-code .info-card-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.tlc-land-code .info-card-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}
.tlc-land-code .info-card-detail {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* --- Section Title / Description --- */
.tlc-land-code .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.tlc-land-code .section-description {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* --- Container --- */
.tlc-land-code .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Info Section --- */
.tlc-land-code .info-section {
  padding: 40px 24px;
  background: var(--bg);
}

/* --- Chapters Section --- */
.tlc-land-code .chapters-section {
  padding: 48px 24px;
  background: var(--bg-alt);
}

/* --- Footer Column Headings --- */
.tlc-land-code .footer-col h3 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.tlc-land-code .footer-col p {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  line-height: 1.7;
}
.tlc-land-code .footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tlc-land-code .footer-col li {
  margin-bottom: 6px;
}
.tlc-land-code .footer-col a {
  display: inline;
  color: rgba(255,255,255,0.6);
  padding: 0;
  font-size: 0.85rem;
}
.tlc-land-code .footer-col a:hover {
  color: var(--secondary-light);
  text-decoration: none;
}
.tlc-land-code .footer-bottom p {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

/* --- Breadcrumb List --- */
.tlc-land-code .breadcrumb-list {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  align-items: center;
}
.tlc-land-code .breadcrumb-item::before {
  content: '›';
  margin-right: 8px;
  color: var(--text-muted);
}
.tlc-land-code .breadcrumb-item:first-child::before {
  content: none;
}

/* --- Hero Badges --- */
.tlc-land-code .hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}
