/*
 * Haiku Archive — styles for the [wph_haiku_table] shortcode.
 * Only enqueued on pages that actually use the shortcode
 * (see aac6_maybe_enqueue_haiku_assets() in functions.php).
 */

#wph-root.wph-root {
	--wph-blue: #2271b1;
	--wph-blue-dark: #135e96;
	--wph-ink: #1d2327;
	--wph-muted: #646970;
	--wph-border: #dcdcde;
	--wph-bg: #f6f7f7;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--wph-ink);
	max-width: 900px;
	margin: 0 auto;
	box-sizing: border-box;
}
#wph-root.wph-root *,
#wph-root.wph-root *::before,
#wph-root.wph-root *::after { box-sizing: inherit; }

/* ---------- Chart card ---------- */
.wph-chart-card {
	border: 1px solid var(--wph-border);
	border-radius: 8px;
	padding: 18px 18px 8px;
	margin-bottom: 28px;
	background: #fff;
}
.wph-chart-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 12px;
	color: var(--wph-ink);
}
.wph-chart-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.wph-chart-btn {
	appearance: none;
	border: 1px solid var(--wph-border);
	background: var(--wph-bg);
	color: var(--wph-ink);
	font-size: 13px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 20px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wph-chart-btn:hover { background: #eaeaea; }
.wph-chart-btn.is-active {
	background: var(--wph-blue);
	border-color: var(--wph-blue);
	color: #fff;
}
.wph-chart-wrap {
	width: 100%;
	overflow-x: auto;
}
.wph-chart-svg { display: block; }
.wph-bar {
	transition: opacity 0.15s ease;
	cursor: pointer;
}
.wph-bar:hover { opacity: 0.8; }
.wph-bar-label {
	font-size: 11px;
	fill: var(--wph-muted);
}
.wph-bar-value {
	font-size: 11px;
	fill: var(--wph-ink);
	font-weight: 600;
}
.wph-axis-line { stroke: var(--wph-border); stroke-width: 1; }
.wph-tooltip {
	position: absolute;
	pointer-events: none;
	background: var(--wph-ink);
	color: #fff;
	font-size: 12px;
	padding: 4px 8px;
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.1s ease;
	white-space: nowrap;
	transform: translate(-50%, -100%);
	z-index: 20;
}
.wph-chart-svg-holder { position: relative; }

.wph-noscript-note {
	font-size: 13px;
	color: var(--wph-muted);
	background: var(--wph-bg);
	border: 1px solid var(--wph-border);
	border-radius: 6px;
	padding: 10px 12px;
	margin: 10px 0 0;
}

/* Fallback in case the active theme doesn't define this class */
#wph-root .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Random haiku ---------- */
.wph-random-card {
	border: 1px solid var(--wph-border);
	border-radius: 8px;
	padding: 18px;
	margin-bottom: 28px;
	background: #fff;
	text-align: center;
}
.wph-random-btn {
	appearance: none;
	border: 1px solid var(--wph-blue);
	background: var(--wph-blue);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 24px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.wph-random-btn:hover { background: var(--wph-blue-dark); border-color: var(--wph-blue-dark); }
.wph-random-btn:active { transform: scale(0.98); }
.wph-random-result {
	margin-top: 20px;
	text-align: left;
	animation: wph-fade-in 0.25s ease;
}
@keyframes wph-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: translateY(0); }
}
.wph-random-haiku {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 24px;
	line-height: 1.5;
	font-style: italic;
	font-weight: 500;
	color: var(--wph-ink);
	white-space: pre-line;
	text-align: center;
}
.wph-random-meta {
	margin-top: 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--wph-muted);
}
.wph-random-meta-item:first-child {
	font-weight: 700;
	color: var(--wph-ink);
}
.wph-random-meta-sep { color: var(--wph-border); }

/* ---------- Table ---------- */
.wph-table-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 10px;
}
.wph-table-scroll {
	width: 100%;
	overflow-x: auto;
	border: 1px solid var(--wph-border);
	border-radius: 8px;
}
table.wph-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	background: #fff;
}
table.wph-table thead th {
	position: sticky;
	top: 0;
	background: var(--wph-bg);
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	border-bottom: 2px solid var(--wph-border);
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}
table.wph-table thead th:hover { background: #eaeaea; }
table.wph-table thead th .wph-sort-arrow {
	display: inline-block;
	margin-left: 4px;
	font-size: 10px;
	opacity: 0.4;
}
table.wph-table thead th.is-sorted .wph-sort-arrow { opacity: 1; color: var(--wph-blue); }
table.wph-table tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--wph-border);
	vertical-align: top;
}
table.wph-table tbody tr:last-child td { border-bottom: none; }
table.wph-table tbody tr:nth-child(even) { background: #fbfbfc; }
table.wph-table tbody tr:hover { background: #f0f6fc; }

/* Haiku gets a lot more room and never line-wraps mid-line;
   Notes gets much less room since it's usually empty/short. */
.wph-haiku-cell {
	white-space: pre;
	font-style: italic;
	color: #3c434a;
	min-width: 270px;
}
.wph-release-cell { font-weight: 600; white-space: nowrap; }
.wph-date-cell { white-space: nowrap; color: var(--wph-muted); }
.wph-type-cell { white-space: nowrap; }
.wph-notes-cell { color: var(--wph-muted); min-width: 90px; max-width: 160px; }

.wph-type-pill {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}
.wph-type-pill[data-type="Major Release"] { background: #d7e9fb; color: #0a4b78; }
.wph-type-pill[data-type="Maintenance/Security Release"] { background: #fbe1e1; color: #8a1f1f; }
.wph-type-pill[data-type="Maintenance Release"] { background: #e5f5e0; color: #1d5c22; }
.wph-type-pill[data-type="Release Candidate"] { background: #fdf0d5; color: #7a5200; }
.wph-type-pill[data-type="Beta"] { background: #ece5fb; color: #3f2a7a; }

.wph-count {
	font-size: 12px;
	color: var(--wph-muted);
	margin: 8px 2px 0;
}

/* ---------- CSV download (below the table, centred) ---------- */
.wph-csv-row {
	text-align: center;
	margin-top: 16px;
}
.wph-csv-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--wph-border);
	background: var(--wph-bg);
	color: var(--wph-ink);
	font-size: 13px;
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 20px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.wph-csv-btn:hover { background: #eaeaea; }
.wph-csv-btn svg { flex-shrink: 0; }

@media (max-width: 600px) {
	.wph-chart-card { padding: 14px 12px 6px; }
	table.wph-table thead th, table.wph-table tbody td { padding: 8px; }
	.wph-random-haiku { font-size: 19px; }
}
