/*
TAG: ไฟล์สไตล์หลัก - กำหนดรูปแบบธีม โครงสร้างหน้า สี และส่วนประกอบหน้าจอ
Theme Name: MHSO Modern
Theme URI: https://web-mhso.moph.go.th/
Author: MHSO
Description: Modern WordPress theme for public health office news, announcements, and homepage slider.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: mhso-modern
*/

:root {
  --primary: #006b5f;
  --primary-dark: #004b45;
  --accent: #f2b705;
  --ink: #17212b;
  --muted: #667085;
  --line: #e7ecef;
  --soft: #f5faf9;
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans Thai", "Tahoma", sans-serif;
  background: var(--white);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  color: var(--white);
  background: var(--primary-dark);
  font-size: 14px;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--white);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #28a58f);
  border-radius: 8px;
}

.brand-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 10px 14px;
  color: #26323d;
  border-radius: 8px;
  font-weight: 600;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
  color: var(--primary);
  background: var(--soft);
}

.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, #e9f8f4 0%, #ffffff 54%, #fff6d8 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 42px;
  min-height: 540px;
  padding: 46px 0;
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.15;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  color: var(--white);
  background: var(--primary);
  border-radius: 8px;
  font-weight: 700;
}

.button.secondary {
  color: var(--primary);
  background: var(--white);
  border: 1px solid var(--line);
}

.slider {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.slide {
  display: none;
}

.slide.is-active {
  display: block;
}

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

.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-body {
  padding: 22px;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.slide-title {
  margin: 8px 0 8px;
  font-size: 24px;
  line-height: 1.35;
}

.slider-dots {
  display: flex;
  gap: 8px;
  padding: 0 22px 22px;
}

.slider-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  background: #cbd5df;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.slider-dots button.is-active {
  width: 28px;
  background: var(--primary);
}

.section {
  padding: 58px 0;
}

.section.soft {
  background: var(--soft);
}

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

.section-head h2 {
  margin: 0;
  font-size: 30px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.news-tabs {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 54px;
  padding: 12px 18px;
  color: #006dff;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab-button.is-active {
  color: var(--ink);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  padding: 18px;
}

.tab-panel.is-active {
  display: block;
}

.tab-title {
  margin: 0 0 16px;
  padding: 14px 16px;
  color: #003d73;
  text-align: center;
  background: #cfe7ff;
  border: 1px solid #acd2f5;
  border-radius: 8px;
  font-size: 18px;
}

.news-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
}

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

.news-table th {
  color: #006dff;
  background: #ffffff;
}

.news-table tr:nth-child(even) td {
  background: #f2f2f2;
}

.news-table a {
  color: #006dff;
  font-weight: 700;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--white) !important;
  background: var(--primary);
  border-radius: 8px;
}

.news-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(23, 33, 43, 0.1);
}

.news-thumb {
  aspect-ratio: 16 / 9;
  background: #dfeae7;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-body {
  padding: 18px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.news-body h3 {
  margin: 8px 0 10px;
  font-size: 20px;
  line-height: 1.4;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.rate-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.06);
}

.rate-card header {
  padding: 20px 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), #1a9f89);
}

.rate-card h3 {
  margin: 0;
  font-size: 22px;
}

.rate-card p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
}

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

.rate-table th {
  color: var(--primary-dark);
  background: var(--soft);
}

.rate-table td:last-child {
  font-weight: 800;
  white-space: nowrap;
}

.quick-link {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quick-link strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 18px;
}

.quick-link span {
  color: var(--muted);
  font-size: 14px;
}

.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  padding: 50px 0;
}

.entry {
  max-width: 820px;
}

.entry h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.2;
}

.entry-content {
  color: #2c3845;
  font-size: 17px;
}

.entry-content h2 {
  margin-top: 34px;
  color: var(--primary-dark);
}

.entry-content h3 {
  margin-top: 24px;
}

.entry-content .info-box {
  padding: 18px 20px;
  background: var(--soft);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
}

.editor-note {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--primary-dark);
  background: #edf8f5;
  border: 1px solid #cfe9e2;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.editor-content-section {
  padding-top: 24px;
}

.sidebar-box {
  padding: 22px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  color: rgba(255, 255, 255, 0.86);
  background: var(--primary-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
  padding: 40px 0;
}

.footer-grid h2,
.footer-grid h3 {
  margin: 0 0 10px;
  color: var(--white);
}

.copyright {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
}

@media (max-width: 900px) {
.header-inner,
.section-head {
    flex-direction:column;
    align-items:center;
}

.topbar .container{
    display:none;
}

  .main-nav ul {
    flex-wrap: wrap;
  }

  .hero-grid,
  .content-wrap,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .news-grid,
  .quick-links,
  .rate-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .news-grid,
  .quick-links,
  .rate-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    padding: 34px 0;
  }

  .tab-list {
    padding: 0;
  }

  .tab-button {
    width: 100%;
    text-align: left;
  }
}

/* ================================
   Download / Rules / Announce List
================================ */

.news-list{
    display:block;
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    overflow:hidden;
}

.download-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    padding:16px 20px;
    border-bottom:1px solid var(--line);
    transition:.2s;
}

.download-item:last-child{
    border-bottom:none;
}

.download-item:hover{
    background:#f8fbfb;
}

.download-left{
    flex:1;
    min-width:0;
}

.download-left a{
    display:flex;
    align-items:center;
    gap:12px;
}

.file-icon{
    min-width:95px;
    font-size:14px;
    font-weight:bold;
}

.file-title{
    color:var(--ink);
    font-size:17px;
    font-weight:600;
}

.download-left a:hover .file-title{
    color:var(--primary);
}

.download-right{
    color:#888;
    font-size:14px;
    white-space:nowrap;
}

@media(max-width:768px){

    .download-item{
        flex-direction:column;
        align-items:flex-start;
    }

    .download-left a{
        align-items:flex-start;
        flex-direction:column;
        gap:4px;
    }

    .download-right{
        margin-left:95px;
    }

}
/* ===========================
   Mobile Menu
=========================== */

.menu-toggle{
    display:none;
}

@media (max-width:768px){

.topbar{
    display:none;
}

.header-inner{
    display:flex;
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    position:relative;
}

.brand{
    text-align:left;
}

.menu-toggle{

    display:block;

    background:none;

    border:none;

    font-size:30px;

    cursor:pointer;

    color:var(--primary);

}

.main-nav{

    display:none;

    position:absolute;

    top:100%;

    right:0;

    width:260px;

    background:#fff;

    border-radius:12px;

    box-shadow:0 10px 30px rgba(0,0,0,.15);

    overflow:hidden;

    z-index:9999;

}

.main-nav.active{

    display:block;

}

.main-nav ul{

    display:flex;

    flex-direction:column;

    margin:0;

    padding:0;

}

.main-nav li{

    list-style:none;

}

.main-nav a{

    display:block;

    padding:14px 20px;

    border-bottom:1px solid #eee;

}

.main-nav a:hover{

    background:#f5f7f7;

}

}
