/*
 * Entangle Projects — frontend.
 *
 * BEM (`entangle-projects-*`), no Tailwind, no icon font. Colours, radii, gaps
 * and type sizes resolve through --ep-* tokens bridged in this order:
 *   1. entangle-base theme tokens (--color-brand, --color-ink, --radius, --grid-gap …)
 *   2. the legacy suite tokens (--color-primary, --color-contrast …)
 *   3. neutral literals
 * Lengths are px (or clamp of px): AutomaticCSS sites run the root at 62.5%,
 * so rem would shrink. Font family and base size are inherited from the theme.
 *
 * Contrast notes (white page): ink 17.7, muted 7.7, brand 5.2, status
 * green 6.0 — the tints behind chip text stay light, so text keeps ≥ 4.5.
 */

/* ---------------------------------------------------------------- tokens */

.entangle-projects-hero,
.entangle-projects-sections,
.entangle-projects-comments,
.entangle-projects-related,
.entangle-projects-fragment,
.entangle-projects-nav,
.entangle-projects-more,
.entangle-projects-archive,
.entangle-projects-archive-title {
	--ep-accent: var(--color-brand, var(--color-primary, #1a1a1a));
	--ep-accent-deep: var(--color-brand-deep, var(--color-primary-deep, var(--ep-accent)));
	--ep-on-accent: var(--color-on-brand, var(--color-contrast, #fff));
	--ep-ink: var(--color-ink, var(--color-base, #18181b));
	--ep-muted: var(--color-ink-soft, #52525b);
	--ep-rule: var(--color-rule, rgba(24, 24, 27, 0.12));
	--ep-rule-strong: var(--color-rule-solid, #d9d9dc);
	--ep-surface: var(--color-bg-alt, #f4f4f5);
	--ep-card: var(--color-card, #fff);
	--ep-radius: var(--radius, 8px);
	--ep-radius-sm: var(--radius-sm, 4px);
	--ep-gap: var(--grid-gap, 24px);
	/* Between the ROWS of a grid of cards a little more than between its columns (the owner, 31. 10.): a card is read
	   down, image to title, and the next row's image must not touch the title above it. The same as the gallery of
	   the proposals (entangle-budget's --eb-row-gap); a theme whose cards touch (grid gap 0) keeps them touching. */
	--ep-row-gap: calc(var(--ep-gap) * 5 / 3);
	--ep-state-running: var(--color-status-running, #1d7239);
	--ep-state-done: var(--color-status-done, #525252);
	/* In preparation: the accent of the site (the owner, 12. 11.: one family of colours, no indigo of its own). */
	--ep-state-prep: var(--ep-accent-deep);
	/* A tag that rides on a picture: how much of its colour its ground takes, and the corner it ends with — the
	   theme's radius, but never more than a tag can carry. */
	--ep-tag-tint: 14%;
	--ep-tag-radius: min(var(--ep-radius), 10px);
	--ep-state-backlog: var(--color-status-caution, hsl(32, 90%, 27%));
	--ep-measure: 760px;
	/* The chrome of a page — the row of prev/next, the strip of tabs — reads at the size of the site's own menu,
	   so that the page has one voice (the owner, 27. 10.). A link of it is a target, not a word: 44 px high. */
	--ep-nav-size: 1.0625rem;
	--ep-nav-target: 44px;
	/* The narrowest a card may be: four, three, two and one of them fit as the wrapper narrows
	   (the same width the proposals of entangle-budget use, so the two lists are one family). */
	--ep-card-min: 16.5rem;
	--ep-adminbar: var(--wp-admin--admin-bar--height, 0px);
	--ep-sticky-top: calc(var(--header-h, 0px) + var(--ep-adminbar) + 24px);
	/* Where the bar of the tabs sticks: right under the site's header (the theme measures it: --header-h). */
	--ep-tabs-top: calc(var(--header-h, 0px) + var(--ep-adminbar));
	/* Pinned, the bar is white and set off from the header by a line of 1 px, the colour of the other lines of the
	   page of a record (the owner, 31. 10.). */
	--ep-tabs-stuck-bg: var(--color-bg, #fff);
	--ep-tabs-stuck-line: var(--ep-rule);
	--ep-tabs-stuck-shadow: rgba(11, 29, 63, 0.07);
}

/* The page width, like the theme's own container (same variables). */
.entangle-projects-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--container, 1200px);
	margin-inline: auto;
	padding-inline: var(--gutter, 24px);
}

/*
 * A block of this plugin standing in the TEXT of a page (not on the plugin's own archive template): the page already
 * holds its width and its gutter, so a wrapper of our own would inset the cards against everything else on that page
 * — a second gutter inside the first (the owner, 26. 10.: the proposals and the projects take the same width).
 * The archive, where this wrapper IS the page container, keeps both.
 */
.wp-block-post-content .entangle-projects-wrap {
	max-width: none;
	padding-inline: 0;
}

/* A core group adds .has-global-padding (root padding 0 on this theme), which would drop the gutter. */
.entangle-projects-archive-title.entangle-projects-wrap {
	padding-inline: var(--gutter, 24px);
}

.entangle-projects-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.entangle-projects-icon {
	display: inline-block;
	flex: none;
	vertical-align: middle;
}

/* ----------------------------------------------------------------- chips */

.entangle-projects-chip {
	--chip: var(--ep-accent-deep);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--ep-surface);
	color: var(--chip);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
	.entangle-projects-chip {
		background: color-mix(in srgb, var(--chip) 12%, transparent);
	}

	a.entangle-projects-chip:hover {
		background: color-mix(in srgb, var(--chip) 22%, transparent);
	}
}

.entangle-projects-chip--in-progress,
.entangle-projects-chip--engagement {
	--chip: var(--ep-state-running);
}

.entangle-projects-chip--completed {
	--chip: var(--ep-state-done);
}

.entangle-projects-chip--in-preparation {
	--chip: var(--ep-state-prep);
}

/* In the backlog: ready on paper, waiting for money or for its turn — the colour of "wait", not of "over". */
.entangle-projects-chip--backlog {
	--chip: var(--ep-state-backlog);
}

/* Over without being done: a proposal that did not go on, a cancelled project. */
.entangle-projects-chip--closed {
	--chip: var(--ep-muted);
}

/* What the record IS — its form, when it is a proposal, and what another module says it is part of (the edition of a
   proposal) — is said in the quiet grey (the owner, 12. 11.): a colour is kept for where the record STANDS (its
   stage, what the assessment said), so that the coloured tags of a row are the ones that answer "how is it going". */
.entangle-projects-chip--form,
.entangle-projects-chip--of {
	--chip: var(--ep-muted);
	color: var(--ep-ink);
}

/* What an assessment said, as a colour (the owner, 28. 10.): it can be done, it can with reservations, it cannot.
   The chips another module hangs on the card (entangle_projects_card_chips) are read by these three and nothing
   else; the word beside the colour says the same thing for whoever does not read colour. */
.entangle-projects-chip--ok {
	--chip: var(--ep-state-running);
}

.entangle-projects-chip--caution {
	--chip: var(--color-status-caution, hsl(32, 90%, 27%));
}

.entangle-projects-chip--stop {
	--chip: var(--color-status-stop, hsl(0, 62%, 38%));
}

.entangle-projects-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.entangle-projects-chip__dot {
	position: relative;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentcolor;
}

@media (prefers-reduced-motion: no-preference) {
	.entangle-projects-chip__dot::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: 50%;
		background: currentcolor;
		animation: entangle-projects-pulse 2s ease-out infinite;
	}
}

@keyframes entangle-projects-pulse {
	0% {
		opacity: 0.6;
		transform: scale(1);
	}

	100% {
		opacity: 0;
		transform: scale(3);
	}
}

/* --------------------------------------------------------------- buttons */

/* Fallback skin only (zero specificity): a theme's own button styles win. */
:where(.entangle-projects-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--ep-accent);
	border-radius: var(--ep-radius-sm);
	background: var(--ep-accent);
	color: var(--ep-on-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

/* The small one (the way to the page of a part, in the drawer): the theme's `entangle-btn--sm` where it has one. */
:where(.entangle-projects-button--sm) {
	min-height: 0;
	padding: 6px 16px;
	font-size: var(--wp--preset--font-size--small, 14px);
}

.entangle-projects-hero__actions .entangle-projects-button--secondary {
	border: 1px solid currentcolor;
	background: transparent;
	color: var(--ep-accent-deep);
}

/* ------------------------------------------------------------------ hero */

/* No air of its own above or below (the owner, 27. 10.): the page already keeps its distance from the header, and
   the band of prev/next is what the detail opens with. */
.entangle-projects-hero {
	padding-block: 0;
}

/* Three cells, three targets: a link fills the whole of its side, so nobody has to aim at the words (the owner,
   27. 10.). The row is as tall as one target and everything in it sits on one line, whatever it holds — an icon,
   a word, or both. */
.entangle-projects-hero__nav {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: stretch;
	border-block: 1px solid var(--ep-rule);
	/* The two lines of the row run to the edges of the window (the owner, 18. 11.), the links stay on the line of
	   the content: the lines are painted by a border-image with outsets to the sides, as the pinned bar of the
	   tabs paints its band — they reach the edges without making the page wider. A browser that does not take it
	   keeps the plain borders above. */
	border-image: linear-gradient(var(--ep-rule), var(--ep-rule)) 1 / 1px 0 / 0 100vmax;
	font-size: var(--ep-nav-size, 1.0625rem);
}

.entangle-projects-hero__nav-side {
	display: flex;
	min-height: var(--ep-nav-target, 44px);
}

.entangle-projects-hero__nav-side--end {
	justify-content: flex-end;
}

.entangle-projects-hero__nav-side > .entangle-projects-hero__nav-link {
	flex: 1 1 auto;
}

.entangle-projects-hero__nav-side--end > .entangle-projects-hero__nav-link {
	justify-content: flex-end;
}

.entangle-projects-hero__nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: var(--ep-nav-target, 44px);
	/* The words of the row stand at the edge of the page, with the rest of the page (the owner, 28. 10.). */
	padding-inline: 0;
	color: inherit;
	line-height: 1;
	text-decoration: none;
}

/* The middle one is the way back to all of them: an icon, named for whoever cannot see it. A mark has no word to
   stand on, so it keeps air around itself — the target stays as wide as a finger. */
.entangle-projects-hero__nav-all {
	justify-content: center;
	padding-inline: 15px;
}

.entangle-projects-hero__nav-link:hover,
.entangle-projects-hero__nav-link:focus-visible {
	background: var(--ep-surface);
	color: var(--ep-ink);
	text-decoration: none;
}

/* The ground under a pointed-at "previous" or "next" runs on to the edge of the window on its own side (the owner,
   19. 11.), as the lines of the row do: the same ground painted once more as a border-image with an outset to that
   side. The words stay where they are, and the page gets no wider. */
.entangle-projects-hero__nav-side:not(.entangle-projects-hero__nav-side--end) > .entangle-projects-hero__nav-link:is(:hover, :focus-visible) {
	border-image: linear-gradient(var(--ep-surface), var(--ep-surface)) fill 0 / 0 / 0 0 0 100vmax;
}

.entangle-projects-hero__nav-side--end > .entangle-projects-hero__nav-link:is(:hover, :focus-visible) {
	border-image: linear-gradient(var(--ep-surface), var(--ep-surface)) fill 0 / 0 / 0 100vmax 0 0;
}

.entangle-projects-hero__nav-side:not(.entangle-projects-hero__nav-side--end) > .entangle-projects-hero__nav-link:is(:hover, :focus-visible):dir(rtl) {
	border-image-outset: 0 100vmax 0 0;
}

.entangle-projects-hero__nav-side--end > .entangle-projects-hero__nav-link:is(:hover, :focus-visible):dir(rtl) {
	border-image-outset: 0 0 0 100vmax;
}

.entangle-projects-hero__grid {
	display: grid;
	gap: var(--wp--preset--spacing--60, 32px);
	align-items: center;
	margin-top: var(--wp--preset--spacing--70, 48px);
}

/* The picture stands at the top of its column (the owner, 31. 10.): the text beside it begins where it begins, and
   the small pictures under it do not push it down the page. */
@media (min-width: 900px) {
	.entangle-projects-hero--has-image .entangle-projects-hero__grid {
		align-items: start;
	}
}

@media (min-width: 900px) {
	.entangle-projects-hero--has-image .entangle-projects-hero__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 56px;
	}
}

/* The gallery: the big picture and, under it, the small ones (includes/gallery.php). */
.entangle-projects-hero__gallery {
	order: -1;
	display: grid;
	gap: 10px;
	min-width: 0;
}

@media (min-width: 900px) {
	.entangle-projects-hero__gallery {
		order: 0;
	}
}

.entangle-projects-hero__media {
	order: -1;
	margin: 0;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: var(--ep-radius);
	background: var(--ep-surface);
}

@media (min-width: 900px) {
	.entangle-projects-hero__media {
		order: 0;
	}
}

.entangle-projects-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.entangle-projects-hero__zoom {
	position: relative;
	display: block;
	height: 100%;
	cursor: zoom-in;
}

/* An upright or nearly square picture is shown whole (includes/gallery.php), over the same picture enlarged and
   blurred: the place keeps its shape, nothing of the picture is cut away, and there are no empty bars beside it. */
.entangle-projects-hero__media {
	position: relative;
}

.entangle-projects-hero__backdrop {
	position: absolute;
	inset: 0;
	display: none;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(28px) saturate(1.15) brightness(0.88);
	transform: scale(1.2);
}

.entangle-projects-hero__media[data-fit="contain"] .entangle-projects-hero__backdrop {
	display: block;
}

.entangle-projects-hero__media[data-fit="contain"] .entangle-projects-hero__img {
	object-fit: contain;
}

.entangle-projects-hero__zoom:focus-visible {
	outline: 3px solid var(--ep-accent);
	outline-offset: -3px;
}

.entangle-projects-hero__thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Above the title on a phone: one row that scrolls sideways, so the title is not pushed off the first screen. */
@media (max-width: 899px) {
	.entangle-projects-hero__thumbs {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 64px;
		overflow-x: auto;
		padding: 2px 2px 4px;
		scrollbar-width: thin;
	}
}

.entangle-projects-hero__thumb-item {
	margin: 0;
}

.entangle-projects-hero__thumb {
	display: block;
	overflow: hidden;
	aspect-ratio: 1;
	border-radius: var(--ep-radius-sm);
	background: var(--ep-surface);
	opacity: 0.72;
	transition: opacity 0.2s ease;
}

.entangle-projects-hero__thumb:hover,
.entangle-projects-hero__thumb:focus-visible,
.entangle-projects-hero__thumb[aria-current="true"] {
	opacity: 1;
}

.entangle-projects-hero__thumb[aria-current="true"] {
	outline: 2px solid var(--ep-accent);
	outline-offset: 2px;
}

.entangle-projects-hero__thumb:focus-visible {
	outline: 3px solid var(--ep-ink);
	outline-offset: 2px;
}

/* "← → browse the photos": while the keyboard is in the gallery, and only then. */
.entangle-projects-hero__keys {
	display: none;
	margin: 0;
	color: var(--ep-muted);
	font-size: 13px;
}

.entangle-projects-hero__gallery:has(:focus-visible) .entangle-projects-hero__keys {
	display: block;
}

.entangle-projects-hero__keys kbd {
	display: inline-block;
	min-width: 1.6em;
	padding: 0 5px;
	border: 1px solid var(--ep-rule-strong);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--ep-card);
	font: inherit;
	font-size: 12px;
	text-align: center;
}

.entangle-projects-hero__thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* The picture over the page (assets/js/hero.js): the browser's own dialog, the picture the whole height of the window
   (the owner, 31. 10.) and never taller — the buttons and the counter lie over it, they take no room from it, and
   the dialog never scrolls. */
.entangle-projects-lightbox {
	box-sizing: border-box;
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	background: transparent;
	color: #fff;
}

.entangle-projects-lightbox::backdrop {
	background: rgba(10, 14, 20, 0.92);
}

.entangle-projects-lightbox__figure {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
}

.entangle-projects-lightbox__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.entangle-projects-lightbox__counter {
	position: absolute;
	bottom: 16px;
	left: 50%;
	padding: 4px 12px;
	border-radius: 999px;
	background: rgba(10, 14, 20, 0.6);
	font-size: 14px;
	transform: translateX(-50%);
}

.entangle-projects-lightbox__counter:empty {
	display: none;
}

.entangle-projects-lightbox__button {
	position: absolute;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	/* Over the picture now: dark enough to be seen on a white sky, light enough on a dark one. */
	background: rgba(10, 14, 20, 0.5);
	color: #fff;
	cursor: pointer;
}

.entangle-projects-lightbox__button:hover,
.entangle-projects-lightbox__button:focus-visible {
	background: rgba(10, 14, 20, 0.75);
}

.entangle-projects-lightbox__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.entangle-projects-lightbox__close {
	top: 12px;
	right: 12px;
}

.entangle-projects-lightbox__previous,
.entangle-projects-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.entangle-projects-lightbox__previous {
	left: 12px;
}

.entangle-projects-lightbox__next {
	right: 12px;
}

@media (max-width: 600px) {
	.entangle-projects-lightbox__previous,
	.entangle-projects-lightbox__next {
		top: auto;
		bottom: 12px;
		transform: none;
	}
}

.entangle-projects-hero__badges {
	/* The sheet of the areas hangs under the WHOLE row, not under the chip: a chip that has wrapped to the end of a
	   narrow line would hang its sheet off the screen. */
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	/* Under the name and the lead of the record (the owner, 12. 11.). */
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.entangle-projects-hero__areas {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0 0 16px;
	padding: 0;
	color: var(--ep-muted);
	/* The names of the areas as they are written, at the spacing of the text (the owner, 18. 11.): in capitals and
	   spaced out, a list of long names was a block of shouting under a quiet chip. */
	font-size: 0.9375rem;
	list-style: none;
}

.entangle-projects-hero__areas a {
	color: inherit;
	text-decoration: none;
}

.entangle-projects-hero__areas a:hover {
	color: var(--ep-ink);
	text-decoration: underline;
}

/* The areas behind one chip (the owner, 27. 10.): their names are long, the row of tags is short. The chip is a chip
   like the others — the same size, the same weight, on the same line — and quiet, because an area is not a state.
   Folded only where the script can open it again (`is-folded`): without it the list stands in the row as it did. */
.entangle-projects-areas {
	position: relative; /* the list opens under THIS chip, not under whatever stood above it */
	display: inline-flex;
	align-items: center;
}

.entangle-projects-areas__toggle {
	--chip: var(--ep-muted);
	border: 0;
	cursor: pointer;
	font-family: inherit;
	gap: 4px;
}

.entangle-projects-areas.is-folded > .entangle-projects-hero__areas {
	position: absolute;
	z-index: 20;
	/* A step of air between the chip and the list (the owner, 18. 11.: the list hung on the chip's own edge). The air
	   is not empty to the cursor — see ::before below — or the list would close on the way to it. */
	inset-block-start: calc(100% + var(--ep-areas-gap, 8px));
	inset-inline-start: 0;
	display: none;
	flex-direction: column;
	gap: 2px;
	width: max-content;
	/* Measured against the PAGE, not against the chip it hangs from (which is only a word wide). */
	max-width: min(22rem, 80vw);
	margin: 0;
	padding: 6px;
	border: 1px solid var(--ep-rule);
	border-radius: var(--radius, 10px);
	background: var(--ep-card);
	color: var(--ep-ink);
	box-shadow: 0 12px 32px rgb(24 24 27 / 14%);
}

/* The air above the list belongs to the list: a strip that cannot be seen, from the list up to the chip (and a pixel
   into it, over the list's own line), so a cursor on its way down never leaves the two and the list stays open. */
.entangle-projects-areas.is-folded > .entangle-projects-hero__areas::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	inset-block-end: 100%;
	height: calc(var(--ep-areas-gap, 8px) + 2px);
}

.entangle-projects-areas.is-folded.is-open > .entangle-projects-hero__areas {
	display: flex;
}

.entangle-projects-areas.is-folded .entangle-projects-hero__areas li {
	display: flex;
}

.entangle-projects-areas.is-folded .entangle-projects-hero__areas a {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-height: var(--ep-nav-target, 44px);
	padding: 6px 10px;
	border-radius: var(--radius, 8px);
}

.entangle-projects-areas.is-folded .entangle-projects-hero__areas a:hover,
.entangle-projects-areas.is-folded .entangle-projects-hero__areas a:focus-visible {
	background: var(--ep-surface);
	color: var(--ep-ink);
	text-decoration: none;
}

.entangle-projects-areas.is-open .entangle-projects-areas__toggle .entangle-projects-icon {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
	.entangle-projects-areas__toggle .entangle-projects-icon {
		transition: transform 0.15s ease;
	}
}

.entangle-projects-hero__title {
	margin: 0 0 var(--wp--preset--spacing--30, 16px);
	font-size: var(--wp--preset--font-size--section-title, clamp(32px, 4.2vw, 56px));
	line-height: 1.05;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.entangle-projects-hero__lead {
	max-width: 60ch;
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--lead, 20px);
}

.entangle-projects-hero__lead > :first-child {
	margin-top: 0;
}

.entangle-projects-hero__lead > :last-child {
	margin-bottom: 0;
}

/* A line another plugin adds under the title (the participatory budget: where a project came from). */
.entangle-projects-hero__note {
	max-width: 60ch;
	margin: 16px 0 0;
	color: var(--ep-muted);
}

.entangle-projects-hero__note-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* What the line is, in bold and in the colour of the title (the owner, 30. 10.): "Patří k projektu", "Vzešlo
   z participativního rozpočtu" — the rest of the line stays quiet. */
.entangle-projects-hero__note-lead {
	color: var(--ep-ink);
	font-weight: 600;
}

/* When it runs and what it costs: a short list of facts under the lead. */
.entangle-projects-hero__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 40px;
	margin: var(--wp--preset--spacing--50, 24px) 0 0;
	padding: 0;
}

.entangle-projects-hero__fact {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.entangle-projects-hero__fact dt {
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 13px);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.entangle-projects-hero__fact dd {
	margin: 0;
	color: var(--ep-ink);
	font-size: var(--wp--preset--font-size--body, 18px);
	font-weight: 600;
}

/* A quieter second line of a fact: who gives the grant under its amount. */
.entangle-projects-hero__fact-note {
	display: block;
	max-width: 32ch;
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 14px);
	font-weight: 400;
}

/* The funder's logo, as a grant asks the page to carry it: under the facts, at the size of a signature. */
.entangle-projects-hero__funder {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin: 20px 0 0;
}

.entangle-projects-hero__funder-label {
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 13px);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.entangle-projects-hero__funder-logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 64px;
}

/* The three answers of the head are parted by a line, not by air alone (the owner, 28. 10.): what it is and what
   it is about, then what is known of it, then what can be done with it. */
.entangle-projects-hero__facts {
	margin-block-start: 20px;
	padding-block-start: 20px;
	border-block-start: 1px solid var(--ep-rule);
}

.entangle-projects-hero__facts + .entangle-projects-hero__actions {
	margin-block-start: 20px;
	padding-block-start: 20px;
	border-block-start: 1px solid var(--ep-rule);
}

/* Sharing stands at the END of the row of what can be done (it is one of those things), and drops under the
   buttons where the row cannot hold both. */
.entangle-projects-hero__doings {
	display: flex;
	align-items: center;
	margin-inline-start: auto;
}

.entangle-projects-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: var(--wp--preset--spacing--50, 24px);
}

/* ------------------------------------------------------------------ tabs */

/* As close to the hero above it as the line allows (the owner, 27. 10.): the strip belongs to what it names. */
.entangle-projects-sections {
	padding-top: 0;
}

/* The bar of the tabs sticks under the site's header while the tabs are read (the owner, 31. 10.; the yoga
   centres of jogacz.cz the model): pinned, it is white across the whole width of the page, set off from the header
   by a line of 1 px, with a soft shadow under it, so it reads as a part of the header and not as a line lost
   over the text. The colour, the line and the shadow are painted by border-image outsets: they reach the edges of
   the window without making the page wider. */
.entangle-projects-tabs__bar {
	position: sticky;
	top: var(--ep-tabs-top);
	z-index: 10;
	margin-bottom: 40px;
	background: var(--color-bg, #fff);
	transition: background-color 0.2s ease;
}

.entangle-projects-tabs__bar::before,
.entangle-projects-tabs__bar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.entangle-projects-tabs__bar::before {
	inset-block: 0;
	z-index: -1;
	border-image: linear-gradient(var(--ep-tabs-stuck-line) 0 1px, var(--ep-tabs-stuck-bg) 1px) fill 0 / 0 / 0 100vmax;
}

.entangle-projects-tabs__bar::after {
	top: 100%;
	height: 16px;
	border-image: linear-gradient(var(--ep-tabs-stuck-shadow), transparent) fill 0 / 0 / 0 100vmax;
}

.entangle-projects-tabs__bar.is-stuck {
	/* Opaque all the way: the band beside it fades in, the bar itself never lets the text under it through. */
	background: var(--ep-tabs-stuck-bg);
}

.entangle-projects-tabs__bar.is-stuck::before,
.entangle-projects-tabs__bar.is-stuck::after {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.entangle-projects-tabs__bar,
	.entangle-projects-tabs__bar::before,
	.entangle-projects-tabs__bar::after {
		transition: none;
	}
}

.entangle-projects-tabs__nav {
	overflow-x: auto;
	overflow-y: hidden;
	border-bottom: 1px solid var(--ep-rule);
	/* The line under the tabs runs to the edges of the window too (the owner, 18. 11.) — the row of prev/next
	   above has the same; the tabs themselves stay on the line of the content. */
	border-image: linear-gradient(var(--ep-rule), var(--ep-rule)) 1 / 0 0 1px / 0 100vmax;
	scrollbar-width: thin;
}

/* Pinned, the bar has its own line and shadow across the window: the line under the tabs goes. */
.entangle-projects-tabs__bar.is-stuck .entangle-projects-tabs__nav {
	border-bottom-color: transparent;
	border-image: none;
}

.entangle-projects-tabs__list {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.entangle-projects-tabs__tab {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: -1px;
	padding: 16px 0;
	border-bottom: 3px solid transparent;
	color: var(--ep-muted);
	font-size: var(--ep-nav-size, 1.0625rem);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.entangle-projects-tabs__tab:hover {
	color: var(--ep-ink);
}

/* How much is in the tab: a number in a disc of the theme's grey surface (the owner, 12. 11.), not in brackets. One
   figure is a circle; more of them stretch it into a pill. */
.entangle-projects-tabs__count {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 1.6em;
	height: 1.6em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: var(--ep-surface);
	color: var(--ep-muted);
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.entangle-projects-tabs__tab[aria-selected="true"] {
	border-bottom-color: var(--ep-accent);
	color: var(--ep-ink);
}

/* Inside the box: the strip scrolls (overflow), so an outside ring would be clipped. */
.entangle-projects-tabs__tab:focus-visible {
	outline: 2px solid var(--ep-accent);
	outline-offset: -2px;
}

/* A panel reached by address or script stops below the sticky header and the bar of the tabs stuck under it. */
.entangle-projects-section {
	scroll-margin-top: calc(var(--ep-tabs-top) + var(--ep-tabs-h, 56px) + 24px);
}

.entangle-projects-section:focus-visible {
	outline: 2px solid var(--ep-accent);
	outline-offset: 4px;
}

.entangle-projects-section[hidden] {
	display: none !important;
}

.entangle-projects-sections:not(.is-enhanced) .entangle-projects-section + .entangle-projects-section {
	margin-top: 64px;
}

.entangle-projects-section__title {
	margin: 0 0 24px;
	font-size: var(--wp--preset--font-size--h-3, 28px);
}

/* The tab already names the section; the heading is for the no-JS stacked page. */
.entangle-projects-sections.is-enhanced .entangle-projects-section__title,
.entangle-projects-sections.is-enhanced .entangle-projects-comments__title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.entangle-projects-section__intro {
	max-width: var(--ep-measure);
	margin-bottom: 32px;
}

.entangle-projects-section__intro > :first-child {
	margin-top: 0;
}

.entangle-projects-section__intro > :last-child {
	margin-bottom: 0;
}

/* ----------------------------------------------------------- description */

.entangle-projects-prose {
	max-width: var(--ep-measure);
}

.entangle-projects-prose > :where(* + *) {
	margin-top: 1.25em;
}

.entangle-projects-prose > .alignwide,
.entangle-projects-prose > .alignfull {
	max-width: none;
}

.entangle-projects-prose img {
	max-width: 100%;
	height: auto;
}

/* Blocks inside the intro of a tab: the same rhythm and limits as the description. */
.entangle-projects-section__intro > :where(* + *) {
	margin-top: 1em;
}

.entangle-projects-section__intro :where(ul, ol) {
	padding-left: 1.25em;
}

.entangle-projects-section__intro img {
	max-width: 100%;
	height: auto;
}

/* ----------------------------------------------------------- assessments */

/* What the assessor groups said and made public: who, the verdict, the words — and when. Never who wrote it. */
.entangle-projects-assessments {
	max-width: 960px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.entangle-projects-assessment {
	display: grid;
	gap: 12px;
	padding-block: 24px;
	border-top: 1px solid var(--ep-rule);
}

.entangle-projects-assessment:first-child {
	padding-top: 0;
	border-top: 0;
}

.entangle-projects-assessment__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
}

.entangle-projects-assessment__group {
	margin: 0;
	font-size: var(--wp--preset--font-size--lead, 18px);
}

.entangle-projects-assessment__date {
	color: var(--ep-muted);
	font-size: 14px;
}

.entangle-projects-assessment__text {
	max-width: var(--ep-measure);
	/* An office's statement can hold a long address: it breaks instead of widening the page on a phone. */
	overflow-wrap: anywhere;
}

.entangle-projects-assessment__text > :first-child {
	margin-top: 0;
}

.entangle-projects-assessment__text > :last-child {
	margin-bottom: 0;
}

.entangle-projects-assessment__file {
	max-width: var(--ep-measure);
	margin: 12px 0 0;
}

/* The width of the column, whatever the picture's own: a wide map must not widen the page on a phone. */
.entangle-projects-assessment__file img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ep-radius-sm);
}

/* The updates (the records module's list) in a tab: its own width, like the entries. */
.entangle-projects-section--updates .entangle-updates {
	max-width: 960px;
}

/* Every one of them is about this project: the line that names the project under each update says nothing here. */
.entangle-projects-section--updates .entangle-update__about {
	display: none;
}

/* ------------------------------------------------------------------- map */

.entangle-projects-map {
	position: relative;
	z-index: 0;
	min-height: 320px;
	isolation: isolate;
	overflow: hidden;
	border-radius: var(--ep-radius);
	background: var(--ep-surface);
}

.entangle-projects-map--single {
	height: 480px;
	max-height: 70vh;
}

.entangle-projects-map .leaflet-container {
	height: 100%;
	font: inherit;
}

.entangle-projects-map__fallback {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 24px;
}

.entangle-projects-map-figure {
	margin: 0;
}

.entangle-projects-map-figure__caption {
	margin-top: 12px;
	color: var(--ep-muted);
	font-size: 14px;
}

.entangle-projects-map__logo {
	display: block;
	margin: 0 0 4px 8px;
	line-height: 0;
}

.entangle-projects-map__logo img {
	display: block;
	height: 30px;
	width: auto;
}

/* The pin and the disc of many pins (assets/js/map.js; the owner, 31. 10.: the yoga centres of jogacz.cz the model, in
   the site's colours). The pin's colour is the stylesheet's, so it answers the pointer and the choice; the disc says
   how many it stands for and darkens under the pointer. */
.entangle-projects-pin,
.entangle-projects-cluster {
	border: 0;
	background: none;
}

.entangle-projects-pin svg {
	display: block;
	overflow: visible;
	filter: drop-shadow(0 2px 3px rgba(11, 29, 63, 0.28));
	transform-origin: 50% 100%;
	transition: transform 0.15s ease;
}

.entangle-projects-pin__shape path {
	fill: var(--ep-accent);
	transition: fill 0.15s ease;
}

.entangle-projects-pin__shape circle {
	fill: #fff;
}

.entangle-projects-pin:hover path,
.entangle-projects-pin:focus-visible path,
.entangle-projects-pin.is-selected path {
	fill: var(--ep-accent-deep);
}

.entangle-projects-pin:hover svg,
.entangle-projects-pin:focus-visible svg,
.entangle-projects-pin.is-selected svg {
	transform: scale(1.15);
}

.entangle-projects-cluster__number {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--ep-accent);
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--ep-accent) 26%, transparent), 0 2px 6px rgba(11, 29, 63, 0.25);
	color: var(--ep-on-accent);
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.entangle-projects-cluster:hover .entangle-projects-cluster__number,
.entangle-projects-cluster:focus-visible .entangle-projects-cluster__number,
.entangle-projects-cluster.is-selected .entangle-projects-cluster__number {
	background: var(--ep-accent-deep);
	box-shadow: 0 0 0 9px color-mix(in srgb, var(--ep-accent) 30%, transparent), 0 3px 8px rgba(11, 29, 63, 0.3);
	transform: scale(1.06);
}

.entangle-projects-pin:focus-visible,
.entangle-projects-cluster:focus-visible {
	outline: 3px solid var(--ep-ink);
	outline-offset: 2px;
	border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
	.entangle-projects-pin svg,
	.entangle-projects-cluster__number {
		transition: none;
	}
}

/* The popup of a pin: Leaflet's frame in the platform's shape — a card with the picture to its edges, the radius of
   the theme, a soft shadow, the closing cross on the picture. */
.entangle-projects-leaflet-popup .leaflet-popup-content-wrapper {
	overflow: hidden;
	padding: 0;
	border-radius: var(--ep-radius);
	box-shadow: 0 12px 32px -8px rgba(11, 29, 63, 0.35);
}

.entangle-projects-leaflet-popup .leaflet-popup-content {
	/* Its width is Leaflet's (the popup's minWidth 220, maxWidth 280: assets/js/map.js). */
	margin: 0;
	font: inherit;
	line-height: 1.4;
}

.entangle-projects-leaflet-popup .leaflet-popup-tip {
	box-shadow: none;
}

.entangle-projects-leaflet-popup a.leaflet-popup-close-button {
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--ep-ink);
	font-size: 18px;
	line-height: 1;
}

.entangle-projects-leaflet-popup a.leaflet-popup-close-button:hover {
	background: #fff;
	color: var(--ep-accent);
}

/* The whole card is active (the owner, 1. 11.): the title's link is stretched over it, so a screen reader still hears
   only the title. The closing cross comes later in Leaflet's frame and stays above the stretched link. */
.entangle-projects-popup {
	position: relative;
	min-width: 0;
}

.entangle-projects-popup a.entangle-projects-popup__title::after {
	content: "";
	position: absolute;
	inset: 0;
}

.entangle-projects-popup a.entangle-projects-popup__title:focus-visible {
	outline: none;
}

.entangle-projects-popup a.entangle-projects-popup__title:focus-visible::after {
	outline: 2px solid var(--ep-accent);
	outline-offset: -2px;
	border-radius: var(--ep-radius);
}

.entangle-projects-popup__img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	background: var(--ep-surface);
}

/* The texts stand in one body with the air around them as padding (the owner, 1. 11.: the title stuck to the foot):
   a margin of one of them would meet the margins of Leaflet and of the theme, the padding of their box meets nothing. */
.entangle-projects-popup__body {
	display: grid;
	justify-items: start;
	gap: 8px;
	padding: 16px 20px 20px;
}

.entangle-projects-popup__state,
.entangle-projects-popup__title,
.leaflet-container a.entangle-projects-popup__title,
.entangle-projects-popup__address {
	margin: 0;
}

.entangle-projects-popup__state {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--ep-surface);
	color: var(--ep-ink);
	font-size: 12px;
	font-weight: 600;
}

.entangle-projects-popup__title,
.leaflet-container a.entangle-projects-popup__title {
	display: block;
	color: var(--ep-ink);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.leaflet-container a.entangle-projects-popup__title:hover,
.leaflet-container .entangle-projects-popup:hover a.entangle-projects-popup__title {
	color: var(--ep-accent);
	text-decoration: underline;
}

.entangle-projects-popup__address {
	margin-top: -2px;
	color: var(--ep-muted);
	font-size: 13px;
}

/* The card of the chosen pin (and of the one under the pointer on the map). */
.entangle-projects-card.is-highlighted {
	outline: 2px solid var(--ep-accent);
	outline-offset: 6px;
	border-radius: var(--ep-radius);
}

/* --------------------------------------------------------------- archive */

.entangle-projects-archive-title .wp-block-query-title {
	margin: 0;
}

/* The filters belong to the title (the owner, 2. 11.): the title's own air under it is enough, no gap of the flow on top. */
.site-main > .entangle-projects-archive-title + .entangle-projects-archive {
	margin-block-start: 0;
}

/* The year beside the title of the archive (includes/year-pill.php, the owner, 31. 10.): a grey pill that reads as a
   sentence, "Dokončené ▾ v roce 2025 ▾", the same pill as the gallery of the proposals has for its edition
   (entangle-budget's .entangle-pill). The pill right beside the title (the owner, 31. 10.: next to the heading, not at
   the far end of the row); where they do not fit side by side, under the title. */
.entangle-projects-title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 16px 24px;
}

.entangle-projects-year {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 6px;
	box-sizing: border-box;
	min-height: var(--ep-nav-target);
	padding-inline: 18px 8px;
	border-radius: 999px;
	background: var(--ep-surface);
	color: var(--ep-ink);
	font-weight: 600;
}

/* Beside the title it stands a tenth of the title's size lower: a word of small letters with tails (Projekty) has its
   weight on the small letters, not between the top of its capital and its baseline, where the row's centre is. */
.entangle-projects-title-row > .entangle-projects-year {
	translate: 0 calc(var(--wp--preset--font-size--display, 4rem) * 0.1);
}

.entangle-projects-year:hover {
	background: color-mix(in srgb, var(--ep-surface) 92%, currentColor);
}

.entangle-projects-year:has(:focus-visible:not(.is-select-open)) {
	outline: 2px solid var(--ep-accent);
	outline-offset: 2px;
}

.entangle-projects-year__field {
	position: relative;
	display: inline-flex;
}

.entangle-projects-year__field::after {
	content: "";
	position: absolute;
	right: 10px;
	top: 50%;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.entangle-projects-year__select {
	min-height: var(--ep-nav-target);
	margin: 0;
	padding: 0 30px 0 0;
	border: 0;
	appearance: none;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

/* The pill draws the ring: the theme's ring on every focused field must not add a second one inside it. */
.entangle-projects-year .entangle-projects-year__select:focus-visible {
	outline: none;
}

.entangle-projects-year__word {
	color: var(--ep-muted);
	font-weight: 400;
}

/* Without the script the button applies the choice; with it, only for the keyboard (archive.js). */
.entangle-projects-year__go {
	min-height: calc(var(--ep-nav-target) - 8px);
	padding: 0 12px;
	border: 0;
	border-radius: 999px;
	background: var(--ep-card);
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.entangle-projects-year.is-enhanced:not(.is-keyboard) .entangle-projects-year__go {
	display: none;
}

.entangle-projects-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px 24px;
	margin-bottom: 16px;
}

.entangle-projects-filters__field {
	display: grid;
	flex: 1 1 220px;
	gap: 6px;
	min-width: min(100%, 220px);
	max-width: 320px;
}

/* A filter is a word with a line under it (the reference site, 28. 10.) — no box, no fill. The chevron is drawn by
   the field, so it takes the colour of whatever state the field is in. */
.entangle-projects-filters__field {
	position: relative;
	color: var(--ep-muted);
}

.entangle-projects-filters__field::after {
	content: "";
	position: absolute;
	right: 4px;
	bottom: 19px;
	width: 9px;
	height: 9px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	pointer-events: none;
}

.entangle-projects-filters__select {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 28px 10px 0;
	border: 0;
	border-bottom: 1px solid var(--ep-rule-strong);
	border-radius: 0;
	appearance: none;
	background: transparent;
	color: var(--ep-ink);
	font: inherit;
	line-height: 1.3;
}

/* The one that is set: two pixels under it, and the word and the chevron in the accent. */
.entangle-projects-filters__field.is-set {
	color: var(--ep-accent);
}

.entangle-projects-filters__field.is-set .entangle-projects-filters__select {
	padding-bottom: 9px;
	border-bottom: 2px solid var(--ep-accent);
	color: var(--ep-accent);
}

.entangle-projects-filters__select:focus-visible {
	outline: 2px solid var(--ep-accent);
	outline-offset: 2px;
}

.entangle-projects-filters__actions {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 48px;
}

/* The Filter button: the form submits by itself on a mouse or touch choice, so with JS it only
   comes back for keyboard users (archive.js adds .is-keyboard). */
.entangle-projects-archive.is-enhanced .entangle-projects-filters__submit {
	display: none;
}

.entangle-projects-archive.is-enhanced .entangle-projects-filters.is-keyboard .entangle-projects-filters__submit {
	display: inline-flex;
}

.entangle-projects-filters__reset {
	color: var(--ep-accent-deep);
	font-size: 14px;
	font-weight: 600;
}

.entangle-projects-archive__count {
	/* Air under "96 projects" before the first row (the owner, 2. 11.: further from the list than from the filters), the
	   same under the count of the proposals. */
	margin: 0 0 48px;
	color: var(--ep-muted);
	font-size: 14px;
}

/* List / Map switch: narrow screens only, and only once archive.js runs — floating at the foot of the window, where
   the thumb is (the owner, 31. 10.: the yoga centres of jogacz.cz the model), over whichever of the two is shown. */
.entangle-projects-viewtoggle {
	display: none;
	position: fixed;
	z-index: 30;
	left: 50%;
	bottom: max(16px, env(safe-area-inset-bottom));
	overflow: hidden;
	border: 1px solid var(--ep-rule-strong);
	border-radius: 999px;
	background: var(--ep-card);
	box-shadow: 0 8px 24px rgba(11, 29, 63, 0.22);
	transform: translateX(-50%);
}

.entangle-projects-archive.is-enhanced .entangle-projects-viewtoggle {
	display: inline-flex;
}

@media (min-width: 1024px) {
	.entangle-projects-archive.is-enhanced .entangle-projects-viewtoggle {
		display: none;
	}
}

.entangle-projects-viewtoggle__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.entangle-projects-viewtoggle__btn.is-active {
	background: var(--ep-accent);
	color: var(--ep-on-accent);
}

.entangle-projects-viewtoggle__btn:focus-visible {
	outline: 2px solid var(--ep-accent);
	outline-offset: -4px;
}

.entangle-projects-archive__split {
	display: grid;
	gap: 32px;
}

/* On a phone the map fills the window under the header, and leaves the foot to the floating switch. */
.entangle-projects-archive__map .entangle-projects-map--archive {
	height: calc(100vh - var(--ep-tabs-top) - 96px);
	height: calc(100svh - var(--ep-tabs-top) - 96px);
	min-height: 320px;
}

/* The list goes on as it is read (assets/js/archive.js): three more pages by themselves, then the button. */
.entangle-projects-archive__load {
	display: grid;
	justify-items: center;
	gap: 12px;
	margin-top: 40px;
}

/* The tab "Get involved" of a record: what has been stands under what runs, a section's step below it. */
.entangle-projects-engagements__past {
	margin-top: var(--wp--preset--spacing--60, 40px);
}

/* A heading the list brings itself (the block's `title`): it is there only while the list has a card. */
.entangle-projects-archive__title {
	margin: 0 0 var(--entangle-head-gap, var(--wp--preset--spacing--50, 24px));
}

/* "Show more" under a list shown a row at a time (the block's `moreStep`, assets/js/more.js). */
.entangle-projects-archive__show-more {
	margin: var(--wp--preset--spacing--50, 24px) 0 0;
	text-align: center;
}

.entangle-projects-archive__show-more > [hidden],
.entangle-projects-cards__item[hidden] {
	display: none;
}

/* The button is drawn hidden until the list has stopped coming by itself, and hidden again when the list is whole:
   the theme's button has a `display` of its own, which would show it all the same (12. 11.: a button that did nothing). */
.entangle-projects-archive__load-more[hidden] {
	display: none;
}

.entangle-projects-archive__loading {
	display: none;
	margin: 0;
	color: var(--ep-muted);
	font-size: 14px;
}

.entangle-projects-archive.is-loading .entangle-projects-archive__loading {
	display: block;
}

@media (max-width: 1023px) {
	/* The floating switch must not cover the last card or the button under it. */
	.entangle-projects-archive.is-enhanced.entangle-projects-archive--has-map .entangle-projects-archive__split {
		padding-bottom: 72px;
	}
}

@media (max-width: 1023px) {
	.entangle-projects-archive.is-enhanced .entangle-projects-archive__map {
		display: none;
	}

	.entangle-projects-archive.is-enhanced.is-map-view .entangle-projects-archive__map {
		display: block;
	}

	.entangle-projects-archive.is-enhanced.is-map-view .entangle-projects-archive__list {
		display: none;
	}
}

@media (min-width: 1024px) {
	.entangle-projects-archive--has-map .entangle-projects-archive__split {
		grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
		align-items: start;
	}

	.entangle-projects-archive__map {
		position: sticky;
		top: var(--ep-sticky-top);
		height: calc(100vh - var(--ep-sticky-top) - 24px);
		min-height: 420px;
	}

	.entangle-projects-archive__map .entangle-projects-map--archive {
		height: 100%;
	}
}

.entangle-projects-cards {
	display: grid;
	/* A card keeps the width it has in a row of FOUR (the owner, 28. 10.): three of them leave the fourth place
	   empty instead of growing to fill the row, so the same card looks the same wherever it stands. Where four no
	   longer fit, the floor (--ep-card-min) takes over and the row holds three, two, one. */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--ep-card-min, 16.5rem), calc((100% - 3 * var(--ep-gap)) / 4))), 1fr));
	gap: var(--ep-row-gap) var(--ep-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.entangle-projects-cards__item {
	margin: 0;
	min-width: 0;
}

/* A card is a picture with words under it (the owner, 28. 10.): no frame, no fill, and the words at the picture's
   own edge. The box with the padding is a VARIANT (--boxed) for a card that stands on a colour of its own. */
.entangle-projects-card {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
	border: 0;
	background: transparent;
}

.entangle-projects-card--boxed {
	overflow: hidden;
	border: 1px solid var(--ep-rule);
	border-radius: var(--ep-radius);
	background: var(--ep-card);
}

.entangle-projects-card:focus-within {
	outline: 2px solid var(--ep-accent);
	outline-offset: 2px;
}

.entangle-projects-card__media {
	position: relative;
	aspect-ratio: 3 / 2;
}

/* The picture's own box rounds and clips it (the hover grows the picture inside it). It is laid OVER the frame, not
   into it (18. 11.): a frame with a ratio still grows to hold what stands in it, so a picture taller than three to two
   — a square one — made its card taller than the cards beside it. Out of the flow, the frame is its ratio and nothing
   else, and every picture is cut to it. */
.entangle-projects-card__picture {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: var(--ep-radius);
	background: var(--ep-surface);
}

/* What the record is and is doing rides on the picture: where it stands, whether people can join in, and what another
   module says of it (the budget: that it came from there). The tags are stuck to the picture's edges in its bottom
   START corner (the owner, 12. 11.) — right above the line and the title they belong to, so the eye reads them as one
   and does not travel across the picture. The stretched link of the title covers the card, so these sit above it —
   they are words, not targets. More tags than a line holds go on above the first ones.

   Their colours are the colours of the tags of a record's page: the same hue for the words, the same share of it in
   the ground — only opaque here, on the card's own surface, because over a photograph a tint is no background (the
   owner, 28. 10.).

   A theme may round its pictures as much as it likes (`--radius`): the first tag is cut to the same curve — by a mask,
   which takes any radius (a `border-radius` larger than the tag is high would be scaled down, and the tag would stand
   out of the corner) — and gives its words room for it; the last one ends in a corner of the theme's radius, as far
   as a tag can carry one. The tags reach one pixel past the picture on its two outer sides, and their curve is that
   pixel wider: two shapes cut to the very same curve let the darker one show through along it. */
.entangle-projects-card__tags {
	position: absolute;
	z-index: 1;
	right: 0;
	bottom: -1px;
	left: -1px;
	display: flex;
	flex-wrap: wrap-reverse;
	justify-content: flex-start;
	margin: 0;
	pointer-events: none;
}

.entangle-projects-card__tags .entangle-projects-chip {
	padding: 6px 12px 7px;
	border-radius: 0;
	background: var(--ep-card);
	font-size: 13px;
	line-height: 1.3;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
	.entangle-projects-card__tags .entangle-projects-chip {
		background: color-mix(in srgb, var(--chip) var(--ep-tag-tint), var(--ep-card));
	}
}

.entangle-projects-card__tags .entangle-projects-chip:first-child {
	--tag-r: calc(var(--ep-radius) + 1px);
	padding-left: max(13px, calc(var(--ep-radius) * 0.55 + 1px));
	-webkit-mask:
		linear-gradient(#000 0 0) right / calc(100% - var(--tag-r)) 100% no-repeat,
		linear-gradient(#000 0 0) top / 100% max(0px, calc(100% - var(--tag-r))) no-repeat,
		radial-gradient(circle at var(--tag-r) calc(100% - var(--tag-r)), #000 calc(var(--tag-r) - 0.5px), transparent var(--tag-r)) left / var(--tag-r) 100% no-repeat;
	mask:
		linear-gradient(#000 0 0) right / calc(100% - var(--tag-r)) 100% no-repeat,
		linear-gradient(#000 0 0) top / 100% max(0px, calc(100% - var(--tag-r))) no-repeat,
		radial-gradient(circle at var(--tag-r) calc(100% - var(--tag-r)), #000 calc(var(--tag-r) - 0.5px), transparent var(--tag-r)) left / var(--tag-r) 100% no-repeat;
}

/* In a padded box the picture is square, and the box clips what stands in it. */
.entangle-projects-card--boxed .entangle-projects-card__tags {
	bottom: 0;
	left: 0;
}

.entangle-projects-card--boxed .entangle-projects-card__tags .entangle-projects-chip:first-child {
	-webkit-mask: none;
	mask: none;
}

.entangle-projects-card__tags .entangle-projects-chip:last-child {
	border-top-right-radius: var(--ep-tag-radius);
}

/* Two tags side by side are two tags: a hairline of the second one's colour parts them. */
.entangle-projects-card__tags .entangle-projects-chip + .entangle-projects-chip {
	box-shadow: inset 1px 0 0 color-mix(in srgb, var(--chip) 28%, transparent);
}

/* A card with no picture of its own shows the drawn one (the owner, 28. 10.), so the media box stays where it was. */
.entangle-projects-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: var(--ep-surface);
	color: var(--ep-muted);
}

.entangle-projects-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.entangle-projects-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 14px 0 0;
}

.entangle-projects-card--boxed .entangle-projects-card__body {
	padding: 20px;
}

.entangle-projects-card--boxed .entangle-projects-card__picture {
	border-radius: 0;
}

.entangle-projects-card__eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0;
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 13px);
}

.entangle-projects-card__eyebrow .entangle-projects-chip {
	padding: 2px 10px;
	font-size: var(--wp--preset--font-size--small, 13px);
}

/* When the project runs and, beside it, how many comments it has (only where it has some). The years are the word of
   the line that is read (the owner, 12. 11.; the edition on the card of a proposal the same): the colour of the text
   and a heavier cut; the comments stay quiet, parted by a dot. */
.entangle-projects-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin: 0;
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 14px);
}

.entangle-projects-card__period {
	color: var(--ep-ink);
	font-weight: 600;
}

.entangle-projects-card__comments {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.entangle-projects-card__period + .entangle-projects-card__comments::before {
	content: "";
	flex: none;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
}

/* The title IS the card now that no lead stands under it (the owner, 28. 10.). */
.entangle-projects-card__title {
	margin: 0;
	font-size: var(--wp--preset--font-size--h-3, 24px);
	line-height: 1.25;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.entangle-projects-card__title a {
	color: inherit;
	text-decoration: none;
}

.entangle-projects-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.entangle-projects-card__title a:hover {
	color: var(--ep-accent-deep);
}

.entangle-projects-card__title a:focus-visible {
	outline: none;
}

/* The picture answers the hover, and nothing else does (the owner, 28. 10.): no shadow under the card, no lift. */
@media (prefers-reduced-motion: no-preference) {
	.entangle-projects-card__img {
		transition: transform 0.4s ease;
	}

	.entangle-projects-card:hover .entangle-projects-card__img {
		transform: scale(1.04);
	}
}

.entangle-projects-pagination .page-numbers:is(ul) {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 40px 0 0;
	padding: 0;
	list-style: none;
}

.entangle-projects-pagination a.page-numbers,
.entangle-projects-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--ep-rule-strong);
	border-radius: var(--ep-radius-sm);
	color: inherit;
	text-decoration: none;
}

.entangle-projects-pagination a.page-numbers:hover {
	border-color: var(--ep-accent);
	color: var(--ep-accent-deep);
}

.entangle-projects-pagination span.page-numbers.current {
	border-color: var(--ep-accent);
	background: var(--ep-accent);
	color: var(--ep-on-accent);
}

.entangle-projects-archive__more {
	margin: 1.5em 0 0;
}

/* The way to all of them reads as the budget's "Zobrazit vše →" under its cards (the owner, 29. 10.: one family). */
.entangle-projects-archive__more-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var(--ep-accent-deep);
	font-weight: 600;
}

