/*
Theme Name: Khon Kaen NOW
Theme URI: https://khonkaen.news/
Author: Watchara Songchan
Description: ธีมข่าวท้องถิ่นสไตล์ไทยรัฐ Responsive อัตโนมัติ
Version: 1.0
Text Domain: khonkaen-now
Tags: news, magazine, thai, responsive, customizable
*/
:root {
  --main-color: #13ca2e;
  --main-color-dark: #108822;
  --headline: #191919;
  --menu-bg: #fff;
  --footer-bg: #191919;
}
body { font-family: 'Sarabun', Arial, sans-serif; background: #f5f6fa; color: var(--headline); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
header { background: var(--menu-bg); border-bottom: 3px solid var(--main-color); box-shadow: 0 2px 14px #0001; position: sticky; top: 0; z-index: 50; }
.flex-header { max-width: 1240px; height: 68px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; }
.logo img { height: 48px; }
.main-menu { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-menu a { color: var(--headline); font-size: 1.08em; font-weight: 700; text-decoration: none; padding: 10px 2px; border-bottom: 2px solid transparent; transition: color .19s, border-bottom .19s; }
.main-menu a:hover, .main-menu .current-menu-item a { color: var(--main-color); border-bottom: 2.5px solid var(--main-color); }
.breaking-bar { width: 100vw; background: var(--main-color); color: #fff; font-weight: 700; padding: 9px 0; font-size: 1.12em; text-align: center; box-shadow: 0 2px 10px #13ca2e15; position: relative; z-index: 99; }
.cat-nav { background: #e7faec; padding: 8px 0; display: flex; gap: 16px; justify-content: center; border-bottom: 2px solid var(--main-color); margin-bottom: 16px; }
.cat-nav a { color: var(--main-color-dark); font-weight: 700; font-size: 1.08em; padding: 3px 16px; border-radius: 99px; transition: background .13s, color .14s; text-decoration: none; }
.cat-nav a:hover, .cat-nav .active { background: var(--main-color); color: #fff; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 12px; }
.news-card { background: #fff; border-radius: 11px; box-shadow: 0 1px 5px #13ca2e15; transition: box-shadow 0.15s cubic-bezier(.4,0,.2,1), transform 0.14s cubic-bezier(.4,0,.2,1); cursor: pointer; position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 290px; }
.news-card:hover { box-shadow: 0 12px 36px 0 rgba(19,202,46,0.13), 0 3px 20px #13ca2e29; transform: translateY(-7px) scale(1.012); z-index: 11; }
.news-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px 10px 0 0; transition: transform 0.17s cubic-bezier(.4,0,.2,1); }
.news-card:hover img { transform: scale(1.023); }
.cat-label { display: inline-block; padding: 0.19em 0.82em; font-size: 0.93em; border-radius: 99px; background: var(--main-color); color: #fff; font-weight: 700; letter-spacing: .04em; margin-right: 5px; vertical-align: middle; margin-bottom: 7px; text-shadow: 0 1px 6px #13ca2e22; }
.news-card h2 { color: var(--headline); font-size: 1.13em; font-weight: 700; margin: 13px 0 6px 0; line-height: 1.22; }
.news-date { font-size: 0.97em; color: var(--main-color-dark); margin-bottom: 7px; }
.news-card .excerpt { font-size: 1.03em; color: #565656; margin-bottom: 10px; }
footer { background: var(--footer-bg); color: #eee; padding: 32px 0 17px 0; margin-top: 64px; font-size: 1.07em; border-top: 6px solid var(--main-color); }
.footer-flex { max-width: 1200px; margin: 0 auto; padding: 0 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer-menu { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.footer-menu a { color: #fff; font-weight: 600; letter-spacing: .01em; transition: color .17s; }
.footer-menu a:hover { color: var(--main-color); text-decoration: underline; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr 1fr; } .footer-flex { flex-direction: column; gap: 16px; text-align: center; } }
@media (max-width: 600px) { .container { padding: 0 7px; } .news-grid { grid-template-columns: 1fr; } .flex-header { flex-direction: column; gap: 9px; height: auto; } .main-menu { gap: 13px; flex-wrap: wrap; } }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-left: 20px;
}
.menu-toggle span {
  width: 30px;
  height: 4px;
  background: var(--main-color);
  border-radius: 2px;
  display: block;
}
@media (max-width: 900px) {
  .desktop-menu { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu {
    position: fixed;
    left: -320px; top: 0;
    width: 270px;
    height: 100vh;
    background: #fff;
    box-shadow: 0 3px 30px #19191923;
    z-index: 200;
    padding: 32px 18px 18px 18px;
    transition: left .25s cubic-bezier(.65,.05,.36,1);
    overflow-y: auto;
  }
  .mobile-menu.active { left: 0; }
  .close-menu { background: none; border: none; font-size: 2em; color: var(--main-color); position: absolute; top: 15px; right: 18px; }
  .mobile-main-menu { display: flex; flex-direction: column; gap: 18px; }
}

/*
Theme Name: Khon Kaen NOW
Description: ข่าวใหญ่, เมนู Responsive, Grid ข่าว, โลโก้ไม่ซ้อน
*/

:root {
  --main-color: #13ca2e;
  --main-color-dark: #108822;
  --headline: #191919;
  --menu-bg: #fff;
  --footer-bg: #191919;
}
body { font-family: 'Sarabun', Arial, sans-serif; background: #f5f6fa; color: var(--headline); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

header { background: var(--menu-bg); border-bottom: 3px solid var(--main-color); box-shadow: 0 2px 14px #0001; position: sticky; top: 0; z-index: 50; }
.flex-header { max-width: 1240px; height: 68px; margin: 0 auto; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; }
.logo img, .custom-logo {
  display: block;
  height: auto;
  max-height: 56px;    /* ปรับ max ตามต้องการ (56px-64px กำลังสวย) */
  width: auto;
  max-width: 260px;    /* หรือ 100% ถ้าอยากไม่เกินกล่อง */
  object-fit: contain;
  margin: 0 auto;
}


.main-menu { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-menu a { color: var(--headline); font-size: 1.08em; font-weight: 700; text-decoration: none; padding: 10px 2px; border-bottom: 2px solid transparent; transition: color .19s, border-bottom .19s; }
.main-menu a:hover, .main-menu .current-menu-item a { color: var(--main-color); border-bottom: 2.5px solid var(--main-color); }

.menu-toggle { display: none; background: none; border: none; flex-direction: column; gap: 5px; cursor: pointer; margin-left: 20px; }
.menu-toggle span { width: 30px; height: 4px; background: var(--main-color); border-radius: 2px; display: block; }
@media (max-width: 900px) {
  .desktop-menu { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu {
    position: fixed; left: -320px; top: 0;
    width: 270px; height: 100vh;
    background: #fff; box-shadow: 0 3px 30px #19191923;
    z-index: 200; padding: 32px 18px 18px 18px;
    transition: left .25s cubic-bezier(.65,.05,.36,1);
    overflow-y: auto;
  }
  .mobile-menu.active { left: 0; }
  .close-menu { background: none; border: none; font-size: 2em; color: var(--main-color); position: absolute; top: 15px; right: 18px; }
  .mobile-main-menu { display: flex; flex-direction: column; gap: 18px; }
}

.cat-nav { background: #e7faec; padding: 8px 0; display: flex; gap: 16px; justify-content: center; border-bottom: 2px solid var(--main-color); margin-bottom: 16px; }
.cat-nav a { color: var(--main-color-dark); font-weight: 700; font-size: 1.08em; padding: 3px 16px; border-radius: 99px; transition: background .13s, color .14s; text-decoration: none; }
.cat-nav a:hover, .cat-nav .active { background: var(--main-color); color: #fff; }

.hero-news { display: flex; flex-wrap: wrap; gap: 36px; margin: 32px 0 32px 0; }
.hero-img { flex: 1 1 390px; min-width: 320px; }
.hero-img img { width: 100%; border-radius: 17px; max-height: 400px; object-fit: cover; }
.hero-content { flex: 1 1 390px; min-width: 320px; display: flex; flex-direction: column; justify-content: center; }
.hero-content h1 { font-size: 2.7em; font-weight: 900; line-height: 1.13; margin: 0 0 15px 0; }
.hero-date { color: var(--main-color-dark); margin-bottom: 8px; font-size: 1.13em; }
.hero-excerpt { color: #393939; font-size: 1.15em; margin-bottom: 19px; }
.btn-main { display: inline-block; padding: 8px 30px; background: var(--main-color); color: #fff; border-radius: 99px; font-weight: 700; font-size: 1.11em; text-decoration: none; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 12px; }
.news-card { background: #fff; border-radius: 11px; box-shadow: 0 1px 5px #13ca2e15; transition: box-shadow 0.15s cubic-bezier(.4,0,.2,1), transform 0.14s cubic-bezier(.4,0,.2,1); cursor: pointer; position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 290px; }
.news-card:hover { box-shadow: 0 12px 36px 0 rgba(19,202,46,0.13), 0 3px 20px #13ca2e29; transform: translateY(-7px) scale(1.012); z-index: 11; }
.news-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px 10px 0 0; transition: transform 0.17s cubic-bezier(.4,0,.2,1); }
.news-card:hover img { transform: scale(1.023); }
.cat-label { display: inline-block; padding: 0.19em 0.82em; font-size: 0.93em; border-radius: 99px; background: var(--main-color); color: #fff; font-weight: 700; letter-spacing: .04em; margin-right: 5px; vertical-align: middle; margin-bottom: 7px; text-shadow: 0 1px 6px #13ca2e22; }
.news-card h2 { color: var(--headline); font-size: 1.13em; font-weight: 700; margin: 13px 0 6px 0; line-height: 1.22; }
.news-date { font-size: 0.97em; color: var(--main-color-dark); margin-bottom: 7px; }
.news-card .excerpt { font-size: 1.03em; color: #565656; margin-bottom: 10px; }
footer { background: var(--footer-bg); color: #eee; padding: 32px 0 17px 0; margin-top: 64px; font-size: 1.07em; border-top: 6px solid var(--main-color); }
.footer-flex { max-width: 1200px; margin: 0 auto; padding: 0 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.footer-menu { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.footer-menu a { color: #fff; font-weight: 600; letter-spacing: .01em; transition: color .17s; }
.footer-menu a:hover { color: var(--main-color); text-decoration: underline; }
@media (max-width: 900px) { 
  .news-grid { grid-template-columns: 1fr 1fr; } 
  .footer-flex { flex-direction: column; gap: 16px; text-align: center; }
  .hero-news { flex-direction: column; gap: 20px; }
}
@media (max-width: 600px) {
  .container { padding: 0 7px; }
  .news-grid { grid-template-columns: 1fr; }
  .flex-header { flex-direction: column; gap: 9px; height: auto; }
  .main-menu { gap: 13px; flex-wrap: wrap; }
  .hero-content h1 { font-size: 1.55em; }
}


