/* =========================================================
   พันธมิตรธุรกิจ — ธีมหน้าเว็บ (โหลดต่อจาก style.css)
   โทนสี เหลือง · แดง · กรมท่า ตามโลโก้
   ========================================================= */
:root{
  --brand:#16224f; --brand-dark:#0e1737; --accent:#e01b22;
  --red:#e01b22; --gold:#ffe11a; --yellow:#ffe11a;
  --bg:#f4f4f1; --soft:#ecebe6; --line:#e3e1da;
  --radius:6px; --radius-sm:4px;
  --shadow:0 1px 2px rgba(22,34,79,.06),0 4px 14px rgba(22,34,79,.06);
  --font:"Sarabun","Noto Sans Thai",system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;
  --head:"Kanit","Sarabun",system-ui,sans-serif;
  --nav-h:52px;
}
[data-theme=dark]{--bg:#0d1226;--card:#151c36;--soft:#1b2444;--line:#26304f}
body{font-size:16.5px}
a:hover{color:var(--red)}
.btn{border-radius:6px}

/* ---------- แถบบนสุด ---------- */
.topbar{background:var(--yellow);color:var(--brand)}
.topbar .clock{color:var(--brand);font-weight:600}
.topbar a,.topbar .today{color:var(--brand)!important}
.topbar a:hover{color:var(--red)!important}

/* ---------- ส่วนหัว ---------- */
.masthead{background:var(--card);border-bottom:0;position:relative}
.masthead::after{content:"";display:block;height:6px;background:linear-gradient(90deg,var(--yellow) 0 33%,var(--red) 33% 66%,var(--brand) 66%)}
.masthead-in{padding-top:12px;padding-bottom:12px}
.brand img.brand-logo{height:96px;border-radius:4px}
.mast-info{display:flex;flex-direction:column;line-height:1.15;padding-left:18px;border-left:3px solid var(--red)}
.mast-kicker{font-size:12.5px;letter-spacing:.5px;color:var(--muted);text-transform:uppercase}
.mast-name{font-family:var(--head);font-size:30px;font-weight:700;color:var(--brand)}
[data-theme=dark] .mast-name{color:#fff}
.mast-tag{font-family:var(--head);font-size:15px;color:var(--red);font-weight:500}
@media (max-width:900px){.mast-info{display:none}}

/* ---------- เมนูหลัก ---------- */
.mainnav{background:var(--red);box-shadow:0 3px 0 var(--brand)}
.menu a{color:#fff;border-radius:4px;font-family:var(--head);font-weight:500;font-size:14.5px}
.menu a:hover{background:rgba(0,0,0,.15);color:#fff}
.menu a.on{background:var(--yellow);color:var(--brand)}
.nav-btn{color:#fff}
.nav-logo span{color:#fff}
.searchbar button{background:var(--red)}

/* ---------- แถบข่าววิ่ง ---------- */
.ticker{background:var(--brand);border-bottom:0}
.ticker-label{background:var(--yellow);color:var(--brand);border-radius:3px}
.ticker-label .pulse{background:var(--red)}
.ticker-move a{color:#fff}
.ticker-move a:hover{color:var(--yellow)}
.ticker-track{mask-image:none}

/* ---------- หัวข้อส่วน ---------- */
.sec-head{border-bottom:3px solid var(--brand);padding-bottom:0;align-items:flex-end}
.sec-head h2{background:var(--brand);color:#fff;padding:7px 16px 5px;border-radius:4px 4px 0 0;font-size:20px;margin-bottom:-3px;position:relative}
.sec-head h2 small{color:var(--yellow)}
.sec-head .bar{width:10px;height:10px;border-radius:0;background:var(--yellow);transform:rotate(45deg)}
.sec-head.light{border-color:var(--yellow)}
.sec-head.light h2{background:var(--yellow);color:var(--brand)}
.sec-head.light h2 small{color:var(--red)}
.sec-head .tabs{margin-bottom:6px}
.tabs{border-radius:4px}
.tabs button{border-radius:3px}
.tabs button.on{background:var(--red)}

/* ---------- ข่าวเด่นแบบโมเสก ---------- */
.mosaic{display:grid;grid-template-columns:2fr 1fr 1fr;grid-template-rows:230px 230px;gap:10px;margin-top:18px}
.mosaic .m-big{grid-row:1/3}
.mosaic .tile{border-radius:var(--radius);min-height:0;box-shadow:none}
.mosaic .tile-txt{padding:14px 16px}
.mosaic .tile-txt h3{font-size:15.5px;line-height:1.4;-webkit-line-clamp:3}
.mosaic .m-big .tile-txt{padding:22px 24px}
.mosaic .m-big .tile-txt h3{font-size:clamp(19px,2vw,26px);-webkit-line-clamp:3}
.mosaic .tile-txt p{color:#e2e6f0;margin:6px 0;font-size:15px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mosaic .tile-txt .meta{color:#cfd6e6;font-size:12.5px}
.mosaic .m-big .badge-cat{background:var(--yellow);color:var(--brand)!important}
.tile::after{background:linear-gradient(180deg,transparent 35%,rgba(14,23,55,.6) 62%,rgba(14,23,55,.95))!important}
.badge-cat{border-radius:3px}
@media (max-width:900px){
  .mosaic{grid-template-columns:1fr 1fr;grid-template-rows:300px 170px 170px}
  .mosaic .m-big{grid-column:1/3;grid-row:auto}
}
@media (max-width:520px){
  .mosaic{grid-template-rows:240px 150px 150px;gap:6px}
  .mosaic .tile-txt h3{font-size:13.5px}
  .mosaic .tile-txt{padding:10px}
}

/* ---------- แผงหมวดข่าว ---------- */
.cat-panel{margin-top:18px}
.cat-panel>*{position:relative}
.cat-panel{background:none}
.cat-panel h2{font-size:19px;color:var(--brand);font-weight:600;display:inline-block;padding-bottom:6px;margin-bottom:12px;border-bottom:3px solid var(--red)}
[data-theme=dark] .cat-panel h2{color:#fff}
.cat-chips{display:flex;flex-wrap:wrap;gap:8px}
.cat-chips a{padding:7px 18px;border-radius:999px;background:var(--card);border:1px solid var(--line);font-family:var(--head);font-size:14.5px;color:var(--brand);transition:.15s}
[data-theme=dark] .cat-chips a{color:#fff}
.cat-chips a:hover{background:var(--c);border-color:var(--c);color:#fff}
.cat-panel{padding:16px 18px;background:linear-gradient(135deg,#fff 0%,#fffbe0 100%);border:1px solid var(--line);border-radius:var(--radius)}
[data-theme=dark] .cat-panel{background:var(--card)}

/* ---------- เลย์เอาต์: sidebar ซ้าย ---------- */
.layout-rev{grid-template-columns:320px minmax(0,1fr)}
.layout-rev .col-side{order:-1}
@media (max-width:1024px){.layout-rev{grid-template-columns:1fr}.layout-rev .col-side{order:2;position:static}}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.grid-2 .card .card-body h3{font-size:17px}
.grid-2 .row-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
@media (max-width:600px){.grid-2{grid-template-columns:1fr}}
.card{border-radius:var(--radius)}
.card:hover{transform:translateY(-2px);border-color:var(--red)}
.pop-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.pop-list li{display:grid;grid-template-columns:44px 150px 1fr;gap:14px;align-items:center;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:10px}
.pop-no{font-family:var(--head);font-size:30px;font-weight:700;color:var(--red);text-align:center}
.pop-thumb .thumb{border-radius:4px}
.pop-list h3{font-size:16px;margin:6px 0 4px}
@media (max-width:600px){.pop-list li{grid-template-columns:32px 100px 1fr}.pop-no{font-size:22px}}
.more-btn{border-radius:var(--radius);background:var(--brand);color:#fff;border:0}
.more-btn:hover{background:var(--red)}

/* ---------- Sidebar ---------- */
.widget{border-radius:var(--radius);border-top:4px solid var(--red)}
.w-title{color:var(--brand)}
[data-theme=dark] .w-title{color:#fff}
.rank-no{background:var(--yellow)!important;color:var(--brand)!important;border-radius:4px!important}

/* ---------- กระดานข่าวตามหมวด ---------- */
.board{border-radius:var(--radius);border-top:0;border-left:6px solid var(--c);padding:18px 20px}
.board-head{border-bottom:1px dashed var(--line);padding-bottom:12px}
.board-ic{border-radius:4px}
.board-head h2{font-size:22px}
.feature-body{display:grid;grid-template-columns:1.4fr 1fr;gap:18px}
.feature-body .f-lead{border-radius:var(--radius);min-height:320px}
.feature-body .f-lead .tile-txt{padding:20px}
.feature-body .f-lead h3{font-size:21px;-webkit-line-clamp:3}
.feature-body .f-lead .meta{color:#cfd6e6}
.f-list{display:flex;flex-direction:column}
.f-item{padding:12px 0 12px 16px;border-bottom:1px solid var(--line);position:relative}
.f-item::before{content:"";position:absolute;left:0;top:19px;width:7px;height:7px;background:var(--c);transform:rotate(45deg)}
.f-item:first-child{padding-top:2px}.f-item:first-child::before{top:9px}
.f-item:last-child{border:0}
.f-item h4{font-size:16px;font-weight:500;line-height:1.4;margin-bottom:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.board-body.rev{grid-template-columns:1fr 1.25fr}
.card-grid.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:900px){
  .feature-body,.board-body.rev{grid-template-columns:1fr}
  .board-body.rev .lead-card{order:-1}
  .card-grid.g4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- วิดีโอ / ชวนลงโฆษณา / ส่วนท้าย ---------- */
.video-band{background:linear-gradient(160deg,#0e1737,#16224f 60%,#2a1030)}
.ad-cta-in{background:linear-gradient(110deg,var(--brand) 0 55%,var(--red) 55%)!important;border-radius:var(--radius)!important}
.footer{background:#0e1737;border-top:6px solid var(--yellow)}
.footer h4{color:var(--yellow)}
.footer .brand img.brand-logo{background:#fff;padding:4px;border-radius:4px;max-height:90px}
.f-adbtn{background:var(--red)!important}
.footer-bottom{background:#0a1029}
.to-top{background:var(--red)}
.cat-hero{background:linear-gradient(120deg,var(--brand),var(--c,var(--red)))}
#readProgress{background:linear-gradient(90deg,var(--yellow),var(--red))}
.feature-body>*,.board-body>*,.mosaic>*{min-width:0}
@media (max-width:900px){.feature-body .f-lead{min-height:240px}}
@media (max-width:520px){
  .mosaic{grid-template-rows:240px;grid-auto-rows:150px}
  .mosaic .m-sm .tile-txt .meta,.mosaic .m-big .tile-txt p{display:none}
  .mosaic .m-sm .tile-txt h3{-webkit-line-clamp:2;margin-top:4px}
  .mosaic .m-sm .badge-cat{font-size:10.5px;padding:1px 7px}
  .cat-panel h2{font-size:16px}
  .cat-chips a{padding:6px 13px;font-size:13.5px}
}
.feature-body .f-lead,.mosaic .tile{aspect-ratio:auto}
