/**
 * NASTF 2026 — the theme's stylesheet for what theme.json and block attributes
 * can't express: the legacy front-end forms, injected rich content, and the
 * single-post card.
 *
 * The scan-tool loaner form and the SIR "submit" form are emitted by shared plugins
 * (nastf-scantool-form, nastf-submit-sir) whose markup carries Tailwind utility
 * classes. nastf-2026 deliberately does NOT load Tailwind, so those classes are inert
 * strings; we style the controls natively, by element, scoped to the NASTF admin-post
 * forms — no Tailwind, no dependency on the legacy theme. Both forms POST to
 * wp-admin/admin-post.php, which is the stable hook. Colors come from theme.json tokens.
 */

/* ---------------------------------------------------------------------------
 * Front-end NASTF forms (scan-tool loaner, SIR submit)
 * ------------------------------------------------------------------------- */
form[action*="admin-post.php"] {
	max-width: 44rem;
	margin: 2rem auto;
	color: var(--wp--preset--color--fg, #111827);
	font-size: 1rem;
	line-height: 1.5;
}

/* Outer bordered card (legacy: .max-w-7xl.border-2.border-black.p-6) */
form[action*="admin-post.php"] > div:first-child {
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--wp--preset--color--border, #e5e7eb);
	border-radius: .5rem;
	padding: 1.5rem 1.75rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

/* Section headings + helper copy */
form[action*="admin-post.php"] h2 {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 1.25rem 0 .25rem;
}
form[action*="admin-post.php"] > div:first-child h2:first-child,
form[action*="admin-post.php"] h2:first-child {
	margin-top: 0;
}
form[action*="admin-post.php"] p {
	color: var(--wp--preset--color--muted, #6b7280);
	margin: .25rem 0 1rem;
}
form[action*="admin-post.php"] fieldset {
	border: 0;
	margin: 1.5rem 0 0;
	padding: 0;
}
form[action*="admin-post.php"] legend {
	font-weight: 600;
	padding: 0;
	margin-bottom: .25rem;
}

/* Labels */
form[action*="admin-post.php"] label {
	display: inline-block;
	font-weight: 500;
	font-size: .9rem;
	margin-bottom: .35rem;
}

/* Text-like controls + selects */
form[action*="admin-post.php"] input[type="text"],
form[action*="admin-post.php"] input[type="email"],
form[action*="admin-post.php"] input[type="tel"],
form[action*="admin-post.php"] input[type="number"],
form[action*="admin-post.php"] input[type="url"],
form[action*="admin-post.php"] select,
form[action*="admin-post.php"] textarea {
	display: block;
	width: 100%;
	max-width: 34rem;
	padding: .55rem .75rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--wp--preset--color--fg, #111827);
	background: #fff;
	border: 1px solid #9ca3af;
	border-radius: .375rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
	margin-bottom: 1rem;
}
form[action*="admin-post.php"] input[type="text"]:focus,
form[action*="admin-post.php"] input[type="email"]:focus,
form[action*="admin-post.php"] input[type="tel"]:focus,
form[action*="admin-post.php"] input[type="number"]:focus,
form[action*="admin-post.php"] input[type="url"]:focus,
form[action*="admin-post.php"] select:focus,
form[action*="admin-post.php"] textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--nastf-accent, #3b82f6);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, .35);
}

/* Radios & checkboxes: native, aligned inline with their label */
form[action*="admin-post.php"] input[type="radio"],
form[action*="admin-post.php"] input[type="checkbox"] {
	width: 1rem;
	height: 1rem;
	margin: 0 .5rem 0 0;
	vertical-align: middle;
	accent-color: var(--wp--preset--color--nastf-accent, #3b82f6);
}
form[action*="admin-post.php"] input[type="radio"] + label,
form[action*="admin-post.php"] input[type="checkbox"] + label,
form[action*="admin-post.php"] input[type="radio"] ~ label,
form[action*="admin-post.php"] input[type="checkbox"] ~ label {
	display: inline;
	margin-bottom: 0;
	font-weight: 500;
	vertical-align: middle;
}

/* Submit button — theme accent, centered (covers <button> and .btn-blue) */
form[action*="admin-post.php"] button[type="submit"],
form[action*="admin-post.php"] input[type="submit"],
form[action*="admin-post.php"] .btn-blue {
	display: block;
	margin: 1.5rem auto 0;
	padding: .7rem 1.6rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: var(--wp--preset--color--nastf-accent, #3b82f6);
	border: 0;
	border-radius: .375rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
	cursor: pointer;
}
form[action*="admin-post.php"] button[type="submit"]:hover,
form[action*="admin-post.php"] input[type="submit"]:hover,
form[action*="admin-post.php"] .btn-blue:hover {
	background: #2563eb;
}

/* ---------------------------------------------------------------------------
 * Injected rich content (ACF WYSIWYG rendered raw inside block wrappers).
 * Give raw p/ul/ol/headings sane rhythm now that Tailwind's base styles are gone.
 * ------------------------------------------------------------------------- */
.nastf-oe__desc,
.nastf-oe__detail-desc,
.nastf-hero__body,
.nastf-home__intro,
.nastf-cards__desc,
.nastf-dir__group-desc,
.nastf-lc__desc {
	line-height: 1.6;
}
.nastf-oe__desc p,
.nastf-oe__detail-desc p,
.nastf-hero__body p,
.nastf-home__intro p,
.nastf-cards__desc p,
.nastf-dir__group-desc p,
.nastf-lc__desc p {
	margin: 0 0 1rem;
}
.nastf-oe__desc ul,
.nastf-oe__desc ol,
.nastf-oe__detail-desc ul,
.nastf-oe__detail-desc ol,
.nastf-hero__body ul,
.nastf-hero__body ol,
.nastf-home__intro ul,
.nastf-home__intro ol,
.nastf-cards__desc ul,
.nastf-cards__desc ol,
.nastf-dir__group-desc ul,
.nastf-dir__group-desc ol,
.nastf-lc__desc ul,
.nastf-lc__desc ol {
	margin: 0 0 1rem;
	padding-left: 1.5rem;
}
.nastf-oe__desc ul,
.nastf-oe__detail-desc ul,
.nastf-hero__body ul,
.nastf-home__intro ul,
.nastf-cards__desc ul,
.nastf-dir__group-desc ul,
.nastf-lc__desc ul {
	list-style: disc;
}
.nastf-oe__desc ol,
.nastf-oe__detail-desc ol,
.nastf-hero__body ol,
.nastf-home__intro ol,
.nastf-cards__desc ol,
.nastf-dir__group-desc ol,
.nastf-lc__desc ol {
	list-style: decimal;
}
.nastf-oe__desc li,
.nastf-oe__detail-desc li,
.nastf-hero__body li,
.nastf-home__intro li,
.nastf-cards__desc li,
.nastf-dir__group-desc li,
.nastf-lc__desc li {
	margin: .35rem 0;
}

/* ---------------------------------------------------------------------------
 * Single posts (templates/single.html) — every post type that isn't a page:
 * dn_sirs, nastf_news, oe_news, post, general_meeting, vsp, …
 *
 * Legacy nastf_2021 rendered these via content/single.php + content-article.php:
 * a bordered card holding the article, then "Posted on <date> by <author>",
 * "Categorized under: <terms>", and Previous:/Next: links below the card. The
 * block template rebuilds that structure; the card look lives here because
 * core's border/shadow supports only serialize into static markup from the
 * editor, and hand-writing that markup is fragile. Matches the directory cards.
 * ------------------------------------------------------------------------- */
.nastf-single,
.nastf-list__item {
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--wp--preset--color--border, #e5e7eb);
	border-radius: 10px;
	padding: 1.75rem 2rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
}
.nastf-single > :first-child,
.nastf-list__item > :first-child {
	margin-top: 0;
}
.nastf-single > :last-child,
.nastf-list__item > :last-child {
	margin-bottom: 0;
}

/* Archive / search result lists (templates/archive.html, search.html). */
.nastf-list {
	display: grid;
	gap: 1.5rem;
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}
.nastf-list__item h2 {
	margin-top: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}
.nastf-list__meta,
.nastf-list__date {
	font-size: .875rem;
	color: var(--wp--preset--color--muted, #6b7280);
	gap: .35rem;
	align-items: baseline;
}
.nastf-list__meta p {
	margin: 0;
}
.nastf-list__pagination {
	margin-top: 2rem;
	gap: 1rem;
}

/* "Posted on <date> by <author>" — a flex row, so the paragraphs that supply the
   connecting words sit inline with the date and author blocks. */
.nastf-single__meta {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--border, #e5e7eb);
	font-size: .875rem;
	color: var(--wp--preset--color--muted, #6b7280);
	gap: .35rem;
	align-items: baseline;
}
.nastf-single__meta p {
	margin: 0;
}

.nastf-single__terms {
	margin-top: .5rem;
	font-size: .875rem;
	color: var(--wp--preset--color--muted, #6b7280);
}

/* Previous:/Next: sit outside the card, pushed to opposite edges like legacy.
   min-width:0 lets long SIR titles wrap instead of forcing the row wider. */
.nastf-single__nav {
	margin-top: 1.25rem;
	gap: 1.5rem;
	font-size: .9rem;
}
.nastf-single__nav .wp-block-post-navigation-link {
	min-width: 0;
	flex: 1 1 0;
}
.nastf-single__nav .wp-block-post-navigation-link:last-child {
	text-align: right;
}
.nastf-single__nav .post-navigation-link__label {
	color: var(--wp--preset--color--muted, #6b7280);
}
