/*
Theme Name: Thailand Good Travel GeneratePress Child
Description: Local-only GeneratePress child theme for 泰國好好玩. Not approved for public deployment.
Author: Thailand Good Travel project
Template: generatepress
Version: 0.1.1
Text Domain: thatravel
Requires at least: 6.5
Requires PHP: 7.4
*/

:root {
  --th-color-canvas: #f4f7f5;
  --th-color-surface: #fbfcfb;
  --th-color-surface-muted: #e7efeb;
  --th-color-ink: #17332c;
  --th-color-text: #29473f;
  --th-color-muted: #5b716a;
  --th-color-border: #c8d7d1;
  --th-color-accent: #176b5b;
  --th-color-accent-strong: #0f5145;
  --th-color-focus: #0b5fff;
  --th-color-warning-bg: #fff7dd;
  --th-color-warning-ink: #543f00;
  --th-radius-sm: 0.5rem;
  --th-radius-md: 0.875rem;
  --th-radius-lg: 1rem;
  --th-shadow-soft: 0 1rem 2.5rem rgb(23 51 44 / 0.08);
  --th-space-1: 0.25rem;
  --th-space-2: 0.5rem;
  --th-space-3: 0.75rem;
  --th-space-4: 1rem;
  --th-space-5: 1.5rem;
  --th-space-6: 2rem;
  --th-space-7: 3rem;
  --th-space-8: 4rem;
  --th-content: 48rem;
  --th-wide: 70rem;
  --th-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --th-color-canvas: #10201c;
    --th-color-surface: #172b25;
    --th-color-surface-muted: #213a33;
    --th-color-ink: #eef7f3;
    --th-color-text: #d5e5df;
    --th-color-muted: #a9beb6;
    --th-color-border: #3d5a50;
    --th-color-accent: #76cbb7;
    --th-color-accent-strong: #a4dfd0;
    --th-color-focus: #8bb9ff;
    --th-color-warning-bg: #3b3214;
    --th-color-warning-ink: #ffefb0;
    --th-shadow-soft: 0 1rem 2.5rem rgb(2 10 7 / 0.25);
  }
}

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--th-color-canvas);
  color: var(--th-color-text);
  font-family: var(--th-font-sans);
  font-size: 1.0625rem;
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}

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

.entry-content {
  overflow-wrap: anywhere;
}

.entry-content > :where(p, ul, ol, h2, h3, h4, blockquote, .th-pattern) {
  max-width: var(--th-content);
  margin-inline: auto;
}

.entry-content > :where(.alignwide, .th-wide) {
  max-width: var(--th-wide);
  margin-inline: auto;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
  color: var(--th-color-ink);
  font-weight: 760;
  letter-spacing: -0.025em;
}

.entry-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.18;
}

.entry-content h2 {
  margin-block: var(--th-space-8) var(--th-space-4);
  font-size: clamp(1.65rem, 3.5vw, 2.125rem);
  line-height: 1.28;
}

.entry-content h3 {
  margin-block: var(--th-space-6) var(--th-space-3);
  font-size: clamp(1.3rem, 2.5vw, 1.55rem);
  line-height: 1.35;
}

.entry-content a {
  color: var(--th-color-accent-strong);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--th-color-focus);
  outline-offset: 3px;
  border-radius: var(--th-radius-sm);
}

.th-pattern {
  min-width: 0;
  margin-block: var(--th-space-6);
}

.th-article-header {
  padding-block: var(--th-space-6) var(--th-space-5);
  border-bottom: 1px solid var(--th-color-border);
}

.th-breadcrumbs {
  margin: 0 0 var(--th-space-4);
  color: var(--th-color-muted);
  font-size: 0.875rem;
}

.th-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.th-article-deck {
  max-width: 42rem;
  margin-block: var(--th-space-4);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--th-color-text);
}

.th-trust-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--th-space-2) var(--th-space-5);
  margin: 0;
  padding: 0;
  color: var(--th-color-muted);
  font-size: 0.875rem;
  list-style: none;
}

.th-disclosure,
.th-evidence-box,
.th-quick-answer,
.th-key-takeaways,
.th-decision-card,
.th-area-card,
.th-itinerary-day,
.th-transport-card,
.th-hotel-card,
.th-activity-card,
.th-product-card,
.th-primary-cta,
.th-alternatives,
.th-author-box,
.th-next-step {
  border: 1px solid var(--th-color-border);
  border-radius: var(--th-radius-md);
  background: var(--th-color-surface);
}

