/* WT26 Publications — frontend styles
 * Used by single + archive templates, the Gutenberg block, the Divi 5 module,
 * and the Breakdance element. Keep theme-agnostic — no Divi/Breakdance/etc.
 * specific selectors here.
 *
 * ---------- Sizing text: never a bare rem ----------
 * Every text size here is `max( <em>, <rem> )`, and new ones must be too.
 *
 * A bare rem measures against <html>, which is NOT where a theme puts its body
 * size. Eight of the ported WT themes set `html { font-size: 62.5% }` so they
 * can write 22px as 2.2rem — on those, a 1.1rem title rendered a flat 11px
 * next to 22px body copy, which is the bug this pattern fixes. A bare em is
 * not the answer either: Divi's body is 14px and Enfold's is 13px, so em alone
 * would SHRINK the two networks that were never broken.
 *
 * max() takes whichever is bigger, so the em half tracks whatever the host
 * theme (or its sidebar, which several themes size separately) is using, and
 * the rem half is the size we shipped before. It can only ever raise a size,
 * and only where we were already rendering below the surrounding text.
 *
 * ---------- Sizing BOXES: plain px ----------
 * Same root, different fix. A grid track, an audio player's cap and the
 * min-width that stops the resources column collapsing are design constants,
 * not text, and a bare rem shrank each to 62.5% on those themes: grid layout
 * packed 150px tracks instead of 240px, and the 1.0.18 fix for audio-only
 * lists collapsing was only ever 180px of the 288px it needed.
 *
 * These are px now. On a 16px-root theme px and rem are the same number, so
 * nothing moves on Divi, Enfold, or any 16px theme; on a 10px-root theme they
 * finally render at the size they were drawn at. Text still scales for a
 * reader who enlarges their browser font, because text uses the max() pair.
 *
 * Padding, margin and gap stay in rem. They compress on a 62.5% theme but
 * nothing breaks, and converting them is where regressions live.
 */

/* ---------- Detail (single page + block "show details") ---------- */

.wt26-pub-detail {
	margin: 0 0 1.5rem;
}

.wt26-pub-detail__title {
	margin: 0 0 0.5rem;
}

.wt26-pub-detail__date {
	margin: 0 0 0.5rem;
	font-weight: 600;
	opacity: 0.8;
}

.wt26-pub-detail__authors {
	margin: 0 0 0.5rem;
	font-style: italic;
}

.wt26-pub-detail__summary {
	margin: 0 0 1rem;
}

/* ---------- Archive card / list row ---------- */

/* The list wrapper is a <ul> and every card an <li> (see render.php). In
 * list layout the <ul> owns three content-sized columns and each row
 * subgrids into them, so the date / title / resources columns align across
 * every row. Browsers without subgrid keep the per-row fixed columns set
 * on .wt26-pub-card below — rows still read fine, they just don't share
 * column widths. */

.wt26-pub-list {
	display: grid;
	gap: 1.25rem;
	margin: 0 0 2rem;
	/* !important: Divi styles content lists with `#left-area ul,
	   .entry-content ul, .et-l--body ul { padding: 0 0 23px 1em;
	   list-style-type: disc }` — the ID variant (1-0-1) can't be beaten
	   by any class selector, and this ul must never render as a bulleted
	   list. Same reset on .wt26-pub-resources below. */
	padding: 0 !important;
	list-style: none !important;
}

.wt26-pub-list--list {
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 0;
}

.wt26-pub-list--list .wt26-pub-card {
	/* Full-width rows in both worlds: with subgrid this stretches the row
	   across the shared tracks; without it the card keeps its own columns. */
	grid-column: 1 / -1;
}

@supports (grid-template-columns: subgrid) {
	.wt26-pub-list--list .wt26-pub-card {
		grid-template-columns: subgrid;
	}
}

/* Pin cells to their columns so a row missing its date (or resources)
   keeps the shared alignment instead of letting later cells slide left —
   under subgrid one slid cell would distort the shared track for every
   row. Reset to auto in the mobile stack below. */
