/*
 * Public site layout and shared components.
 * Used by the public home and the event pages (not by /panel/).
 */

html.public-site {
	overflow-x: hidden;
	overflow-y: auto;
	scroll-snap-type: none;
	/* Warm white canvas: keeps the dotted paper feel without the old yellow cast. */
	--pub-canvas: #fbf7ed;
	background-color: var(--pub-canvas);
	background-image: radial-gradient(rgba(23, 42, 89, 0.09) 1.1px, transparent 1.2px);
	background-size: 20px 20px;
}

body.public-site {
	display: flex;
	flex-direction: column;
	height: auto;
	min-height: 100dvh;
	overflow: visible;
	background-color: var(--pub-canvas);
	background-image: radial-gradient(rgba(23, 42, 89, 0.09) 1.1px, transparent 1.2px);
	background-size: 20px 20px;

	--pub-blue: 47, 107, 224;
	--pub-red: 232, 64, 47;
	--pub-red-strong: 179, 38, 30;
	--pub-yellow: 245, 197, 24;
	--pub-green: 32, 160, 120;
	--pub-green-strong: 15, 122, 90;
	--pub-teal: 32, 201, 151;
	--pub-navy: 23, 42, 89;
	--pub-ink: #172A59;
	--pub-muted: #5A6784;
	--pub-cream: #FFFDF7;
	--pub-paper: #FFFFFF;
	--pub-border: rgba(23, 42, 89, 0.12);
	--pub-shadow: 0 8px 24px rgba(23, 42, 89, 0.07);

	color: var(--pub-ink);
}

body.public-site .content-container {
	flex: 1 0 auto;
	height: auto;
	padding-top: var(--padding-top-header, 80px);
	font-size: 1rem;
	line-height: 1.6;
}

body.public-site .footer {
	margin-top: auto;
	background: rgb(255, 250, 235);
	border-top: 4px solid;
	border-image: linear-gradient(90deg, #2F6BE0 0 33%, #E8402F 33% 66%, #F5C518 66%) 1;
}

body.public-site header#header {
	background: rgb(255, 250, 235);
	box-shadow: 0 1px 0 rgba(23, 42, 89, 0.08);
	border-bottom: 3px solid;
	border-image: linear-gradient(90deg, #2F6BE0 0 33%, #E8402F 33% 66%, #F5C518 66%) 1;
}

body.public-site a:focus-visible,
body.public-site button:focus-visible,
body.public-site [tabindex]:focus-visible {
	outline: 3px solid rgb(var(--pub-blue));
	outline-offset: 3px;
	border-radius: 8px;
}

/* Header navigation */

body.public-site header nav ul {
	gap: 0.15rem;
}

body.public-site header nav .pub-nav-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	width: auto;
	padding: 0.5em 0.8em;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.005em;
	color: var(--pub-muted);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

body.public-site header nav .pub-nav-link:hover {
	background: rgba(32, 160, 120, 0.1);
	color: var(--pub-ink);
}

body.public-site header nav .pub-nav-link.is-active {
	background: rgba(245, 197, 24, 0.32);
	color: var(--pub-ink);
}

body.public-site header nav .pub-nav-link--panel {
	color: var(--pub-ink);
	border: 1px solid rgba(23, 42, 89, 0.14);
}

body.public-site header nav .pub-nav-link--panel svg {
	opacity: 0.7;
}

.header-signin {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	padding: 0.5em 0.9em;
	border-radius: 999px;
	border: 1px solid rgba(23, 42, 89, 0.16);
	color: var(--pub-ink);
	font-size: 0.82rem;
	font-weight: 800;
	text-decoration: none;
	white-space: nowrap;
}

.header-signin:hover {
	background: rgba(245, 197, 24, 0.24);
}

.footer-internal {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	margin-top: 0.5rem;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--pub-muted);
	text-decoration: none;
}

.footer-internal:hover {
	color: var(--pub-ink);
	text-decoration: underline;
}

/* Buttons */

.pub-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.pub-actions .button {
	width: auto;
	margin: 0;
}

body.public-site .button {
	color: #fff;
	background: rgb(var(--pub-blue));
	border-radius: 999px;
	min-height: 44px;
	padding: 0.7em 1.2em;
	font-size: 0.96rem;
}

body.public-site .button:hover {
	color: #fff;
	background: rgb(31, 91, 214);
	filter: none;
}

body.public-site .button.pub-button-ghost {
	--btn-bg: 255, 255, 255;
	--btn-color: 23, 42, 89;
	color: var(--pub-ink);
	background: transparent;
	border: 1px solid rgba(23, 42, 89, 0.18);
}