.th-disclosure {
  padding: var(--th-space-4) var(--th-space-5);
  font-size: 0.9375rem;
}

.th-disclosure p,
.th-evidence-box p,
.th-author-box p {
  margin-block: 0;
}

.th-quick-answer {
  padding: var(--th-space-6);
  border-left: 0.4rem solid var(--th-color-accent);
  box-shadow: var(--th-shadow-soft);
}

.th-pattern-label {
  margin: 0 0 var(--th-space-2);
  color: var(--th-color-accent-strong);
  font-size: 0.8125rem;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.th-quick-answer > :last-child,
.th-key-takeaways > :last-child,
.th-decision-card > :last-child,
.th-area-card > :last-child,
.th-itinerary-day > :last-child,
.th-transport-card > :last-child,
.th-next-step > :last-child {
  margin-bottom: 0;
}

.th-key-takeaways {
  padding: var(--th-space-5) var(--th-space-6);
  background: var(--th-color-surface-muted);
}

.th-key-takeaways ul {
  margin-bottom: 0;
}

.th-evidence-box {
  display: grid;
  grid-template-columns: minmax(8rem, 0.34fr) minmax(0, 1fr);
  gap: var(--th-space-5);
  padding: var(--th-space-5);
}

.th-evidence-status {
  color: var(--th-color-accent-strong);
  font-weight: 760;
}

.th-update-log {
  padding-top: var(--th-space-4);
  border-top: 2px solid var(--th-color-border);
}

.th-update-log dl {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: var(--th-space-3) var(--th-space-5);
}

.th-update-log dt {
  color: var(--th-color-muted);
  font-weight: 700;
}

.th-update-log dd {
  margin: 0;
}

.th-author-box {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: var(--th-space-5);
  padding: var(--th-space-5);
}

.th-author-avatar,
.th-media-placeholder {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--th-color-border);
  border-radius: var(--th-radius-md);
  background: var(--th-color-surface-muted);
  color: var(--th-color-muted);
}

figure.th-media-placeholder {
  margin: 0;
}

.th-author-avatar {
  width: 5rem;
  aspect-ratio: 1;
  font-size: 0.75rem;
  text-align: center;
}

.th-media-placeholder {
  min-height: 14rem;
  padding: var(--th-space-5);
  text-align: center;
}

.th-next-step {
  padding: var(--th-space-6);
}

.th-next-step nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--th-space-3);
}

.th-next-step a,
.th-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 2px solid var(--th-color-accent);
  border-radius: var(--th-radius-sm);
  color: var(--th-color-accent-strong);
  font-weight: 740;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.th-next-step a:hover,
.th-button:hover {
  background: var(--th-color-accent);
  color: var(--th-color-surface);
}

.th-next-step a:active,
.th-button:active {
  transform: translateY(1px);
}

.th-area-card,
.th-decision-card,
.th-itinerary-day,
.th-transport-card,
.th-hotel-card,
.th-activity-card,
.th-product-card,
.th-primary-cta,
.th-alternatives {
  padding: var(--th-space-6);
}

.th-commerce-card {
  display: grid;
  grid-template-columns: minmax(12rem, 0.42fr) minmax(0, 1fr);
  gap: var(--th-space-6);
}

.th-commerce-card > * {
  min-width: 0;
}

.th-commerce-card .th-card-media {
  min-height: 13rem;
  aspect-ratio: 4 / 3;
}

.th-card-status {
  display: inline-block;
  margin-bottom: var(--th-space-3);
  color: var(--th-color-accent-strong);
  font-size: 0.8125rem;
  font-weight: 760;
}

.th-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--th-space-3);
  margin-top: var(--th-space-5);
}

.th-card-actions .th-button {
  width: auto;
}

.th-primary-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--th-space-5);
  border-color: var(--th-color-accent);
  background: var(--th-color-surface-muted);
}

.th-primary-cta .th-button {
  min-width: 10rem;
  background: var(--th-color-accent);
  color: var(--th-color-surface);
}

.th-primary-cta .th-button:hover {
  background: var(--th-color-accent-strong);
}