.wt26-pub-list--list .wt26-pub-card__date      { grid-column: 1; }
.wt26-pub-list--list .wt26-pub-card__body      { grid-column: 2; }
.wt26-pub-list--list .wt26-pub-card__resources { grid-column: 3; }

.wt26-pub-list--grid {
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5rem;
}

.wt26-pub-list--grid .wt26-pub-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.02);
}

.wt26-pub-list--grid .wt26-pub-card__date,
.wt26-pub-list--grid .wt26-pub-card__body,
.wt26-pub-list--grid .wt26-pub-card__resources {
	width: 100%;
}

.wt26-pub-empty {
	padding: 1.5rem;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	text-align: center;
	opacity: 0.7;
}

.wt26-pub-card {
	display: grid;
	grid-template-columns: minmax(112px, 144px) 1fr minmax(128px, 224px);
	gap: 1rem;
	align-items: center;
	margin: 0;
	padding: 5px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.wt26-pub-card__date {
	font-weight: 600;
	opacity: 0.8;
}

.wt26-pub-card__body {
	min-width: 0;
}

.wt26-pub-card__title {
	/* The title is a <p>; zero both margin AND padding — Divi's stylesheet
	   spaces paragraphs with padding-bottom, not margin. */
	margin: 0;
	padding: 0;
	/* max(em, rem): see the "Sizing text" note at the top of this file. The
	   em half tracks the host theme (and its sidebar, which several themes
	   size separately); the rem half is the old value, so nothing shrinks on
	   a 16px-root theme. */
	font-size: max(1em, 1.1rem);
	line-height: 1.3;
}

.wt26-pub-card__authors {
	margin: 0 0 0.25rem;
	font-style: italic;
	font-size: 0.95em;
}

.wt26-pub-card__summary {
	margin: 0;
	opacity: 0.85;
}

.wt26-pub-card__resources {
	min-width: 0;
}

@media (max-width: 600px) {
	.wt26-pub-list--list {
		grid-template-columns: 1fr;
	}

	.wt26-pub-list--list .wt26-pub-card,
	.wt26-pub-card {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}

	.wt26-pub-list--list .wt26-pub-card__date,
	.wt26-pub-list--list .wt26-pub-card__body,
	.wt26-pub-list--list .wt26-pub-card__resources {
		grid-column: auto;
	}

	.wt26-pub-card__date {
		order: 2;
		font-size: 0.9em;
	}

	.wt26-pub-card__body {
		order: 1;
	}

	.wt26-pub-card__resources {
		order: 3;
	}
}

/* ---------- Resource list (PDF / video / audio links) ---------- */

.wt26-pub-resources {
	margin: 0;
	/* !important: defeats Divi's content-ul rules (see .wt26-pub-list). */
	padding: 0 !important;
	list-style: none !important;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.wt26-pub-resources__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wt26-pub-resources__item a {
	display: inline-block;
	text-decoration: underline;
}

.wt26-pub-resources__item--audio audio {
	width: 100%;
	max-width: 352px;
}

/* In the list layout's shared grid the resources track is content-sized
   (`auto`), and a percentage width can't resolve while that track is being
   measured — so an <audio> (a replaced element, `width: 100%` above)
   contributes zero, and a list whose only resources are audio collapses
   the whole third column to nothing. Give the audio item a real inline
   size for the track to measure. Subgrid world only: the non-subgrid
   per-row template already floors the track at 128px, and 288px there would
   overflow its 224px cap. Lists that also carry PDF/video links never
   collapsed — the link text gives the track a width. */
@supports (grid-template-columns: subgrid) {
	.wt26-pub-list--list .wt26-pub-resources__item--audio {
		min-width: 288px;
	}

	@media (max-width: 600px) {
		.wt26-pub-list--list .wt26-pub-resources__item--audio {
			/* The mobile stack is a definite single column; keep the player
			   fluid there instead of forcing 288px into narrow phones. */
			min-width: 0;
		}
	}
}

.wt26-pub-resources__label {
	display: block;
	margin-bottom: 0.25rem;
	font-weight: 600;
	font-size: 0.95em;
}

/* ---------- Extra Information block (single-page only) ---------- */

.wt26-pub-extra-info {
	margin: 2rem 0 1.5rem;
	padding: 1.5rem 1.75rem;
	border-left: 4px solid #7c3aed;
	background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 70%);
	border-radius: 6px;
}

.wt26-pub-extra-info__heading {
	margin: 0 0 0.75rem;
	font-size: max(1.1em, 1.1rem);
	font-weight: 700;
	color: #5b21b6;
	letter-spacing: 0.01em;
}

.wt26-pub-extra-info__body {
	font-size: max(1em, 1rem);
	line-height: 1.6;
}

.wt26-pub-extra-info__body p:first-child { margin-top: 0; }
.wt26-pub-extra-info__body p:last-child  { margin-bottom: 0; }

.wt26-pub-extra-info__body a {
	color: #6d28d9;
	text-decoration: underline;
}

/* ---------- Live Stream display ----------
 *
 * The outer card carries no background, border, shadow, or padding by
 * default. That chrome is whatever the surrounding wrapper provides —
 * a Divi 5 module wrapper, a Breakdance element, a Gutenberg cover/group,
 * or a theme container. If we paint the outer container here, page-builder
 * design controls (Background Color, Border, etc.) on the wrapping element
 * have nothing visible to control because our inner div sits on top.
 *
 * Sub-elements (badges, the live-stream button, etc.) keep their colored
 * accents — those are intentional contrasting bits, not container chrome,
 * and themes can override them with simple CSS targeting the BEM classes.
 */

.wt26-pub-livestream {
	margin: 1.5rem 0;
}

.wt26-pub-livestream__header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 0 0 0.75rem;
}

