/* PATRUNNING design system (docs/theme-redesign-analysis-2026-10-30.md §6, mockup design/phase0/pr.css).
   Loaded only on pages switched to the new layout (inc/next.php). Every colour is a custom property; dark mode
   swaps tokens only. Fonts self-hosted, SIL OFL 1.1: IBM Plex Sans Thai 400/500/600 (text) + Kanit 400/600 (headings, logo). */

@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-400-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-500-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Thai"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-thai-600-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/kanit-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/kanit-400-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/kanit-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kanit"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/kanit-600-thai.woff2") format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }

/* ---------- Tokens (light). Dark mode only swaps tokens: html[data-theme="dark"] (key RubyDarkMode, as before). ---------- */
:root {
  --brand: #00c8c8;          /* bars, fills, chips (never small text on white) */
  --brand-ink: #00716f;      /* text/links/buttons: 5.9:1 on white, 5.1:1 on --brand-soft */
  --brand-soft: #e3f8f8;
  --on-brand: #032a2b;
  --accent: #ffb020;         /* register button + status badges */
  --on-accent: #2b1a00;
  --accent-soft: #fff3d6;
  --accent-ink: #8a5300;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-2: #eef2f2;
  --ink: #12191a;
  --muted: #56636a;
  --faint: #66737a;
  --line: #dfe5e6;
  --btn: #0f2a2b;            /* the one dark button per card */
  --on-btn: #ffffff;
  --header-bg: var(--brand);
  --header-ink: var(--on-brand);
  --footer-bg: #0d1f20;
  --footer-ink: #c9d6d7;
  --danger: #c0352b;
  --shadow: 0 1px 2px rgb(16 32 33 / .06), 0 4px 16px rgb(16 32 33 / .06);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "IBM Plex Sans Thai", system-ui, "Segoe UI", sans-serif;
  --font-head: "Kanit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --wrap: 1200px;
  --top: 0px;                /* admin bar height */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand-ink: #4fe0e0;
  --brand-soft: #0f3334;
  --accent-soft: #3a2a0a;
  --accent-ink: #ffc65c;
  --bg: #0c1415;
  --surface: #131e1f;
  --surface-2: #1a2829;
  --ink: #e6eeee;
  --muted: #a3b2b4;
  --faint: #7f9092;
  --line: #263738;
  --btn: #00c8c8;
  --on-btn: #032a2b;
  --header-bg: #0f2223;
  --header-ink: #e6eeee;
  --footer-bg: #091011;
  --footer-ink: #a9b8b9;
  --shadow: 0 1px 2px rgb(0 0 0 / .4);
  color-scheme: dark;
}
body.admin-bar { --top: 32px; }
@media (max-width: 782px) { body.admin-bar { --top: 0px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--font); overflow-wrap: anywhere; }
img, svg, video { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.3; margin: 0; letter-spacing: 0; color: inherit; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.55rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }
.sr-only, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; display: inline-block; }
.icon--fill { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.skip:focus { left: 8px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); margin: 0; }
.note { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: var(--top); z-index: 40; background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid color-mix(in srgb, var(--header-ink) 12%, transparent); }
.site-header > .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.logo-h { margin: 0; font-size: inherit; line-height: 1; }
.logo { font: 600 1.35rem/1 var(--font-head); color: inherit; text-decoration: none; letter-spacing: .02em; white-space: nowrap; display: inline-flex; align-items: center; }
.logo span { font-weight: 400; opacity: .8; }
:root[data-theme="dark"] .site-header .logo span { color: var(--brand-ink); opacity: 1; }
.logo__img { max-height: 40px; width: auto; }
@media (max-width: 374px) { .site-header .logo { font-size: clamp(1rem, 5vw, 1.35rem); } } /* menu + logo + 2 buttons fit one row down to 320 px */
.nav { display: none; margin-left: auto; min-width: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav__list { display: flex; gap: 2px; }
.nav__list > li { position: relative; }
.nav a { display: block; padding: 8px 8px; border-radius: 999px; color: inherit; text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap; }
.nav__list > li > a:hover, .nav__list > li:focus-within > a { background: color-mix(in srgb, var(--header-ink) 10%, transparent); }
.nav .current-menu-item > a, .nav .current-menu-ancestor > a { background: color-mix(in srgb, var(--header-ink) 14%, transparent); }
.nav .menu-item-has-children > a::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.2em) rotate(45deg); opacity: .7; }
.nav .sub-menu { position: absolute; left: 0; top: 100%; min-width: 240px; padding: 6px; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgb(0 0 0 / .18), inset 0 0 0 1px var(--line); visibility: hidden; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 45; }
.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
.nav .sub-menu a { border-radius: 6px; font-size: .92rem; }
.nav .sub-menu a:hover { background: var(--surface-2); }
.hdr-actions { display: flex; gap: 4px; margin-left: auto; }
.nav + .hdr-actions { margin-left: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn .icon { width: 22px; height: 22px; }
.theme-toggle .i-moon, :root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.menu-btn { flex: none; margin-left: -8px; }
@media (min-width: 1240px) { .nav { display: block; } .menu-btn { display: none; } }
.hdr-search { display: none; padding: 0 0 12px; }
.hdr-search:target, .hdr-search.is-open { display: block; }

/* off-canvas menu */
.offcanvas { position: fixed; inset: 0; z-index: 99999; visibility: hidden; }
.offcanvas.is-open { visibility: visible; }
.offcanvas__scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .45); opacity: 0; transition: opacity .2s; }
.offcanvas__panel { position: absolute; inset: 0 auto 0 0; width: min(320px, 86vw); background: var(--surface); color: var(--ink); padding: 12px 16px 24px; transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.offcanvas.is-open .offcanvas__scrim { opacity: 1; }
.offcanvas.is-open .offcanvas__panel { transform: none; }
.offcanvas__head { display: flex; align-items: center; justify-content: space-between; }
.offcanvas__head .logo { color: var(--ink); }
.offcanvas__head .logo span { color: var(--brand-ink); opacity: 1; }
.offcanvas ul { list-style: none; margin: 0; padding: 0; }
.offcanvas li a { display: flex; align-items: center; min-height: 48px; padding: 0 8px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.offcanvas .sub-menu a { padding-left: 24px; font-weight: 400; min-height: 44px; color: var(--muted); }
.offcanvas .current-menu-item > a { color: var(--brand-ink); }
@media (prefers-reduced-motion: reduce) { .offcanvas__panel, .offcanvas__scrim, .nav .sub-menu { transition: none; } }

/* ---------- Buttons, chips, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn:hover { filter: brightness(1.12); }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--brand { background: var(--brand-ink); color: #fff; }
:root[data-theme="dark"] .btn--brand { background: var(--brand); color: var(--on-brand); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row--top { margin-top: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-weight: 500; font-size: .93rem; white-space: nowrap; cursor: pointer; border: 0; }
.chip b { font-weight: 600; color: var(--muted); font-size: .85em; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.chip--type { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--ink); min-height: 32px; font-size: .88rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 9px; border-radius: 6px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge--today, .badge--ongoing { background: var(--accent); color: var(--on-accent); }
.badge--week, .badge--soon { background: var(--accent-soft); color: var(--accent-ink); }
.badge--free { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 28px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head a { flex: none; font-weight: 600; text-decoration: none; white-space: nowrap; font-size: .95rem; }
.section__title { margin-bottom: 14px; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
@media (min-width: 768px) { .panel { padding: 22px; } .section { padding: 36px 0; } }

/* ---------- Single event ---------- */
.ev-hero { position: relative; overflow: hidden; color: #fff; background: #10292a; }
.ev-hero__bg { position: absolute; inset: -40px; background: var(--brand) center / cover no-repeat; filter: blur(28px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.ev-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .25), rgb(0 0 0 / .55)); }
.ev-hero > .wrap { position: relative; z-index: 1; display: grid; gap: 18px; padding-top: 20px; padding-bottom: 26px; }
.ev-hero__poster { width: min(44%, 200px); justify-self: center; border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 40px rgb(0 0 0 / .45); aspect-ratio: 3 / 4; background: #1e3a3b; }
.ev-hero__poster img { width: 100%; height: 100%; object-fit: cover; }
.ev-hero__poster .pr-date { background: var(--brand); color: var(--on-brand); }
.ev-hero__poster .pr-date__w { color: var(--on-brand); opacity: .75; }
.ev-hero__poster .pr-date__d { font-size: 3.4rem; }
.ev-hero__poster .pr-date__m { font-size: 1.2rem; }
.ev-hero h1 { color: #fff; margin: 10px 0 14px; }
.ev-hero__info { min-width: 0; }
.crumbs { font-size: .85rem; opacity: .9; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.crumbs a { color: #fff; }
.chips--hero { align-items: center; }
.facts { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts .icon { width: 22px; height: 22px; margin-top: 2px; color: var(--brand); }
.facts small { display: block; opacity: .78; font-size: .8rem; }
.facts strong { font-weight: 600; }
.facts__sub { opacity: .8; }
.facts__map { color: #fff; font-size: .85rem; margin-left: 4px; }
.ev-hero--noimg .ev-hero__bg { background: linear-gradient(135deg, var(--brand), #0b4f50); opacity: .7; filter: none; }
@media (min-width: 900px) { .ev-hero--noimg h1 { max-width: 900px; } .ev-hero--noimg > .wrap { padding-top: 32px; padding-bottom: 36px; } .ev-hero--noimg .facts { grid-template-columns: repeat(auto-fit, minmax(190px, max-content)); column-gap: 36px; } }
.reg-note { font-size: .88rem; opacity: .88; margin: 8px 0 0; }
@media (min-width: 560px) { .facts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) {
  .ev-hero:not(.ev-hero--noimg) > .wrap { grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: center; padding-top: 36px; padding-bottom: 40px; }
  .ev-hero__poster { width: 100%; }
}
.ev-layout { display: grid; gap: 20px; padding-top: 22px; padding-bottom: 40px; }
.ev-layout > * { min-width: 0; }
@media (min-width: 980px) { .ev-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; } .ev-aside { position: sticky; top: calc(var(--top) + 80px); align-self: start; } }
.ev-main { display: grid; gap: 20px; }
.ev-main > * { min-width: 0; }
.ev-main .panel h2 { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.summary { font-size: 1.02rem; margin: 0; }
.dl { display: grid; gap: 12px 20px; margin: 16px 0 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dl dt { font-size: .82rem; color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.entry { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.entry img { border-radius: var(--radius-sm); margin: 12px 0; }
.entry > :last-child { margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
.prices { width: 100%; border-collapse: collapse; }
.prices th, .prices td { text-align: left; padding: 11px 6px; border-bottom: 1px solid var(--line); vertical-align: top; background: transparent; }
.prices th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.prices td:not(:first-child), .prices th:not(:first-child) { text-align: right; white-space: nowrap; }
.prices td small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.prices .early { color: var(--accent-ink); font-weight: 600; }
.prices s { color: var(--faint); }
.map { position: relative; display: block; width: 100%; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16 / 7; min-height: 150px; background: var(--surface-2); text-decoration: none; color: var(--ink); }
.map__art { position: absolute; inset: 0; width: 100%; height: 100%; }
.map__land { fill: var(--surface-2); }
.map__river { stroke: var(--brand-soft); stroke-width: 34; fill: none; }
.map__road { stroke: var(--line); stroke-width: 10; fill: none; }
.map__lane { stroke: var(--line); stroke-width: 4; fill: none; }
.map__block { fill: color-mix(in srgb, var(--brand) 25%, transparent); }
.map__pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: var(--danger); }
.map__pin .icon { width: 40px; height: 40px; filter: drop-shadow(0 2px 2px rgb(0 0 0 / .3)); }
.map__label { position: absolute; left: 10px; right: 10px; bottom: 10px; width: fit-content; max-width: calc(100% - 20px); background: var(--surface); padding: 4px 10px; border-radius: 6px; font-size: .82rem; box-shadow: var(--shadow); }
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.share .fb { background: #0866ff; color: #fff; }
.share .line { background: #06c755; color: #04210f; }
.past { list-style: none; margin: 0; padding: 0; }
.past li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.past li:last-child { border-bottom: 0; }
.past small { color: var(--muted); white-space: nowrap; }
.reg-card h2 { font-size: 1.1rem; margin-bottom: 6px; }
.reg-card .price-from { font: 600 1.5rem/1.2 var(--font-head); margin: 4px 0 12px; }
.reg-card .price-from small { font: 400 .85rem var(--font); color: var(--muted); }
.sticky-reg { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; gap: 10px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -6px 20px rgb(0 0 0 / .12); }
.sticky-reg .btn { flex: 1; min-width: 0; }
.sticky-reg__price { font-size: .8rem; color: var(--muted); line-height: 1.25; white-space: nowrap; }
.sticky-reg__price strong { display: block; color: var(--ink); font-size: 1rem; }
main.has-sticky { padding-bottom: 76px; }
@media (min-width: 980px) { .sticky-reg { display: none; } main.has-sticky { padding-bottom: 0; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.is-on { opacity: 1; }

/* ---------- Watermark: site name as text, bottom-left of images ---------- */
.wm { position: relative; }
.wm::after { content: "PATRUNNING.COM"; white-space: nowrap; position: absolute; left: 8px; bottom: 7px; z-index: 1; pointer-events: none; font: 600 .72rem/1 var(--font-head); letter-spacing: .04em; color: #fff; opacity: .9; padding: 3px 6px; border-radius: 4px; background: rgb(0 0 0 / .28); text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
.wm--lg::after { font-size: .62rem; }
@media (min-width: 900px) { .wm--lg::after { font-size: .9rem; left: 12px; bottom: 10px; padding: 4px 8px; } }

/* ---------- Ad slots (Advanced Ads placements). The slot keeps the creative's ratio: no layout shift. ---------- */
.ad { margin: 0 auto; width: 100%; max-width: var(--ad-max, 728px); }
.ad__label { font-size: .72rem; color: var(--faint); margin-bottom: 4px; letter-spacing: .04em; }
.ad__slot.has-ratio { aspect-ratio: var(--ad-ratio); overflow: hidden; }
.ad img { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--surface-2); }
.ad--one .ad__slot [role="region"] ~ [role="region"] { display: none; }
.ad__slot a { display: block; }
.ad--side { --ad-max: 100%; margin-top: 16px; }
.ad--feed { --ad-max: 600px; margin-top: 18px; }
@media (min-width: 980px) { .ad--mobile { display: none; } }
@media (max-width: 979px) { .ad--desktop { display: none; } }

/* ---------- Search box ---------- */
.search__box { display: flex; align-items: center; gap: 8px; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.search__box:focus-within { box-shadow: var(--shadow), inset 0 0 0 2px var(--brand-ink); }
.search__box .icon { color: var(--muted); }
.search__box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; min-height: 40px; font-size: 1rem; }
.search__box .btn { flex: none; }

/* ---------- Footer (the team's footer widgets) + cookie bar ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 40px; padding: 36px 0 20px; font-size: .93rem; }
main.has-sticky + .site-footer { margin-top: 0; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.site-footer h2, .site-footer .widget-title, .site-footer .widget-title * { font: 600 1rem/1.3 var(--font-head); color: #fff; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer .widget + .widget { margin-top: 18px; }
.site-footer img { max-width: 180px; }
.site-footer .logo { color: #fff; font-size: 1.4rem; }
.site-footer .copy { border-top: 1px solid rgb(255 255 255 / .12); margin-top: 28px; padding-top: 16px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 70; display: flex; align-items: center; gap: 8px 12px; max-width: 760px; margin: 0 auto; padding: 10px 12px 10px 16px; background: var(--ink); color: var(--bg); border-radius: 12px; font-size: .88rem; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
.cookie p { margin: 0; flex: 1 1 150px; line-height: 1.45; }
.cookie a { color: inherit; }
.cookie .btn { min-height: 36px; padding: 0 14px; font-size: .88rem; flex: none; }
.cookie .btn--ghost { color: var(--bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bg) 40%, transparent); }
.cookie .btn--brand { background: var(--brand); color: var(--on-brand); }
.cookie[hidden] { display: none; }
body:has(main.has-sticky) .cookie { bottom: 84px; }
@media (min-width: 980px) { body:has(main.has-sticky) .cookie { bottom: 12px; } }
@media (max-width: 420px) { .cookie { flex-wrap: wrap; } .cookie p { flex-basis: 100%; } .cookie .btn { flex: 1; } }

/* ---------- Home (templates/next/home.php) ---------- */
.hero-home { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 22%, var(--bg)) 0%, var(--bg) 100%); padding: 26px 0 14px; }
.hero-home__lead { font: 600 clamp(1.35rem, 1.1rem + 1.2vw, 2rem)/1.3 var(--font-head); margin: 0 0 4px; }
.hero-home__sub { margin: 0 0 16px; color: var(--muted); }
.hero-home .stats { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 14px 0 0; font-size: .92rem; color: var(--muted); }
/* the hero is the cover of the site: title, search and numbers centred; the sections below stay left-aligned */
.hero-home__lead, .hero-home__sub { text-align: center; }
.hero-home .search { margin-left: auto; margin-right: auto; }
.hero-home .stats { justify-content: center; }
.hero-home .stats strong { color: var(--ink); }
.search { position: relative; max-width: 760px; }
.search__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: var(--surface); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / .18), inset 0 0 0 1px var(--line); max-height: 360px; overflow-y: auto; }
.search__list[hidden] { display: none; }
.search__list a { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search__list a:hover, .search__list a.is-active { background: var(--surface-2); }
.search__list small { color: var(--muted); white-space: nowrap; }
.search__hint { padding: 8px 12px; color: var(--muted); font-size: .88rem; }
.announce { position: relative; width: fit-content; max-width: min(660px, 100%); margin: 18px auto 0; border-radius: var(--radius); overflow: hidden; background: #111; }
.announce a { display: block; }
.announce img { width: auto; max-width: 100%; max-height: min(420px, 60vh); height: auto; margin: 0 auto; }
.announce__close { position: absolute; top: 8px; right: 8px; background: rgb(0 0 0 / .55); color: #fff; }
.announce__close:hover { background: rgb(0 0 0 / .75); }
.announce[hidden] { display: none; }
.home-next .section__head p { margin: 2px 0 0; color: var(--muted); font-size: .93rem; }
.home-next .section + .section { padding-top: 8px; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.month { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); }
.month:hover { box-shadow: inset 0 0 0 2px var(--brand-ink); }
.month b { font-family: var(--font-head); font-weight: 600; }
.month span { font-size: .85rem; color: var(--muted); }
.month.is-now { background: var(--brand-soft); box-shadow: none; }
.regions { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.region { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.region h3 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.region h3 small { font: 500 .85rem var(--font); color: var(--muted); }
.region .chips { gap: 6px; }
.region .chip { min-height: 32px; padding: 0 10px; font-size: .86rem; }
.post-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.post { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post__media { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); }
.post__media img { width: 100%; height: 100%; object-fit: cover; }
.post__media.is-closed img { filter: grayscale(.6); opacity: .75; }
.post__body { padding: 12px 14px 16px; }
.post h3 { font: 600 .98rem/1.4 var(--font); margin: 0 0 6px; }
.post h3 a { color: var(--ink); text-decoration: none; }
.post h3 a::after { content: ""; position: absolute; inset: 0; }
.post p { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post__badge .reg-badge { position: static; }
.post__badge { padding: 12px 14px 0; }
.reg-badge { position: absolute; left: 8px; top: 8px; z-index: 2; box-shadow: var(--shadow); }
.reg-banner { display: block; max-width: 728px; margin: 0 auto 18px; }
.reg-banner img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.promo-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.promo-row .ad { --ad-max: 100%; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 3); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 4px 0 10px; }
.hscroll > * { scroll-snap-align: start; }
@media (max-width: 1000px) { .hscroll { grid-auto-columns: calc((100% - 12px) / 2); } }
.ad--top { margin-top: 24px; }
.cta-org { display: grid; gap: 16px; align-items: center; background: var(--btn); color: var(--on-btn); border-radius: var(--radius); padding: 22px; }
.cta-org h2 { color: inherit; }
.cta-org p { margin: 6px 0 0; opacity: .85; }
.cta-org ul { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .92rem; opacity: .9; }
.cta-org .btn { background: var(--brand); color: var(--on-brand); }
@media (min-width: 760px) { .cta-org { grid-template-columns: 1fr auto; padding: 28px 32px; } }
.h-small { font-size: 1.05rem; }
.sponsors { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sponsor a { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 7; padding: 16px 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.sponsor a:hover { box-shadow: var(--shadow), inset 0 0 0 2px var(--brand-ink); }
.sponsor img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.more-mobile { display: none; }

/* mobile: no sideways rows; posts become a compact list, banners stack, free runs show 4 + a button */
@media (max-width: 759px) {
  .sponsors { grid-template-columns: minmax(0, 1fr); }
  .promo-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hscroll { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-auto-columns: auto; overflow: visible; scroll-snap-type: none; padding: 0; }
  .hscroll--free > :nth-child(n + 5) { display: none; }
  .more-mobile { display: flex; margin-top: 12px; }
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .post { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: stretch; }
  .post__media { aspect-ratio: auto; min-height: 96px; }
  .post__body { padding: 10px 12px 12px; }
  .post h3 { font-size: .95rem; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .post p { font-size: .82rem; -webkit-line-clamp: 2; }
  .reg-badge { left: 6px; top: 6px; font-size: .72rem; min-height: 20px; padding: 0 6px; }
  .post .wm::after { font-size: .5rem; left: 4px; bottom: 4px; padding: 2px 4px; }
  .post--closed { display: none; }
  .post--noimg { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 760px) and (max-width: 1079px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.admin-bar #wpadminbar { overflow: hidden; }

/* ---------- Home: mourning bar + dialog (Customizer "หน้าต่างลอย"), gallery widget area ---------- */
.mourn-bar { background: var(--mb-bg, #111); color: var(--mb-ink, #eee); }
.mourn-bar__btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; color: inherit; text-decoration: none; font-size: .92rem; }
.mourn-bar__btn:hover .mourn-bar__more { text-decoration: underline; }
.mourn-bar__icon { width: 18px; height: 18px; }
.mourn-bar__more { opacity: .8; }
.announce-dialog { padding: 0; border: 0; border-radius: var(--radius); background: var(--mb-bg, #111); max-width: min(640px, 92vw); max-height: 92vh; overflow: hidden; box-shadow: 0 20px 60px rgb(0 0 0 / .5); }
.announce-dialog::backdrop { background: rgb(0 0 0 / .65); }
.announce-dialog img { width: auto; max-width: 100%; max-height: 88vh; margin: 0 auto; }
.announce-dialog form { position: absolute; top: 8px; right: 8px; margin: 0; }
.announce-dialog__close { background: rgb(0 0 0 / .55); color: #fff; }
.announce-dialog__close:hover { background: rgb(0 0 0 / .8); }
.home-gallery { margin-top: 18px; }
.home-gallery .hg-widget + .hg-widget { margin-top: 12px; }
.home-gallery .hg-title { font-size: 1.05rem; margin-bottom: 8px; }
/* same look as the old Elementor image carousel: 3 photos edge to edge (1 on phones), 3:2, plain white arrows, dots, autoplay 5 s */
.home-gallery .gallery { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% / 3); gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0; }
.home-gallery .gallery::-webkit-scrollbar { display: none; }
.home-gallery .gallery br { display: none; }
.home-gallery .gallery-item { margin: 0; scroll-snap-align: start; width: auto !important; max-width: none !important; }
.home-gallery .gallery-icon, .home-gallery .gallery-icon a { display: block; height: 100%; }
.home-gallery .gallery img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 0; border: 0 !important; }
.home-gallery .gallery-caption { display: none; }
.home-gallery .hg-nav { position: relative; }
.home-gallery .hg-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: transparent; color: rgb(237 237 237 / .9); filter: drop-shadow(0 1px 2px rgb(0 0 0 / .6)); }
.home-gallery .hg-arrow:hover { background: transparent; color: #fff; }
.home-gallery .hg-arrow .icon { width: 30px; height: 30px; stroke-width: 2.5; }
.home-gallery .hg-arrow--prev { left: 2px; }
.home-gallery .hg-arrow--next { right: 2px; }
.home-gallery .hg-dots { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.home-gallery .hg-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%; background: #000; opacity: .2; cursor: pointer; }
:root[data-theme="dark"] .home-gallery .hg-dots button { background: #fff; }
.home-gallery .hg-dots button[aria-current="true"] { opacity: 1; }
.home-gallery .textwidget, .home-gallery .widget_custom_html { text-align: center; }
.home-gallery .textwidget p { margin: 0; }
.home-gallery .textwidget a, .home-gallery a.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 24px; border-radius: 3px; background: #f7086f; color: #fff; font-size: .95rem; font-weight: 500; text-decoration: none; }
.home-gallery .textwidget a:hover, .home-gallery a.btn:hover { filter: brightness(1.08); color: #fff; }
.home-gallery .textwidget a::before, .home-gallery a.btn::before { content: ""; width: 16px; height: 16px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='16' height='14' rx='2'/%3E%3Ccircle cx='11' cy='11' r='1.5'/%3E%3Cpath d='m22 16-4-4-7 7M2 8v12a2 2 0 0 0 2 2h14'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='6' width='16' height='14' rx='2'/%3E%3Ccircle cx='11' cy='11' r='1.5'/%3E%3Cpath d='m22 16-4-4-7 7M2 8v12a2 2 0 0 0 2 2h14'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 759px) { .home-gallery .gallery { grid-auto-columns: 100%; } .home-gallery .textwidget a, .home-gallery a.btn { padding: 8px 16px; text-align: center; line-height: 1.35; } }

/* ---------- Weekly calendar /วิ่งไหนดี/ (templates/next/week.php) ---------- */
.page-head { padding: 22px 0 6px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .cal-next .filters .chips--scroll, .cal-next .months-strip, .cal-next .years-strip { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; } }
.chip.is-on b { color: inherit; opacity: .8; }
.cal-tools { display: grid; gap: 12px; padding: 12px 0 4px; }
.cal-tools .search { max-width: none; }
.weeknav { display: flex; align-items: center; gap: 8px; }
.weeknav strong { flex: 1; text-align: center; font: 600 1.05rem var(--font-head); background: var(--surface); border-radius: 999px; min-height: 44px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.weeknav .icon-btn { flex: none; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.weeknav .icon-btn:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.weeknav__now { margin: 4px 0 0; text-align: right; font-size: .92rem; font-weight: 600; }
@media (min-width: 760px) { .cal-tools { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: center; } }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 10px 0 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; }
.day:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.day small { font-size: .78rem; color: var(--muted); }
.day b { font: 600 1.35rem/1.1 var(--font-head); }
.day span { font-size: .74rem; color: var(--brand-ink); font-weight: 600; white-space: nowrap; }
.day.is-today { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-ink); }
.day.is-empty span { color: var(--faint); font-weight: 400; }
.day.is-on { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.day.is-on small, .day.is-on span { color: inherit; }
@media (max-width: 380px) { .days { gap: 4px; } .day span { font-size: .68rem; } }
.filters { display: grid; gap: 10px; margin-top: 12px; }
.total { margin: 16px 0 4px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.total span { color: var(--muted); font-weight: 400; }
.total__link { font-weight: 600; font-size: .92rem; }
.dayblock { padding-top: 18px; }
.dayblock h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 1.15rem; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--brand); }
.dayblock h2 small { font: 500 .85rem var(--font); color: var(--muted); }
.dayblock--ongoing h2 { border-bottom-color: var(--line); }
.dayblock > h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 1.05rem; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.dayblock > h3 small { font: 500 .85rem var(--font); color: var(--muted); }
.dayblock--past > .dayblock { padding-top: 8px; }
/* month grid (page 848): 7 columns, Monday first; a day with events links to its day block */
.mgrid { margin: 14px 0 4px; padding: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); max-width: 560px; }
.mgrid__head, .mgrid__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mgrid__head { margin-bottom: 4px; }
.mgrid__head span { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); }
.mgrid__head .is-we { color: var(--brand-ink); }
.mgrid__d { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; padding: 4px 2px; border-radius: var(--radius-sm); color: var(--faint); text-decoration: none; line-height: 1.15; }
.mgrid__d b { font-weight: 500; font-size: .95rem; }
.mgrid__d small { font-size: .68rem; font-weight: 600; }
.mgrid__d small span { display: none; }
.mgrid__d.has-ev { background: var(--brand-soft); color: var(--brand-ink); }
.mgrid__d.has-ev b { font-weight: 700; color: var(--ink); }
a.mgrid__d:hover { box-shadow: inset 0 0 0 2px var(--brand-ink); }
a.mgrid__d:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.mgrid__d.is-past { opacity: .45; }
.mgrid__d.is-today { box-shadow: inset 0 0 0 2px var(--brand-ink); }
.mgrid__d.is-blank { min-height: 0; }
@media (min-width: 560px) { .mgrid__d { min-height: 52px; } .mgrid__d small span { display: inline; } }
.dayblock:target > h2, .dayblock:target > summary { background: linear-gradient(transparent 60%, var(--accent-soft) 0); }
/* events already running: folded <details>, the h2 is the summary */
.dayblock--fold > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.dayblock--fold > summary::-webkit-details-marker { display: none; }
.dayblock--fold > summary h2 { flex: 1 1 auto; margin: 0; padding: 0; border: 0; }
.dayblock--fold > summary:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; border-radius: 4px; }
.dayblock--fold[open] > summary { margin-bottom: 10px; }
.fold__hint { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; font-weight: 600; color: var(--brand-ink); white-space: nowrap; }
.fold__hint::before { content: "แสดง"; }
.fold__hint::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.dayblock--fold[open] .fold__hint::before { content: "ซ่อน"; }
.dayblock--fold[open] .fold__hint::after { transform: translateY(2px) rotate(-135deg); }
/* compact calendar card: the day is in the h2, the date range in the meta line (no date tile); small button
   beside the status badge */
.pr-card--row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
.pr-card--row.is-text { grid-template-columns: minmax(0, 1fr); }
.pr-card--row .pr-card__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 5px; }
.pr-card--row .pr-card__body > * { grid-column: 1 / -1; }
.pr-card--row .pr-card__body > .pr-card__row:has(.pr-badge) { grid-column: 1; }
.pr-card--row .pr-card__cta { grid-column: 2; justify-self: end; margin: 0; padding: 0; min-width: 0; max-width: 100%; }
.pr-card--row .pr-card__cta .pr-btn { min-height: 32px; padding: 0 12px; font-size: .8rem; }
.pr-card--row .pr-card__datetag { font-size: .66rem; padding: 1px 4px; left: 4px; top: 4px; }
@media (min-width: 560px) { .pr-card--row { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; } .pr-card--row.is-text { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .fold__hint::after { transition: none; } }
/* later days render when scrolled near (less work on the first screen; the HTML is all there) */
.week-list > .dayblock:nth-child(n + 4) { content-visibility: auto; contain-intrinsic-size: auto 900px; }
.week-list .empty { margin-top: 16px; }
.week-list .ad--feed { margin-top: 24px; }
.cta-org--week { margin-top: 32px; }
.intro { margin-top: 24px; padding: 20px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.intro h2 { color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; }
.intro h3 { margin: 12px 0 0; padding-left: 12px; border-left: 3px solid var(--brand); font: 500 1rem var(--font); color: var(--brand-ink); }
.intro figure { margin: 16px auto 0; max-width: 728px; text-align: center; }
.intro figure img, .intro img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.intro figcaption { font-size: .85rem; margin-top: 4px; }
.intro__body > :last-child { margin-bottom: 0; }
.cal-next { padding-bottom: 36px; }

/* ---------- Monthly calendar /ปฏิทินงานวิ่งรายเดือน/ (templates/next/month.php) ---------- */
.months-strip { margin-top: 12px; }
.years-strip { margin-top: 12px; }
.years-strip + .months-strip { margin-top: 8px; }
.months-strip .chip { min-height: 40px; }
.monthnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 24px; }
.monthnav .btn:only-child { margin-left: auto; }
.monthnav .btn { color: var(--ink); background: var(--surface); }
/* the page text: Elementor buttons arrive as bare links, its headings as h2 */
.intro__body > a { display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 44px; margin: 12px auto; padding: 8px 18px; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-weight: 600; text-decoration: none; text-align: center; line-height: 1.35; }
.intro__body > a:hover { filter: brightness(1.12); }
.intro__body > a.is-inline { display: inline; min-height: 0; margin: 0; padding: 0; background: none; color: var(--brand-ink); font-weight: inherit; text-decoration: underline; text-align: inherit; }
.intro__body > a.is-inline:hover { filter: none; }
.intro__body h2 { font-size: 1.05rem; color: var(--ink); margin: 18px 0 6px; }
.intro__body > :first-child { margin-top: 0; }
.intro__body p a { color: var(--brand-ink); }

/* ---------- Category archive /category/…/ (templates/next/category.php) ---------- */
.cat-head { background: linear-gradient(135deg, var(--brand-soft), var(--bg) 70%); border-bottom: 1px solid var(--line); padding: 20px 0 14px; }
.cat-crumbs { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .86rem; color: var(--muted); }
.cat-crumbs a { color: var(--brand-ink); }
.cat-head h1 { margin: 4px 0 6px; }
.cat-desc { color: var(--muted); max-width: 65ch; }
.cat-desc p { margin: 0 0 6px; }
.cat-count { margin: 0 0 14px; color: var(--muted); font-size: .93rem; }
.cat-chips { padding-bottom: 6px; }
@media (min-width: 760px) { .cat-chips.chips--scroll { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; } }
.cat-chips .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: hsl(var(--h) 60% 42%); }
.cat-chips .chip.is-on .dot { box-shadow: 0 0 0 2px var(--on-btn); }
.av { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; font: 600 1rem/1 var(--font-head); color: #fff; background: hsl(var(--h) 55% 38%); }
.alist { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acard { position: relative; display: flex; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.acard:hover, .acard:focus-within { box-shadow: var(--shadow), inset 0 0 0 2px var(--brand-ink); }
.acard__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 16px; }
.acard__media { order: 2; flex: none; width: 34%; max-width: 220px; background: var(--surface-2); }
.acard__media img { width: 100%; height: 100%; min-height: 140px; object-fit: cover; }
.acard__by { display: flex; gap: 10px; align-items: center; }
.acard__by b { display: block; font-size: .9rem; font-weight: 600; }
.acard__by small, .acard__meta { color: var(--muted); font-size: .82rem; }
.acard__meta { margin: 0; }
.acard h2 { font-size: 1.15rem; line-height: 1.4; }
.acard h2 a { color: var(--ink); text-decoration: none; }
.acard h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.acard__text { margin: 0; color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard__more { margin-top: auto; color: var(--brand-ink); font-weight: 600; font-size: .9rem; }
.acard--lead { grid-column: 1 / -1; background: linear-gradient(120deg, var(--surface) 60%, var(--brand-soft)); }
.acard--lead .acard__body { padding: 24px 28px 22px; }
.acard--lead h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.65rem); }
.acard--lead .acard__text { -webkit-line-clamp: 3; }
.acard--lead .acard__media { width: 42%; max-width: 460px; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pager .page-numbers { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; text-decoration: none; }
.pager a.page-numbers:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.pager .page-numbers.current { background: var(--btn); color: var(--on-btn); box-shadow: none; }
.pager .page-numbers.dots { background: none; box-shadow: none; min-width: 20px; padding: 0; color: var(--muted); }
.pager .icon { width: 18px; height: 18px; }
.pager__note { text-align: center; color: var(--muted); font-size: .86rem; margin: 10px 0 0; }
@media (max-width: 759px) {
  .alist { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .acard__media { order: 0; width: 112px; }
  .acard__media img { min-height: 100%; }
  .acard--lead { flex-direction: column; }
  .acard--lead .acard__media { width: 100%; max-width: none; aspect-ratio: 16 / 9; }
  .acard.has-img:not(.acard--lead) .acard__more { display: none; }
  .acard__body, .acard--lead .acard__body { padding: 16px 16px 14px; }
  .acard h2 { font-size: 1.08rem; }
  .pager .page-numbers.prev span, .pager .page-numbers.next span { display: none; }
}

/* ---------- Contact page /contact-us/ (templates/next/contact.php) ---------- */
.contact-head { background: linear-gradient(135deg, var(--brand-soft), var(--bg) 70%); border-bottom: 1px solid var(--line); padding: 20px 0 22px; }
.contact-head h1 { margin: 4px 0 6px; }
.contact-lead { margin: 0; color: var(--muted); font-size: 1.02rem; max-width: 60ch; }
.contact-grid { display: grid; gap: 20px; }
.contact-grid > * { min-width: 0; }
.contact-person { padding: 0; overflow: hidden; display: grid; grid-template-columns: 38% minmax(0, 1fr); align-items: center; }
.contact-person__photo { height: 100%; min-height: 150px; background: var(--surface-2); }
.contact-person__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.contact-person__body { padding: 16px 18px; }
.contact-person__role { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px 3px 8px; margin-bottom: 8px; }
.contact-person__role .icon { width: 16px; height: 16px; }
.contact-person h2 { font-size: 1.25rem; line-height: 1.35; }
.contact-person__nick { margin: 2px 0 0; color: var(--muted); }
.contact-cards { display: grid; gap: 16px; }
.ccard { display: flex; flex-direction: column; gap: 4px; }
.ccard__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 8px; }
.ccard__icon .icon { width: 24px; height: 24px; }
.ccard small { color: var(--muted); font-size: .85rem; }
.ccard__value { font: 600 1.3rem/1.3 var(--font-head); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.ccard__value:hover { color: var(--brand-ink); }
.ccard__note { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.ccard__note .icon { width: 18px; height: 18px; margin-top: 3px; }
.ccard .btn-row { margin-top: auto; padding-top: 10px; }
.contact-notice { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.contact-notice .icon { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.contact-notice p { margin: 0; }
.contact-links { margin-top: 16px; }
.contact-links h2 { font-size: 1.1rem; margin-bottom: 10px; }
.llist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.llist a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; font-weight: 500; }
.llist a:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.llist .icon { color: var(--brand-ink); width: 22px; height: 22px; }
.llist .icon--go { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }
.contact-notes { margin-top: 16px; color: var(--muted); }
.contact-notes p:last-child { margin-bottom: 0; }
.contact-fallback img { border-radius: var(--radius-sm); }
@media (min-width: 560px) { .contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
  .contact-person { grid-template-columns: minmax(0, 1fr); position: sticky; top: calc(var(--top) + 80px); }
  .contact-person__photo { aspect-ratio: 4 / 5; height: auto; }
  .contact-person__body { padding: 18px 22px 22px; }
  .contact-person h2 { font-size: 1.35rem; }
}

/* ---------- Single post / other pages (templates/next/post.php, page.php, comments.php) ---------- */
.post-head { padding-bottom: 18px; }
.post-head h1 { max-width: 30em; }
.post-head--crumbs { padding-bottom: 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); font-size: .9rem; }
.post-meta > * { display: inline-flex; align-items: center; gap: 6px; }
.post-meta a { color: var(--brand-ink); text-decoration: none; }
.post-meta .icon { width: 17px; height: 17px; }
.post-layout { display: grid; gap: 20px; padding-top: 22px; padding-bottom: 8px; }
.post-layout > * { min-width: 0; }
.post-main { display: grid; gap: 20px; align-content: start; }
.post-main > * { min-width: 0; }
.post-layout.no-aside:not(.is-wide) .post-main { max-width: 860px; }
@media (min-width: 980px) {
  .post-layout:not(.no-aside) { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .post-aside { position: sticky; top: calc(var(--top) + 76px); align-self: start; }
}
.post-aside { display: grid; gap: 14px; align-content: start; }
.post-aside img { width: 100%; height: auto; border-radius: var(--radius-sm); }
.post-aside .widget-title, .post-aside h2 { font-size: 1rem; margin: 0 0 8px; }
.post-aside [class*="advads"], .post-aside .widget { display: grid; gap: 12px; }
.post-aside .widget > *, .post-aside [class*="advads"] > * { margin: 0; }
.page-feat { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.page-feat img { width: 100%; }
.post-body--elementor { min-width: 0; }
/* Elementor content: its kit asks for Roboto + line-height 1em, which only fitted the old forced Thai font
   (patrunning-core fonts.css, not loaded here); Thai text overlapped. Same override as the old site, our face. */
.is-elementor :is(h1, h2, h3, h4, h5, h6, p, li, .elementor-heading-title, .elementor-widget-text-editor) { font-family: var(--font) !important; }
.is-elementor .elementor-heading-title { line-height: 1.5 !important; }
.is-elementor h5.elementor-heading-title { font-size: 1rem !important; }
.is-elementor h6.elementor-heading-title { font-size: .9rem !important; }
/* dark mode: Elementor's kit greys (text/secondary) would be dim on the dark surface; brand colours stay */
:root[data-theme="dark"] .is-elementor { --e-global-color-text: var(--ink); --e-global-color-secondary: var(--ink); color: var(--ink); }
.post-actions { display: grid; gap: 20px; }
.post-share h2, .react__title { font-size: 1.05rem; margin: 0; }
.post-share .share { margin-top: 10px; }

/* the reading column: old classic-editor content (center tags, inline images, br-separated lines, shortcodes) */
.prose { font-size: 1.04rem; line-height: 1.75; }
.prose::after { content: ""; display: table; clear: both; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose img { display: inline-block; vertical-align: middle; max-width: 100%; height: auto; border-radius: 6px; }
.prose img.is-broken { display: none !important; }
.prose center, .prose .aligncenter, .prose .wp-caption.aligncenter { display: block; text-align: center; }
.prose img.aligncenter, .prose .wp-caption.aligncenter { display: block; margin: 12px auto; }
.prose .alignleft { float: left; margin: 4px 20px 12px 0; }
.prose .alignright { float: right; margin: 4px 0 12px 20px; }
@media (max-width: 599px) { .prose .alignleft, .prose .alignright { float: none; display: block; margin: 12px auto; } }
.prose .wp-caption { max-width: 100%; }
.prose .wp-caption-text, .prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin: 6px 0 0; }
.prose figure { margin: 16px 0; }
.prose h2, .prose h3, .prose h4 { margin: 1.4em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li + li { margin-top: .25em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.prose iframe, .prose video, .prose embed, .prose object { max-width: 100%; }
.prose iframe[src*="youtube"], .prose iframe[src*="youtu.be"], .prose iframe[src*="facebook.com/plugins/video"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose pre { overflow-x: auto; background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); }
/* [gallery] (209 old posts): a grid of square thumbnails */
.prose .gallery { display: grid; gap: 8px; grid-template-columns: repeat(var(--gcols, 3), minmax(0, 1fr)); margin: 16px 0; }
.prose .gallery br { display: none; }
.prose .gallery-columns-1 { --gcols: 1; }
.prose .gallery-columns-2 { --gcols: 2; }
.prose .gallery-columns-4 { --gcols: 4; }
.prose .gallery-columns-5, .prose .gallery-columns-6, .prose .gallery-columns-7, .prose .gallery-columns-8, .prose .gallery-columns-9 { --gcols: 5; }
@media (max-width: 599px) { .prose .gallery:not(.gallery-columns-1) { --gcols: 2; } }
.prose .gallery-item { margin: 0; width: auto !important; }
.prose .gallery-icon a { display: block; }
.prose .gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 0 !important; display: block; }
/* Envira Gallery Lite (180 posts): its own CSS/JS; keep it inside the column */
.prose .envira-gallery-wrap { max-width: 100%; margin: 16px 0; }
.prose .envira-gallery-wrap img { border-radius: 0; }
/* [countdown] boxes (patrunning-core front.css has fixed light colours) */
.prose .pr-countdown .countdown-section { background: var(--surface-2); color: var(--ink); border-radius: var(--radius-sm); }
/* Advanced Ads "Content" placements (injected into the_content) */
.prose [class*="advads-"] img, .prose [id*="advads-"] img { border-radius: var(--radius-sm); }

/* reactions ("คุณรู้สึกอย่างไรกับเรื่องนี้?", the theme's pr-core.js votes) */
.react { display: grid; gap: 12px; }
.rb-reaction { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.rb-reaction .reaction { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; user-select: none; transition: box-shadow .15s; }
.rb-reaction .reaction:hover { box-shadow: inset 0 0 0 1.5px var(--brand-ink); }
.rb-reaction .reaction.active { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-ink); }
.rb-reaction .reaction.loading { opacity: .6; }
.rb-reaction .reaction-content { display: contents; }
.rb-reaction .reaction-icon .rb-svg { width: 36px; height: 36px; display: block; }
.rb-reaction .reaction-title { font-size: .8rem; color: var(--muted); font-weight: 500; text-align: center; line-height: 1.3; }
.rb-reaction .reaction-count { font-weight: 600; font-size: .95rem; }

/* comments */
.pcomments h2 { font-size: 1.2rem; }
.pcomments h2 .muted { font-weight: 400; }
.pcomments__head { margin-bottom: 12px; }
.clist, .clist .children { list-style: none; margin: 0; padding: 0; }
.clist > li + li { border-top: 1px solid var(--line); }
.clist .children { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--line); }
.clist .comment-body { padding: 14px 0; display: grid; gap: 4px; }
.clist .comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.clist .comment-author .avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--surface-2); }
.clist .comment-author .says { display: none; }
.clist .comment-author .fn a { color: inherit; }
.clist .comment-metadata { font-size: .8rem; margin-left: 46px; }
.clist .comment-metadata a { color: var(--muted); text-decoration: none; }
.clist .comment-content { margin-left: 46px; }
.clist .comment-content p { margin: 4px 0 6px; }
.clist .comment-awaiting-moderation { font-size: .85rem; color: var(--accent-ink); margin-left: 46px; }
.clist .reply { margin-left: 46px; font-size: .85rem; }
.clist .reply a { font-weight: 600; text-decoration: none; }
@media (max-width: 599px) { .clist .children { margin-left: 8px; padding-left: 10px; } }
.pcomments .nav-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.cform { margin-top: 8px; }
.cform > summary { list-style: none; width: fit-content; cursor: pointer; }
.cform > summary::-webkit-details-marker { display: none; }
.cform[open] > summary { display: none; }
.comment-respond { margin-top: 8px; }
.clist .comment-respond { margin: 4px 0 16px 46px; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
@media (max-width: 599px) { .clist .comment-respond { margin-left: 0; } }
.comment-reply-title { font-size: 1.05rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; margin-bottom: 8px; }
.comment-reply-title small a { font: 500 .85rem var(--font); }
.comment-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.comment-form > * { margin: 0; grid-column: 1 / -1; }
.comment-form > .comment-form-author, .comment-form > .comment-form-email, .comment-form > .comment-form-url { grid-column: auto; }
.comment-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.comment-form .required { color: var(--danger); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--brand-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-ink) 25%, transparent); }
.comment-form .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form .comment-form-cookies-consent label { margin: 0; }
.comment-form .comment-form-cookies-consent input { margin-top: 5px; }

/* "เรื่องที่คุณอาจสนใจ" (pr-related.css) under the post */
.post-related .single-related-outer .rbc-container { padding: 0; }
.post-related .pr-rel { margin-bottom: 8px; }
