/* ==========================================================================
   Community Notices signup
   --------------------------------------------------------------------------
   Markup: template-parts/widgets/tpa-community-notices.php
   Script: assets/js/tpa-community-notices.js

   Borrows from what is already on the site rather than adding a new look:
   - the panel is the pale "Shaded panel" (.is-style-tpa-panel) used for the
     Capital Projects notices card;
   - the field and button are the pill controls of the newsletter "field" form
     on Community, which match the site's .wp-block-button pills;
   - inside the newsletter band (Contact Us) it takes the band's own input and
     button classes, so the two forms read as one card.

   Tokens come from :root in tpa-blocks.css, with fallbacks so this file still
   renders sensibly if it ever loads on its own.
   ========================================================================== */

.tpa-cn {
	--tpa-cn-navy: var(--tpa-navy, #0b3b60);
	--tpa-cn-blue: var(--tpa-blue, #1679c5);
	--tpa-cn-ink: var(--tpa-ink, #2b2b2b);
	--tpa-cn-dim: var(--tpa-dim, #4b5563);
	--tpa-cn-error: #b3261e;
	/* Darker than the newsletter's #0f7a3d so it holds 4.5:1 on the pale blue band too. */
	--tpa-cn-success: #0b5d2e;

	color: var(--tpa-cn-ink);
}

.tpa-cn *,
.tpa-cn *::before,
.tpa-cn *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Panel -- page content (top of Community Notices)
   -------------------------------------------------------------------------- */

.tpa-cn-block {
	margin-block: 0 clamp(1.75rem, 3vw, 2.5rem);
}

/* The Subscribe buttons elsewhere jump here; keep the heading clear of the top edge. */
.tpa-cn-block[id] {
	scroll-margin-top: 1.5rem;
}

.tpa-cn--panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(1rem, 3vw, 2.5rem);
	align-items: center;
	padding: clamp(1.25rem, 3vw, 2rem);
	background: var(--tpa-band, #edf4f8);
	border-radius: var(--tpa-round, 10px);
}

.tpa-cn--panel .tpa-cn__title {
	margin: 0 0 0.5rem;
	color: var(--tpa-cn-navy);
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	line-height: 1.2;
}

.tpa-cn--panel .tpa-cn__body {
	margin: 0;
	color: var(--tpa-cn-dim);
	line-height: 1.55;
}

.tpa-cn--panel .tpa-cn__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tpa-cn--panel .tpa-cn__input {
	flex: 1 1 14rem;
	min-width: 0;
	min-height: 2.75rem;
	padding: 0.5rem 1.15rem;
	font: inherit;
	font-size: 1rem;
	color: var(--tpa-cn-ink);
	background: #fff;
	border: 1px solid #8097a7;
	border-radius: 999px;
}

.tpa-cn--panel .tpa-cn__input::placeholder {
	color: #5f6f7c;
}

.tpa-cn--panel .tpa-cn__submit {
	flex: 0 0 auto;
	min-height: 2.75rem;
	padding: 0.4rem 1.6rem;
	font: inherit;
	font-size: 1rem;
	color: #fff;
	background: var(--tpa-cn-navy);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.tpa-cn--panel .tpa-cn__submit:hover {
	background: var(--tpa-cn-blue);
}

@media (max-width: 767.98px) {
	.tpa-cn--panel {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* --------------------------------------------------------------------------
   Stacked -- below the newsletter form, inside the newsletter band
   -------------------------------------------------------------------------- */

.tpa-cn--stacked {
	margin-top: 1.75rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(11, 59, 96, 0.35);
}

.tpa-cn--stacked .tpa-cn__title {
	margin-bottom: 0.75rem;
}

.tpa-cn--stacked .tpa-cn__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Two forms in one card: give both buttons one width so the two fields line up. */
.tpa-newsletter__form-col:has(.tpa-cn--stacked) .tpa-newsletter__submit {
	min-width: 7.5rem;
}

/* --------------------------------------------------------------------------
   Shared: focus, validation, messages
   -------------------------------------------------------------------------- */

.tpa-cn__input:focus-visible {
	outline: 3px solid var(--tpa-cn-blue);
	outline-offset: 2px;
	border-color: var(--tpa-cn-navy);
}

.tpa-cn__submit:focus-visible {
	outline: 3px solid var(--tpa-cn-blue);
	outline-offset: 2px;
}

.tpa-cn__submit[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.tpa-cn__form.is-invalid .tpa-cn__input {
	border-color: var(--tpa-cn-error);
	box-shadow: 0 0 0 1px var(--tpa-cn-error);
}

.tpa-cn__msg {
	margin: 0.6rem 0 0;
	padding-left: 1.15rem;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
}

.tpa-cn--stacked .tpa-cn__msg {
	padding-left: 0;
}

.tpa-cn__msg[hidden] {
	display: none;
}

.tpa-cn__msg--pending {
	color: var(--tpa-cn-dim);
	font-weight: 400;
}

.tpa-cn__msg-link {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
}

.tpa-cn__msg-link:hover,
.tpa-cn__msg-link:focus {
	text-decoration-thickness: 2px;
}

.tpa-cn__msg--error {
	color: var(--tpa-cn-error);
}

.tpa-cn__msg--success {
	color: var(--tpa-cn-success);
}

.tpa-cn__note {
	margin: 0.5rem 0 0;
	padding-left: 1.15rem;
	font-size: 0.85rem;
	color: var(--tpa-cn-dim);
}

.tpa-cn--stacked .tpa-cn__note {
	padding-left: 0;
}
