/*
Theme Name: Thay Chot So
Theme URI: https://thaychotso.com
Author: thaychotso.com
Author URI: https://thaychotso.com
Description: WordPress theme for lottery result, data analysis, forecast notes, and editorial content.
Version: 1.0.4
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tcs
*/

:root {
  --tcs-bg: #f7f9fb;
  --tcs-surface: #ffffff;
  --tcs-ink: #17212b;
  --tcs-muted: #5d6a76;
  --tcs-soft: #e5edf4;
  --tcs-line: #d7e2ea;
  --tcs-primary: #0d6b66;
  --tcs-primary-strong: #084b48;
  --tcs-accent: #d93636;
  --tcs-accent-2: #f0a51a;
  --tcs-blue: #1e5aa7;
  --tcs-radius: 8px;
  --tcs-shadow: 0 16px 44px rgba(20, 35, 48, 0.12);
  --tcs-container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--tcs-bg);
  color: var(--tcs-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--tcs-primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--tcs-accent);
}

button,
input,
select,
textarea {
  font: inherit;
}

.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;
}

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

.tcs-topbar {
  background: #0f1c26;
  color: #eaf3f6;
  font-size: 14px;
}

.tcs-topbar__inner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tcs-topbar a {
  color: #d4f3ed;
}

.tcs-site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--tcs-line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.tcs-brand-row {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.tcs-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--tcs-ink);
  min-width: 0;
}

.tcs-brand img {
  width: 218px;
  max-height: 62px;
  object-fit: contain;
}

.tcs-brand__text {
  display: grid;
  gap: 2px;
}

.tcs-brand__name {
  font-size: 23px;
  font-weight: 800;
  color: var(--tcs-primary-strong);
  line-height: 1.1;
}

.tcs-brand__tagline {
  color: var(--tcs-muted);
  font-size: 14px;
}

.tcs-nav-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tcs-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--tcs-line);
  background: var(--tcs-surface);
  border-radius: var(--tcs-radius);
  color: var(--tcs-ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tcs-menu-toggle span,
.tcs-menu-toggle span::before,
.tcs-menu-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  content: "";
}

.tcs-menu-toggle span {
  position: relative;
}

.tcs-menu-toggle span::before,
.tcs-menu-toggle span::after {
  position: absolute;
  left: 0;
}

.tcs-menu-toggle span::before {
  top: -7px;
}

.tcs-menu-toggle span::after {
  top: 7px;
}

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

.tcs-primary-menu .menu-item {
  position: relative;
}

.tcs-primary-menu a {
  display: block;
  color: var(--tcs-ink);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 13px;
  border-radius: var(--tcs-radius);
}

.tcs-primary-menu a:hover,
.tcs-primary-menu .current-menu-item > a,
.tcs-primary-menu .current-menu-ancestor > a {
  background: #e8f4f1;
  color: var(--tcs-primary-strong);
}

.tcs-primary-menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 230px;
  background: var(--tcs-surface);
  border: 1px solid var(--tcs-line);
  box-shadow: var(--tcs-shadow);
  border-radius: var(--tcs-radius);
  padding: 8px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.tcs-primary-menu .menu-item:hover > .sub-menu,
.tcs-primary-menu .menu-item:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tcs-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
}

.tcs-header-search input[type="search"],
.tcs-sidebar input[type="search"] {
  width: 100%;
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--tcs-ink);
}

.tcs-search-button,
.tcs-button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--tcs-primary);
  border-radius: var(--tcs-radius);
  background: var(--tcs-primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.tcs-search-button:hover,
.tcs-button:hover,
.wp-block-button__link:hover {
  background: var(--tcs-primary-strong);
  border-color: var(--tcs-primary-strong);
  color: #fff;
}

.tcs-button--light {
  background: #fff;
  color: var(--tcs-primary-strong);
  border-color: #fff;
}

.tcs-button--line {
  background: transparent;
  color: var(--tcs-primary-strong);
}

.tcs-hero {
  position: relative;
  min-height: 580px;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background: #10232d;
}

.tcs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(9, 26, 36, 0.9), rgba(9, 26, 36, 0.55), rgba(9, 26, 36, 0.16));
  z-index: 1;
}