.entangle-projects-archive__more-link::after {
	content: "\2192";
	content: "\2192" / "";
}

.entangle-projects-archive__more-link:dir(rtl)::after {
	content: "\2190";
	content: "\2190" / "";
}

/* The heading of the list and the way to all of them in ONE row (`--headed`: the block's `title` and its link; the
   owner, 18. 11.). The way to all of them is then a small outlined button, and where the window has the width it
   stands at the end of the heading's row, on the heading's own middle; in a narrow window it stays under the cards,
   the whole width. One link in the markup, moved by the grid — the same row the lists of Entangle Records have. */
.entangle-projects-archive--headed > .entangle-projects-archive__more {
	margin: var(--wp--preset--spacing--50, 24px) 0 0;
}
.entangle-projects-archive--headed > .entangle-projects-archive__more > .entangle-projects-archive__more-link {
	display: flex;
	justify-content: center;
	box-sizing: border-box;
	min-height: 2.75rem;
	padding: 0.4em 1.125em;
	border: 1px solid var(--ep-accent);
	border-radius: var(--radius-control, var(--ep-radius-sm));
	font-size: 0.9375rem;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}
@media (hover: hover) {
	.entangle-projects-archive--headed > .entangle-projects-archive__more > .entangle-projects-archive__more-link:hover {
		background: var(--color-brand-soft, color-mix(in srgb, var(--ep-accent) 12%, transparent));
	}
}
@media (min-width: 48rem) {
	.entangle-projects-archive--headed {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: var(--wp--preset--spacing--50, 24px);
	}
	.entangle-projects-archive--headed > * {
		grid-column: 1 / -1;
	}
	.entangle-projects-archive--headed > .entangle-projects-archive__title {
		grid-row: 1;
		grid-column: 1;
	}
	.entangle-projects-archive--headed > .entangle-projects-archive__more {
		grid-row: 1;
		grid-column: 2;
		align-self: center;
		/* The heading's own air under it, so the middle of the button is the middle of the heading. */
		margin: 0 0 var(--entangle-head-gap, var(--wp--preset--spacing--50, 24px));
	}
	.entangle-projects-archive--headed > .entangle-projects-archive__more > .entangle-projects-archive__more-link {
		display: inline-flex;
		min-height: 2.5rem;
	}
}

