/**
 * SwimTimeLog Departures - front end.
 *
 * Scoped under .stl-* and driven by custom properties, so a theme can restyle
 * it by redefining the properties rather than fighting the selectors.
 */

.stl-departures,
.stl-empty {
	--stl-ink: currentColor;
	--stl-muted: rgba(0, 0, 0, .55);
	--stl-line: rgba(0, 0, 0, .12);
	--stl-surface: #fff;
	--stl-track: rgba(0, 0, 0, .08);
	--stl-paid: #1c7a58;
	--stl-pending: #b4cbca;
	--stl-accent: #cf6234;
	--stl-accent-ink: #fff;
	--stl-radius: 3px;
	--stl-gap: 24px;
}

@media (prefers-color-scheme: dark) {
	.stl-departures,
	.stl-empty {
		--stl-muted: rgba(255, 255, 255, .6);
		--stl-line: rgba(255, 255, 255, .16);
		--stl-surface: rgba(255, 255, 255, .04);
		--stl-track: rgba(255, 255, 255, .12);
		--stl-paid: #4dbd92;
		--stl-pending: #2a4749;
	}
}

/* ---------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------ */

.stl-departures {
	display: grid;
	gap: var(--stl-gap);
	margin: 0 0 1.5em;
}

.stl-departures--grid.stl-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stl-departures--grid.stl-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stl-departures--grid.stl-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 980px) {
	.stl-departures--grid.stl-cols-3,
	.stl-departures--grid.stl-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.stl-departures--grid { grid-template-columns: minmax(0, 1fr) !important; }
}

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

.stl-card {
	display: flex;
	flex-direction: column;
	background: var(--stl-surface);
	border: 1px solid var(--stl-line);
	border-radius: var(--stl-radius);
	overflow: hidden;
}

.stl-departures--list .stl-card {
	flex-direction: row;
}

.stl-departures--list .stl-card__media {
	flex: 0 0 34%;
	max-width: 320px;
	height: auto;
}

.stl-departures--list .stl-card__body { flex: 1; }

@media (max-width: 700px) {
	.stl-departures--list .stl-card { flex-direction: column; }
	.stl-departures--list .stl-card__media { flex-basis: auto; max-width: none; }
}

.stl-card__media {
	position: relative;
	display: block;
	height: 190px;
	overflow: hidden;
	background: #123;
	text-decoration: none;
}

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