.tcs-hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcs-hero__inner {
  position: relative;
  z-index: 2;
  padding: 84px 0 72px;
}

.tcs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: inherit;
  font-size: 14px;
  font-weight: 800;
}

.tcs-hero h1 {
  max-width: 820px;
  margin: 18px 0 14px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.tcs-hero p {
  max-width: 700px;
  margin: 0 0 28px;
  color: #e8f3f4;
  font-size: 19px;
}

.tcs-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tcs-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: -34px;
  position: relative;
  z-index: 3;
}

.tcs-stat-card,
.tcs-card,
.tcs-panel,
.tcs-sidebar .widget,
.tcs-feature-card {
  background: var(--tcs-surface);
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
  box-shadow: 0 8px 22px rgba(15, 30, 42, 0.06);
}

.tcs-stat-card {
  padding: 18px;
}

.tcs-stat-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--tcs-primary-strong);
}

.tcs-stat-card span {
  color: var(--tcs-muted);
  font-size: 14px;
}

.tcs-section {
  padding: 62px 0;
}

.tcs-section--tight {
  padding: 38px 0;
}

.tcs-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.tcs-section__head h2,
.tcs-archive-header h1,
.tcs-entry-header h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: 0;
}

.tcs-section__head p {
  margin: 8px 0 0;
  max-width: 680px;
  color: var(--tcs-muted);
}

.tcs-grid {
  display: grid;
  gap: 18px;
}

.tcs-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.tcs-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.tcs-feature-card {
  padding: 22px;
}

.tcs-feature-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.tcs-feature-card p {
  margin: 0;
  color: var(--tcs-muted);
}

.tcs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.tcs-content-area {
  min-width: 0;
}

.tcs-main {
  padding: 44px 0 64px;
}

.tcs-card {
  overflow: hidden;
}

.tcs-card__image {
  aspect-ratio: 16 / 10;
  background: var(--tcs-soft);
}

.tcs-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcs-card__body {
  padding: 18px;
}

.tcs-card__body h2,
.tcs-card__body h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.tcs-card__meta,
.tcs-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--tcs-muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.tcs-card__excerpt {
  color: var(--tcs-muted);
  margin: 0 0 14px;
}

.tcs-term-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf5f4;
  color: var(--tcs-primary-strong);
  font-size: 13px;
  font-weight: 800;
}

.tcs-entry {
  background: var(--tcs-surface);
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
  overflow: hidden;
}

.tcs-entry-header {
  padding: 30px 30px 18px;
}

.tcs-entry-featured img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.tcs-entry-content {
  padding: 26px 30px 34px;
}

.tcs-entry-content > *:first-child {
  margin-top: 0;
}

.tcs-entry-content h2,
.tcs-entry-content h3,
.tcs-entry-content h4 {
  line-height: 1.25;
  margin: 1.35em 0 0.45em;
  letter-spacing: 0;
}

.tcs-entry-content p,
.tcs-entry-content li {
  color: #283743;
}

.tcs-entry-content a {
  font-weight: 700;
}

.tcs-entry-content blockquote {
  margin: 24px 0;
  padding: 18px 22px;
  border-left: 4px solid var(--tcs-accent-2);
  background: #fff8e8;
  color: #25323d;
}

.tcs-breadcrumbs {
  padding: 18px 0 0;
  color: var(--tcs-muted);
  font-size: 14px;
}

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

.tcs-archive-header {
  margin-bottom: 26px;
  padding: 28px;
  background: var(--tcs-surface);
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
}

.tcs-archive-header p {
  margin: 8px 0 0;
  color: var(--tcs-muted);
  max-width: 760px;
}

.tcs-category-hero {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.tcs-category-hero img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: var(--tcs-radius);
}