.entangle-projects-empty {
	padding: 48px 0;
	color: var(--ep-muted);
	text-align: center;
}

/* --------------------------------------------------------------- narrow */

@media (max-width: 599px) {
	.entangle-projects-filters__field {
		flex-basis: 100%;
		max-width: none;
	}

	.entangle-projects-tabs__list {
		gap: 4px 24px;
	}

	.entangle-projects-hero__actions .entangle-projects-button {
		flex: 1 1 100%;
	}
}

/* A project behind a password: its name and the form of core, nothing else (entangle_projects_password_gate()). */
.entangle-projects-protected {
	padding-block: 48px;
}

.entangle-projects-protected__title {
	margin: 0 0 20px;
	font-size: var(--wp--preset--font-size--section-title, clamp(32px, 4.2vw, 56px));
	line-height: 1.05;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.entangle-projects-protected .post-password-form {
	max-width: var(--ep-measure);
}

/* ------------------------------------------------------------- comments */

/* The discussion under a project or a proposal (core's comment blocks inside; entangle_projects_render_comments_block()). */
/* The foot of a page: the project before and after it, and a band of others. The page of a proposal has had the
   same since F2c (the budget draws that one), so the two pages of one family end the same way. */
.entangle-projects-nav {
	margin-block: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: var(--ep-gap);
}

/* The air between the tabs and the way on: the same step as on the page of a proposal (the participatory budget's
   foot, the owner 29. 10.), and all the air there is — two classes, so that the theme's gap of a flow layout does
   not add itself to it. */
.entangle-projects-sections ~ .entangle-projects-nav {
	margin-block-start: var(--wp--preset--spacing--80, 64px);
}

/* …and from the way on to the band of other projects, the step the budget keeps between the same two. */
.entangle-projects-nav + .entangle-projects-more {
	margin-block-start: var(--wp--preset--spacing--70, 48px);
}

.entangle-projects-nav__link {
	display: grid;
	align-content: center;
	gap: 4px;
	box-sizing: border-box;
	min-height: 44px;
	min-width: 0;
	padding: 16px 20px;
	border: 1px solid var(--ep-rule);
	border-radius: var(--ep-radius);
	color: inherit;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.entangle-projects-nav__link--next {
	text-align: end;
}

.entangle-projects-nav__link:hover,
.entangle-projects-nav__link:focus-visible {
	border-color: var(--ep-accent);
}

.entangle-projects-nav__direction {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--small, 14px);
}

.entangle-projects-nav__link--next .entangle-projects-nav__direction {
	justify-content: flex-end;
}

.entangle-projects-nav__link:focus-visible {
	outline: 3px solid var(--ep-ink);
	outline-offset: 2px;
}

/* The key that goes there (assets/js/keys.js), as a key: shown where there is a keyboard and a mouse (a phone has no
   arrows), hidden from assistive technology — the link says `aria-keyshortcuts` itself. */
.entangle-projects-nav__key {
	display: none;
	min-width: 1.6em;
	padding: 1px 5px;
	border: 1px solid var(--ep-rule-strong);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--ep-card);
	color: var(--ep-muted);
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

@media (hover: hover) and (pointer: fine) {
	.entangle-projects-nav__key {
		display: inline-block;
	}
}

.entangle-projects-nav__link.is-pressed .entangle-projects-nav__key {
	border-bottom-width: 1px;
	color: var(--ep-ink);
	transform: translateY(1px);
}

.entangle-projects-nav__title {
	font-weight: 600;
	line-height: 1.3;
}

/* A band of its own colour across the whole page: the page is read to its end, and the way on is offered there. */
.entangle-projects-more {
	background: var(--ep-surface);
	/* The band usually ends the page, so the air under the last row is the band's own and a little wider than
	   above; the theme lets a .entangle-band keep it and runs the colour to the footer. */
	padding-block: var(--wp--preset--spacing--70, 48px) var(--wp--preset--spacing--80, 64px);
}

.entangle-projects-more__inner {
	display: grid;
	/* The theme's grid gap, as in the budget's band: the two bands are one. */
	gap: var(--ep-gap);
}

/* The name of the band and, at the end of its line, the way to all of them — the button of the head's size; where
   the line cannot hold both, under each other. The head keeps a little more air from the cards than the cards keep
   from each other (the owner, 29. 10.): it names them, it is not one of them. */
.entangle-projects-more__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-block-end: var(--wp--preset--spacing--30, 16px);
}

