/*
Theme Name: Time Access V2
Theme URI: https://www.timeaccesssolution.com/blog/
Author: Time Access Solution
Description: Maintained historical WordPress archive integrated with the Time Access Solution main-site shell.
Version: 0.4.1
Requires at least: 6.0
Requires PHP: 7.3
Text Domain: timeaccess-v2
*/

:root {
  --tas-ink: #10233f;
  --tas-muted: #5b687a;
  --tas-blue: #075ea8;
  --tas-blue-dark: #064479;
  --tas-cyan: #0aa7b5;
  --tas-green: #11845b;
  --tas-warm: #f4ad2e;
  --tas-paper: #ffffff;
  --tas-soft: #f3f7fa;
  --tas-line: #dce5ec;
  --tas-shadow: 0 16px 45px rgba(16, 35, 63, 0.11);
  --tas-radius: 18px;
  --tas-font: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--tas-ink);
  background:
    radial-gradient(circle at 8% 5%, rgba(10, 167, 181, 0.08), transparent 25rem),
    linear-gradient(180deg, #f9fbfc 0, #fff 28rem);
  font-family: var(--tas-font);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a { color: var(--tas-blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--tas-blue-dark); }
img { max-width: 100%; height: auto; }
button, input { font: inherit; }

.tas-skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--tas-blue-dark);
  transform: translateY(-150%);
}
.tas-skip-link:focus { transform: translateY(0); }

.tas-blog-bar-inner,
.tas-page-shell,
.tas-shared-fallback {
  width: min(1180px, calc(100% - 34px));
  margin-inline: auto;
}