.stl-card__img--placeholder {
	background: linear-gradient(165deg, #0b3a46, #1c6e7e 70%);
}

.stl-ribbon {
	padding: 4px 10px;
	background: #fff;
	color: #1c6e7e;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	line-height: 1.6;
	border-radius: var(--stl-radius);
}

.stl-card__media .stl-ribbon {
	position: absolute;
	left: 10px;
	bottom: 10px;
}

.stl-ribbon--confirmed { background: var(--stl-paid); color: #fff; }
.stl-ribbon--cancelled { background: #9c2626; color: #fff; }
.stl-ribbon--completed { background: #50575e; color: #fff; }

.stl-card__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 18px 20px;
	flex: 1;
}

.stl-card__meta {
	margin: 0;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--stl-muted);
}

.stl-card__title {
	margin: 0;
	font-size: 1.25em;
	line-height: 1.25;
}

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

.stl-card__title a:hover,
.stl-card__title a:focus-visible { text-decoration: underline; }

.stl-card__progress {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

/* Two-tone: solid is money received, hatched is reserved and still to clear. */
.stl-bar {
	display: flex;
	height: 8px;
	background: var(--stl-track);
	border-radius: 999px;
	overflow: hidden;
}

.stl-bar__paid,
.stl-bar__pending {
	display: block;
	flex: 0 0 auto;
	height: 100%;
	transition: width .4s ease;
}

.stl-bar__paid { background: var(--stl-paid); }

.stl-bar__pending {
	background: repeating-linear-gradient(
		45deg,
		var(--stl-pending),
		var(--stl-pending) 3px,
		transparent 3px,
		transparent 7px
	);
}

.stl-card__note {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 6px 12px;
	margin: 0;
	font-size: 14px;
	color: var(--stl-muted);
	font-variant-numeric: tabular-nums;
}

.stl-card__note strong { color: var(--stl-ink); }

.stl-card__pending { opacity: .8; }

.stl-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--stl-line);
}

.stl-card__price {
	font-size: 1.05em;
	font-weight: 700;
}

.stl-card__price em {
	font-style: normal;
	font-size: 12px;
	font-weight: 400;
	color: var(--stl-muted);
}

.stl-card__deadline {
	margin: 0;
	font-size: 13px;
	color: var(--stl-muted);
	font-variant-numeric: tabular-nums;
}

.stl-card--cancelled .stl-card__media,
.stl-card--completed .stl-card__media { filter: saturate(.35); }

/* ---------------------------------------------------------------
 * Buttons and empty state
 * ------------------------------------------------------------ */

.stl-btn {
	display: inline-block;
	padding: 9px 16px;
	background: var(--stl-accent);
	color: var(--stl-accent-ink);
	border-radius: var(--stl-radius);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	transition: filter .15s ease;
}

.stl-btn:hover,
.stl-btn:focus-visible { filter: brightness(1.08); color: var(--stl-accent-ink); }

.stl-btn--quiet {
	background: transparent;
	color: inherit;
	border: 1px solid var(--stl-line);
}

.stl-empty {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 28px;
	border: 1px dashed var(--stl-line);
	border-radius: var(--stl-radius);
}

.stl-empty__text { margin: 0; color: var(--stl-muted); }

/* Keyboard users must still see where they are. */
.stl-card a:focus-visible,
.stl-btn:focus-visible {
	outline: 2px solid var(--stl-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.stl-bar__paid,
	.stl-bar__pending,
	.stl-btn { transition: none; }
}

/* ===============================================================
 * Single departure page
 * ============================================================ */

.stl-single {
	--stl-ink: currentColor;
	--stl-muted: rgba(0, 0, 0, .58);
	--stl-line: rgba(0, 0, 0, .12);
	--stl-surface: #fff;
	--stl-track: rgba(0, 0, 0, .08);
	--stl-paid: #1c7a58;
	--stl-pending: #b4cbca;
	--stl-accent: #cf6234;
	--stl-accent-ink: #fff;
	--stl-radius: 3px;

	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px 60px;
}

@media (prefers-color-scheme: dark) {
	.stl-single {
		--stl-muted: rgba(255, 255, 255, .62);
		--stl-line: rgba(255, 255, 255, .16);
		--stl-surface: rgba(255, 255, 255, .04);
		--stl-track: rgba(255, 255, 255, .12);
		--stl-paid: #4dbd92;
		--stl-pending: #2a4749;
	}
}

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

.stl-hero {
	position: relative;
	margin: 0 0 34px;
	border-radius: var(--stl-radius);
	overflow: hidden;
	background: linear-gradient(165deg, #0b3a46, #1c6e7e 70%);
}

.stl-hero__img {
	display: block;
	width: 100%;
	height: clamp(240px, 42vw, 460px);
	object-fit: cover;
}

.stl-hero--image .stl-hero__inner {
	position: absolute;
	inset: auto 0 0 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
	color: #fff;
}

.stl-hero__inner {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 34px 30px 28px;
	color: #fff;
}

.stl-hero__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
}

.stl-hero__place {
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .92;
}

.stl-hero__title {
	margin: 0;
	color: inherit;
	font-size: clamp(28px, 4.4vw, 46px);
	line-height: 1.08;
	text-wrap: balance;
}

.stl-hero__dates {
	margin: 0;
	font-size: 1.05em;
	opacity: .95;
}

/* ---------- two column layout ---------- */

.stl-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 44px;
	align-items: start;
}

@media (max-width: 900px) {
	.stl-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}

.stl-main {
	display: flex;
	flex-direction: column;
	gap: 40px;
	min-width: 0;
}

/* ---------- fact strip ---------- */

.stl-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1px;
	background: var(--stl-line);
	border: 1px solid var(--stl-line);
	border-radius: var(--stl-radius);
	overflow: hidden;
	margin: 0;
}