.entangle-projects-more__title {
	margin: 0;
	/* The h2 of the theme: the band is a part of the page, not a note under it (the owner, 29. 10.). */
	font-size: var(--wp--preset--font-size--h-2, clamp(1.75rem, 1.4rem + 1.4vw, 2.375rem));
	line-height: 1.15;
}

.entangle-projects-more__action {
	margin: 0;
	text-align: center;
}

/* Until the script says otherwise every card is on the page and the button promises nothing. */
.entangle-projects-more[hidden],
.entangle-projects-more__action > [hidden] {
	display: none;
}

/* A part of a project in the theme's drawer, from the left (includes/fragment.php, views/project-fragment.php):
   the head of its page in one column, the text of its description, and the way to the page. */
.entangle-projects-fragment {
	display: grid;
	gap: 16px;
	color: var(--ep-ink);
}

.entangle-projects-fragment > * {
	margin: 0;
}

.entangle-projects-fragment__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.entangle-projects-fragment__title {
	font-size: var(--wp--preset--font-size--h-3, 28px);
	line-height: 1.15;
}

.entangle-projects-fragment__lead {
	color: var(--ep-muted);
	font-size: var(--wp--preset--font-size--lead, 20px);
}

.entangle-projects-fragment__lead > :first-child {
	margin-top: 0;
}