.wt26-pub-livestream__badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: max(0.7em, 11px);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: #be123c;
	color: #fff;
}

.wt26-pub-livestream--live .wt26-pub-livestream__badge::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #fff;
	animation: wt26-pub-livestream-pulse 1.4s ease-out infinite;
}

.wt26-pub-livestream__badge--upcoming {
	background: #475569;
}

.wt26-pub-livestream__title {
	margin: 0;
	font-size: max(1.25em, 1.25rem);
	line-height: 1.3;
}

.wt26-pub-livestream__when {
	margin: 0.25rem 0 0.5rem;
	font-size: max(1em, 1rem);
	opacity: 0.85;
}

.wt26-pub-livestream__sep {
	margin: 0 0.4rem;
	opacity: 0.5;
}

.wt26-pub-livestream__tz {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 1px 7px;
	border-radius: 4px;
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.04em;
	background: rgba(190, 18, 60, 0.12);
	color: #be123c;
	vertical-align: middle;
}

.wt26-pub-livestream__countdown {
	margin: 0 0 0.75rem;
	font-size: max(1.1em, 1.1rem);
	font-weight: 600;
	color: #be123c;
}

/* JS-driven live ticker. Hidden by default; the countdown JS unhides it on
 * upgrade so JS-disabled visitors still see the humanized text fallback.
 *
 * Coloring is intentionally left to the host theme — we only ship structural
 * layout + a digit-change bounce. Page builders (Divi, Breakdance) can target
 * `.wt26-pub-livestream__pill`, `__pill-num`, `__pill-lbl`, `__pill-sep`, and
 * `__ticker-label` via design controls or custom CSS. */
.wt26-pub-livestream__ticker {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 0.25rem 0 1.25rem;
}

