/*
Theme Name: Ulrik Christensen Waterfall
Theme URI: https://ulrikchristensen.com
Description: A personal blog about end-user computing and cloud, for GeneratePress. Every post is drawn as a bar split into its sections and sized by reading time, the way a logon-duration waterfall splits a sign-in into phases. The newest post leads the front page with its bar across the page; lists show each post's bar on a shared time scale; on a post, the bar is the table of contents and fills in as you read.
Author: Ulrik Christensen
Author URI: https://ulrikchristensen.com
Template: generatepress
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ucw
Tags: blog, one-column, custom-menu, featured-images, translation-ready, editor-style
*/

/* ==========================================================================
   1. Tokens

   --contrast, --contrast-2, --base, --base-2, --base-3 and --accent are
   GeneratePress global colours (inc/gp-defaults.php). Light values live
   there; dark values are below. Ratios were measured against the page.
   ========================================================================== */

:root {
	color-scheme: light dark;

	/* Segments. Unread is ink; read is green. Green on ink 4.8:1, on paper 3.3:1. */
	--ucw-seg: #16213F;
	--ucw-seg-hover: #33406B;
	--ucw-signal: #17A262;
	--ucw-selection: #C8EED9;

	--ucw-font: "Atkinson Hyperlegible Next Variable", "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ucw-mono: "Atkinson Hyperlegible Mono Variable", "Atkinson Hyperlegible Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

	--ucw-measure: 37rem;   /* running text, about 72 characters at 18px */
	--ucw-small: 0.9375rem; /* 15px: meta, legends, captions */
	--ucw-bar-h: 2.5rem;    /* the labelled bar's height */
	--ucw-gutter: 32px;     /* matches the content padding in gp-defaults.php */
	--ucw-duration: 160ms;
}

@media (max-width: 768px) {
	:root {
		--ucw-gutter: 20px;
	}
}

@media (prefers-color-scheme: dark) {
	:root {
		--contrast: #E3E8F4;     /* text, 15.1:1 */
		--contrast-2: #9AA5C4;   /* secondary, 7.5:1 */
		--base: #2A3350;
		--base-2: #182038;
		--base-3: #0E1322;
		--accent: #4CD495;       /* links, 9.8:1 */

		--ucw-seg: #55628A;      /* 3.1:1 on the page */
		--ucw-seg-hover: #6E7CA6;
		--ucw-signal: #66EBA9;   /* 4.0:1 on unread */
		--ucw-selection: #1D5A3E;
	}
}

/* ==========================================================================
   2. Base
   ========================================================================== */

body.ucw {
	background: var(--base-3);
	color: var(--contrast);
	font-family: var(--ucw-font);
	font-size: 1.125rem;
	line-height: 1.6;
	font-feature-settings: "kern";
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.ucw ::selection {
	background: var(--ucw-selection);
	color: var(--contrast);
}

.ucw h1,
.ucw h2,
.ucw h3,
.ucw h4,
.ucw h5,
.ucw h6 {
	font-family: var(--ucw-font);
	color: var(--contrast);
	text-wrap: balance;
}

.ucw a {
	color: var(--accent);
	text-underline-offset: 0.16em;
	text-decoration-thickness: 1px;
}

.ucw :focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

.ucw .site-content {
	font-variant-numeric: proportional-nums;
}

/* ==========================================================================
   3. Header and menu
   ========================================================================== */

.ucw .site-header {
	border-bottom: 1px solid var(--base);
}

/* The Top Bar widget area: quiet, and gone when its widgets print nothing. */
.ucw .top-bar {
	background: transparent;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
}

.ucw .top-bar:not(:has(a, img, p, li, input, h2, h3, h4)) {
	display: none;
}

/* Social icons in the header and top bar take the ink colour, not the brand's. */
.ucw .header-widget .wp-block-social-link.wp-social-link,
.ucw .top-bar .wp-block-social-link.wp-social-link {
	background: transparent;
}

.ucw .header-widget .wp-block-social-link.wp-social-link .wp-block-social-link-anchor,
.ucw .top-bar .wp-block-social-link.wp-social-link .wp-block-social-link-anchor {
	color: var(--contrast);
	fill: currentColor;
}

.ucw .header-widget {
	align-self: center;
}

.ucw .header-widget .widget,
.ucw .header-widget .wp-block-social-links {
	margin: 0;
	padding: 0;
}

.ucw .main-title {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.ucw .main-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--contrast);
	text-decoration: none;
}