.entangle-projects-fragment__lead > :last-child {
	margin-bottom: 0;
}

.entangle-projects-fragment__note {
	color: var(--ep-muted);
}

.entangle-projects-fragment__facts.entangle-projects-hero__facts {
	margin: 0;
	padding-block: 16px;
	border-block: 1px solid var(--ep-rule);
}

.entangle-projects-fragment__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--ep-radius-sm);
}

.entangle-projects-fragment__actions {
	padding-block-start: 8px;
}

/* The records that stand under this one, in the tab of their own: one line that says what they are, and the cards
   of a listing under it. */
.entangle-projects-related {
	display: grid;
	gap: 20px;
}

.entangle-projects-related__says {
	margin: 0;
	color: var(--ep-muted);
}

.entangle-projects-comments {
	padding-block: 48px 64px;
	scroll-margin-top: var(--ep-sticky-top);
}

/* The page core sends a writer to after a comment is `#comment-<id>`, the <li> of the thread: it stops below the header too. */
.entangle-projects-comments [id^="comment-"] {
	scroll-margin-top: var(--ep-sticky-top);
}

.entangle-projects-comments__inner {
	max-width: var(--ep-measure);
	border-top: 1px solid var(--ep-rule);
	padding-top: 40px;
}

/* In a tab it is content of the tab like any other: it starts where the tab starts, with no frame of its own, and is as
   wide as the assessments (the owner, 2. 11.). */