.tas-blog-bar { border-bottom: 1px solid var(--tas-line); background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(12px); }
.tas-blog-bar-inner { display: flex; min-height: 106px; align-items: center; justify-content: space-between; gap: 26px; }
.tas-eyebrow { margin: 0 0 2px; color: var(--tas-cyan); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
.tas-blog-title { color: var(--tas-ink); font-size: clamp(20px, 2.6vw, 30px); font-weight: 850; text-decoration: none; }
.tas-blog-description { margin: 3px 0 0; color: var(--tas-muted); font-size: 14px; }
.tas-blog-bar .search-form { display: flex; width: min(400px, 100%); }
.tas-blog-bar .search-form label { flex: 1; }
.tas-blog-bar .search-field {
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border: 1px solid var(--tas-line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #fff;
}
.tas-blog-bar .search-submit {
  min-height: 46px;
  padding: 8px 16px;
  border: 0;
  border-radius: 0 12px 12px 0;
  color: #fff;
  background: var(--tas-blue);
  cursor: pointer;
}

.tas-page-shell { padding-block: 38px 90px; }
.tas-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start; }
.tas-main-column { min-width: 0; }
.tas-section-head { margin-bottom: 24px; }
.tas-section-head h1 { margin: 0; font-size: clamp(30px, 4.2vw, 50px); line-height: 1.22; letter-spacing: -0.025em; }
.tas-section-head p { max-width: 760px; margin: 10px 0 0; color: var(--tas-muted); }
.archive .tas-section-head h1,
.category .tas-section-head h1,
.search .tas-section-head h1 { font-size: clamp(28px, 3.2vw, 40px); }

.tas-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 30px;
  overflow: hidden;
  margin-bottom: 34px;
  padding: clamp(30px, 5vw, 62px);
  border-radius: 26px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(4, 55, 104, 0.98), rgba(7, 94, 168, 0.91)),
    radial-gradient(circle at 88% 10%, #0aa7b5, transparent 20rem);
  box-shadow: var(--tas-shadow);
}
.tas-hero::after {
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 45px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}
.tas-hero-copy { position: relative; z-index: 1; }
.tas-hero h1 { max-width: 720px; margin: 0; font-size: clamp(34px, 4.3vw, 54px); line-height: 1.18; letter-spacing: -0.03em; }
.tas-hero p { max-width: 680px; margin: 18px 0 0; color: rgba(255,255,255,.88); font-size: 19px; }
.tas-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tas-hero-actions a { padding: 10px 18px; border-radius: 999px; color: var(--tas-ink); background: #fff; font-weight: 800; text-decoration: none; }
.tas-hero-actions .tas-hero-secondary { color: #fff; border: 1px solid rgba(255,255,255,.4); background: transparent; }
.tas-hero-stat { align-self: end; position: relative; z-index: 1; padding: 24px; border: 1px solid rgba(255,255,255,.23); border-radius: 20px; background: rgba(255,255,255,.1); }
.tas-hero-stat strong { display: block; font-size: 36px; line-height: 1; }
.tas-hero-stat span { color: rgba(255,255,255,.8); font-size: 14px; }

.tas-category-list { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 28px; padding: 0; list-style: none; }
.tas-category-list a { display: block; padding: 7px 13px; border: 1px solid var(--tas-line); border-radius: 999px; color: var(--tas-ink); background: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.tas-category-list a:hover { border-color: var(--tas-cyan); color: var(--tas-blue-dark); }

.tas-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.tas-card {
  overflow: hidden;
  border: 1px solid var(--tas-line);
  border-radius: var(--tas-radius);
  background: #fff;
  box-shadow: 0 9px 28px rgba(16, 35, 63, 0.07);
}
.tas-card-image { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #e8f1f6, #d8e8ef); }
.tas-card-image img { width: 100%; height: 100%; object-fit: cover; }
.tas-card-placeholder { display: grid; height: 100%; place-items: center; color: rgba(7,94,168,.6); font-weight: 850; letter-spacing: .08em; }
.tas-card-body { padding: 20px; }
.tas-card-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 8px; color: var(--tas-muted); font-size: 13px; }
.tas-card h2 { margin: 0; font-size: clamp(20px, 2vw, 25px); line-height: 1.38; }
.tas-card h2 a { color: var(--tas-ink); text-decoration: none; }
.tas-card h2 a:hover { color: var(--tas-blue); }
.tas-card p { margin: 10px 0 0; color: var(--tas-muted); font-size: 15px; line-height: 1.7; }
.tas-card-more { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 800; text-decoration: none; }

.tas-sidebar { position: static; display: grid; gap: 18px; align-self: start; }
.tas-archive-status {
  padding: 22px;
  border: 1px solid #bdd4e5;
  border-radius: var(--tas-radius);
  color: #fff;
  background: linear-gradient(145deg, var(--tas-blue-dark), #083255);
  box-shadow: 0 12px 35px rgba(16,35,63,.12);
}
.tas-status-label { margin: 0 0 7px; color: #7fe1e8; font-size: 11px; font-weight: 850; letter-spacing: .18em; }
.tas-archive-status h2 { margin: 0; color: #fff; font-size: 20px; line-height: 1.4; }
.tas-archive-status p:last-child { margin: 10px 0 0; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.7; }

.tas-current-links { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--tas-line); border-radius: var(--tas-radius); background: #fff; box-shadow: 0 12px 35px rgba(16,35,63,.08); }
.tas-current-links h2 { margin: 0 0 5px; font-size: 18px; }
.tas-current-links a { display: grid; grid-template-columns: 32px 1fr; column-gap: 10px; padding: 11px; border-radius: 12px; color: var(--tas-ink); background: var(--tas-soft); text-decoration: none; }
.tas-current-links a:hover { color: var(--tas-blue-dark); background: #e6f1f6; }
.tas-current-links a > span { grid-row: 1 / 3; align-self: center; color: var(--tas-cyan); font-size: 11px; font-weight: 850; letter-spacing: .08em; }
.tas-current-links strong { font-size: 14px; line-height: 1.4; }
.tas-current-links small { color: var(--tas-muted); font-size: 12px; line-height: 1.45; }

.tas-widget-stack { display: grid; gap: 18px; }
.tas-widget {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--tas-line);
  border-radius: var(--tas-radius);
  background: #fff;
  box-shadow: 0 12px 35px rgba(16,35,63,.08);
}
.tas-widget .widget-title { margin: 0 0 12px; color: var(--tas-ink); font-size: 19px; line-height: 1.4; }
.tas-widget ul { margin: 0; padding: 0; list-style: none; }
.tas-widget li { padding: 8px 0; border-bottom: 1px solid var(--tas-line); color: var(--tas-muted); font-size: 14px; line-height: 1.55; }
.tas-widget li:last-child { border-bottom: 0; }
.tas-widget li a { color: var(--tas-ink); text-decoration: none; }
.tas-widget li a:hover { color: var(--tas-blue); }
.tas-widget li > span { float: right; margin-left: 8px; color: var(--tas-muted); font-size: 12px; }
.tas-widget .children { padding-left: 14px; }
.tas-custom-widgets { display: grid; gap: 18px; }
.tas-widget-footer { padding: 32px 0; border-top: 1px solid var(--tas-line); background: #eaf1f5; }
.tas-widget-footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; width: min(1180px, calc(100% - 34px)); margin: 0 auto; }
.tas-footer-widget { height: 100%; box-shadow: none; }

.tas-article { overflow: hidden; border: 1px solid var(--tas-line); border-radius: 22px; background: #fff; box-shadow: var(--tas-shadow); }
.tas-article-header { padding: clamp(26px, 5vw, 54px); border-bottom: 1px solid var(--tas-line); background: linear-gradient(145deg, #fff, #f2f8fb); }
.tas-breadcrumbs { margin: 0 0 16px; color: var(--tas-muted); font-size: 13px; }
.tas-breadcrumbs a { color: var(--tas-muted); text-decoration: none; }
.tas-article h1 { margin: 0; font-size: clamp(32px, 4.8vw, 54px); line-height: 1.24; letter-spacing: -0.025em; }
.tas-article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: var(--tas-muted); font-size: 14px; }
.tas-article-content { padding: clamp(25px, 5vw, 54px); font-size: 18px; line-height: 1.9; overflow-wrap: anywhere; }
.tas-article-content > :first-child { margin-top: 0; }
.tas-article-content h2 { margin: 1.7em 0 .6em; font-size: clamp(25px, 3vw, 34px); line-height: 1.35; }
.tas-article-content h3 { margin: 1.5em 0 .55em; font-size: 23px; }
.tas-article-content img { display: block; max-width: 100%; height: auto; margin: 24px auto; border-radius: 12px; }
.tas-article-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.tas-article-content th,
.tas-article-content td { padding: 10px 12px; border: 1px solid var(--tas-line); text-align: left; }
.tas-article-content th { background: var(--tas-soft); }
.tas-article-content blockquote { margin: 24px 0; padding: 14px 20px; border-left: 4px solid var(--tas-cyan); color: var(--tas-muted); background: var(--tas-soft); }
.tas-archive-note { display: grid; gap: 3px; margin: 0 0 24px; padding: 14px 17px; border-left: 4px solid var(--tas-warm); border-radius: 0 12px 12px 0; color: var(--tas-muted); background: #fff8e9; font-size: 14px; }
.tas-archive-note strong { color: var(--tas-ink); }
.tas-archive-note--article { margin: 0; border-bottom: 1px solid #f0dfb7; border-radius: 0; padding-inline: clamp(25px, 5vw, 54px); }
.tas-article-next-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 clamp(25px, 5vw, 54px) 22px; }
.tas-article-next-actions a { display: grid; gap: 3px; padding: 16px; border: 1px solid var(--tas-line); border-radius: 13px; color: var(--tas-ink); background: var(--tas-soft); text-decoration: none; }
.tas-article-next-actions a:hover { border-color: var(--tas-cyan); }
.tas-article-next-actions span { color: var(--tas-muted); font-size: 13px; }
.tas-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 clamp(25px, 5vw, 54px) clamp(25px, 5vw, 54px); }
.tas-post-nav a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--tas-line); border-radius: 12px; text-decoration: none; }
.tas-post-nav .nav-next { text-align: right; }

.tas-pagination { margin-top: 32px; }
.tas-pagination ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tas-pagination a,
.tas-pagination span { display: grid; min-width: 42px; min-height: 42px; place-items: center; padding: 5px 11px; border: 1px solid var(--tas-line); border-radius: 10px; text-decoration: none; }
.tas-pagination .current { color: #fff; border-color: var(--tas-blue); background: var(--tas-blue); }
.tas-empty { padding: 34px; border: 1px solid var(--tas-line); border-radius: var(--tas-radius); background: #fff; }

.tas-shared-fallback { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding-block: 16px; background: #fff; }

@media (max-width: 920px) {
  body { padding-bottom: 72px; font-size: 16px; }
  .tas-blog-bar-inner { min-height: 130px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 12px; padding-block: 17px; }
  .tas-blog-bar-inner .search-form { width: 100%; }
  .tas-layout { grid-template-columns: 1fr; }
  .tas-sidebar { position: static; order: initial; }
  .tas-widget-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tas-hero { grid-template-columns: 1fr; }
  .tas-hero-stat { display: none; }
}

@media (max-width: 640px) {
  .tas-blog-bar-inner,
  .tas-page-shell,
  .tas-shared-fallback { width: min(100% - 22px, 1180px); }
  .tas-page-shell { padding-top: 22px; }
  .tas-hero { margin-inline: -1px; padding: 27px 23px; border-radius: 18px; }
  .tas-hero h1 { font-size: 34px; }
  .tas-hero p { font-size: 16px; }
  .tas-card-grid { grid-template-columns: 1fr; }
  .tas-article { border-radius: 16px; }
  .tas-article-content { font-size: 17px; }
  .tas-post-nav { grid-template-columns: 1fr; }
  .tas-post-nav .nav-next { text-align: left; }
  .tas-article-next-actions { grid-template-columns: 1fr; }
  .tas-widget-footer-grid { grid-template-columns: 1fr; width: min(100% - 22px, 1180px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