.wt26-pub-livestream__ticker-label {
	font-size: max(0.72em, 0.72rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

/* Pause/resume control for the per-second ticker (WCAG 2.2.2 Pause, Stop, Hide).
   Injected by livestream-countdown.js, since the ticker only exists when JS runs.
   Deliberately unstyled beyond a quiet text button: colour is the host theme's
   job (currentColor keeps it legible on light and dark cards alike). */
.wt26-pub-livestream__ticker-toggle {
	align-self: flex-start;
	margin: 0.1rem 0 0;
	padding: 0.2em 0;
	border: 0;
	background: none;
	color: currentColor;
	font: inherit;
	font-size: max(0.75em, 0.75rem);
	text-decoration: underline;
	cursor: pointer;
	opacity: 0.85;
}

.wt26-pub-livestream__ticker-toggle:hover {
	opacity: 1;
}

.wt26-pub-livestream__ticker-pills {
	display: flex;
	align-items: stretch;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.wt26-pub-livestream__pill {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 84px;
	padding: 0.6rem 0.85rem;
	border: 1px solid currentColor;
	border-radius: 12px;
	line-height: 1;
}

.wt26-pub-livestream__pill-sep {
	display: inline-flex;
	align-items: center;
	font-size: 1.8rem;
	font-weight: 700;
	padding: 0 0.1rem;
	user-select: none;
	opacity: 0.5;
}

.wt26-pub-livestream__pill-num {
	display: inline-block;
	font-size: 2.4rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
}

.wt26-pub-livestream__pill-num--changed {
	animation: wt26-pub-livestream-flip 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wt26-pub-livestream-flip {
	0%   { transform: translateY(-6px) scale(1.18); opacity: 0.4; }
	60%  { transform: translateY(0) scale(1.08); opacity: 1; }
	100% { transform: translateY(0) scale(1); opacity: 1; }
}

.wt26-pub-livestream__pill-lbl {
	margin-top: 0.35rem;
	font-size: max(0.7em, 0.7rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
	.wt26-pub-livestream__pill-num--changed {
		animation: none;
	}
}

.wt26-pub-livestream__cta {
	margin: 0.5rem 0 0;
}

.wt26-pub-livestream__btn {
	display: inline-block;
	padding: 0.6rem 1.1rem;
	font-weight: 600;
	background: #be123c;
	color: #fff !important;
	border-radius: 6px;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.wt26-pub-livestream__btn:hover {
	background: #9f1239;
	transform: translateY(-1px);
}

.wt26-pub-livestream__player {
	margin-top: 0.5rem;
	border-radius: 8px;
	overflow: hidden;
}

.wt26-pub-livestream__player iframe,
.wt26-pub-livestream__oembed iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 16 / 9;
	height: auto !important;
	border: 0;
}

.wt26-pub-livestream__fallback a {
	font-weight: 600;
}

.wt26-pub-livestream__empty {
	padding: 1rem 1.25rem;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	color: #6b7280;
	background: #f9fafb;
}

@keyframes wt26-pub-livestream-pulse {
	0%   { opacity: 1; transform: scale(1); }
	50%  { opacity: 0.5; transform: scale(0.85); }
	100% { opacity: 1; transform: scale(1); }
}

/* ---------- Archive page shell ----------
 *
 * The PHP archive template prints its own <main>; classic themes whose
 * containers expect the theme's markup render it full-bleed. Cap and
 * center it, matching the wt26-staff archive fix. Themes that wrap the
 * template in their own constrained container just see a 100%-width main
 * inside it. */

.wt26-pub-archive {
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 2.5rem 1.25rem 3.5rem;
}

.wt26-pub-archive__header {
	margin: 0 0 1.5rem;
}

/* ---------- Pagination (used by block + archive templates) ---------- */

.wt26-pub-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin: 1.5rem 0;
}

.wt26-pub-pagination .page-numbers {
	display: inline-block;
	padding: 0.35em 0.7em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 3px;
	text-decoration: none;
}

/* The current page must be a filled chip. `background: currentColor` cannot do
   that here: currentColor resolves to this element's own `color`, which the very
   next line sets to #fff — so the chip rendered white-on-white (1:1) and the
   current page number was invisible. Use an explicit dark chip; themes can
   override it. White on #23272b = 15.6:1. */
.wt26-pub-pagination .page-numbers.current {
	background: #23272b;
	border-color: #23272b;
	color: #fff;
}