.entangle-projects-section--comments .entangle-projects-comments {
	max-width: none;
	margin-inline: 0;
	padding: 0;
}

.entangle-projects-section--comments .entangle-projects-comments__inner {
	max-width: 960px;
	padding-top: 0;
	border-top: 0;
}

.entangle-projects-comments__title {
	margin: 0 0 24px;
	font-size: var(--wp--preset--font-size--h-3, 28px);
}

.entangle-projects-comments__closed {
	margin: 0;
	color: var(--ep-muted);
}

/* What stands under a thread is parted from it by a line, as the comments are from each other; with no thread (core's
   list draws nothing then) it is the first thing of the discussion and needs none. */
.entangle-projects-comments .wp-block-comment-template ~ .wp-block-post-comments-form,
.entangle-projects-comments .wp-block-comment-template ~ .entangle-projects-comments__closed {
	margin-top: 8px;
	padding-top: 32px;
	border-top: 1px solid var(--ep-rule);
}

/* The fields keep the width of a line of text; the form itself, and the line over it, is as wide as the thread. */
.entangle-projects-comments .comment-respond > * {
	max-width: var(--ep-measure);
}

.entangle-projects-comments .wp-block-comment-template {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The answers to a comment (core nests them in a plain <ol> under it) stand under it, set in from it and held together
   by a line at their start (the owner, 12. 11.): who answers whom is read at a glance. An answer has no line above it —
   the line beside it says where it belongs — and less air than a comment that starts a thread. */
.entangle-projects-comments .wp-block-comment-template ol {
	margin: 0 0 24px;
	padding: 0 0 0 20px;
	border-inline-start: 2px solid var(--ep-rule-strong);
	list-style: none;
}

.entangle-projects-comments .wp-block-comment-template ol ol {
	margin-block: 4px 0;
}

.entangle-projects-comments .wp-block-comment-template ol .entangle-projects-comment {
	padding-block: 12px;
	border-top: 0;
}

.entangle-projects-comments .wp-block-comment-template ol > li:first-child > .entangle-projects-comment {
	padding-top: 0;
}

.entangle-projects-comments .wp-block-comment-template ol > li:last-child > .entangle-projects-comment:last-child {
	padding-bottom: 0;
}

/* The words, and under them who and when: the rows of the assessments, a line between them and no card. */
.entangle-projects-comment {
	display: grid;
	gap: 8px;
	padding-block: 24px;
	border-top: 1px solid var(--ep-rule);
}

.entangle-projects-comments .wp-block-comment-template > li:first-child > .entangle-projects-comment {
	padding-top: 0;
	border-top: 0;
}

.entangle-projects-comment > .wp-block-comment-content {
	max-width: var(--ep-measure);
	margin: 0;
	overflow-wrap: anywhere;
}

.entangle-projects-comment .wp-block-comment-content > :first-child {
	margin-top: 0;
}

.entangle-projects-comment .wp-block-comment-content > :last-child {
	margin-bottom: 0;
}

.entangle-projects-comment > .entangle-projects-comment__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0;
	color: var(--ep-muted);
	font-size: 14px;
}

