/* City Forms Directory – front end (ported from the original Forms page) */

.cfd-app {
	--brand-accent: #26537e;   /* overridden by Settings → Main accent color */
	--text: #1f2937;
	--muted: #6b7280;
	--border: #e5e7eb;
	--surface: #ffffff;
	--radius: 14px;
}

/* ---------- Search + view toggle ---------- */
.cfd-app .permit-header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	margin: 10px 0 6px;
	flex-wrap: wrap;
}
.cfd-app .permit-header input {
	max-width: 320px;
	width: 100%;
	padding: 8px 10px;
	border-radius: 999px;
	border: 1px solid var(--border);
}
.cfd-app .cfd-view-toggle {
	background: #fff;
	border: 2px solid var(--border);
	border-radius: 999px;
	padding: 8px 12px;
	font-size: 16px;
	line-height: 1;
	color: var(--text);
	cursor: pointer;
	transition: background .2s ease;
}
.cfd-app .cfd-view-toggle[aria-pressed="true"] {
	background: var(--brand-accent);
	color: #fff;
	border-color: var(--brand-accent);
}
.cfd-app .cfd-view-toggle:focus-visible { outline: 3px solid var(--brand-accent); }

/* ---------- Filter tabs ---------- */
.cfd-app .edu-filterbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 16px;
}
.cfd-app .edu-filterbar button {
	background: #fff;
	font-size: 15px;
	border: 2px solid var(--border);
	color: var(--text);
	border-radius: 999px;
	padding: 8px 14px;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.cfd-app .edu-filterbar button[aria-pressed="true"],
.cfd-app .edu-filterbar button:hover {
	background: var(--brand-accent);
	border-color: var(--brand-accent);
	color: #fff;
}
.cfd-app .edu-filterbar button:focus-visible { outline: 3px solid var(--brand-accent); }

/* ---------- Grid + cards ---------- */
.cfd-app .edu-resource-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 22px;
	margin-top: 12px;
}
.cfd-app .edu-resource-grid.is-list { display: block; }

.cfd-app .edu-card {
	position: relative;
	display: block;
	width: 100%;
	font: inherit;
	text-decoration: none;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px 20px;
	text-align: center;
	cursor: pointer;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cfd-app .edu-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
	border-color: var(--accent, var(--brand-accent));
}
.cfd-app .edu-card:focus-visible { outline: 5px solid var(--brand-accent); }
.cfd-app .edu-card[aria-expanded="true"] {
	border-color: var(--accent, var(--brand-accent));
	box-shadow: 0 0 0 2px var(--accent, var(--brand-accent));
}

.cfd-app .edu-icon {
	width: 54px;
	height: 54px;
	border-radius: 12px;
	margin: 28px auto 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	color: var(--accent, var(--brand-accent));
	background: color-mix(in srgb, var(--accent, var(--brand-accent)) 12%, #fff);
}

.cfd-app .edu-card h3 {
	margin: 6px 0;
	font-size: 18px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--text);
}
.cfd-app .edu-card p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--muted);
}

