/* หน้าข่าว/บทความ (ใช้ร่วมกับ styles.css) */
.news-page main.wrap { padding-top: 18px; max-width: 1040px; }
.news-nav { display: flex; gap: 4px; }
.news-nav a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.news-nav a:hover { color: var(--text); }
.news-nav a.on { color: #fff; background: rgba(225, 29, 42, .16); }
.n-h1 { font-size: 22px; margin: 4px 0 12px; }
.n-chips { margin: 0 0 16px; flex-direction: row; flex-wrap: wrap; position: static; background: none; }
.n-chips .chip { display: inline-flex; align-items: center; text-decoration: none; }

.n-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.n-card {
  display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.n-card:hover { border-color: rgba(225, 29, 42, .6); transform: translateY(-2px); }
.n-cover { aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.n-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.n-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #2a0608, #131316 60%), url('/assets/icon-192.png') center / 64px no-repeat; background-blend-mode: normal; }
.n-body { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; }
.n-body h3 { margin: 0; font-size: 16px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.n-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.n-body time { color: #71717a; font-size: 12px; }
.n-cat { display: inline-block; justify-self: start; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 7px; }
.n-pager { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; color: var(--muted); font-size: 14px; }
.n-pager a { color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }

.article { max-width: 760px; margin: 0 auto; }
.n-back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.n-back:hover { color: var(--text); }
.article h1 { font-size: 28px; line-height: 1.4; margin: 10px 0 8px; }
.a-meta { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.a-cover { width: 100%; border-radius: var(--radius); margin-bottom: 18px; display: block; }
.a-content { font-size: 17px; line-height: 1.9; color: #e4e4e7; }
.a-content h2 { font-size: 22px; margin: 28px 0 10px; padding-left: 10px; border-left: 4px solid var(--accent); line-height: 1.4; }
.a-content h3 { font-size: 19px; margin: 22px 0 8px; }
.a-content p { margin: 0 0 16px; }
.a-content img { max-width: 100%; border-radius: 10px; display: block; margin: 8px 0; }
.a-content a { color: var(--accent-2); }
.a-content blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid #52525b; background: var(--panel); border-radius: 0 10px 10px 0; color: #d4d4d8; }
.a-content ul, .a-content ol { padding-left: 22px; margin: 0 0 16px; }
.a-content hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
/* ปุ่มติดต่อท้ายบทความ */
.a-contact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 28px 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.ct-btn { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; font-weight: 600; transition: filter .15s, transform .15s; }
.ct-btn svg { width: 20px; height: 20px; flex: 0 0 20px; }
.ct-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ct-btn.line { background: #06c755; }
.ct-btn.fb { background: #1877f2; }
.n-more h2 { font-size: 18px; margin: 10px 0 12px; }

@media (max-width: 900px) { .n-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .news-page body, body.news-page { padding-bottom: 0; }
  .n-grid { grid-template-columns: 1fr; gap: 10px; }
  .n-card { grid-template-columns: 120px 1fr; grid-template-rows: none; }
  .n-cover { aspect-ratio: auto; height: 100%; min-height: 96px; }
  .n-body { padding: 10px 12px; }
  .n-body h3 { font-size: 15px; }
  .n-body p { display: none; }
  .article h1 { font-size: 22px; }
  .a-content { font-size: 16px; }
  .news-nav a { padding: 6px 8px; font-size: 13px; }
}

/* ---------- พรีวิวคู่บอล (บทวิเคราะห์) ---------- */
.pv-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: linear-gradient(135deg, #2a0608 0%, var(--panel) 55%, #0c1530 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px; margin: 4px 0 20px; }
.pv-team { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.pv-team b { font-size: 16px; line-height: 1.35; }
.pv-team small { color: var(--muted); font-size: 12px; }
.pv-logo { width: 64px; height: 64px; object-fit: contain; }
.pv-mini { width: 22px; height: 22px; object-fit: contain; flex: 0 0 22px; }
.pv-noimg { display: inline-block; background: var(--panel-2); border-radius: 50%; }
.pv-mid { display: grid; justify-items: center; gap: 4px; text-align: center; }
.pv-league { font-size: 12px; color: #fca5a5; font-weight: 600; }
.pv-vs { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.pv-time { font-size: 13px; color: var(--text); white-space: nowrap; }
.pv-venue { font-size: 11px; color: var(--muted); max-width: 150px; }

.pv-sec { margin: 26px 0; }
.pv-title { font-size: 19px; margin: 0 0 12px; padding-left: 10px; border-left: 4px solid var(--accent); line-height: 1.4; }
.pv-note { color: #71717a; font-size: 12px; margin: 8px 0 0; }
.pv-empty { color: var(--muted); font-size: 13px; margin: 6px 0; }
.pv-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pv-tally { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.pv-tally-n { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pv-tally-n span:nth-child(2) { text-align: center; } .pv-tally-n span:last-child { text-align: right; }
.pv-tally-n b { display: block; font-size: 22px; color: var(--text); }
.pv-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--panel-2); }
.pv-bar .w { background: var(--accent); } .pv-bar .d { background: #71717a; } .pv-bar .l { background: var(--blue); }

.pv-h2h { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pv-h2h-row { display: grid; grid-template-columns: 74px 1fr auto 1fr; align-items: center; gap: 8px; padding: 9px 12px; font-size: 14px; }
.pv-h2h-row + .pv-h2h-row { border-top: 1px solid var(--line); }
.pv-h2h-row time { color: var(--muted); font-size: 12px; }
.pv-h2h-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d4d4d8; }
.pv-h2h-row .t.r { text-align: right; }
.pv-h2h-row .t.win { color: #fff; font-weight: 700; }
.pv-h2h-row .sc { font-weight: 700; background: var(--panel-2); border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-h2h-row small { grid-column: 2 / -1; color: #71717a; font-size: 11px; text-align: center; margin-top: -4px; }

.pv-form, .pv-line { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.pv-form-h { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pv-form-h b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-pills { margin-left: auto; display: flex; gap: 3px; }
.pv-pill { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; flex: 0 0 22px; }
.pv-pill.W { background: #16a34a; } .pv-pill.D { background: #71717a; } .pv-pill.L { background: #dc2626; }
.pv-form-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.pv-form-row + .pv-form-row { border-top: 1px dashed #26262c; }
.pv-form-row .o { flex: 1; min-width: 0; display: grid; overflow: hidden; }
.pv-form-row .o small { color: #71717a; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-form-row b { font-variant-numeric: tabular-nums; }

.pv-fm { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 2px 8px; }
.pv-players { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pv-players li { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 5px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pv-players .pos { flex: 0 0 30px; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); background: var(--panel-2); border-radius: 4px; padding: 1px 0; }

.pv-score { text-align: center; background: radial-gradient(circle at 50% 0%, rgba(225, 29, 42, .28), var(--panel) 70%); border: 1px solid rgba(225, 29, 42, .45); border-radius: var(--radius); padding: 16px 12px 14px; margin: 26px 0; }
.pv-score-t { font-size: 13px; font-weight: 700; color: #fca5a5; letter-spacing: .5px; }
.pv-score-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 10px 0 8px; }
.pv-team.s .pv-logo { width: 48px; height: 48px; }
.pv-team.s b { font-size: 14px; }
.pv-score-n { font-size: 40px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.pv-score-n i { font-style: normal; color: var(--muted); margin: 0 10px; }
.pv-score small { color: #71717a; font-size: 11px; }

@media (max-width: 640px) {
  .pv-2col { grid-template-columns: 1fr; }
  .pv-logo { width: 52px; height: 52px; }
  .pv-team b { font-size: 14px; }
  .pv-vs { font-size: 22px; }
  .pv-h2h-row { grid-template-columns: 62px 1fr auto 1fr; font-size: 13px; padding: 8px 10px; gap: 6px; }
  .pv-score-n { font-size: 34px; }
  .pv-players { grid-template-columns: 1fr 1fr; column-gap: 10px; }
  .pv-players li { font-size: 13px; min-width: 0; }
}

/* ---------- ภาพปกอัตโนมัติ (โลโก้สองทีม) ---------- */
.n-cover { position: relative; }
.n-vs { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; padding: 22px 10px 10px;
  background: radial-gradient(circle at 50% 120%, rgba(225, 29, 42, .45), transparent 60%), linear-gradient(135deg, #2a0608 0%, #131316 50%, #0c1530 100%); }
.n-vs::after { content: ''; position: absolute; inset: 0; background: url('/assets/icon-192.png') right 8px bottom 8px / 22px no-repeat; opacity: .5; pointer-events: none; }
.n-vs-l { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 600; color: #fca5a5; letter-spacing: .3px; }
.n-vs-t { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.n-vs-t img, .n-vs-t i { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.n-vs-t i { display: block; border-radius: 50%; background: var(--panel-2); }
.n-vs-t b { font-size: 13px; line-height: 1.3; color: #fff; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n-vs-x { font-size: 20px; font-weight: 800; color: #fff; text-shadow: 0 0 12px rgba(225, 29, 42, .8); }

/* ---------- ป้าย NEW กระพริบ ---------- */
@keyframes kg-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.94); } }
.n-new { position: absolute; top: 8px; left: 8px; z-index: 1; background: #fbbf24; color: #111; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  border-radius: 5px; padding: 2px 7px; box-shadow: 0 0 12px rgba(251, 191, 36, .6); animation: kg-blink 1.1s ease-in-out infinite; }
.tab { position: relative; }
.tab-new { position: absolute; top: 0; right: calc(50% - 30px); background: #fbbf24; color: #111; font-size: 9px; font-weight: 800; line-height: 1;
  border-radius: 4px; padding: 2px 4px; letter-spacing: .3px; animation: kg-blink 1.1s ease-in-out infinite; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .n-new, .tab-new { animation: none; } }
/* มือถือ: ปกเป็นภาพย่อ 120px → โชว์แค่โลโก้ + VS */
@media (max-width: 640px) {
  .n-vs { padding: 6px; gap: 2px; }
  .n-vs-l, .n-vs-t b, .n-vs::after { display: none; }
  .n-vs-t img, .n-vs-t i { width: 36px; height: 36px; }
  .n-vs-x { font-size: 12px; }
  .n-new { top: 5px; left: 5px; font-size: 9px; padding: 1px 5px; }
}