/* Two classes: core's flow layout of a group gives every next child a margin at the weight of one. */
.entangle-projects-comment .entangle-projects-comment__meta > * {
	margin: 0;
}

/* The reply is a word in the line, with the target of a small control and not of a button — and underlined (the owner,
   12. 11.): among the name and the date it is the one thing that can be pressed. */
.entangle-projects-comment__meta .comment-reply-link {
	display: inline-block;
	min-height: 24px;
	padding-block: 0;
	color: var(--ep-accent-deep);
	font-weight: 600;
	line-height: 24px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.entangle-projects-comment__meta .comment-reply-link:hover {
	text-decoration-thickness: 2px;
}

/* The date is the address of the comment, not a thing to do: it reads as a date. */
.entangle-projects-comment__meta .wp-block-comment-date a {
	color: inherit;
	text-decoration: none;
}

.entangle-projects-comment .wp-block-comment-author-name {
	color: var(--ep-ink);
	font-weight: 600;
}

.entangle-projects-comments .comment-reply-title {
	margin: 0 0 16px;
	font-size: var(--wp--preset--font-size--h-4, 22px);
}

/* The way out of an answer, beside the words that say whom it answers: a small underlined link on a line of its own. */
.entangle-projects-comments .comment-reply-title small {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 400;
}

.entangle-projects-comments #cancel-comment-reply-link {
	color: var(--ep-accent-deep);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* An answer is written where it will stand (core moves the form under the comment it answers): in a box of the grey
   surface, so that it is seen to be the form of THIS comment and not a part of the thread. */
.entangle-projects-comments .wp-block-comment-template .comment-respond {
	margin: 4px 0 24px;
	padding: 20px;
	border-radius: var(--ep-radius-sm);
	background: var(--ep-surface);
}

/* The form of a comment is a form of the site (the owner, 12. 11.): the fields of Entangle Forms — a small label, the
   control, a smaller help — in its measures and its tokens (assets/css/form.css of entangle-forms; written here too,
   because a site may have the discussion without that plugin). */
.entangle-projects-comments .comment-form {
	--ef-gap: 1.5rem;
	--ef-tight: 0.375rem;
	--ef-rule: color-mix(in srgb, currentColor 50%, transparent);
	--ef-muted: var(--color-ink-soft, color-mix(in srgb, currentColor 70%, transparent));
	--ef-accent: var(--color-brand, currentColor);
	--ef-surface: var(--color-card, transparent);
	--ef-radius: min(var(--radius-sm, 4px), var(--radius-control, 10px));
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ef-gap);
	max-width: var(--entangle-form-width, 40rem);
	margin: 0;
}