.th-alternatives-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--th-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.th-alternatives-list li {
  padding: var(--th-space-4);
  border-top: 2px solid var(--th-color-border);
}

.th-alternatives-list strong,
.th-alternatives-list span {
  display: block;
}

.th-alternatives-list span {
  margin-top: var(--th-space-2);
  color: var(--th-color-muted);
}

.th-area-card {
  display: grid;
  grid-template-columns: minmax(10rem, 0.38fr) minmax(0, 1fr);
  gap: var(--th-space-6);
}

.th-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--th-space-3);
  margin: 0;
}

.th-facts > div {
  padding-top: var(--th-space-3);
  border-top: 1px solid var(--th-color-border);
}

.th-facts dt {
  color: var(--th-color-muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.th-facts dd {
  margin: 0;
  color: var(--th-color-ink);
  font-weight: 650;
}

.th-decision-card {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: var(--th-space-6);
}

.th-decision-card .th-recommendation {
  padding-left: var(--th-space-5);
  border-left: 3px solid var(--th-color-accent);
}

.th-itinerary-day header,
.th-transport-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--th-space-4);
  margin-bottom: var(--th-space-4);
}

.th-itinerary-day ol {
  margin-bottom: 0;
  padding-left: 1.3rem;
}

.th-itinerary-day li + li {
  margin-top: var(--th-space-3);
}

.th-transport-card .th-caveat {
  padding: var(--th-space-3) var(--th-space-4);
  border-radius: var(--th-radius-sm);
  background: var(--th-color-warning-bg);
  color: var(--th-color-warning-ink);
}

.th-table-region {
  margin-block: var(--th-space-6);
}

.th-table-hint {
  display: none;
  color: var(--th-color-muted);
  font-size: 0.875rem;
}

.th-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--th-color-border);
  border-radius: var(--th-radius-md);
  background: var(--th-color-surface);
  -webkit-overflow-scrolling: touch;
}

.th-compare-table {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.th-compare-table th,
.th-compare-table td {
  padding: var(--th-space-3) var(--th-space-4);
  border-bottom: 1px solid var(--th-color-border);
  text-align: left;
  vertical-align: top;
}

.th-compare-table th {
  color: var(--th-color-ink);
  background: var(--th-color-surface-muted);
  font-weight: 760;
}

.th-compare-table tr:last-child td {
  border-bottom: 0;
}

.th-legal-todo {
  padding: var(--th-space-5);
  border: 2px dashed var(--th-color-border);
  border-radius: var(--th-radius-md);
  background: var(--th-color-surface);
}

@media (max-width: 767px) {
  body {
    font-size: 1.0625rem;
  }

  .entry-content {
    padding-inline: var(--th-space-4);
  }

  .entry-content h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.25rem);
  }

  .entry-content h2 {
    margin-top: var(--th-space-7);
    font-size: clamp(1.55rem, 7vw, 1.8rem);
  }

  .th-evidence-box,
  .th-author-box,
  .th-area-card,
  .th-decision-card {
    grid-template-columns: 1fr;
  }

  .th-commerce-card,
  .th-primary-cta {
    grid-template-columns: 1fr;
  }

  .th-quick-answer,
  .th-key-takeaways,
  .th-area-card,
  .th-decision-card,
  .th-itinerary-day,
  .th-transport-card,
  .th-hotel-card,
  .th-activity-card,
  .th-product-card,
  .th-primary-cta,
  .th-alternatives,
  .th-author-box,
  .th-next-step {
    padding: var(--th-space-5);
  }

  .th-decision-card .th-recommendation {
    padding-top: var(--th-space-4);
    padding-left: 0;
    border-top: 3px solid var(--th-color-accent);
    border-left: 0;
  }

  .th-facts,
  .th-next-step nav,
  .th-alternatives-list {
    grid-template-columns: 1fr;
  }

  .th-card-actions,
  .th-card-actions .th-button,
  .th-primary-cta .th-button {
    width: 100%;
  }

  .th-itinerary-day header,
  .th-transport-card header {
    display: block;
  }

  .th-table-hint {
    display: block;
  }

  .th-table-scroll {
    scroll-snap-type: x proximity;
  }

  .th-compare-table th,
  .th-compare-table td {
    min-width: 9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .th-next-step,
  .th-disclosure {
    break-inside: avoid;
  }

  .th-table-scroll {
    overflow: visible;
  }
}