/* The mark: a three-step waterfall, last step read. */
.ucw .main-title a::before {
	content: "";
	flex: none;
	width: 1.25rem;
	height: 1rem;
	background:
		linear-gradient(var(--ucw-seg), var(--ucw-seg)) 0 1px / 0.5rem 0.25rem no-repeat,
		linear-gradient(var(--ucw-seg), var(--ucw-seg)) 0.5625rem 6px / 0.375rem 0.25rem no-repeat,
		linear-gradient(var(--ucw-signal), var(--ucw-signal)) 1rem 11px / 0.25rem 0.25rem no-repeat;
}

.ucw .site-description {
	color: var(--contrast-2);
	font-size: var(--ucw-small);
}

.ucw .main-navigation .main-nav ul li a {
	position: relative;
	font-size: 1rem;
	font-weight: 600;
}

/* Where you are: a segment under the item, green like a read section. */
.ucw .main-navigation .main-nav ul li a::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 4px;
	height: 4px;
	border-radius: 2px;
	background: transparent;
}

.ucw .main-navigation .main-nav ul li[class*="current-menu-"] > a::after,
.ucw .main-navigation .main-nav ul li.current_page_parent > a::after {
	background: var(--ucw-signal);
}

.ucw .main-navigation .menu-toggle {
	font-weight: 600;
}

@media (max-width: 768px) {
	/* Keep header widgets (the social icon) on the title's row, before the menu button. */
	.ucw .has-inline-mobile-toggle .site-branding { order: 0; }
	.ucw .has-inline-mobile-toggle .header-widget { order: 1; flex-basis: auto; margin: 0 0.25rem 0 auto; }
	.ucw .has-inline-mobile-toggle .mobile-menu-control-wrapper { order: 2; margin-left: 0; }
	.ucw .has-inline-mobile-toggle #site-navigation { order: 3; }
	.ucw .has-inline-mobile-toggle .site-branding + .mobile-menu-control-wrapper { margin-left: auto; }

	.ucw .main-navigation.toggled .main-nav > ul {
		background: var(--base-3);
		border-top: 1px solid var(--base);
	}

	.ucw .main-navigation .main-nav ul li a::after {
		left: 12px;
		right: auto;
		width: 2rem;
	}
}

/* ==========================================================================
   4. The bar

   A post's sections as segments, each one sized by its reading time
   (flex-grow is the section's word count). Used labelled under the newest
   post and at the top of a post; small and unlabelled in post lists; slim
   and fixed to the top of the window while a post is read.

   --ucw-fill (0–1) is set per segment by assets/js/waterfall.js.
   ========================================================================== */

.ucw-seg {
	position: relative;
	min-width: 0;
}

.ucw-seg__fill {
	position: absolute;
	inset: 0;
	background: var(--ucw-signal);
	transform: scaleX(var(--ucw-fill, 0));
	transform-origin: 0 50%;
}

.ucw-seg__fill:dir(rtl) {
	transform-origin: 100% 50%;
}

/* --- Labelled --------------------------------------------------------- */

.ucw-bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 1.25rem;
	align-items: start;
}