.entangle-projects-comments .comment-form p {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--ef-tight);
	margin: 0;
}

.entangle-projects-comments .comment-form label {
	padding: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
}

.entangle-projects-comments .comment-form .required {
	font-weight: 400;
	color: var(--ef-muted);
}

.entangle-projects-comments .comment-form .comment-notes,
.entangle-projects-comments .comment-form .logged-in-as {
	display: block;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--ef-muted);
}

.entangle-projects-comments .comment-form textarea,
.entangle-projects-comments .comment-form input[type="text"],
.entangle-projects-comments .comment-form input[type="email"],
.entangle-projects-comments .comment-form input[type="url"] {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-height: var(--btn-target, 44px);
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--ef-rule);
	border-radius: var(--ef-radius);
	background: var(--ef-surface);
	box-shadow: 0 1px 2px color-mix(in srgb, currentColor 6%, transparent);
	color: inherit;
	font: inherit;
	font-size: 1rem;
	line-height: 1.5;
}

.entangle-projects-comments .comment-form textarea {
	min-height: 6em;
	resize: vertical;
}

.entangle-projects-comments .comment-form :is(textarea, input[type="text"], input[type="email"], input[type="url"]):where(:hover:not(:disabled)) {
	border-color: color-mix(in srgb, currentColor 75%, transparent);
}

.entangle-projects-comments .comment-form :is(textarea, input[type="text"], input[type="email"], input[type="url"]):focus-visible {
	border-color: var(--ef-accent);
	outline: 3px solid color-mix(in srgb, var(--ef-accent) 35%, transparent);
	outline-offset: 0;
}

/* The one choice of the form: the box and its words in a line, the words in the weight of text. */
.entangle-projects-comments .comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
}

.entangle-projects-comments .comment-form .comment-form-cookies-consent input {
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	margin: 0.2rem 0 0;
	accent-color: var(--ef-accent);
}

.entangle-projects-comments .comment-form .comment-form-cookies-consent label {
	font-weight: 400;
}

.entangle-projects-comments .comment-form .form-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.entangle-projects-comments .comment-form .form-submit input[type="submit"] {
	min-height: var(--btn-target, 44px);
	cursor: pointer;
}
