/*
Theme Name: ESGis Risk Intelligence Board
Theme URI: https://esgis.esghub.hk
Author: ESGis
Description: NGO-facing dashboard theme for ESG risk signals, cases, and entities.
Version: 0.1.0
Text Domain: esgis
*/

:root {
	--bg: #f6f7fb;
	--card: #ffffff;
	--border: #e5e7ef;
	--text: #111827;
	--muted: #6b7280;
	--accent: #0f766e;
	--danger: #dc2626;
	--warning: #f59e0b;
	--info: #2563eb;
	--success: #16a34a;
	--unknown: #9ca3af;
	--radius: 12px;
	--shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	background: var(--bg);
	color: var(--text);
}

a {
	color: var(--info);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.esgis-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 20px 48px;
}

header.site-header,
footer.site-footer {
	background: #fff;
	border-bottom: 1px solid var(--border);
	box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

footer.site-footer {
	border-top: 1px solid var(--border);
	border-bottom: 0;
}

.site-header__inner,
.site-footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.site-branding h1 {
	font-size: 20px;
	margin: 0;
}

.site-branding span {
	display: block;
	font-size: 12px;
	color: var(--muted);
}

.primary-nav ul {
	list-style: none;
	display: flex;
	gap: 16px;
	margin: 0;
	padding: 0;
}

.primary-nav a {
	color: var(--text);
	font-weight: 600;
	padding: 8px 10px;
	border-radius: 8px;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
	background: #eef2ff;
	color: #1d4ed8;
}

.esgis-grid {
	display: grid;
	gap: 16px;
}

.esgis-grid.one {
	grid-template-columns: 1fr;
}

.esgis-grid.two {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.esgis-grid.three {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.esgis-grid.four {
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.esgis-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px;
}

.esgis-card h3 {
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 16px;
}

.esgis-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	color: var(--muted);
	font-size: 13px;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border: 1px solid var(--border);
	background: #f3f4f6;
	color: var(--text);
}

.severity-s1 { background: #ecfeff; color: #0ea5e9; border-color: #67e8f9; }
.severity-s2 { background: #fef3c7; color: #d97706; border-color: #fcd34d; }
.severity-s3 { background: #ffedd5; color: #ea580c; border-color: #fdba74; }
.severity-s4 { background: #fee2e2; color: #b91c1c; border-color: #fecdd3; }

.credibility-c1 { background: #e0f2fe; color: #2563eb; }
.credibility-c2 { background: #dcfce7; color: #15803d; }
.credibility-c3 { background: #e0e7ff; color: #4338ca; }

.level-green { background: #dcfce7; color: #15803d; }
.level-yellow { background: #fef3c7; color: #b45309; }
.level-orange { background: #ffedd5; color: #c2410c; }
.level-red { background: #fee2e2; color: #b91c1c; }
.level-unknown { background: #e5e7eb; color: #374151; }

.esgis-table {
	width: 100%;
	border-collapse: collapse;
}

.esgis-table th,
.esgis-table td {
	border-bottom: 1px solid var(--border);
	padding: 12px 10px;
	text-align: left;
	font-size: 14px;
}

.esgis-table th {
	font-weight: 700;
	color: #111827;
}

.esgis-banner {
	background: linear-gradient(135deg, #f8fafc, #eef2ff);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: var(--shadow);
}

.esgis-filter-bar {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.esgis-filter-bar label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
	margin-bottom: 4px;
}

.esgis-filter-bar select,
.esgis-filter-bar input {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
}

.esgis-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border-radius: 10px;
	padding: 10px 14px;
	font-weight: 700;
	border: 1px solid var(--border);
	background: #0f172a;
	color: #fff;
	cursor: pointer;
}

.esgis-btn.secondary {
	background: #fff;
	color: var(--text);
}

.esgis-section {
	margin-bottom: 24px;
}

.esgis-section h2 {
	margin: 0 0 12px;
	font-size: 20px;
}

.esgis-badge-stack {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.esgis-empty {
	padding: 12px;
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 768px) {
	.site-header__inner,
	.site-footer__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.primary-nav ul {
		flex-wrap: wrap;
	}

	.esgis-container {
		padding: 16px 14px 32px;
	}
}