.ucw-bar__track {
	display: flex;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.ucw-bar .ucw-seg {
	flex: var(--ucw-w) 1 0%;
	min-width: 0.5rem;
	margin: 0;
	container-type: inline-size;
}

.ucw-seg__link {
	display: block;
	color: inherit;
	text-decoration: none;
	border-radius: 3px;
}

.ucw .ucw-seg__link {
	color: var(--contrast);
	text-decoration: none;
}

.ucw-seg__bar {
	position: relative;
	display: block;
	height: var(--ucw-bar-h);
	overflow: hidden;
	border-radius: 3px;
	background: var(--ucw-seg);
	transition: background-color var(--ucw-duration) ease;
}

.ucw-seg__title {
	display: -webkit-box;
	margin-top: 0.625rem;
	padding-right: 0.5rem;
	overflow: hidden;
	font-size: var(--ucw-small);
	font-weight: 700;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ucw-seg__time {
	display: block;
	margin-top: 0.125rem;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* A segment too narrow for its name keeps it for screen readers and the tooltip. */
@container (max-width: 5.5rem) {
	.ucw-seg__title,
	.ucw-seg__time {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

.ucw-bar__total {
	margin: 0;
	font-size: 1.375rem;
	font-weight: 800;
	line-height: var(--ucw-bar-h);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

@media (hover: hover) {
	.ucw-seg__link:hover .ucw-seg__bar {
		background: var(--ucw-seg-hover);
	}

	.ucw-seg__link:hover .ucw-seg__title {
		text-decoration: underline;
		text-decoration-thickness: 2px;
		text-underline-offset: 0.18em;
	}
}

.ucw-seg__link:focus-visible {
	outline-offset: 4px;
}

/* Narrow screens: a stepped waterfall, one row per section, each bar
   starting where the one before it ended. */
@media (max-width: 40rem) {
	.ucw-bar {
		grid-template-columns: minmax(0, 1fr);
	}

	.ucw-bar__total {
		grid-row: 1;
		margin-bottom: 0.75rem;
		line-height: 1.2;
	}

	.ucw-bar__track {
		flex-direction: column;
		gap: 0.875rem;
	}

	.ucw-bar .ucw-seg {
		flex: none;
		min-width: 0;
		container-type: normal;
	}

	.ucw-seg__link {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"title time"
			"bar   bar";
		column-gap: 1rem;
	}

	.ucw-seg__title {
		grid-area: title;
		margin: 0;
		padding: 0;
	}

	.ucw-seg__time {
		grid-area: time;
		margin: 0;
	}

	.ucw-seg__bar {
		grid-area: bar;
		height: 0.625rem;
		margin-top: 0.375rem;
		margin-left: calc(var(--ucw-start) * 1%);
		width: max(0.375rem, calc(var(--ucw-pct) * 1%));
		border-radius: 2px;
	}
}

/* --- Small, in post lists ----------------------------------------------

   The track is the shared time scale (ucw_bar_scale_minutes(), 20 minutes
   by default); the bar sits on it at its share of that. */

.ucw-track {
	position: relative;
	display: block;
}

.ucw-track::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: var(--base);
}

.ucw-mini {
	position: relative;
	display: flex;
	gap: 2px;
	width: calc(var(--ucw-scale) * 100%);
	min-width: 0.375rem;
	height: 0.625rem;
}

.ucw-mini .ucw-seg {
	flex: var(--ucw-w) 1 0%;
	min-width: 2px;
	overflow: hidden;
	border-radius: 1px;
	background: var(--ucw-seg);
}

/* --- Slim, fixed while reading ------------------------------------------ */

.ucw-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 200;
	display: flex;
	gap: 2px;
	height: 6px;
	background: var(--base-3);
	transform: translateY(-100%);
	transition: transform var(--ucw-duration) ease;
}

.ucw-sticky[hidden] {
	display: none;
}

.ucw-sticky.is-shown {
	transform: none;
}

.admin-bar .ucw-sticky {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .ucw-sticky {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .ucw-sticky {
		top: 0;
	}
}

.ucw-sticky .ucw-seg {
	flex: var(--ucw-w) 1 0%;
	min-width: 2px;
	overflow: hidden;
	background: var(--ucw-seg);
}

/* ==========================================================================
   5. Front page
   ========================================================================== */

.ucw-front .site-main {
	margin: 0;
}

.ucw-lead {
	padding: clamp(1rem, 4vw, 3.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.ucw-lead__meta {
	margin: 0 0 1rem;
	color: var(--contrast-2);
	font-size: 1rem;
}

.ucw .ucw-lead__title {
	max-width: 14em;
	margin: 0 0 1.5rem;
	font-size: clamp(2.5rem, 1.15rem + 5.4vw, 5.25rem);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: -0.03em;
}

.ucw .ucw-lead__title a {
	color: var(--contrast);
	text-decoration: none;
}

.ucw-lead__excerpt {
	max-width: 34rem;
	margin: 0 0 clamp(2rem, 4vw, 3rem);
	color: var(--contrast-2);
	font-size: 1.375rem;
	line-height: 1.5;
}

@media (hover: hover) {
	.ucw .ucw-lead__title a:hover {
		text-decoration: underline;
		text-decoration-thickness: 0.06em;
		text-underline-offset: 0.1em;
	}
}

.ucw-section-head {
	margin-bottom: 1.25rem;
}

.ucw .ucw-section-head h2 {
	margin: 0 0 0.375rem;
	font-size: 1.75rem;
	font-weight: 800;
	letter-spacing: -0.015em;
}

.ucw-legend {
	max-width: 34rem;
	margin: 0;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
	line-height: 1.5;
}

.ucw-all {
	margin: 1.5rem 0 0;
	font-weight: 700;
}

.ucw-about {
	max-width: var(--ucw-measure);
	margin-top: clamp(3rem, 7vw, 5rem);
	font-size: 1.375rem;
	line-height: 1.5;
}

.ucw-about p {
	margin: 0 0 0.75rem;
}

.ucw-about p + p {
	font-size: 1.125rem;
	font-weight: 700;
}

.ucw-empty {
	padding: clamp(2rem, 6vw, 5rem) 0;
}

.ucw .ucw-empty h2 {
	font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	margin-bottom: 1rem;
}

/* ==========================================================================
   6. Post lists: blog, archives, search, earlier posts on the front page
   ========================================================================== */

.ucw .page-header {
	margin: 0 0 clamp(2rem, 4vw, 3rem);
	padding: 0;
	border: 0;
}

.ucw .page-header .page-title {
	margin: 0 0 0.75rem;
	font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.025em;
}

.ucw .page-header .taxonomy-description p {
	max-width: var(--ucw-measure);
	color: var(--contrast-2);
}

.ucw-rows {
	border-top: 1px solid var(--base);
}

/* :not(#ucw-row) lifts these above GeneratePress's
   ".one-container.blog .post:not(:last-child)…" padding. */
.ucw .site-main .ucw-row:not(#ucw-row),
.ucw .site-main .ucw-rows > article:not(#ucw-row) {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr) clamp(9rem, 28%, 19rem) 4rem;
	column-gap: clamp(1rem, 2.5vw, 2rem);
	align-items: baseline;
	margin: 0;
	padding: 1.25rem 0 1.375rem;
	border-bottom: 1px solid var(--base);
}

.ucw-row__date {
	color: var(--contrast-2);
	font-size: var(--ucw-small);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.ucw-row__main {
	min-width: 0;
}

.ucw .ucw-row__title {
	margin: 0;
	text-wrap: pretty;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.ucw .ucw-row__title a {
	color: var(--contrast);
	text-decoration: none;
}

@media (hover: hover) {
	.ucw .ucw-row__title a:hover {
		text-decoration: underline;
		text-decoration-thickness: 2px;
	}
}

.ucw-row__category {
	margin: 0.25rem 0 0;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
}

.ucw-row .ucw-track {
	align-self: start;
	margin-top: 0.625rem;
}

.ucw-row__time {
	margin: 0;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

@media (max-width: 48rem) {
	.ucw .site-main .ucw-row:not(#ucw-row),
	.ucw .site-main .ucw-rows > article:not(#ucw-row) {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"date time"
			"main main"
			"bar  bar";
		row-gap: 0.375rem;
	}

	.ucw-row__date { grid-area: date; }
	.ucw-row__time { grid-area: time; font-size: var(--ucw-small); }
	.ucw-row__main { grid-area: main; }

	.ucw-row .ucw-track {
		grid-area: bar;
		margin-top: 0.5rem;
	}

	.ucw .ucw-row__title {
		font-size: 1.25rem;
	}
}

/* Page numbers. */
.ucw .paging-navigation {
	margin-top: 2.5rem;
}

.ucw .paging-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.ucw .paging-navigation .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.75rem;
	border-radius: 3px;
	color: var(--contrast);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
}

.ucw .paging-navigation .page-numbers.current {
	background: var(--ucw-seg);
	color: var(--base-3);
}

@media (hover: hover) {
	.ucw .paging-navigation a.page-numbers:hover {
		background: var(--base-2);
	}
}

/* ==========================================================================
   7. Posts and pages
   ========================================================================== */

.ucw .inside-article {
	padding: 0;
}

.ucw .entry-header {
	margin: 0;
}

.ucw-prose .entry-title,
.ucw-prose .entry-content > h1:first-child,
.ucw-prose .entry-content > .uc-eyebrow:first-child + h1 {
	max-width: 16em;
	margin: 0;
	font-size: clamp(2.25rem, 1.3rem + 3.6vw, 3.75rem);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.025em;
}

.ucw-post-header {
	margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.ucw-post-meta {
	margin: 1rem 0 clamp(2rem, 4vw, 2.75rem);
	color: var(--contrast-2);
	font-size: 1rem;
}

.ucw .ucw-post-meta a {
	color: var(--contrast-2);
}

.ucw-featured {
	margin: 0 0 clamp(2.5rem, 5vw, 3.5rem);
}

.ucw-featured img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.ucw-featured figcaption,
.ucw .entry-content figcaption,
.ucw .entry-content .wp-element-caption {
	margin-top: 0.625rem;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
	line-height: 1.45;
}

/* Pages without a featured image start straight under the header. */
.ucw.page .entry-header {
	margin-bottom: 2rem;
}

/* --- Running text ------------------------------------------------------- */

.ucw .entry-content > * {
	max-width: var(--ucw-measure);
}

.ucw .entry-content > .alignwide,
.ucw .entry-content > .alignfull {
	max-width: none;
}

.ucw .entry-content > .alignfull {
	margin-left: calc(-1 * var(--ucw-gutter, 32px));
	margin-right: calc(-1 * var(--ucw-gutter, 32px));
}

.ucw .entry-content {
	font-size: 1.125rem;
	line-height: 1.65;
}

.ucw .entry-content p,
.ucw .entry-content ul,
.ucw .entry-content ol {
	margin-bottom: 1.4em;
}

.ucw .entry-content h2 {
	margin: 2.75rem 0 1rem;
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.015em;
	scroll-margin-top: 2rem;
}

.ucw .entry-content h3 {
	margin: 2rem 0 0.75rem;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
}

.ucw .entry-content h4 {
	margin: 1.75rem 0 0.5rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.ucw .entry-content ul,
.ucw .entry-content ol {
	padding-left: 1.25em;
	margin-left: 0;
}

.ucw .entry-content li {
	margin-bottom: 0.4em;
}

.ucw .entry-content li::marker {
	color: var(--contrast-2);
}

.ucw .entry-content a {
	color: var(--accent);
	text-decoration: underline;
}

@media (hover: hover) {
	.ucw .entry-content a:hover {
		text-decoration-thickness: 2px;
	}
}

.ucw .entry-content blockquote {
	margin: 2rem 0;
	padding: 0 0 0 1.25rem;
	border-left: 4px solid var(--ucw-seg);
	font-size: 1.25rem;
	font-style: normal;
	line-height: 1.5;
}

.ucw .entry-content blockquote cite {
	display: block;
	margin-top: 0.5rem;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
	font-style: normal;
}

.ucw .entry-content hr,
.ucw .entry-content .wp-block-separator {
	height: 1px;
	margin: 3rem 0;
	border: 0;
	background: var(--base);
	opacity: 1;
}

.ucw .entry-content img {
	border-radius: 4px;
}

/* About page content written for the earlier theme. */
.ucw .entry-content .uc-eyebrow {
	margin-bottom: 0.75rem;
	color: var(--contrast-2);
	font-size: 1rem;
}

.ucw .entry-content .uc-lead {
	margin-top: 1.25rem;
	color: var(--contrast-2);
	font-size: 1.375rem;
	line-height: 1.5;
}

/* --- Code --------------------------------------------------------------- */

.ucw code,
.ucw kbd,
.ucw samp,
.ucw pre {
	font-family: var(--ucw-mono);
	font-variant-ligatures: none;
}

.ucw :not(pre) > code,
.ucw kbd {
	padding: 0.1em 0.3em;
	border-radius: 3px;
	background: var(--base-2);
	color: var(--contrast);
	font-size: 0.875em;
	overflow-wrap: anywhere;
}

.ucw .entry-content pre,
.ucw .entry-content .wp-block-code {
	max-width: none;
	width: min(100%, 48rem);
	margin: 1.75rem 0;
	padding: 1.125rem 1.375rem;
	overflow-x: auto;
	border: 0;
	border-radius: 4px;
	background: var(--base-2);
	color: var(--contrast);
	font-size: 0.9375rem;
	line-height: 1.6;
	tab-size: 4;
	white-space: pre;
}

.ucw .entry-content pre code {
	padding: 0;
	background: none;
	font-size: inherit;
}

/* --- Tables ------------------------------------------------------------- */

.ucw .entry-content .wp-block-table {
	max-width: none;
	width: min(100%, 48rem);
	overflow-x: auto;
}

.ucw .entry-content table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.ucw .entry-content th,
.ucw .entry-content td {
	padding: 0.625rem 1rem 0.625rem 0;
	border: 0;
	border-bottom: 1px solid var(--base);
	text-align: left;
	vertical-align: top;
}

.ucw .entry-content thead,
.ucw .entry-content tfoot {
	border: 0;
}

.ucw .entry-content thead th {
	border-bottom: 2px solid var(--contrast);
	font-weight: 700;
}

/* --- After the post ----------------------------------------------------- */

.ucw .footer-entry-meta {
	max-width: var(--ucw-measure);
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--base);
	color: var(--contrast-2);
	font-size: 1rem;
}

.ucw .footer-entry-meta .gp-icon {
	display: none;
}

.ucw .post-navigation {
	display: grid;
	gap: 0.75rem;
	margin-top: 1rem;
}

.ucw .post-navigation .nav-previous,
.ucw .post-navigation .nav-next {
	padding: 0;
}

.ucw .post-navigation a {
	font-weight: 700;
}

/* ==========================================================================
   8. Comments and forms
   ========================================================================== */

.ucw .comments-area {
	max-width: var(--ucw-measure);
	margin-top: 4rem;
}

.ucw .comments-title,
.ucw .comment-reply-title {
	font-size: 1.5rem;
	font-weight: 800;
}

.ucw .comment-form label {
	display: block;
	margin-bottom: 0.375rem;
	font-weight: 700;
}

.ucw .ucw-optional {
	color: var(--contrast-2);
	font-weight: 400;
}

.ucw input[type="text"],
.ucw input[type="email"],
.ucw input[type="url"],
.ucw input[type="search"],
.ucw textarea {
	width: 100%;
	max-width: 32rem;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--contrast-2);
	border-radius: 3px;
	background: var(--base-3);
	color: var(--contrast);
	font: inherit;
	font-size: 1rem;
}

.ucw textarea {
	max-width: none;
}

.ucw input:focus-visible,
.ucw textarea:focus-visible {
	border-color: var(--contrast);
	outline: 3px solid var(--accent);
	outline-offset: 1px;
}

.ucw button,
.ucw input[type="submit"],
.ucw .wp-block-button__link {
	padding: 0.75rem 1.25rem;
	border: 0;
	border-radius: 3px;
	background: var(--ucw-seg);
	color: var(--base-3);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

@media (hover: hover) {
	.ucw button:hover,
	.ucw input[type="submit"]:hover,
	.ucw .wp-block-button__link:hover {
		background: var(--ucw-seg-hover);
		color: var(--base-3);
	}
}

.ucw .main-navigation .menu-toggle,
.ucw .main-navigation .menu-toggle:hover {
	background: transparent;
	color: var(--contrast);
	padding: 0 12px;
}

.ucw .search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 32rem;
}

.ucw .search-form label {
	flex: 1;
}

.ucw .search-form .search-field {
	max-width: none;
}

.ucw .search-form .search-submit {
	flex: none;
}

/* ==========================================================================
   9. Footer
   ========================================================================== */

.ucw .site-info {
	background: transparent;
	color: var(--contrast-2);
	font-size: var(--ucw-small);
}

.ucw .copyright-bar {
	padding-top: 1.5rem;
	border-top: 1px solid var(--base);
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	width: 100%;
}

.ucw-copyright {
	margin: 0;
}

.ucw-footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ucw .ucw-footer-menu a {
	color: var(--contrast-2);
	text-decoration: none;
}

@media (hover: hover) {
	.ucw .ucw-footer-menu a:hover {
		color: var(--contrast);
		text-decoration: underline;
	}
}

/* ==========================================================================
   10. Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.ucw-sticky,
	.ucw-seg__bar {
		transition: none;
	}
}