body.public-site .button.pub-button-ghost:hover {
	background: rgba(23, 42, 89, 0.05);
	color: var(--pub-ink);
}

/* Layout helpers */

.pub-wrap {
	width: min(1220px, calc(100% - 2rem));
	margin-inline: auto;
}

/*
 * One soft wash shared by all public pages. It fades into the dotted paper
 * canvas instead of ending at a section boundary.
 */
.pub-page-wash {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 40rem),
		radial-gradient(42rem 30rem at 6% -2%, rgba(245, 197, 24, 0.2), transparent 72%),
		radial-gradient(38rem 28rem at 96% 2%, rgba(32, 160, 120, 0.14), transparent 72%);
	background-repeat: no-repeat;
}

.pub-section {
	padding-block: clamp(2.2rem, 5vw, 4rem);
}

.pub-title {
	margin: 0;
	font-size: clamp(1.65rem, 4vw, 2.4rem);
	line-height: 1.1;
	font-weight: 900;
	letter-spacing: -0.025em;
}

.pub-lead {
	margin: 0.55rem 0 0;
	max-width: 56ch;
	font-size: clamp(0.96rem, 1.7vw, 1.05rem);
	color: var(--pub-muted);
}

.pub-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	font-size: 0.86rem;
	font-weight: 800;
	text-decoration: none;
	color: rgb(var(--pub-blue));
	white-space: nowrap;
}

.pub-link-arrow:hover {
	text-decoration: underline;
}

.pub-icon {
	display: inline-block;
	vertical-align: -0.15em;
	flex: 0 0 auto;
}

/* Stickers and cards */

.pub-sticker {
	position: absolute;
	top: 0.8rem;
	right: 0.8rem;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	padding: 0.25em 0.6em;
	border-radius: 999px;
	background: rgb(var(--pub-red-strong));
	color: #fff;
	font-size: 0.68rem;
	font-weight: 900;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 2px 0 rgba(23, 42, 89, 0.16);
}

.pub-event-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: clamp(1rem, 2.5vw, 1.5rem);
}

.pub-event-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--pub-border);
	border-radius: 20px;
	background: var(--pub-paper);
	box-shadow: var(--pub-shadow);
	text-decoration: none;
	color: inherit;
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pub-event-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(23, 42, 89, 0.1);
}

.pub-event-card__poster {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(135deg, rgba(var(--pub-blue), 0.16), rgba(var(--pub-yellow), 0.28));
}

.pub-event-card__poster img {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pub-event-card__badge {
	position: absolute;
	left: 0.75rem;
	bottom: 0.75rem;
	z-index: 2;
	padding: 0.25em 0.6em;
	border-radius: 999px;
	background: rgb(var(--pub-yellow));
	color: var(--pub-ink);
	font-size: 0.68rem;
	font-weight: 900;
	box-shadow: 0 2px 0 rgba(23, 42, 89, 0.14);
}

.pub-event-card__fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0.05em;
	color: #fff;
	background:
		radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.28) 0 10px, transparent 11px),
		radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.22) 0 14px, transparent 15px),
		linear-gradient(140deg, rgb(var(--pub-blue)), rgb(var(--pub-red)));
}

.pub-event-card__fallback-day {
	font-size: clamp(2.2rem, 7vw, 3.1rem);
	font-weight: 900;
	line-height: 0.9;
	letter-spacing: -0.04em;
}

.pub-event-card__fallback-month {
	font-size: 0.78rem;
	font-weight: 900;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.pub-event-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	padding: 0.95rem 1.05rem 1.1rem;
}

.pub-event-card__date {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--pub-muted);
}

.pub-event-card__date svg {
	color: rgb(var(--pub-blue));
}

.pub-event-card__title {
	font-size: 1.08rem;
	font-weight: 900;
	line-height: 1.22;
}

.pub-event-card__meta {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--pub-muted);
}

.pub-event-card__desc {
	font-size: 0.88rem;
	color: var(--pub-muted);
}

.pub-event-card__cta {
	margin-top: 0.3rem;
	font-size: 0.82rem;
	font-weight: 900;
	color: rgb(var(--pub-blue));
}

.pub-event-card--featured {
	grid-column: span 2;
}

.pub-event-card--featured .pub-event-card__poster {
	aspect-ratio: 21 / 9;
}

.pub-event-card--featured .pub-event-card__title {
	font-size: clamp(1.2rem, 2.4vw, 1.45rem);
}

.pub-event-grid:has(> .pub-event-card:only-child) {
	grid-template-columns: minmax(0, 980px);
	justify-content: center;
}

.pub-event-grid > .pub-event-card--featured:only-child {
	grid-column: auto;
}

