/* Hallmark · component: event band · genre: editorial · theme: guiadesurfing (site tokens) · states: 8 · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V3 · weakest: V, a navy band repeats the hero's tone; fixed by lime and cyan counting digits plus the hero's two-tone stripe on its top edge, so it reads as the site's own */

:root {
	--ev-bg: var(--c-navy);
	--ev-ink: var(--c-sky-2);
	--ev-ink-soft: var(--c-sky-1);
	--ev-num-before: var(--c-lime);
	--ev-num-running: var(--c-cyan);
	--ev-stripe-a: var(--c-lime);
	--ev-stripe-b: var(--c-cyan);
	--ev-btn-bg: var(--c-lime);
	--ev-btn-ink: var(--c-navy);
	--ev-btn-hover: var(--c-sky-2);
	--ev-focus: var(--c-sky-2);
	--ev-img-r: 8px;
}

.zwg-eventos {
	padding-block: 24px 8px;
}

.zwg-eventos[hidden],
.zwg-ev-item[hidden] {
	display: none;
}

.zwg-eventos__title {
	margin: 0 0 8px;
	font: inherit;
	font-size: .9rem;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	color: var(--c-muted);
}

.zwg-eventos__list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* From tablet up, every active event sits in the same row and shares the width equally: 1 event is full width, 2 are halves, 3 are thirds. */
@media (min-width: 760px) {
	.zwg-eventos__list {
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: minmax(0, 1fr);
	}
}

.zwg-ev-item {
	min-width: 0;
	container-type: inline-size;
}

.zwg-ev {
	height: 100%;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"title"
		"meta"
		"count"
		"act";
	align-items: center;
	gap: 8px 20px;
	padding: 20px 16px 16px;
	border-top: 6px solid var(--ev-stripe-b);
	border-image: linear-gradient(90deg, var(--ev-stripe-a) 0 20%, var(--ev-stripe-b) 20% 100%) 1 0 0 0;
	border-radius: 0 0 var(--r) var(--r);
	background: var(--ev-bg);
	color: var(--ev-ink);
	box-shadow: var(--shadow);
}

.zwg-ev:has(> .zwg-ev__fig) {
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas:
		"img title"
		"meta meta"
		"count count"
		"act act";
}

.zwg-ev__fig {
	grid-area: img;
	display: grid;
	justify-items: center;
	align-content: start;
}

/* The picture and its "Ampliar" line are one link, so keyboard and screen readers meet a single stop. The gallery viewer in main.js opens it. */
.zwg-ev__zoom {
	display: grid;
	justify-items: center;
	gap: 4px;
	border-radius: var(--ev-img-r);
	color: var(--ev-ink);
	text-decoration: none;
}

.zwg-ev__zoomtxt {
	font-size: .875rem;
	line-height: 1.2;
	padding-block: 2px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.zwg-ev__zoom:hover {
	color: var(--ev-num-before);
}

.zwg-ev__zoom:hover .zwg-ev__zoomtxt {
	text-decoration-thickness: 2px;
}

.zwg-ev__zoom:focus-visible {
	outline: 3px solid var(--ev-focus);
	outline-offset: 3px;
	box-shadow: none;
}

@media (scripting: enabled) {
	.zwg-ev__zoom {
		cursor: zoom-in;
	}
}

.zwg-ev__img {
	display: block;
	width: 56px;
	height: 56px;
	border-radius: var(--ev-img-r);
	object-fit: cover;
}

.zwg-ev__title {
	grid-area: title;
	margin: 0;
	min-width: 0;
	overflow-wrap: break-word;
	font-size: 1.375rem;
	font-weight: 900;
	line-height: 1.15;
	color: var(--ev-ink);
}

.zwg-ev__meta {
	grid-area: meta;
	display: grid;
	gap: 2px;
	min-width: 0;
}

.zwg-ev__meta p {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--ev-ink);
}

.zwg-ev__meta .zwg-ev__cats {
	font-size: .9375rem;
	color: var(--ev-ink-soft);
}

/* Rows without an icon (note, categories) start on the same line as the text of the rows that have one: icon width 18px plus the 8px gap. */
.zwg-ev__meta p:not(:has(> svg)) {
	padding-inline-start: 26px;
}

.zwg-ev__meta svg {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	fill: none;
	stroke: var(--ev-num-running);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.zwg-ev__meta a {
	color: var(--ev-ink);
	text-underline-offset: 3px;
}

.zwg-ev__status {
	grid-area: count;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 0 0;
	font-size: 1.125rem;
	font-weight: 900;
	line-height: 1.25;
	color: var(--ev-num-before);
}

.zwg-ev__status[data-state="curso"] {
	color: var(--ev-num-running);
}

/* Live dot: the ring grows and fades with transform and opacity only. */
.zwg-ev__dot {
	position: relative;
	flex: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: currentcolor;
}

.zwg-ev__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: currentcolor;
	opacity: .6;
	animation: zwg-ev-pulse 1.8s ease-out infinite;
}

@keyframes zwg-ev-pulse {
	from {
		transform: scale(1);
		opacity: .6;
	}
	to {
		transform: scale(2.6);
		opacity: 0;
	}
}

