/*
Theme Name: Jaiyai98 Arena
Description: A Thai sports and games journal inspired by the badminton court.
Version: 1.0.0
Author: jaiyai98
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: jaiyai98-arena
License: GNU General Public License v2 or later
*/
:root {
    --deep: #052825;
    --forest: #10443f;
    --teal: #126258;
    --citron: #ddf77b;
    --frost: #f4f6f1;
    --ink: #12352e;
    --muted: #4c6259;
    --rule: #c6d0c6;
    --display: "Instrument Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
    --body: "Fahkwang", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--frost); color: var(--ink); font: 1rem/1.68 var(--body); overflow-wrap: break-word; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.35; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button, select, label[for] { cursor: pointer; }
img, svg, picture { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #3993ff; outline-offset: 3px; }
.frame { width: min(calc(100% - clamp(40px, 8.4vw, 160px)), 1512px); margin-inline: auto; }
.skip { position: fixed; z-index: 20; top: 6px; left: 8px; transform: translateY(-180%); background: white; color: var(--ink); padding: 8px 14px; }
.skip:focus { transform: none; }
.sr-only, .service-switch input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip-path: inset(50%); white-space: nowrap; overflow: hidden; }
.ui-icon { width: 17px; height: 17px; flex: none; }
.mast { background: var(--deep); color: #f3f6ec; }
.mast-inner, .wordmark, .mast-actions, .main-menu ul { display: flex; align-items: center; }
.mast-inner { gap: clamp(22px, 4.2vw, 75px); min-height: clamp(66px, 5.1vw, 81px); }
.wordmark { width: fit-content; gap: 9px; flex-shrink: 0; }
.wordmark img { width: 33px; height: 33px; }
.wordmark > span { font: 750 clamp(1.45rem, 2vw, 2.15rem)/1 var(--display); text-transform: uppercase; letter-spacing: -.08em; }
.wordmark b { color: var(--citron); }
.main-menu ul, .closing ul { margin: 0; padding: 0; list-style: none; }
.main-menu ul { gap: clamp(16px, 2.2vw, 39px); }
.main-menu a, .desk-login { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; font-size: .94rem; }
.main-menu a[aria-current], .main-menu a:hover, .desk-login:hover { color: var(--citron); }
.main-menu .drawer-login, .nav-toggle { display: none; }
.mast-actions { margin-left: auto; gap: clamp(12px, 2vw, 31px); }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 40px; min-height: 44px; padding: 8px 22px; width: fit-content; font-size: .94rem; line-height: 1.48; font-weight: 700; }
.action .ui-icon { width: 15px; height: 15px; }
.primary-action, .ink-action { background: var(--citron); color: #123731; }
.primary-action:hover, .ink-action:hover { background: #edff9f; }
.outline-action { color: #fff; border-color: #9ab8ac; background: #092d27a6; }
.outline-action:hover { background: #24564a; }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; width: fit-content; font-size: .91rem; font-weight: 700; }
.text-link .ui-icon { width: 15px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.cover { position: relative; isolation: isolate; overflow: hidden; background: #071c1c; color: white; }
.cover-art, .cover::after { position: absolute; inset: 0; z-index: -2; }
.cover-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 43%; }
.cover::after { content: ""; z-index: -1; background: linear-gradient(90deg, #031e1de8 0%, #041f1ded 22%, #06221caa 38%, #061c1710 58%, transparent 78%); }
.cover-inner { min-height: clamp(400px, 34vw, 560px); padding-block: clamp(38px, 3.9vw, 69px); display: flex; align-items: center; }
.cover-copy { width: min(48%, 650px); }
.cover h1 { font-size: clamp(2rem, 3.5vw, 4rem); }
.cover-brand { display: block; font: 800 clamp(4.8rem, 7.6vw, 8.8rem)/.91 var(--display); text-transform: uppercase; letter-spacing: -.088em; white-space: nowrap; }
.cover-brand > span { display: inline-block; padding-right: .045em; color: var(--citron); }
.cover-subjects { display: block; margin-top: 8px; color: white; font-weight: 650; font-size: clamp(1.7rem, 2.9vw, 3.2rem); }
.cover-copy > p { max-width: 31em; margin-top: 9px; color: #e2ede7; font-size: clamp(.99rem, 1.16vw, 1.25rem); }
.cover-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: clamp(16px, 1.7vw, 30px); }
.cover-copy > .member-note { margin-top: 7px; color: #d8e5de; font-size: .78rem; }

.themes, .journal { padding-block: clamp(26px, 3vw, 52px); }
.themes h2, .section-heading h2, .court-copy h2 { font-size: clamp(1.55rem, 2.6vw, 2.85rem); font-weight: 700; }
.themes h2 { margin-bottom: clamp(12px, 1.2vw, 22px); }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 24px); }
.topic-card { display: block; min-width: 0; background: white; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.topic-photo { position: relative; aspect-ratio: 2.4; overflow: hidden; background: #0e3733; }
.topic-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .24s ease; }
.topic-card:hover .topic-photo img { transform: scale(1.035); }
.topic-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 15px 0; }
.topic-label h3 { font-size: clamp(1.18rem, 1.75vw, 1.85rem); }
.topic-label .ui-icon { width: 23px; height: 23px; padding: 3px; color: var(--teal); border: 1px solid #c5d2c9; border-radius: 50%; }
.topic-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.topic-card p { padding: 3px 15px 13px; color: var(--muted); font-size: .9rem; line-height: 1.47; }

.court-section { border-block: 1px solid #afc6bb; background: #dce8df; }
.court-layout { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(24px, 6vw, 104px); align-items: center; padding-block: clamp(26px, 3.2vw, 54px); }
.court-copy h2 { margin-bottom: 6px; }
.court-copy p { max-width: 38em; color: #314d42; }
.court-copy .text-link { margin-top: 8px; color: #07554b; }
.service-switch { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; margin: 0; padding: clamp(12px, 1.5vw, 26px); min-width: 0; border: none; border-radius: 11px; background: var(--forest); color: white; }
.service-switch label { display: grid; place-items: center; min-height: 38px; padding: 5px 3px; color: #ebf3e9; border: 1px solid #79988c; border-radius: 4px; font-size: .85rem; font-weight: 650; }
.service-switch input:checked + label { background: var(--citron); color: var(--deep); border-color: var(--citron); }
.service-switch input:focus-visible + label { outline: 3px solid white; outline-offset: 1px; }
.service-result { display: none; grid-column: 1/-1; grid-template-columns: clamp(57px, 6.5vw, 99px) minmax(0,1fr); align-items: center; gap: clamp(12px, 1.6vw, 25px); padding-top: 13px; }
#serve-lead:checked ~ .result-lead, #serve-tie:checked ~ .result-tie, #serve-change:checked ~ .result-change { display: grid; }
.service-result strong { font-size: 1.17rem; }
.service-result p { color: #e4eee7; font-size: .88rem; line-height: 1.55; }
.court-diagram { position: relative; background: #397163; aspect-ratio: 1.05; border: 1px solid #bdd4b9; }
.court-diagram::after { content: ""; position: absolute; width: 1px; left: 50%; inset-block: 0; background: linear-gradient(#d9e8d0 31%, transparent 31% 69%, #d9e8d0 69%); }
.court-diagram .top-line, .court-diagram .bottom-line, .court-diagram .net { position: absolute; inset-inline: 0; height: 1px; top: 31%; background: #cddfc6; }
.court-diagram .bottom-line { top: 69%; }
.court-diagram .net { top: 50%; height: 2px; background: #eff3e5; }
.court-diagram .player { position: absolute; width: 11%; aspect-ratio: 1; top: 79%; left: 73%; background: var(--citron); border-radius: 50%; box-shadow: 0 0 0 2px #123731; }
.result-tie .player { top: 12%; left: 22%; }
.result-change .player { top: 12%; left: 71%; }

.section-heading, .journal-controls, .read-meta, .article-byline { display: flex; align-items: center; gap: 10px; }
.section-heading { flex-wrap: wrap; padding-bottom: 12px; }
.journal-controls { margin-left: auto; color: var(--muted); font-size: .86rem; }
.journal-controls select { color: var(--ink); padding: 6px 8px; background: white; border: 1px solid #92a69b; border-radius: 5px; }
.journal-controls[hidden] + .text-link { margin-left: auto; }
.journal-list, .read-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(14px,2vw,32px); }
.read-card { border-top: 2px solid var(--forest); min-width: 0; }
.read-cover { display: block; overflow: hidden; border-radius: 0 0 8px 8px; background: #ced9cd; }
.read-cover img { width: 100%; height: auto; aspect-ratio: 2.2; object-fit: cover; }
.read-body { padding: 12px 0; }
.read-meta { flex-wrap: wrap; gap: 4px 11px; color: var(--muted); font-size: .79rem; }
.read-meta span { color: #125548; font-weight: 700; }
.read-body h3, .read-body h2 { margin-top: 3px; font-size: clamp(1.14rem,1.57vw,1.7rem); }
.read-body a:hover, .closing a:hover, .article-byline a:hover, .crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.read-body p { margin-top: 6px; color: var(--muted); font-size: .93rem; }
.reader-desk { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: clamp(16px,3vw,51px); padding-block: 0 clamp(36px,4vw,72px); }
.feature-copy { align-self: start; border-top: 1px solid var(--rule); padding-top: 17px; }
.feature-copy h2, .member-body h2 { font-size: clamp(1.23rem,1.8vw,1.9rem); }
.feature-copy p, .feature-copy h2 + p { margin-top: 7px; }
.feature-copy a { text-decoration: underline; color: #075749; }
.member-panel { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); overflow: hidden; background: var(--deep); color: white; border-radius: 8px; }
.member-photo { position: relative; min-height: 155px; }
.member-photo img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.member-body { align-self: center; padding: clamp(14px,1.65vw,27px); }
.member-body a { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 8px; border-bottom: 1px solid #638074; color: #eff3e5; font-size: .92rem; }
.member-body .ui-icon { width: 14px; color: var(--citron); }
.member-body a:hover { color: var(--citron); }

.inner-head { padding-block: clamp(25px,4vw,70px); border-bottom: 1px solid #aec5b8; background: #dce7de; }
.inner-head h1 { max-width: 30em; font-size: clamp(1.9rem,3.5vw,4rem); overflow-wrap: anywhere; }
.inner-head p { max-width: 57em; color: #304d40; margin-top: 10px; }
.crumb { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: .82rem; color: #425d50; }
.article-byline { flex-wrap: wrap; margin-bottom: 5px; color: #164e3e; font-weight: 650; font-size: .84rem; }
.reading { display: grid; grid-template-columns: minmax(0,1fr) minmax(170px,27%); align-items: start; gap: clamp(16px,3.3vw,57px); padding-block: clamp(25px,3.2vw,55px) clamp(40px,5vw,87px); }
.prose { min-width: 0; border: 1px solid var(--rule); padding: clamp(18px,2.7vw,47px); border-radius: 8px; background: white; line-height: 1.85; font-size: 1.03rem; overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin: 1.15em 0 .44em; }
.prose h2 { font-size: clamp(1.25rem,1.85vw,2rem); }
.prose h3 { font-size: 1.13rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 .85em; }
.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .3em; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose a { color: #096455; text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin-block: 15px; }
.prose caption { text-align: start; font-weight: bold; padding-block: 5px; }
.prose th, .prose td { text-align: start; vertical-align: top; border: 1px solid #bdcec0; padding: 7px 9px; }
.prose th { background: #edf3eb; }
.outbound { padding: 15px; border-left: 3px solid var(--teal); margin-bottom: 20px; background: #ebf3e8; }
.outbound p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.prose a.action { text-decoration: none; color: var(--deep); }
.reading-side { border-radius: 8px; overflow: hidden; background: var(--forest); color: white; }
.reading-side img { width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; }
.reading-side .text-link { margin: 4px 15px; }
.post-links { display: grid; gap: 7px; margin-top: 21px; padding-top: 14px; border-top: 1px solid var(--rule); }
.archive-body, .missing { padding-block: clamp(23px,3.4vw,60px) clamp(38px,4.6vw,80px); }
.archive-intro { margin-bottom: 21px; }
.pagination, .missing .action { margin-top: 18px; }
.nav-links { display: flex; gap: 12px; flex-wrap: wrap; }
.closing { background: var(--deep); color: white; }
.closing-grid { display: grid; grid-template-columns: 1.5fr .8fr 1fr; gap: clamp(20px,4.5vw,76px); padding-block: clamp(30px,3.8vw,64px); }
.closing-brand p { margin-top: 12px; max-width: 27em; color: #d3e1d7; font-size: .9rem; }
.closing h2 { margin-bottom: 6px; color: var(--citron); font-size: 1rem; }
.closing li a { display: inline-block; padding-block: 3px; color: #ebf0e7; font-size: .91rem; }
.colophon { display: flex; justify-content: space-between; gap: 9px; flex-wrap: wrap; padding-block: 12px; border-top: 1px solid #547268; color: #c4d8cc; font-size: .78rem; }

@media (max-width:1050px) {
    .frame { width: 93%; }
    .mast-inner { gap: 22px; }
    .cover-copy { width: 50%; }
    .cover-inner { min-height: 384px; }
    .topic-label { padding-inline: 10px; }
    .topic-card p { padding-inline: 10px; }
}
@media (max-width:860px) {
    .mast-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 60px; gap: 0 8px; }
    .mast-inner > .wordmark { grid-area: 1/1; justify-self: start; }
    .mast-actions { grid-area: 1/2; gap: 8px; }
    .main-menu { grid-area: 2/1/3/-1; }
    .main-menu ul { flex-wrap: wrap; gap: 0 15px; }
    .main-menu .drawer-login { display: inline-flex; gap: 5px; }
    .desk-login, .nav-ready .main-menu { display: none; }
    .nav-ready .menu-open .main-menu { display: block; border-top: 1px solid #56746a; }
    .nav-ready .nav-toggle { display: inline-flex; align-items: center; justify-content: center; flex-direction: column; width: 42px; height: 42px; gap: 5px; border: 1px solid #82a194; border-radius: 50%; background: transparent; color: #fff; }
    .nav-toggle span { width: 15px; height: 2px; background: currentColor; }
    .cover-brand { font-size: clamp(4.1rem,9vw,5.2rem); }
    .cover-inner { min-height: 340px; }
    .topic-grid { gap: 8px; }
    .topic-photo { aspect-ratio: 1.9; }
    .topic-card p { font-size: .8rem; }
    .court-layout { gap: 20px; }
}
@media (max-width:680px) {
    .frame { width: calc(100% - 30px); }
    .mast-inner { min-height: 58px; }
    .wordmark img { width: 28px; height: 28px; }
    .wordmark { gap: 6px; }
    .wordmark > span { font-size: 1.42rem; }
    .mast-actions { gap: 5px; }
    .mast-actions .action { min-height: 37px; padding: 6px 11px; gap: 4px; font-size: .82rem; }
    .nav-ready .nav-toggle { width: 37px; height: 37px; }
    .cover-art img { object-position: 50% 37%; }
    .cover::after { background: linear-gradient(0deg, #021d1cf7 0%, #03211ef0 24%, #06231cd1 44%, #041d192a 74%, transparent); }
    .cover-inner { min-height: clamp(395px,105vw,545px); padding-block: clamp(105px,32vw,172px) 23px; align-items: end; }
    .cover-copy { width: 100%; }
    .cover-brand { font-size: clamp(3.3rem,14vw,5.65rem); }
    .cover-subjects { font-size: 1.65rem; margin-top: 5px; }
    .cover-copy > p { margin-top: 6px; max-width: 38em; font-size: .94rem; line-height: 1.58; }
    .cover-actions { margin-top: 12px; gap: 6px; }
    .cover-actions .action { min-height: 40px; padding: 6px 13px; font-size: .84rem; }
    .cover-copy > .member-note { margin-top: 6px; font-size: .75rem; }
    .themes, .journal { padding-block: 21px; }
    .themes h2 { margin-bottom: 10px; }
    .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .topic-photo { aspect-ratio: 2; }
    .topic-label { padding: 6px 8px 0; }
    .topic-label h3 { font-size: 1.14rem; }
    .topic-label .ui-icon { width: 20px; height: 20px; }
    .topic-card p { padding: 2px 8px 9px; font-size: .79rem; }
    .court-layout { grid-template-columns: minmax(0,1fr); gap: 11px; }
    .court-copy .text-link { margin-top: 3px; }
    .service-result { grid-template-columns: 70px minmax(0,1fr); }
    .section-heading { gap: 5px 8px; }
    .section-heading > .text-link { margin-left: auto; }
    .journal-controls { order: 3; width: 100%; margin-left: 0; }
    .journal-list, .read-grid { grid-template-columns: minmax(0,1fr); gap: 9px; }
    .read-card { display: grid; grid-template-columns: minmax(72px,30%) minmax(0,1fr); gap: 10px; border-top: 1px solid var(--rule); padding-top: 9px; }
    .read-cover { border-radius: 5px; }
    .read-cover img { height: 100%; aspect-ratio: auto; }
    .read-body { padding: 0; }
    .read-body h3, .read-body h2 { font-size: 1.08rem; }
    .read-body p { margin-top: 4px; font-size: .86rem; }
    .read-meta { font-size: .72rem; }
    .reader-desk, .reading { grid-template-columns: minmax(0,1fr); gap: 13px; }
    .member-photo { min-height: 125px; }
    .prose { padding: 15px; font-size: .96rem; }
    .prose th, .prose td { padding: 5px; font-size: .83rem; }
    .outbound { padding: 11px; }
    .reading-side { display: grid; grid-template-columns: 33% minmax(0,1fr); align-items: center; }
    .closing-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .closing-brand { grid-column: 1/-1; }
}
@media (max-width:365px) {
    .frame { width: calc(100% - 22px); }
    .wordmark > span { font-size: 1.32rem; }
    .mast-actions .ui-icon, .cover-actions .ui-icon { display: none; }
    .cover-actions .action { padding-inline: 10px; }
}
@media (prefers-reduced-motion:reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