.stl-fact {
	background: var(--stl-surface);
	padding: 15px 16px;
}

.stl-fact dt {
	margin: 0 0 3px;
	font-size: 11px;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--stl-muted);
}

.stl-fact dd {
	margin: 0;
	font-weight: 600;
	line-height: 1.35;
}

.stl-story > *:first-child { margin-top: 0; }
.stl-story > *:last-child { margin-bottom: 0; }

/* ---------- booking panel ---------- */

.stl-panel {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 22px;
	background: var(--stl-surface);
	border: 1px solid var(--stl-line);
	border-radius: var(--stl-radius);
}

.stl-panel__lead { margin: 0; font-size: 1.05em; }
.stl-panel__go { color: var(--stl-paid); }

.stl-panel__note {
	margin: 0;
	font-size: 14px;
	color: var(--stl-muted);
	font-variant-numeric: tabular-nums;
}

.stl-panel__note strong { color: var(--stl-ink); }

.stl-panel__facts {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	border-top: 1px solid var(--stl-line);
}

.stl-panel__facts > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--stl-line);
}

.stl-panel__facts dt { margin: 0; color: var(--stl-muted); font-size: 14px; }
.stl-panel__facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.stl-panel__cta { text-align: center; }

.stl-panel__deadline,
.stl-panel__closed {
	margin: 0;
	font-size: 13px;
	color: var(--stl-muted);
	text-align: center;
}

@media (max-width: 900px) {
	.stl-panel { position: static; }
}

/* ---------- registration form ---------- */

.stl-register__title { margin: 0 0 8px; }
.stl-register__intro { margin: 0 0 20px; color: var(--stl-muted); max-width: 62ch; }

.stl-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: 20px;
}

@media (max-width: 620px) {
	.stl-form__grid { grid-template-columns: minmax(0, 1fr); }
}

.stl-field { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.stl-field--wide { grid-column: 1 / -1; }

.stl-field label { font-weight: 600; font-size: 14px; }
.stl-req { color: var(--stl-accent); }

.stl-field input[type="text"],
.stl-field input[type="email"],
.stl-field input[type="tel"],
.stl-field input[type="number"],
.stl-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--stl-line);
	border-radius: var(--stl-radius);
	background: var(--stl-surface);
	color: inherit;
	font: inherit;
}

.stl-field--check label {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-weight: 400;
}

.stl-hint { font-size: 12px; color: var(--stl-muted); }

.stl-form__total { margin: 0 0 16px; font-size: 1.1em; }

.stl-btn--lg { display: inline-block; padding: 13px 26px; font-size: 16px; }

/* The honeypot must be reachable by bots and invisible to everyone else. */
.stl-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.stl-notice {
	padding: 14px 16px;
	margin: 0 0 20px;
	border-left: 3px solid var(--stl-line);
	border-radius: var(--stl-radius);
	background: var(--stl-surface);
}

.stl-notice--success { border-left-color: var(--stl-paid); }
.stl-notice--warning { border-left-color: #c98a2e; }
.stl-notice--error { border-left-color: #b3392f; }

.stl-payinfo {
	margin-top: 26px;
	padding: 20px 22px;
	background: var(--stl-surface);
	border: 1px solid var(--stl-line);
	border-radius: var(--stl-radius);
}

.stl-payinfo h3 { margin-top: 0; }

.stl-others {
	margin-top: 56px;
	padding-top: 34px;
	border-top: 1px solid var(--stl-line);
}

.stl-others__title { margin: 0 0 20px; }