.tcs-sidebar {
  display: grid;
  gap: 18px;
}

.tcs-sidebar .widget {
  padding: 18px;
}

.tcs-sidebar .widget-title,
.tcs-sidebar h2,
.tcs-sidebar h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.25;
}

.tcs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tcs-sidebar li + li {
  border-top: 1px solid var(--tcs-line);
}

.tcs-sidebar li a {
  display: block;
  padding: 10px 0;
  color: var(--tcs-ink);
  font-weight: 700;
}

.tcs-sidebar li a:hover {
  color: var(--tcs-primary);
}

.tcs-search-form {
  display: flex;
  gap: 8px;
}

.tcs-search-form label {
  flex: 1;
}

.tcs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
  background: #fff;
}

.tcs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.tcs-table th,
.tcs-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--tcs-line);
  text-align: left;
}

.tcs-table th {
  background: #edf5f4;
  color: var(--tcs-primary-strong);
}

.tcs-number-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tcs-number {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tcs-accent);
  color: var(--tcs-accent);
  font-weight: 900;
}

.tcs-related {
  margin-top: 28px;
}

.tcs-pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.page-numbers,
.nav-links a,
.nav-links span {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tcs-line);
  border-radius: var(--tcs-radius);
  background: #fff;
  color: var(--tcs-ink);
  font-weight: 700;
}

.page-numbers.current,
.nav-links .current {
  background: var(--tcs-primary);
  color: #fff;
  border-color: var(--tcs-primary);
}

.tcs-footer {
  background: #101923;
  color: #d8e5ec;
}

.tcs-footer a {
  color: #e8fbf7;
}

.tcs-footer__top {
  padding: 44px 0 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}

.tcs-footer h2,
.tcs-footer h3 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 18px;
}

.tcs-footer p {
  margin: 0;
  color: #b9c8d1;
}

.tcs-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tcs-footer li + li {
  margin-top: 8px;
}

.tcs-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 16px 0;
  color: #cbd8de;
  font-size: 14px;
}

.alignwide {
  max-width: var(--tcs-container);
}

.alignfull {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.wp-caption,
.wp-caption-text,
.gallery-caption,
.bypostauthor {
  max-width: 100%;
}

@media (max-width: 1080px) {
  .tcs-header-search {
    display: none;
  }

  .tcs-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tcs-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .tcs-topbar__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 9px 0;
  }

  .tcs-brand-row {
    min-height: 72px;
  }

  .tcs-brand img {
    width: 180px;
  }

  .tcs-menu-toggle {
    display: inline-flex;
  }

  .tcs-primary-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    background: #fff;
    border-top: 1px solid var(--tcs-line);
    box-shadow: 0 18px 32px rgba(15, 30, 42, 0.12);
  }

  .tcs-primary-menu.is-open {
    display: flex;
  }

  .tcs-primary-menu a {
    padding: 12px;
  }

  .tcs-primary-menu .sub-menu {
    position: static;
    width: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin: 2px 0 8px 14px;
    border-color: var(--tcs-line);
  }

  .tcs-hero {
    min-height: 520px;
  }

  .tcs-quick-stats,
  .tcs-footer__top {
    grid-template-columns: repeat(2, 1fr);
  }

  .tcs-section__head {
    display: block;
  }

  .tcs-category-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tcs-container {
    width: min(100% - 24px, var(--tcs-container));
  }

  .tcs-brand__text {
    display: none;
  }

  .tcs-hero {
    min-height: 500px;
  }

  .tcs-hero__inner {
    padding: 64px 0 58px;
  }

  .tcs-hero h1 {
    font-size: 38px;
  }

  .tcs-hero p {
    font-size: 17px;
  }

  .tcs-quick-stats,
  .tcs-grid--2,
  .tcs-grid--3,
  .tcs-footer__top {
    grid-template-columns: 1fr;
  }

  .tcs-entry-header,
  .tcs-entry-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .tcs-search-form {
    flex-direction: column;
  }
}