/* Badge */
.cfd-app .form-type-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	border-radius: 12px;
	color: #fff;
	white-space: nowrap;
}
.cfd-app .edu-card .form-type-badge {
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
}
.cfd-app .form-type-badge.apply    { background-color: #2e6f95; }
.cfd-app .form-type-badge.download { background-color: #6c757d; }
.cfd-app .form-type-badge.redirect { background-color: #3a7d44; }
.cfd-app .form-type-badge.closed   { background-color: #9b2c2c; }

/* Closed cards */
.cfd-app .edu-card.is-closed { opacity: .7; }
.cfd-app .edu-card.is-closed .edu-icon { filter: grayscale(1); }

/* List view: text left, badge column right, whole row lifts on hover */
.cfd-app .edu-card.list-row {
	display: grid;
	grid-template-columns: minmax(0, 600px) 150px;
	column-gap: 24px;
	align-items: center;
	text-align: left;
	padding: 12px 14px;
	margin: 0;
	background: #fff;
	color: var(--text);
	border: none;
	border-bottom: 1px solid var(--border);
	border-radius: 0;
	box-shadow: none;
	transform: none;
	transition: transform .18s ease, box-shadow .18s ease, border-radius .18s ease;
}
.cfd-app .edu-card.list-row:hover,
.cfd-app .edu-card.list-row:focus-visible {
	background: #fff;
	color: var(--text);
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
	border-radius: 10px;
	border-bottom-color: transparent;
	position: relative;
	z-index: 1;
}
.cfd-app .edu-card.list-row h3,
.cfd-app .edu-card.list-row:hover h3 {
	margin: 0 0 2px;
	font-size: 16px;
	color: var(--text);
}
.cfd-app .edu-card.list-row p { font-size: 14px; }
.cfd-app .edu-card.list-row .cfd-badge-col { text-align: center; }
.cfd-app .edu-card.list-row .form-type-badge {
	position: static;
	transform: none;
	margin: 0;
}
@media (max-width: 600px) {
	.cfd-app .edu-card.list-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
	.cfd-app .edu-card.list-row .form-type-badge { font-size: 10px; padding: 3px 8px; }
}
@media (prefers-reduced-motion: reduce) {
	.cfd-app .edu-card.list-row:hover { transform: none; }
}

.cfd-app .cfd-no-results {
	grid-column: 1 / -1;
	color: var(--muted);
	padding: 12px 0;
}

/* ---------- Expanded form row ---------- */
.cfd-app .permit-expansion-row {
	grid-column: 1 / -1;
	scroll-margin-top: 90px;
}
.cfd-app .permit-form-wrapper { display: none; margin-top: 2rem; }
.cfd-app .permit-form-wrapper.is-active { display: block; }

.cfd-app .cfd-closed-notice {
	margin: 4px 0 8px;
	padding: 14px 16px;
	border-radius: 12px;
	border: 1px solid #f1c4c4;
	background: #fdf3f3;
	color: #7a1f1f;
	font-size: 15px;
}

/* Shown only to logged-in staff when a form can't load */
.cfd-app .cfd-admin-warning {
	padding: 12px 14px;
	border-radius: 10px;
	border: 2px dashed #d63638;
	background: #fcf0f1;
	color: #8a2424;
	font-size: 14px;
}
.cfd-app .cfd-admin-warning a { color: #8a2424; text-decoration: underline; }

/* ---------- Intro note + badge key ---------- */
.cfd-app .cfd-notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 20px;
	margin: 0 0 16px;
	padding: 10px 14px;
	border-left: 4px solid var(--brand-accent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--brand-accent) 7%, #fff);
	font-size: 14px;
	color: var(--text);
}
.cfd-app .cfd-notice-text { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.cfd-app .cfd-notice-text .fa-circle-info { color: var(--brand-accent); }
.cfd-app .cfd-notice a { color: var(--brand-accent); font-weight: 600; text-decoration: underline; }
.cfd-app .cfd-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: 13px;
	color: var(--muted);
}
.cfd-app .cfd-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.cfd-app .cfd-legend .form-type-badge { font-size: 10px; padding: 3px 8px; }

/* ---------- "What permit do I need?" helper ---------- */
.cfd-app .permit-project-helper {
	margin: 0 0 18px;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: #f9fafb;
}
.cfd-app .cfd-helper-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px 12px;
}
.cfd-app .cfd-helper-title {
	margin: 0;
	font-weight: 600;
	font-size: 15px;
	color: var(--text);
	white-space: nowrap;
}
.cfd-app .cfd-helper-title .fa-solid { color: var(--brand-accent); margin-right: 2px; }
.cfd-app .cfd-project-input {
	flex: 1 1 auto;
	min-width: 120px;
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: #fff;
	font-size: 15px;
}
.cfd-app .cfd-project-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	border-radius: 999px;
	border: 2px solid var(--brand-accent);
	background: var(--brand-accent);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
}
.cfd-app .cfd-project-button:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.cfd-app .cfd-project-button { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 600px) {
	.cfd-app .cfd-helper-row { flex-wrap: wrap; }
	.cfd-app .cfd-helper-title { white-space: normal; flex-basis: 100%; }
	.cfd-app .cfd-project-button { flex: 1 1 100%; }
}

.cfd-app .project-helper-results:empty { display: none; }
.cfd-app .project-helper-results { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cfd-app .project-helper-results h3 { margin: 0 0 4px; font-size: 18px; }
.cfd-app .project-helper-note,
.cfd-app .project-helper-secondary { font-size: 14px; color: var(--muted); margin: 4px 0; }
.cfd-app .project-helper-list {
	list-style: none;
	margin: 6px 0 4px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.cfd-app .permit-chip {
	border-radius: 999px;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
	padding: 6px 10px;
	font-size: 14px;
	cursor: pointer;
}
.cfd-app .permit-chip:hover { border-color: var(--brand-accent); }
.cfd-app .permit-chip:focus-visible { outline: 3px solid var(--brand-accent); }

/* Screen-reader-only text */
.cfd-app .visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.cfd-app .edu-card { transition: none; }
	.cfd-app .edu-card:hover { transform: none; }
}
