/**
 * Styles for upcoming-regatta-events.php.
 *
 * Every selector is scoped under the wrapper the widget emits for this
 * template, so nothing here can reach the Elementor header, footer, or any
 * other widget on the page. Tokens are declared on the wrapper rather than
 * :root for the same reason.
 *
 * One component, three states: the row switches layout from [data-count],
 * which the template fills with the number of events returned.
 */

.eti-tpl--theme-upcoming-regatta-events-php {
	--ure-bg: #ffffff;
	--ure-surface: #f5f5f5;
	--ure-fg: #000000;
	--ure-muted: #8c8c8c;
	/* Small text needs >= 4.5:1 on white, which #8c8c8c does not reach. */
	--ure-muted-strong: color-mix(in srgb, #8c8c8c 55%, black);
	--ure-border: #dbdbdb;
	--ure-accent: #cd010d;
	--ure-accent-hover: color-mix(in srgb, #cd010d 84%, black);
	--ure-accent-active: color-mix(in srgb, #cd010d 72%, black);
	--ure-accent-secondary: #f6ed41;
	--ure-font: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--ure-radius: 8px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure {
	font-family: var(--ure-font);
	color: var(--ure-fg);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure *,
.eti-tpl--theme-upcoming-regatta-events-php .ure *::before,
.eti-tpl--theme-upcoming-regatta-events-php .ure *::after {
	box-sizing: border-box;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure img,
.eti-tpl--theme-upcoming-regatta-events-php .ure svg {
	display: block;
	max-width: 100%;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure a {
	color: inherit;
	text-decoration: none;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ------------------------------------------------------------------
   Section header
   ------------------------------------------------------------------ */

.eti-tpl--theme-upcoming-regatta-events-php .ure__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	margin-bottom: clamp(24px, 3vw, 36px);
}

/* The text column takes the space it needs for the heading to sit on one line;
   the "All regatta events" link keeps its intrinsic width and drops below once
   the two no longer fit. Applies to every card count — the head has no
   count-specific rules, and the 2/3-card heading is the longer of the two
   strings, so sizing for it covers the 1-card state too. */
.eti-tpl--theme-upcoming-regatta-events-php .ure__head > div:first-child {
	flex: 1 1 auto;
	min-width: 0;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__all {
	flex: 0 0 auto;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__kicker {
	display: inline-block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ure-accent);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__heading {
	margin: 0;
	/* Must clear "Upcoming regattas on Melton Lake" (32 characters, the 2/3-card
	   heading) on one line. `ch` is the width of "0", which runs wider than this
	   font's average glyph, so 32ch leaves real headroom rather than sitting on
	   the boundary. It still wraps below ~880px, where the link drops anyway. */
	max-width: 34ch;
	text-wrap: balance;
	font-family: var(--ure-font);
	font-size: clamp(26px, 3vw, 34px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--ure-fg);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__sub {
	margin: 8px 0 0;
	max-width: 52ch;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ure-muted-strong);
}

/* Secondary entry point. The only solid button in this component lives in the
   single-event state, so this stays a text link. */
.eti-tpl--theme-upcoming-regatta-events-php .ure__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 2px;
	border-bottom: 2px solid var(--ure-accent);
	font-size: 15px;
	font-weight: 700;
	color: var(--ure-fg);
	transition: gap 0.15s ease, border-bottom-width 0.15s ease;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__all:hover,
.eti-tpl--theme-upcoming-regatta-events-php .ure__all:focus {
	gap: 12px;
	color: var(--ure-fg);
	border-bottom-width: 3px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__all:focus-visible {
	outline: 3px solid var(--ure-fg);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ------------------------------------------------------------------
   The row — state driven by data-count
   ------------------------------------------------------------------ */

.eti-tpl--theme-upcoming-regatta-events-php .ure__row {
	display: grid;
	gap: 24px;
	align-items: stretch;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] {
	grid-template-columns: repeat(3, 1fr);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="2"] {
	grid-template-columns: repeat(2, 1fr);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] {
	grid-template-columns: 1fr;
}

/* ------------------------------------------------------------------
   Card
   ------------------------------------------------------------------ */

.eti-tpl--theme-upcoming-regatta-events-php .ure-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--ure-bg);
	border: 1px solid var(--ure-border);
	border-radius: var(--ure-radius);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover,
.eti-tpl--theme-upcoming-regatta-events-php .ure-card:focus-within {
	border-color: var(--ure-fg);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover {
	transform: translateY(-2px);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__hit {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__hit:focus-visible {
	outline: 3px solid var(--ure-fg);
	outline-offset: -3px;
	border-radius: var(--ure-radius);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--ure-surface);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover .ure-card__media img {
	transform: scale(1.04);
}

/* No featured image and no landing-page hero: the mark on black, not an empty
   gray box. */
.eti-tpl--theme-upcoming-regatta-events-php .ure-card__media--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ure-fg);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__mark {
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: 50%;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover .ure-card__mark {
	transform: none;
}

/* Date chip — anchored to one corner with equal inset, never crossing the edge. */
.eti-tpl--theme-upcoming-regatta-events-php .ure-card__date {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 62px;
	padding: 8px 10px;
	border-radius: var(--ure-radius);
	background: var(--ure-accent);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__date-m {
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__date-d {
	margin-top: 3px;
	font-size: 22px;
	font-weight: 900;
	line-height: 1.1;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__date-y {
	margin-top: 3px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.1em;
	opacity: 0.9;
}

/* The one place the secondary brand yellow carries weight. */
.eti-tpl--theme-upcoming-regatta-events-php .ure-card__status {
	position: absolute;
	top: 14px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 11px;
	border-radius: 100px;
	background: var(--ure-accent-secondary);
	color: var(--ure-fg);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ure-fg);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 12px;
	padding: 22px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__title {
	margin: 0;
	font-family: var(--ure-font);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: var(--ure-fg);
	text-wrap: balance;
	overflow-wrap: break-word;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	color: var(--ure-muted-strong);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__meta span {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__meta .ure-icon {
	width: 15px;
	height: 15px;
	margin-top: 3px;
}

/* Race days sit in the footer at two- and three-up; the feature state moves
   them up into the meta block, so only one of the two ever shows. */
.eti-tpl--theme-upcoming-regatta-events-php .ure-card__meta span.ure-card__meta-days {
	display: none;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__excerpt {
	margin: 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--ure-fg);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: break-word;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-badge {
	display: inline-flex;
	align-items: center;
	height: 26px;
	padding: 0 10px;
	border: 1px solid var(--ure-border);
	border-radius: 100px;
	background: var(--ure-surface);
	font-size: 12px;
	font-weight: 700;
	color: var(--ure-fg);
	white-space: nowrap;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--ure-border);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--ure-fg);
	transition: gap 0.15s ease;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover .ure-card__more {
	gap: 12px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__days {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--ure-muted-strong);
}

/* Solid CTA — single-event state only. */
.eti-tpl--theme-upcoming-regatta-events-php .ure-card__cta {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 24px;
	border: 1px solid var(--ure-accent);
	border-radius: var(--ure-radius);
	background: var(--ure-accent);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	color: #ffffff;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover .ure-card__cta {
	background: var(--ure-accent-hover);
	border-color: var(--ure-accent-hover);
}

.eti-tpl--theme-upcoming-regatta-events-php .ure-card__hit:active .ure-card__cta {
	background: var(--ure-accent-active);
	border-color: var(--ure-accent-active);
}

/* ------------------------------------------------------------------
   State: 2 events — the extra width buys type size, not stretch
   ------------------------------------------------------------------ */

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="2"] .ure-card__body {
	padding: 26px;
	gap: 14px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="2"] .ure-card__title {
	font-size: 24px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="2"] .ure-card__excerpt {
	-webkit-line-clamp: 4;
}

/* ------------------------------------------------------------------
   State: 1 event — horizontal feature card, so a lone regatta reads as
   the headline rather than an orphaned third
   ------------------------------------------------------------------ */

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__hit {
	flex-direction: row;
	align-items: stretch;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__media {
	flex: 0 0 46%;
	aspect-ratio: auto;
	min-height: 340px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__date {
	top: 16px;
	left: 16px;
	min-width: 74px;
	padding: 10px 12px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__date-d {
	font-size: 26px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__status {
	top: 18px;
	right: 16px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__body {
	gap: 16px;
	padding: clamp(26px, 3vw, 40px);
	justify-content: center;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__title {
	max-width: 18ch;
	font-size: clamp(28px, 3.4vw, 38px);
	letter-spacing: -0.02em;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__meta {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px 24px;
	font-size: 15px;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__meta span.ure-card__meta-days {
	display: flex;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__excerpt {
	max-width: 56ch;
	font-size: 16px;
	-webkit-line-clamp: 4;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__foot {
	justify-content: flex-start;
	gap: 20px;
	padding-top: 6px;
	border-top: none;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__more,
.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__days {
	display: none;
}

.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__cta {
	display: inline-flex;
}

/* ------------------------------------------------------------------
   Responsive — small screens get one column, never a squeeze
   ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] {
		grid-template-columns: repeat(2, 1fr);
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] .ure-card:first-child {
		grid-column: 1 / -1;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] .ure-card:first-child .ure-card__media {
		aspect-ratio: 21 / 9;
	}
}

@media (max-width: 880px) {
	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__hit {
		flex-direction: column;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__media {
		flex: 0 0 auto;
		aspect-ratio: 16 / 9;
		min-height: 0;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__title {
		max-width: none;
	}
}

@media (max-width: 680px) {
	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"],
	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="2"] {
		grid-template-columns: 1fr;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] .ure-card:first-child {
		grid-column: auto;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="3"] .ure-card:first-child .ure-card__media {
		aspect-ratio: 16 / 9;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__head {
		align-items: flex-start;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__foot {
		flex-wrap: wrap;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure__row[data-count="1"] .ure-card__cta {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.eti-tpl--theme-upcoming-regatta-events-php .ure-card,
	.eti-tpl--theme-upcoming-regatta-events-php .ure-card__media img,
	.eti-tpl--theme-upcoming-regatta-events-php .ure-card__more,
	.eti-tpl--theme-upcoming-regatta-events-php .ure__all {
		transition: none;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover {
		transform: none;
	}

	.eti-tpl--theme-upcoming-regatta-events-php .ure-card:hover .ure-card__media img {
		transform: none;
	}
}
