/* SIS Post — one layout for every blog post. Tokens follow SIS Home / SIS Navigation. */

.sispo {
	--sispo-primary: var(--sisn-primary, #0b5354);
	--sispo-dark: var(--sisn-primary-dark, #073334);
	--sispo-accent: var(--sisn-accent, #e3a033);
	--sispo-ink: #1a2222;
	--sispo-text: #2c3636;
	--sispo-muted: #5b6b6b;
	--sispo-line: #e3e8e8;
	--sispo-tint: #f4f7f6;
	--sispo-soft: #eef4f3;
	--sispo-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
	--sispo-display: "Bai Jamjuree", system-ui, sans-serif, var(--sispo-emoji);
	--sispo-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif, var(--sispo-emoji);
	--sispo-radius: 14px;
	--sispo-ease: cubic-bezier(.2, .7, .2, 1);
	display: block;
	color: var(--sispo-text);
	font-family: var(--sispo-body);
	font-size: 17px;
	line-height: 1.75;
	background: #fff;
	overflow-wrap: break-word;
}
.sispo *, .sispo *::before, .sispo *::after { box-sizing: border-box; }
.sispo .sispo-i { flex: none; }
/* The theme sets "p, li, ul, body a { font-size: 22px }" site-wide. */
.sispo p, .sispo li, .sispo ul, .sispo ol, .sispo a, .sispo time { font-size: inherit; line-height: inherit; }

.sispo-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .sispo-wrap { padding: 0 16px; } }

/* ---------- Header ---------- */
.sispo-hero {
	background: linear-gradient(180deg, var(--sispo-soft) 0%, #fff 100%);
	border-bottom: 1px solid var(--sispo-line);
	padding: 40px 0 44px;
}
.sispo-hero__in { display: grid; gap: 40px; align-items: center; }
.sispo-hero--split .sispo-hero__in { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.sispo-hero--text .sispo-hero__in,
.sispo-hero--cover .sispo-hero__in { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.sispo-hero--text .sispo-hero__in { padding-top: 8px; }

.sispo-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--sispo-muted); margin-bottom: 18px; }
.sispo .sispo-crumbs a { color: var(--sispo-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.sispo .sispo-crumbs a:hover { color: var(--sispo-primary); }
.sispo-crumbs .sispo-i { width: 16px; height: 16px; }

.sispo .sispo-chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sispo .sispo-chips li { margin: 0; padding: 0; }
.sispo .sispo-chips a {
	display: inline-block; padding: 3px 12px; border-radius: 999px;
	background: #fff; border: 1px solid var(--sispo-line);
	color: var(--sispo-primary); font-size: 13px; font-weight: 600; text-decoration: none;
}
.sispo .sispo-chips a:hover { border-color: var(--sispo-primary); }

.sispo h1.sispo-title {
	font-family: var(--sispo-display) !important;
	font-weight: 700 !important;
	font-size: clamp(28px, 3.6vw, 44px);
	line-height: 1.3 !important;
	letter-spacing: 0;
	color: var(--sispo-dark);
	margin: 0 0 18px;
	text-transform: none;
}

.sispo .sispo-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--sispo-muted); font-size: 15px; }
.sispo .sispo-meta li { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 0; }
.sispo .sispo-meta .sispo-i { color: var(--sispo-primary); }

.sispo-hero__media { margin: 0; position: relative; }
.sispo .sispo-hero__media img {
	display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain;
	border-radius: var(--sispo-radius); background: #fff;
	box-shadow: 0 1px 2px rgba(7, 51, 52, .06), 0 18px 40px -18px rgba(7, 51, 52, .35);
	cursor: zoom-in;
}
.sispo-hero--cover .sispo-hero__media {
	overflow: hidden; border-radius: var(--sispo-radius); background: var(--sispo-dark);
	margin-top: 4px;
}
.sispo-hero--cover .sispo-hero__media img { position: relative; z-index: 1; max-height: 70vh; border-radius: 0; box-shadow: none; background: transparent; }
.sispo-hero__blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.2); opacity: .55; }

@media (max-width: 900px) {
	.sispo-hero { padding: 24px 0 28px; }
	.sispo-hero--split .sispo-hero__in { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.sispo .sispo-hero__media img { max-height: 70vh; }
}

/* ---------- Body ---------- */
.sispo-body { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; gap: 56px; padding-top: 44px; padding-bottom: 56px; }
.sispo-body.has-toc { grid-template-columns: 240px minmax(0, 760px); }
.sispo-body:not(.has-toc) .sispo-aside { order: 2; }

.sispo-aside { align-self: start; position: sticky; top: calc(var(--sisn-bar-h, 80px) + 16px); display: flex; flex-direction: column; gap: 22px; font-size: 15px; }

.sispo-toc summary {
	list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
	font-family: var(--sispo-display); font-weight: 700; color: var(--sispo-dark); font-size: 15px;
	padding-bottom: 10px; border-bottom: 1px solid var(--sispo-line);
}
.sispo-toc summary::-webkit-details-marker { display: none; }
.sispo .sispo-toc ol { list-style: none; margin: 10px 0 0; padding: 0; border-left: 2px solid var(--sispo-line); }
.sispo .sispo-toc li { margin: 0; padding: 0; }
.sispo .sispo-toc li.lv3 a { padding-left: 26px; font-size: 14px; }
.sispo .sispo-toc a {
	display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent;
	color: var(--sispo-muted); text-decoration: none; line-height: 1.45;
	transition: color .15s, border-color .15s;
}
.sispo .sispo-toc a:hover { color: var(--sispo-primary); }
.sispo .sispo-toc a.is-active { color: var(--sispo-primary); border-left-color: var(--sispo-accent); font-weight: 600; }

.sispo-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sispo-share__label { font-size: 13px; color: var(--sispo-muted); margin-right: 4px; }
.sispo .sispo-share__btn {
	width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
	border: 1px solid var(--sispo-line); background: #fff; color: var(--sispo-dark); cursor: pointer;
	padding: 0; text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.sispo .sispo-share__btn:hover { background: var(--sispo-primary); border-color: var(--sispo-primary); color: #fff; }

@media (max-width: 1100px) {
	.sispo-body, .sispo-body.has-toc { grid-template-columns: minmax(0, 760px); gap: 24px; padding-top: 28px; }
	.sispo-aside { position: static; order: 0 !important; }
	.sispo-toc { background: var(--sispo-tint); border: 1px solid var(--sispo-line); border-radius: 12px; padding: 12px 16px; }
	.sispo-toc summary { border-bottom: 0; padding-bottom: 0; }
	.sispo-toc[open] summary { padding-bottom: 8px; }
}

/* ---------- Content typography (overrides hand-set styles) ---------- */
.sispo-content { min-width: 0; }
.sispo .sispo-content > :first-child { margin-top: 0 !important; }
.sispo .sispo-content p,
.sispo .sispo-content li {
	font-family: var(--sispo-body) !important;
	font-size: 17px !important;
	line-height: 1.8 !important;
	color: var(--sispo-text) !important;
}
.sispo .sispo-content p { margin: 0 0 1.1em; }
.sispo .sispo-content span,
.sispo .sispo-content font,
.sispo .sispo-content em,
.sispo .sispo-content strong { font-family: inherit !important; font-size: inherit !important; color: inherit !important; }
.sispo .sispo-content strong, .sispo .sispo-content b { font-weight: 600; color: var(--sispo-ink) !important; }

.sispo .sispo-content h1,
.sispo .sispo-content h2,
.sispo .sispo-content h3,
.sispo .sispo-content h4,
.sispo .sispo-content h5,
.sispo .sispo-content h6 {
	font-family: var(--sispo-display) !important;
	font-weight: 700 !important;
	color: var(--sispo-dark) !important;
	line-height: 1.4 !important;
	letter-spacing: 0;
	text-transform: none;
	scroll-margin-top: calc(var(--sisn-bar-h, 80px) + 24px);
}
.sispo .sispo-content h1, .sispo .sispo-content h2 { font-size: 26px; margin: 1.8em 0 .6em; }
.sispo .sispo-content h3 { font-size: 21px; margin: 1.7em 0 .55em; }
.sispo .sispo-content h4, .sispo .sispo-content h5, .sispo .sispo-content h6 { font-size: 18px; margin: 1.5em 0 .5em; }
.sispo .sispo-content h2 *, .sispo .sispo-content h3 *, .sispo .sispo-content h4 * { color: inherit !important; font: inherit !important; }

/* Section headings get an accent bar; centred title banners get a panel. */
.sispo .sispo-content h2:not(.sispo-banner),
.sispo .sispo-content h3:not(.sispo-banner) { position: relative; padding-left: 16px; }
.sispo .sispo-content h2:not(.sispo-banner)::before,
.sispo .sispo-content h3:not(.sispo-banner)::before {
	content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: var(--sispo-accent);
}
.sispo .sispo-content .sispo-banner { font-size: 22px; padding: 0; margin: 0 0 .35em; }
.sispo .sispo-content .sispo-banner + .sispo-banner { font-size: 17px !important; font-weight: 600 !important; color: var(--sispo-muted) !important; margin-bottom: 1.6em; }

.sispo .sispo-content a { color: var(--sispo-primary) !important; text-decoration: underline; text-decoration-color: rgba(11, 83, 84, .35); text-underline-offset: 3px; text-decoration-thickness: 1px; word-break: break-word; }
.sispo .sispo-content a:hover { text-decoration-color: currentColor; }
.sispo .sispo-content a:has(img) { text-decoration: none; }

.sispo .sispo-content ul,
.sispo .sispo-content ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.sispo .sispo-content ul { list-style: none; padding-left: 0; }
.sispo .sispo-content ul > li { position: relative; padding-left: 1.4em; margin: 0 0 .45em; }
.sispo .sispo-content ul > li::before { content: ""; position: absolute; left: .25em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--sispo-primary); }
.sispo .sispo-content ol > li { margin: 0 0 .45em; padding-left: .2em; }
.sispo .sispo-content ol > li::marker { color: var(--sispo-primary); font-weight: 700; }

.sispo .sispo-content hr { border: 0; height: 1px; background: var(--sispo-line); margin: 2.2em 0; }

.sispo .sispo-content blockquote {
	margin: 1.6em 0; padding: 16px 20px; border: 0; border-left: 4px solid var(--sispo-accent);
	background: var(--sispo-tint); border-radius: 0 12px 12px 0; font-style: normal;
}
.sispo .sispo-content blockquote p:last-child { margin-bottom: 0; }

/* Images */
.sispo .sispo-content img { max-width: 100%; height: auto !important; border-radius: 12px; display: block; margin: 1.4em auto; }
.sispo .sispo-content img.alignleft, .sispo .sispo-content img.alignright { display: inline; margin: .3em 0 1em; }
@media (min-width: 641px) {
	.sispo .sispo-content img.alignleft { float: left; margin-right: 1.4em; max-width: 50%; }
	.sispo .sispo-content img.alignright { float: right; margin-left: 1.4em; max-width: 50%; }
}
.sispo .sispo-content p > img:only-child { margin: 0 auto; }
.sispo .sispo-content img.sispo-zoom { cursor: zoom-in; }
.sispo .sispo-content figure { margin: 1.6em 0; max-width: 100%; width: auto !important; }
.sispo .sispo-content figcaption, .sispo .sispo-content .wp-caption-text { font-size: 14px; color: var(--sispo-muted); text-align: center; margin-top: 8px; }
.sispo .sispo-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 1.6em 0; }
.sispo .sispo-content .gallery-item { margin: 0; width: auto !important; }
.sispo .sispo-content .gallery img { margin: 0; aspect-ratio: 1; object-fit: cover; border: 0 !important; }

/* Tables */
.sispo-table { overflow-x: auto; margin: 1.4em 0 1.6em; border: 1px solid var(--sispo-line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.sispo .sispo-table table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 0 !important; border: 0; font-size: 15px; }
.sispo .sispo-table th, .sispo .sispo-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--sispo-line); vertical-align: top; line-height: 1.6; color: var(--sispo-text); font-family: var(--sispo-body); }
.sispo .sispo-table thead th, .sispo .sispo-table tr:first-child > th { background: var(--sispo-primary); color: #fff !important; font-weight: 600; white-space: nowrap; }
.sispo .sispo-table thead th * { color: #fff !important; }
.sispo .sispo-table tbody tr:nth-child(even) td { background: var(--sispo-tint); }
.sispo .sispo-table tbody tr:last-child td { border-bottom: 0; }
.sispo .sispo-table td.col-date { white-space: nowrap; }

/* Embeds */
.sispo-embed { position: relative; aspect-ratio: 16 / 9; margin: 1.6em 0; border-radius: 12px; overflow: hidden; background: #000; }
.sispo .sispo-embed iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }

/* File links */
.sispo .sispo-content a.sispo-file {
	display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
	padding: 4px 12px 4px 6px; margin: 2px 0; border-radius: 10px;
	border: 1px solid var(--sispo-line); background: #fff;
	text-decoration: none; font-weight: 500; line-height: 1.5; vertical-align: middle;
	transition: border-color .15s, background .15s;
}
.sispo .sispo-content a.sispo-file::before {
	content: attr(data-ext); flex: none; text-transform: uppercase;
	font: 700 10.5px/1 var(--sispo-display); letter-spacing: .04em;
	padding: 5px 6px; border-radius: 6px; background: #c2410c; color: #fff;
}
.sispo .sispo-content a.sispo-file[data-ext^="doc"]::before { background: #1d4ed8; }
.sispo .sispo-content a.sispo-file[data-ext^="xls"]::before, .sispo .sispo-content a.sispo-file[data-ext="csv"]::before { background: #15803d; }
.sispo .sispo-content a.sispo-file[data-ext^="ppt"]::before { background: #b45309; }
.sispo .sispo-content a.sispo-file[data-ext="zip"]::before, .sispo .sispo-content a.sispo-file[data-ext="rar"]::before { background: #475569; }
.sispo .sispo-content a.sispo-file:hover { border-color: var(--sispo-primary); background: var(--sispo-soft); }

/* Tags and page links */
.sispo .sispo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2em; }
.sispo .sispo-tags a { padding: 3px 12px; border-radius: 999px; background: var(--sispo-tint); border: 1px solid var(--sispo-line); color: var(--sispo-muted) !important; text-decoration: none; font-size: 14px; }
.sispo .sispo-pages { margin: 2em 0; display: flex; gap: 8px; }

/* ---------- Previous / next ---------- */
.sispo-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 56px; }
.sispo .sispo-pn__item {
	display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
	border: 1px solid var(--sispo-line); border-radius: var(--sispo-radius); text-decoration: none;
	transition: border-color .2s, box-shadow .2s, transform .2s var(--sispo-ease);
}
.sispo .sispo-pn__item:hover { border-color: var(--sispo-primary); box-shadow: 0 10px 24px -16px rgba(7, 51, 52, .5); transform: translateY(-2px); }
.sispo-pn__item.is-next { text-align: right; align-items: flex-end; }
.sispo-pn__dir { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sispo-muted); }
.sispo-pn__title { font-family: var(--sispo-display); font-weight: 600; color: var(--sispo-dark); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
	.sispo-pn { grid-template-columns: 1fr; }
	.sispo-pn > span:empty { display: none; }
}

/* ---------- Related ---------- */
.sispo-related { background: var(--sispo-tint); border-top: 1px solid var(--sispo-line); padding: 48px 0 64px; }
.sispo h2.sispo-related__h { font-family: var(--sispo-display) !important; font-weight: 700 !important; font-size: 24px; line-height: 1.35 !important; color: var(--sispo-dark); margin: 0 0 22px; }
.sispo .sispo-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .sispo .sispo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sispo .sispo-cards li { margin: 0; padding: 0; }
.sispo .sispo-card {
	display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--sispo-radius);
	overflow: hidden; text-decoration: none; border: 1px solid var(--sispo-line);
	transition: box-shadow .2s, transform .2s var(--sispo-ease);
}
.sispo .sispo-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -20px rgba(7, 51, 52, .55); }
.sispo-card__img { display: block; aspect-ratio: 16 / 10; background: var(--sispo-soft); overflow: hidden; }
.sispo .sispo-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--sispo-ease); }
.sispo .sispo-card:hover .sispo-card__img img { transform: scale(1.04); }
.sispo-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.sispo-card__body time { font-size: 13px; color: var(--sispo-muted); }
.sispo-card__title { font-family: var(--sispo-display); font-weight: 600; color: var(--sispo-dark); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.sispo-comments { max-width: 808px; padding-bottom: 56px; }

/* ---------- Lightbox ---------- */
.sispo-lb {
	position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 24px;
	background: rgba(4, 24, 25, .92); opacity: 0; transition: opacity .2s; cursor: zoom-out;
}
.sispo-lb.is-open { opacity: 1; }
.sispo-lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.sispo-lb button {
	position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
	border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.sispo-lb button:hover { background: rgba(255, 255, 255, .26); }

.sispo-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100001;
	background: var(--sisn-primary-dark, #073334); color: #fff; padding: 10px 18px; border-radius: 999px;
	font: 500 14px/1.4 "IBM Plex Sans Thai", system-ui, sans-serif; opacity: 0; transition: opacity .2s, transform .2s;
}
.sispo-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reading progress ---------- */
.sispo-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100002; pointer-events: none; }
.sispo-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--sisn-accent, #e3a033); }

@media (prefers-reduced-motion: reduce) {
	.sispo *, .sispo-lb, .sispo-toast { transition: none !important; }
}
@media print {
	.sispo-aside, .sispo-pn, .sispo-related, .sispo-progress { display: none !important; }
	.sispo-body, .sispo-body.has-toc { grid-template-columns: 1fr; }
}

/* Werkstatt draws red counter badges on every "#wrapper ol li". */
#wrapper .sispo ol { list-style: none; counter-reset: none; }
#wrapper .sispo ol li::before { content: none; display: none; }
#wrapper .sispo .sispo-content ol { list-style: decimal; padding-left: 1.5em; }
#wrapper .sispo .sispo-content ol li { margin-bottom: .45em; }
#wrapper .sispo .sispo-content li:last-child { margin-bottom: 0; }
#wrapper .sispo .sispo-content ul > li::before { content: ""; display: block; }

/* The theme clips [role="main"] with overflow:hidden, which stops the
   sticky contents list. clip still hides overflow but keeps sticky working. */
body.sispo-page #wrapper [role="main"] { overflow: clip; }

/* Lines that hold a file link sit closer together. */
.sispo .sispo-content p:has(> a.sispo-file) { margin-bottom: .55em; }
.sispo .sispo-content > :first-child img:first-child { margin-top: 0; }

/* Phones and tablets: contents list above the article, share buttons after it. */
@media (max-width: 1100px) {
	.sispo-body .sispo-aside { display: contents; }
	.sispo-body .sispo-toc { order: 0; }
	.sispo-body .sispo-content { order: 1; }
	.sispo-body .sispo-share { order: 2; border-top: 1px solid var(--sispo-line); padding-top: 20px; }
}

/* WordPress swaps emoji for small <img class="emoji">; keep them inline. */
.sispo .sispo-content img.emoji,
.sispo .sispo-content img.wp-smiley {
	display: inline !important; width: 1em !important; height: 1em !important;
	margin: 0 .07em !important; vertical-align: -0.1em; border-radius: 0; box-shadow: none; cursor: default;
}

/* ---------- Emoji ---------- */
/* <html class="sispo-noto"> is added by a head script on Windows/Linux desktops, which also loads the Noto webfont. */
.sispo-noto .sispo { --sispo-emoji: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; }

/* Emoji-led line: emoji in its own column, wrapped text lines up after it. */
.sispo .sispo-content .sispo-erow { display: flex; align-items: flex-start; gap: .6em; margin: 0 0 .9em; }
.sispo .sispo-content .sispo-emo {
	flex: none; width: 1.5em; text-align: center;
	font-family: var(--sispo-emoji) !important; font-style: normal; font-weight: 400;
	line-height: inherit;
}
.sispo .sispo-content .sispo-erow__t { flex: 1 1 auto; min-width: 0; }
.sispo .sispo-content .sispo-erow.is-file { gap: 0; margin-bottom: .5em; }
.sispo .sispo-content .sispo-erow.is-file .sispo-emo { display: none; }
.sispo .sispo-content .sispo-erow img.emoji { margin: 0 !important; }

/* Several emoji lines from one paragraph (contact block, results list). */
.sispo .sispo-content .sispo-egroup { margin: 0 0 1.2em; }
.sispo .sispo-content .sispo-egroup .sispo-erow { margin-bottom: .3em; }
.sispo .sispo-content .sispo-egroup .sispo-erow:last-child { margin-bottom: 0; }

/* A paragraph that is only emoji (a section marker). */
.sispo .sispo-content p.sispo-edeco { font-size: 26px !important; line-height: 1.2 !important; margin: 1.4em 0 .3em; font-family: var(--sispo-emoji) !important; }

/* Heading that starts with an emoji: the emoji sits in a tile instead of the accent bar. */
.sispo .sispo-content h2.has-emo,
.sispo .sispo-content h3.has-emo,
.sispo .sispo-content h4.has-emo { display: flex; align-items: center; gap: .55em; padding-left: 0; }
.sispo .sispo-content h2.has-emo::before,
.sispo .sispo-content h3.has-emo::before,
.sispo .sispo-content h4.has-emo::before { display: none; }
.sispo .sispo-content .sispo-hemo {
	flex: none; display: inline-grid; place-items: center;
	width: 1.9em; height: 1.9em; border-radius: 10px;
	background: var(--sispo-soft); border: 1px solid var(--sispo-line);
	font-family: var(--sispo-emoji) !important; font-weight: 400 !important; font-size: .82em !important; line-height: 1 !important;
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
	.sispo { font-size: 16px; }
	.sispo-hero { padding: 18px 0 22px; }
	.sispo-hero__in { gap: 18px !important; }
	.sispo-crumbs { margin-bottom: 12px; font-size: 13px; }
	.sispo .sispo-chips { margin-bottom: 10px; }
	.sispo h1.sispo-title { font-size: clamp(23px, 6.6vw, 30px); margin-bottom: 12px; }
	.sispo .sispo-meta { font-size: 14px; gap: 6px 16px; }
	.sispo .sispo-hero__media img { max-height: 62vh; border-radius: 12px; }

	.sispo-body, .sispo-body.has-toc { padding-top: 20px; padding-bottom: 36px; gap: 20px; }
	.sispo .sispo-content p,
	.sispo .sispo-content li { font-size: 16px !important; line-height: 1.75 !important; }
	.sispo .sispo-content h1, .sispo .sispo-content h2 { font-size: 22px; margin-top: 1.5em; }
	.sispo .sispo-content h3 { font-size: 19px; margin-top: 1.5em; }
	.sispo .sispo-content .sispo-banner { font-size: 19px; }
	.sispo .sispo-content .sispo-banner + .sispo-banner { font-size: 15px !important; }
	.sispo .sispo-content hr { margin: 1.6em 0; }
	.sispo .sispo-content img { border-radius: 10px; margin: 1em auto; }

	/* File links fill the line so they are easy to tap. */
	.sispo .sispo-content .sispo-erow.is-file a.sispo-file { display: flex; width: 100%; padding: 8px 12px 8px 8px; }
	.sispo .sispo-content a.sispo-file { min-height: 36px; }

	/* Tables with a header row become one card per row. */
	.sispo-table.is-stack { border: 0; border-radius: 0; overflow: visible; }
	.sispo .sispo-table.is-stack table { min-width: 0; }
	.sispo .sispo-table.is-stack thead,
	.sispo .sispo-table.is-stack tr.sispo-thead {
		position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
	}
	.sispo .sispo-table.is-stack table,
	.sispo .sispo-table.is-stack tbody,
	.sispo .sispo-table.is-stack tr { display: block; width: 100%; }
	.sispo .sispo-table.is-stack tr {
		border: 1px solid var(--sispo-line); border-radius: 12px; margin: 0 0 10px; padding: 6px 0; background: #fff !important;
	}
	.sispo .sispo-table.is-stack tbody tr:nth-child(even) td { background: transparent; }
	.sispo .sispo-table.is-stack td {
		display: grid; grid-template-columns: minmax(70px, 30%) 1fr; gap: 10px;
		padding: 6px 14px; border: 0; text-align: left !important; white-space: normal !important; font-size: 15px;
	}
	.sispo .sispo-table.is-stack td::before {
		content: attr(data-label); color: var(--sispo-muted); font-size: 13px; font-weight: 600; line-height: 1.7;
	}
	.sispo .sispo-table.is-stack td:not([data-label])::before { content: none; }
	.sispo .sispo-table.is-stack td:not([data-label]) { grid-template-columns: 1fr; }

	/* Tables that stay tables: scroll sideways, with a fade on the right as a hint. */
	.sispo-table:not(.is-stack) {
		background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left / 24px 100% no-repeat local,
			radial-gradient(farthest-side at 100% 50%, rgba(7, 51, 52, .18), transparent) right / 12px 100% no-repeat scroll;
	}

	/* Previous / next: compact. */
	.sispo-pn { gap: 10px; padding-bottom: 36px; }
	.sispo .sispo-pn__item { padding: 12px 16px; }
	.sispo-pn__title { font-size: 15px; }

	/* Related posts: swipe sideways instead of a long stack. */
	.sispo-related { padding: 32px 0 40px; }
	.sispo h2.sispo-related__h { font-size: 20px; margin-bottom: 14px; }
	.sispo .sispo-cards {
		grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
		gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
		margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; scrollbar-width: none;
	}
	.sispo .sispo-cards::-webkit-scrollbar { display: none; }
	.sispo .sispo-cards li { scroll-snap-align: start; }
	.sispo-card__body { padding: 12px 14px 16px; }

	.sispo .sispo-share__btn { width: 42px; height: 42px; }
}
.sispo .sispo-share__btn.is-native { background: var(--sispo-primary); border-color: var(--sispo-primary); color: #fff; }

/* "NEW" markers (red NEW text, 🅝🅔🅦, 🆕) in one badge style. */
.sispo .sispo-badge {
	display: inline-block; vertical-align: .18em; margin: 0 .3em;
	padding: .28em .55em .22em; border-radius: 6px;
	background: #d92d20; color: #fff !important;
	font: 700 .58em/1 var(--sispo-display) !important; letter-spacing: .06em; text-transform: uppercase;
	text-decoration: none;
}
.sispo h1.sispo-title .sispo-badge { font-size: .42em !important; vertical-align: .35em; }
.sispo .sispo-content p .sispo-badge,
.sispo .sispo-content li .sispo-badge { font-size: 11px !important; vertical-align: .12em; }
/* Headings force "font: inherit; color: inherit" on their children. */
.sispo .sispo-content h1 .sispo-badge,
.sispo .sispo-content h2 .sispo-badge,
.sispo .sispo-content h3 .sispo-badge,
.sispo .sispo-content h4 .sispo-badge,
.sispo .sispo-content h5 .sispo-badge,
.sispo .sispo-content h6 .sispo-badge {
	color: #fff !important; font: 700 11px/1 var(--sispo-display) !important;
	vertical-align: .3em; padding: .4em .6em .32em;
}
.sispo .sispo-content .sispo-egroup > p:not(.sispo-erow) { margin-bottom: .35em; }
/* Some list items wrap their text in <p>; no paragraph gap inside a list item. */
.sispo .sispo-content li > p { margin: 0; }
/* Beats ".sispo-content span { color: inherit !important }". */
.sispo .sispo-content span.sispo-badge { color: #fff !important; font-family: var(--sispo-display) !important; }

/* ---------- Desktop alignment ----------
   The body is one 760px column, or a 240px contents list + 56px gap + 760px
   column. A text-only header and the previous/next row line up with that
   column instead of spanning the full 1180px. */
.sispo-hero--text .sispo-hero__in,
.sispo-hero--cover .sispo-hero__in,
.sispo-pn { max-width: 808px; }
@media (min-width: 1101px) {
	.sispo-article.has-toc .sispo-hero--text .sispo-hero__in,
	.sispo-article.has-toc .sispo-hero--cover .sispo-hero__in,
	.sispo-article.has-toc .sispo-pn { max-width: 1104px; padding-left: 320px; }
}

/* Tall posters in the body (class and --sispo-r = width/height set in PHP):
   narrower, so one picture does not fill several screens. Click opens it
   full size. The width is computed rather than using max-height, because
   lazy-loaded images start as a 1x1 placeholder. */
@media (min-width: 641px) {
	.sispo .sispo-content img.sispo-tall { width: min(100%, calc(max(100vh, 760px) * var(--sispo-r))) !important; }
}
/* A picture on its own line gets the same gap below as a paragraph break. */
.sispo .sispo-content p:has(> img:only-child),
.sispo .sispo-content p:has(> a:only-child > img:only-child) { margin-bottom: 1.6em; }
/* aspect-ratio comes from the image's width/height; contain avoids stretching if they are off. */
.sispo .sispo-content img[style*="aspect-ratio"] { object-fit: contain; }
