/**
 * WP Super Docs — Service blocks, front-end styles
 * @since 1.0.10
 */

/* ── Single service card ───────────────────────────────────────── */

.wpsd-service-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #ffffff;
	margin-block: 1.25em;
}

.wpsd-service-card--compact {
	padding: 12px 14px;
	margin: 0;
}

.wpsd-service-card-media {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpsd-service-card-logo {
	width: 42px;
	height: 42px;
	object-fit: contain;
	border-radius: 6px;
}

.wpsd-service-card-initial {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: #2563eb;
	color: #ffffff;
	font-size: 20px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
}

.wpsd-service-card-body {
	flex: 1;
	min-width: 0;
}

.wpsd-service-card-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.wpsd-service-card-name {
	font-size: 1rem;
	font-weight: 600;
	color: #0f172a;
}

.wpsd-service-card-category {
	background: #dbeafe;
	color: #2563eb;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wpsd-service-card-desc {
	margin: 0 0 8px;
	font-size: 0.9rem;
	line-height: 1.6;
	color: #475569;
}

.wpsd-service-card-links {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.wpsd-service-card-link {
	font-size: 0.8rem;
	color: #2563eb;
	text-decoration: none;
}

.wpsd-service-card-link:hover {
	text-decoration: underline;
}

/* ── Service list / grid ───────────────────────────────────────── */

.wpsd-service-list {
	margin-block: 1.5em;
}

.wpsd-service-list-heading {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748b;
	margin: 1.5em 0 0.75em;
	padding-bottom: 0.4em;
	border-bottom: 1px solid #e2e8f0;
}

.wpsd-service-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 10px;
}

/* ── Dark mode ─────────────────────────────────────────────────── */
/*
 * The WPSD theme controls dark mode via html[data-wpsd-theme="dark"],
 * not @media (prefers-color-scheme: dark). We mirror that here so the
 * service cards flip only when the WPSD dark toggle is on.
 *
 * The @media block below handles non-WPSD pages (plain WP themes), but
 * only when the WPSD theme hasn't explicitly been set to "light" — that
 * way a user who picked light mode in WPSD never sees dark cards even
 * if their OS is in dark mode.
 */

html[data-wpsd-theme="dark"] .wpsd-service-card {
	border-color: #334155;
	background: #1e293b;
}
html[data-wpsd-theme="dark"] .wpsd-service-card-name     { color: #f1f5f9; }
html[data-wpsd-theme="dark"] .wpsd-service-card-desc     { color: #94a3b8; }
html[data-wpsd-theme="dark"] .wpsd-service-card-category { background: #1e3a5f; color: #7aadda; }
html[data-wpsd-theme="dark"] .wpsd-service-list-heading  { color: #94a3b8; border-bottom-color: #334155; }
html[data-wpsd-theme="dark"] .wpsd-service-card-link     { color: #60a5fa; }
html[data-wpsd-theme="dark"] .wpsd-service-card-initial  { background: #3b82f6; }

/* Fallback for non-WPSD themes that only use OS preference. */
@media (prefers-color-scheme: dark) {
	html:not([data-wpsd-theme="light"]):not([data-wpsd-theme="light"]) .wpsd-service-card {
		border-color: #334155;
		background: #1e293b;
	}
	html:not([data-wpsd-theme="light"]) .wpsd-service-card-name     { color: #f1f5f9; }
	html:not([data-wpsd-theme="light"]) .wpsd-service-card-desc     { color: #94a3b8; }
	html:not([data-wpsd-theme="light"]) .wpsd-service-card-category { background: #1e3a5f; color: #7aadda; }
	html:not([data-wpsd-theme="light"]) .wpsd-service-list-heading  { color: #94a3b8; border-bottom-color: #334155; }
	html:not([data-wpsd-theme="light"]) .wpsd-service-card-link     { color: #60a5fa; }
	html:not([data-wpsd-theme="light"]) .wpsd-service-card-initial  { background: #3b82f6; }
}
