/*
Theme Name: ProOnet
Theme URI: https://pronop.com/
Author: ProNop
Description: ธีมคลังข้อสอบออนไลน์สำหรับใช้งานร่วมกับ ProNop มีระบบค้นหา ตัวกรอง และการ์ดข้อสอบแยกตามวิชา
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: proonet
*/

:root {
    --po-navy: #172f52;
    --po-blue: #2f68dc;
    --po-sky: #eaf3ff;
    --po-red: #ce2f3e;
    --po-gold: #f5ad35;
    --po-ink: #17243a;
    --po-muted: #68758a;
    --po-line: #dce4ef;
    --po-soft: #f5f8fc;
    --po-white: #fff;
    --po-radius: 20px;
    --po-shadow: 0 14px 35px rgba(23,47,82,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; color: var(--po-ink); background: #f7f9fc; font-family: "Noto Sans Thai", Tahoma, Arial, sans-serif; line-height: 1.55; overflow-x: hidden; }
body.admin-bar .site-header { top: 32px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; }
.po-wrap { width: min(1460px, calc(100% - 48px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { position: sticky; z-index: 100; top: 0; background: var(--po-white); border-bottom: 1px solid var(--po-line); box-shadow: 0 5px 16px rgba(23,47,82,.06); }
.site-header__inner { min-height: 82px; display: flex; align-items: center; gap: 26px; }
.site-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; }
.site-brand__mark { display: grid; place-items: center; width: 52px; aspect-ratio: 1; border-radius: 16px; color: #fff; font-size: 28px; font-weight: 900; background: linear-gradient(145deg, var(--po-blue), #6858e8); box-shadow: 0 8px 18px rgba(47,104,220,.25); }
.site-brand__text { display: grid; line-height: 1.15; }
.site-brand__text strong { font-size: 24px; }
.site-brand__text small { margin-top: 5px; color: var(--po-muted); font-size: 11px; }
.custom-logo { width: auto; max-height: 58px; }
.primary-nav { margin-left: auto; }
.primary-menu { display: flex; align-items: center; gap: 4px; padding: 0; margin: 0; list-style: none; }
.primary-menu a { display: block; padding: 13px 14px; color: #41506a; border-radius: 12px; font-weight: 700; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { color: var(--po-blue); background: var(--po-sky); }
.header-account { display: inline-flex; align-items: center; gap: 9px; padding: 10px 15px; border: 1px solid #cadaf2; border-radius: 14px; color: var(--po-navy); font-weight: 800; white-space: nowrap; }
.header-account:hover { border-color: var(--po-blue); color: var(--po-blue); }
.header-account img { border-radius: 50%; }
.menu-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border: 1px solid #ccd8e8; border-radius: 13px; background: var(--po-white); color: var(--po-navy); font-size: 23px; cursor: pointer; }

.po-main { min-height: 70vh; }
.po-hero { padding: 62px 0 34px; background: radial-gradient(circle at 12% 20%, #eef6ff 0 18%, transparent 40%), linear-gradient(180deg,#fff 0,#f7f9fc 100%); }
.po-hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; color: var(--po-red); font-weight: 850; letter-spacing: .02em; }
.po-hero h1 { max-width: 900px; margin: 0; color: var(--po-navy); font-size: clamp(32px,4vw,54px); line-height: 1.2; }
.po-hero__lead { max-width: 760px; margin: 12px 0 0; color: var(--po-muted); font-size: 18px; }

.po-search-panel { position: relative; z-index: 2; padding-bottom: 35px; }
.po-search-form { padding: 22px; border: 1px solid var(--po-line); border-radius: var(--po-radius); background: var(--po-white); box-shadow: var(--po-shadow); }
.po-search-form__keyword { display: flex; gap: 10px; margin-bottom: 15px; }
.po-search-form__keyword input { flex: 1; min-width: 0; height: 54px; padding: 0 18px; border: 1px solid #cfd9e7; border-radius: 14px; outline: none; }
.po-search-form input:focus, .po-search-form select:focus { border-color: var(--po-blue); box-shadow: 0 0 0 3px rgba(47,104,220,.12); }
.po-search-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 130px; padding: 0 22px; border: 0; border-radius: 14px; color: #fff; background: var(--po-blue); font-weight: 850; cursor: pointer; box-shadow: 0 8px 18px rgba(47,104,220,.20); }
.po-search-button:hover { background: #2358c6; }
.po-filter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.po-field label { display: block; margin: 0 0 6px; color: #536177; font-size: 13px; font-weight: 750; }
.po-field select { width: 100%; height: 50px; padding: 0 42px 0 14px; border: 1px solid #cfd9e7; border-radius: 12px; color: var(--po-ink); background: #fff; outline: none; }

.po-subjects { padding: 8px 0 42px; }
.po-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.po-section-heading h2 { margin: 0; color: var(--po-navy); font-size: clamp(24px,3vw,34px); }
.po-section-heading p { margin: 5px 0 0; color: var(--po-muted); }
.po-view-all { flex: 0 0 auto; padding: 10px 15px; border: 1px solid #cbd8eb; border-radius: 12px; color: var(--po-blue); background: #fff; font-weight: 800; }
.po-view-all:hover { color: #fff; border-color: var(--po-blue); background: var(--po-blue); }
.po-subject-block { padding: 25px 0 30px; border-top: 1px solid var(--po-line); }
.po-subject-block:first-child { border-top: 0; }
.po-exam-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.po-exam-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--po-line); border-radius: 18px; background: #fff; box-shadow: 0 7px 20px rgba(23,47,82,.07); transition: transform .2s ease, box-shadow .2s ease; }
.po-exam-card:hover { transform: translateY(-5px); box-shadow: var(--po-shadow); }
.po-exam-card__media { position: relative; display: grid; place-items: center; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg,#dff2ff,#fff0dc); }
.po-exam-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.po-exam-card:hover .po-exam-card__media img { transform: scale(1.035); }
.po-exam-card__placeholder { font-size: clamp(46px,7vw,78px); }
.po-exam-card__type { position: absolute; top: 12px; left: 12px; padding: 5px 10px; border-radius: 999px; color: #fff; background: rgba(23,47,82,.88); font-size: 12px; font-weight: 800; backdrop-filter: blur(5px); }
.po-exam-card__body { padding: 16px 17px 18px; }
.po-exam-card__body h3 { min-height: 2.8em; margin: 0 0 10px; color: var(--po-navy); font-size: 17px; line-height: 1.4; }
.po-exam-card__meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; color: var(--po-muted); font-size: 13px; }
.po-exam-card__meta span { padding: 4px 8px; border-radius: 8px; background: var(--po-soft); }
.po-exam-card__action { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--po-blue); font-weight: 850; }
.po-empty { padding: 46px 24px; border: 2px dashed #cad8ea; border-radius: var(--po-radius); text-align: center; background: #fff; }
.po-empty__icon { display: block; margin-bottom: 10px; font-size: 46px; }
.po-empty h2, .po-empty h3 { margin: 0 0 7px; color: var(--po-navy); }
.po-empty p { margin: 0 0 16px; color: var(--po-muted); }
.po-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 16px; border: 0; border-radius: 12px; color: #fff; background: var(--po-blue); font-weight: 800; }

.po-page { padding: 42px 0 65px; }
.po-page-card { padding: clamp(20px,4vw,48px); border: 1px solid var(--po-line); border-radius: 24px; background: #fff; box-shadow: var(--po-shadow); }
.po-page-card h1 { margin-top: 0; color: var(--po-navy); }
.po-exam-header { display: grid; grid-template-columns: minmax(0,1fr) minmax(270px,420px); gap: 32px; align-items: center; margin-bottom: 28px; }
.po-exam-header__cover { overflow: hidden; border-radius: 18px; background: var(--po-sky); }
.po-exam-header__cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.po-breadcrumb { margin: 0 0 12px; color: var(--po-blue); font-weight: 750; }
.po-exam-title { margin: 0 0 12px; color: var(--po-navy); font-size: clamp(28px,4vw,46px); line-height: 1.22; }
.po-exam-player { padding-top: 25px; border-top: 1px solid var(--po-line); }
.po-content { overflow-wrap: anywhere; }
.po-content iframe { max-width: 100%; }
.po-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.po-pagination .page-numbers { padding: 8px 12px; border: 1px solid var(--po-line); border-radius: 10px; background: #fff; }
.po-pagination .current { color: #fff; border-color: var(--po-blue); background: var(--po-blue); }

.site-footer { padding: 34px 0; color: #d8e4f6; background: var(--po-navy); }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer strong { color: #fff; }
.site-footer p { margin: 4px 0 0; }
.footer-menu { display: flex; gap: 18px; padding: 0; margin: 0; list-style: none; }
.footer-menu a:hover { color: #fff; }

@media (max-width: 1050px) {
    .po-exam-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .primary-menu a { padding-inline: 9px; }
    .site-brand__text small { display: none; }
}
@media (max-width: 820px) {
    body.admin-bar .site-header { top: 46px; }
    .po-wrap { width: min(100% - 28px, 720px); }
    .site-header__inner { min-height: 72px; gap: 11px; }
    .site-brand__mark { width: 46px; border-radius: 14px; font-size: 24px; }
    .site-brand__text strong { font-size: 21px; }
    .menu-toggle { display: block; }
    .primary-nav { position: absolute; top: calc(100% + 1px); right: 14px; left: 14px; display: none; padding: 12px; border: 1px solid var(--po-line); border-radius: 16px; background: #fff; box-shadow: var(--po-shadow); }
    .primary-nav.is-open { display: block; }
    .primary-menu { display: grid; }
    .primary-menu a { padding: 11px 13px; }
    .header-account { padding: 9px 12px; }
    .header-account span { display: none; }
    .po-hero { padding-top: 40px; }
    .po-filter-grid { grid-template-columns: 1fr; }
    .po-exam-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .po-exam-header { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .po-wrap { width: min(100% - 20px, 500px); }
    .site-brand__text strong { font-size: 19px; }
    .header-account { min-width: 44px; justify-content: center; padding: 7px; }
    .po-hero { padding: 30px 0 23px; }
    .po-hero h1 { font-size: 31px; }
    .po-hero__lead { font-size: 15px; }
    .po-search-form { padding: 14px; border-radius: 16px; }
    .po-search-form__keyword { display: grid; }
    .po-search-button { min-height: 48px; }
    .po-section-heading { align-items: start; }
    .po-section-heading p { font-size: 14px; }
    .po-view-all { padding: 8px 10px; font-size: 13px; }
    .po-exam-grid { grid-template-columns: 1fr; }
    .po-exam-card { display: grid; grid-template-columns: 42% minmax(0,1fr); }
    .po-exam-card__media { height: 100%; aspect-ratio: auto; min-height: 154px; }
    .po-exam-card__type { top: 8px; left: 8px; padding: 4px 7px; font-size: 10px; }
    .po-exam-card__body { padding: 13px; }
    .po-exam-card__body h3 { min-height: 0; font-size: 15px; }
    .po-exam-card__meta { gap: 4px; font-size: 11px; }
    .po-exam-card__action { font-size: 13px; }
    .site-footer__inner { align-items: flex-start; flex-direction: column; }
}