.pub-event-grid > .pub-event-card--featured:only-child .pub-event-card__poster {
	aspect-ratio: 16 / 10;
}

@media (min-width: 800px) {
	.pub-event-grid > .pub-event-card:only-child {
		display: grid;
		grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
		min-height: 330px;
	}

	.pub-event-grid > .pub-event-card:only-child .pub-event-card__poster {
		height: 100%;
		min-height: 330px;
		aspect-ratio: auto;
	}

	.pub-event-grid > .pub-event-card:only-child .pub-event-card__body {
		justify-content: center;
		padding: clamp(1.2rem, 2.5vw, 1.8rem);
	}
}

/* Tabs */

.pub-tabs {
	display: inline-flex;
	gap: 0.25rem;
	padding: 0.25rem;
	border-radius: 999px;
	border: 1px solid rgba(23, 42, 89, 0.12);
	background: rgba(255, 255, 255, 0.8);
}

.pub-tab {
	display: inline-flex;
	align-items: center;
	padding: 0.5em 0.95em;
	border-radius: 999px;
	color: var(--pub-muted);
	font-size: 0.84rem;
	font-weight: 800;
	text-decoration: none;
	white-space: nowrap;
}

.pub-tab:hover {
	color: var(--pub-ink);
}

.pub-tab.is-active {
	background: rgb(var(--pub-blue));
	color: #fff;
}

/* Empty states */

.pub-empty {
	padding: clamp(1.8rem, 4vw, 3rem) 1.4rem;
	border: 1px dashed rgba(23, 42, 89, 0.2);
	border-radius: 22px;
	background: rgba(255, 255, 255, 0.72);
	text-align: center;
}

.pub-empty__icon {
	display: inline-flex;
	margin-bottom: 0.4rem;
	color: rgb(var(--pub-green-strong));
}

.pub-empty h3 {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
	font-weight: 900;
}

.pub-empty p {
	margin: 0 auto;
	max-width: 44ch;
	color: var(--pub-muted);
}

.pub-empty__action {
	margin-top: 1rem;
}

/* Page header band */

.pub-page-head {
	padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 2.5vw, 1.75rem);
}

.pub-page-head .pub-title::after {
	content: "";
	display: block;
	width: 3rem;
	height: 0.3rem;
	margin-top: 0.45rem;
	border-radius: 999px;
	background: linear-gradient(90deg, #2F6BE0 0 33%, #E8402F 33% 66%, #F5C518 66%);
}

.pub-page-head--compact {
	padding-block: 1.4rem 1.2rem;
}

.pub-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin: 0 0 0.7rem;
	padding: 0;
	list-style: none;
	font-size: 0.76rem;
	font-weight: 800;
	color: var(--pub-muted);
}

.pub-breadcrumb a {
	color: rgb(var(--pub-blue));
	text-decoration: none;
}

.pub-breadcrumb a:hover {
	text-decoration: underline;
}

.pub-breadcrumb li + li::before {
	content: "\2192";
	margin-right: 0.4em;
	color: rgba(23, 42, 89, 0.35);
}

/* Small print */

@media (max-width: 700px) {
	.pub-event-card--featured {
		grid-column: span 1;
	}

	.pub-event-card--featured .pub-event-card__poster {
		aspect-ratio: 16 / 10;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.public-site *,
	body.public-site *::before,
	body.public-site *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================
   Form-heavy public pages (rail + cards + framework forms)
   Reused by the family self-service page; add only generic
   components here so other public form pages can share them.
   ========================================================== */

.pub-form-page {
	font-size: 0.75em;
}

@media only screen and (min-width: 450px) {
	.pub-form-page {
		font-size: 0.8em;
	}
}

@media only screen and (min-width: 800px) {
	.pub-form-page {
		font-size: 0.85em;
	}
}

.pub-rail-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(1.25rem, 3vw, 2.25rem);
	padding-block: clamp(1.5rem, 3.5vw, 2.75rem) 4rem;
	align-items: start;
}

.pub-rail {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

.pub-eyebrow {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgb(var(--pub-green-strong));
}

.pub-sidenav {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.35rem;
}

.pub-sidenav-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
	/* Override the global `nav a` block layout (header navigation). */
	width: auto;
	height: auto;
	min-height: 40px;
	padding: 0.35em 0.7em;
	border-radius: 12px;
	border: 1px solid rgba(23, 42, 89, 0.12);
	background: rgba(255, 255, 255, 0.78);
	color: var(--pub-ink);
	font-size: 0.86rem;
	font-weight: 800;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.pub-sidenav-link:hover {
	background: rgba(245, 197, 24, 0.22);
	border-color: rgba(23, 42, 89, 0.22);
}

.pub-sidenav-count {
	min-width: 1.6em;
	padding: 0.05em 0.45em;
	border-radius: 999px;
	background: rgba(47, 107, 224, 0.12);
	color: rgb(var(--pub-blue));
	font-size: 0.75rem;
	font-weight: 900;
	text-align: center;
}

.pub-note {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
	padding: 0.6em 0.8em;
	border: 1px dashed rgba(23, 42, 89, 0.22);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--pub-muted);
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.5;
}

.pub-note .pub-icon {
	margin-top: 0.15em;
	color: rgb(var(--pub-green-strong));
}

.pub-help-card {
	padding: 0.9rem 1rem;
	border: 1px dashed rgba(23, 42, 89, 0.18);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.6);
}