.zwg-ev__count {
	grid-area: count;
	display: grid;
	gap: 2px;
	margin: 8px 0 0;
	color: var(--ev-ink);
}

.zwg-ev__lead {
	margin: 0;
	font-size: .9375rem;
	color: var(--ev-ink-soft);
}

.zwg-ev__cells {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	font-variant-numeric: tabular-nums;
}

.zwg-ev__cell {
	display: grid;
	justify-items: center;
	min-width: 3.1rem;
}

.zwg-ev__sep {
	font-size: 2rem;
	font-weight: 900;
	line-height: 1.1;
	color: var(--ev-ink-soft);
}

.zwg-ev__num {
	font-size: 2rem;
	font-weight: 900;
	line-height: 1.1;
	color: var(--ev-num-before);
}

.zwg-ev__count[data-state="running"] .zwg-ev__num {
	color: var(--ev-num-running);
}

.zwg-ev__unit {
	font-size: .875rem;
	line-height: 1.2;
	color: var(--ev-ink-soft);
}

/* Before the script has run the numbers are hidden but keep their room, so nothing jumps when they appear. */
.zwg-eventos:not(.is-live) .zwg-ev__count {
	visibility: hidden;
}

@media (scripting: none) {
	.zwg-ev__count {
		display: none;
	}
}

.zwg-ev__act {
	grid-area: act;
	margin: 8px 0 0;
}

.zwg-ev__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 20px;
	border: 2px solid var(--ev-btn-bg);
	border-radius: 10px;
	background: var(--ev-btn-bg);
	color: var(--ev-btn-ink);
	font-weight: 900;
	text-decoration: none;
	transition: background-color var(--dur), border-color var(--dur), transform var(--dur);
}

.zwg-ev__btn:hover,
.zwg-ev__btn.is-hover {
	border-color: var(--ev-btn-hover);
	background: var(--ev-btn-hover);
}

.zwg-ev__btn:focus-visible,
.zwg-ev__btn.is-focus {
	outline: 3px solid var(--ev-focus);
	outline-offset: 3px;
	box-shadow: none;
}

.zwg-ev__btn:active,
.zwg-ev__btn.is-active {
	transform: translateY(1px);
}

.zwg-ev__meta a:focus-visible {
	outline: 3px solid var(--ev-focus);
	outline-offset: 3px;
	box-shadow: none;
}

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

@media (prefers-reduced-motion: reduce) {
	.zwg-ev__dot::after {
		animation: none;
		transform: scale(1.9);
		opacity: .35;
	}
	.zwg-ev__btn {
		transition: none;
	}
	.zwg-ev__btn:active,
	.zwg-ev__btn.is-active {
		transform: none;
	}
}

@media (forced-colors: active) {
	.zwg-ev {
		border: 2px solid CanvasText;
		border-image: none;
	}
	.zwg-ev__btn {
		border-color: ButtonText;
	}
	.zwg-ev__dot,
	.zwg-ev__dot::after {
		background: CanvasText;
	}
}

/* Mid width: the countdown and the button share a row under the text. */
@container (min-width: 440px) {
	.zwg-ev {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas:
			"title title"
			"meta meta"
			"count act";
	}
	.zwg-ev:has(> .zwg-ev__fig) {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas:
			"img title title"
			"img meta meta"
			"count count act";
	}
	.zwg-ev__fig {
		align-self: start;
	}
	.zwg-ev__img {
		width: 72px;
		height: 72px;
	}
	.zwg-ev__btn {
		width: auto;
	}
	.zwg-ev__act {
		align-self: end;
	}
}

/* Wide: one row, picture | text | countdown | button. */
@container (min-width: 760px) {
	.zwg-ev {
		grid-template-columns: minmax(0, 1fr) auto auto;
		grid-template-areas:
			"title count act"
			"meta count act";
		align-items: center;
		gap: 4px 32px;
		padding: 20px 24px 20px 20px;
	}
	.zwg-ev:has(> .zwg-ev__fig) {
		grid-template-columns: auto minmax(0, 1fr) auto auto;
		grid-template-areas:
			"img title count act"
			"img meta count act";
		column-gap: 20px;
	}
	.zwg-ev:has(> .zwg-ev__fig) .zwg-ev__count,
	.zwg-ev:has(> .zwg-ev__fig) .zwg-ev__status {
		margin-left: 12px;
	}
	.zwg-ev__fig {
		align-self: center;
	}
	.zwg-ev__img {
		width: 104px;
		height: 104px;
	}
	.zwg-ev__title {
		font-size: 1.5rem;
		align-self: end;
	}
	.zwg-ev__meta {
		align-self: start;
	}
	.zwg-ev__count,
	.zwg-ev__status,
	.zwg-ev__act {
		margin: 0;
	}
	.zwg-ev__status {
		white-space: nowrap;
	}
	.zwg-ev__status,
	.zwg-ev__act {
		align-self: center;
	}
	.zwg-ev__cell {
		min-width: 3.6rem;
	}
	.zwg-ev__num {
		font-size: 2.25rem;
	}
	.zwg-ev__sep {
		font-size: 2.25rem;
	}
}
