<?php
/**
 * Functional styles for Civic Dispatch surfaces.
 *
 * @package CivicDispatch
 */

.cd-wrap,
.cd-dashboard,
.cd-portfolio,
.cd-hub-panel {
	max-width: 1120px;
	margin: 0 auto 2rem;
}

.cd-dash-header {
	margin-bottom: 1.25rem;
}

.cd-dash-header h1 {
	margin: 0 0 0.35rem;
	font-size: clamp(1.75rem, 2.5vw, 2.25rem);
	line-height: 1.2;
}

.cd-dash-header .cd-muted {
	margin: 0;
	max-width: 42rem;
}

/* Dashboard: 12-col style via CSS grid — calendar gets more room */
.cd-dash-layout {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 1rem;
	align-items: start;
}

.cd-dash-layout > .cd-card {
	grid-column: span 4;
	min-height: 0;
}

.cd-dash-layout > .cd-card--calendar {
	grid-column: span 8;
	grid-row: span 2;
}

.cd-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.25rem;
}

.cd-card {
	background: #fff;
	border: 1px solid #e2e5ea;
	border-radius: 10px;
	padding: 0.95rem 1.05rem;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.cd-card--compact {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.cd-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.15rem;
}

.cd-card h3,
.cd-card h4 {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.cd-card-link {
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.cd-muted {
	color: #6b7280;
	font-size: 0.85em;
}

.cd-empty {
	margin: 0.25rem 0 0;
}

.cd-item-title {
	display: block;
	font-size: 0.9rem;
	line-height: 1.3;
	text-decoration: none;
	color: inherit;
}

.cd-item-meta {
	display: block;
	margin-top: 0.15rem;
	font-size: 0.78rem;
	line-height: 1.35;
}

.cd-row-between {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
}

.cd-progress {
	height: 6px;
	background: #eef1f5;
	border-radius: 999px;
	overflow: hidden;
	margin: 0.35rem 0 0;
}

.cd-progress > span {
	display: block;
	height: 100%;
	background: #0f766e;
}

.cd-btn-primary,
.cd-interest-cta .cd-btn-primary {
	background: #0f766e;
	color: #fff;
	border: 0;
	border-radius: 6px;
	padding: 0.45rem 0.9rem;
	cursor: pointer;
}

.cd-btn-secondary,
.cd-interest-cta .cd-btn-secondary {
	background: #f3f4f6;
	color: #111;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 0.45rem 0.9rem;
	cursor: pointer;
}

.cd-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cd-list li {
	padding: 0.65rem 0;
	border-bottom: 1px solid #eef1f5;
}

.cd-list--compact li {
	padding: 0.45rem 0;
}

.cd-list--compact li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.cd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.cd-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.28rem 0.65rem;
	border-radius: 999px;
	background: #ecfdf5;
	color: #0f766e;
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	border: 1px solid #a7f3d0;
}

.cd-chip--ghost {
	background: #f8fafc;
	color: #334155;
	border-color: #e2e8f0;
}

.cd-pill {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: #f0fdfa;
	color: #0f766e;
	font-size: 0.72rem;
	font-weight: 700;
	white-space: nowrap;
}

.cd-tag {
	display: inline-block;
	margin-right: 0.35rem;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	background: #f1f5f9;
	color: #475569;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Calendar widget */
.cd-calendar {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.85fr);
	gap: 0.85rem 1rem;
	align-items: start;
}

.cd-cal-toolbar {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.cd-cal-month-label {
	font-weight: 700;
	font-size: 0.95rem;
}

.cd-cal-nav {
	width: 2rem;
	height: 2rem;
	border: 1px solid #e2e8f0;
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	color: #334155;
}

.cd-cal-nav:hover {
	background: #f8fafc;
}

.cd-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 0.2rem;
	margin-bottom: 0.25rem;
	text-align: center;
	font-size: 0.68rem;
	font-weight: 700;
	color: #94a3b8;
	text-transform: uppercase;
}

.cd-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 0.25rem;
}

.cd-cal-day {
	aspect-ratio: 1;
	border: 0;
	border-radius: 8px;
	background: #f8fafc;
	cursor: pointer;
	padding: 0;
	position: relative;
	color: #0f172a;
	font-size: 0.8rem;
}

.cd-cal-day:hover:not(:disabled) {
	background: #eef2ff;
}

.cd-cal-day.is-outside {
	background: transparent;
	cursor: default;
}

.cd-cal-day.is-today {
	box-shadow: inset 0 0 0 1.5px #0f766e;
}

.cd-cal-day.is-selected {
	background: #0f766e;
	color: #fff;
}

.cd-cal-day.has-events::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 0.28rem;
	width: 0.28rem;
	height: 0.28rem;
	border-radius: 50%;
	background: #0f766e;
	transform: translateX(-50%);
}

.cd-cal-day.is-selected.has-events::after {
	background: #fff;
}

.cd-cal-day-num {
	display: block;
}

.cd-cal-details {
	background: #f8fafc;
	border: 1px solid #eef2f7;
	border-radius: 8px;
	padding: 0.7rem 0.8rem;
	min-height: 10rem;
}

.cd-cal-details-title {
	font-size: 0.8rem;
	font-weight: 700;
	margin-bottom: 0.35rem;
	color: #334155;
}

.cd-hub-mission {
	margin-bottom: 0.75rem;
	padding: 0.75rem 1rem;
	background: #f8fafc;
	border-left: 3px solid #0f766e;
}

.cd-interest-cta {
	margin: 0.75rem 0;
}

.cd-badge {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: #ecfdf5;
	color: #065f46;
	font-size: 0.8rem;
	margin-right: 0.35rem;
}

.cd-badge.is-verified {
	background: #eff6ff;
	color: #1e40af;
}

.cd-form label {
	display: block;
	font-weight: 600;
	margin-top: 0.75rem;
}

.cd-form input[type="text"],
.cd-form input[type="search"],
.cd-form textarea {
	width: 100%;
	max-width: 640px;
}

.cd-section-title {
	margin: 1.5rem 0 0.75rem;
	font-size: 1.25rem;
}

.cd-verified-flag::before {
	content: "✓ ";
	color: #1e40af;
	font-weight: 700;
}

@media (max-width: 1024px) {
	.cd-dash-layout > .cd-card,
	.cd-dash-layout > .cd-card--calendar {
		grid-column: span 6;
		grid-row: auto;
	}

	.cd-calendar {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.cd-dash-layout > .cd-card,
	.cd-dash-layout > .cd-card--calendar {
		grid-column: span 12;
	}
}