.pub-help-card h2 {
	margin: 0 0 0.3rem;
	font-size: 0.88rem;
	font-weight: 900;
	color: var(--pub-ink);
}

.pub-help-card p {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.55;
	color: var(--pub-muted);
}

.pub-main {
	display: flex;
	flex-direction: column;
	gap: clamp(1.6rem, 3vw, 2.4rem);
	min-width: 0;
}

.pub-section-block {
	scroll-margin-top: calc(var(--padding-top-header, 80px) + 1.25rem);
}

.pub-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.9rem;
	padding-bottom: 0.55rem;
	border-bottom: 1px solid rgba(23, 42, 89, 0.12);
}

.pub-section-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 900;
	letter-spacing: -0.01em;
	color: var(--pub-ink);
}

.pub-section-meta {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--pub-muted);
	white-space: nowrap;
}

.pub-card-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.pub-card {
	position: relative;
	padding: 1.1rem 1.2rem 1.2rem;
	border: 1px solid var(--pub-border);
	border-radius: 20px;
	background: var(--pub-paper);
	box-shadow: var(--pub-shadow);
}

.pub-card--dashed {
	margin-top: 1rem;
	border-style: dashed;
	background: rgba(255, 255, 255, 0.72);
	box-shadow: none;
}

.pub-card-head {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	padding-bottom: 0.8rem;
	margin-bottom: 0.9rem;
	border-bottom: 1px solid rgba(23, 42, 89, 0.08);
}

.pub-card-identity {
	min-width: 0;
}

.pub-card-identity h3 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 900;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.pub-avatar {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.9rem;
	height: 2.9rem;
	overflow: hidden;
	border-radius: 50%;
	background: rgba(47, 107, 224, 0.14);
	color: rgb(var(--pub-blue));
	font-size: 1.15rem;
	font-weight: 900;
}

.pub-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pub-avatar--success {
	background: rgba(32, 160, 120, 0.16);
	color: rgb(var(--pub-green-strong));
}

.pub-muted {
	margin: 0.35rem 0 0;
	color: var(--pub-muted);
	font-size: 0.78rem;
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* Framework forms inside public cards */
.pub-card .form {
	margin: 0;
	width: 100%;
}

.pub-card form.form-template {
	width: 100%;
	margin: 0;
	gap: 1rem;
}

.pub-card form.form-template .form-field-div {
	width: 100%;
	margin: 0;
	gap: 0.4rem;
}

.pub-card .form-template > .form-error-occured,
.pub-card .form-template > .form-bottom-loading {
	width: 100%;
}

.pub-card .form-template > button[type="submit"] {
	width: 100%;
	margin: 0.5rem 0 0;
}

@media only screen and (min-width: 1000px) {
	.pub-rail-layout {
		grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
	}

	.pub-rail {
		position: sticky;
		top: calc(var(--padding-top-header, 80px) + 1.5rem);
	}
}

@media only screen and (min-width: 1100px) {
	.pub-form-grid form.form-template {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 1.15rem;
		row-gap: 0.9rem;
		align-items: start;
	}

	/* Everything spans the full row unless it is a field group. */
	.pub-form-grid form.form-template > * {
		grid-column: 1 / -1;
	}

	.pub-form-grid form.form-template > .form-field-div {
		grid-column: span 1;
		min-width: 0;
	}

	.pub-form-grid form.form-template > button[type="submit"] {
		justify-self: end;
		width: auto;
		min-width: 9rem;
		margin: 0.4rem 0 0;
	}
}

@media only screen and (max-width: 999px) {
	.pub-sidenav {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.pub-sidenav-link {
		gap: 0.5em;
	}
}

@media only screen and (max-width: 700px) {
	.pub-card {
		padding: 0.95rem;
		border-radius: 16px;
	}

	.pub-avatar {
		width: 2.6rem;
		height: 2.6rem;
	}

	.pub-rail-layout {
		padding-block: 1.1rem 3rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pub-sidenav-link {
		transition: none;
	}
}
