/*
Theme Name: Fazdrive Status
Description: A public status page for a server watched by the Fazdrive Server Monitor plugin: overall status, load, services, uptime history and notices.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Author: Fazdrive
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fazdrive-status
*/

/*
 * The palette and type are the Server Monitor dashboard's. The tokens below
 * are a copy of the block at the top of the plugin's assets/admin.css; change
 * both together.
 */

@font-face {
	font-family: "Saira";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(assets/fonts/saira-latin-wght-normal.woff2) format("woff2");
}

:root {
	/* Surfaces: deep blue-green, lightest on top. */
	--fsm-abyss: #071c1d;
	--fsm-hull: #0d2a2b;
	--fsm-raised: #143839;
	--fsm-seam: #1f4a4a;
	--fsm-grid: #183c3d;
	/* Ink */
	--fsm-ink: #e8f3f1;
	--fsm-ink-2: #93b3ae;
	/* Signal accent and states */
	--fsm-signal: #2bd4a4;
	--fsm-warning: #fbb315;
	--fsm-critical: #f0605d;
	--fsm-neutral: #7f9a96;

	--fsm-display: "Saira", "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
	--fsm-radius: 10px;
	--fsm-radius-sm: 4px;

	color-scheme: dark;
}

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--fsm-abyss);
	color: var(--fsm-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

a { color: var(--fsm-signal); }
a:hover { color: var(--fsm-ink); }
:focus-visible {
	outline: 2px solid var(--fsm-signal);
	outline-offset: 2px;
}

h1, h2, h3 {
	font-family: var(--fsm-display);
	font-weight: 600;
	line-height: 1.25;
	color: var(--fsm-ink);
	margin: 0;
}
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
[hidden] { display: none !important; }

.fs-skip {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 10;
	padding: 8px 14px;
	border-radius: var(--fsm-radius-sm);
	background: var(--fsm-signal);
	color: var(--fsm-abyss);
	font-weight: 600;
	text-decoration: none;
}
.fs-skip:focus { top: 12px; color: var(--fsm-abyss); }

.fs-muted { color: var(--fsm-ink-2); margin: 0; }

/* ------------------------------------------------------------------ */
/* Page frame                                                         */
/* ------------------------------------------------------------------ */

.fs-page {
	max-width: 1000px;
	margin: 0 auto;
	padding: 0 24px 40px;
}

.fs-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 24px;
	padding: 22px 0 16px;
	border-bottom: 1px solid var(--fsm-seam);
	margin-bottom: 24px;
}
.fs-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--fsm-display);
	font-size: 19px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--fsm-ink);
	text-decoration: none;
}
.fs-brand:hover { color: var(--fsm-ink); }
.fs-brand svg {
	width: 24px;
	height: 24px;
	color: var(--fsm-signal);
	flex: none;
}
.fs-brand__logo {
	width: auto;
	max-height: 36px;
}
.fs-bar__tag {
	margin: 0;
	color: var(--fsm-ink-2);
	font-size: 14px;
}

.fs-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--fsm-seam);
	color: var(--fsm-ink-2);
	font-size: 14px;
}
.fs-foot p { margin: 0; }
.fs-foot__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.fs-foot__menu a { color: var(--fsm-ink-2); }
.fs-foot__menu a:hover { color: var(--fsm-ink); }

/* ------------------------------------------------------------------ */
/* Status banner (the one loud element)                               */
/* ------------------------------------------------------------------ */

.fs-hero {
	--fs-state: var(--fsm-neutral);
	--fs-state-wash: rgba(127, 154, 150, 0.16);
	position: relative;
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	align-items: center;
	gap: 8px 28px;
	padding: 28px 30px;
	margin: 0 0 16px;
	border: 1px solid var(--fsm-seam);
	border-radius: 14px;
	background: linear-gradient(100deg, var(--fs-state-wash), rgba(13, 42, 43, 0) 58%), var(--fsm-hull);
	overflow: hidden;
}
.fs-hero[data-state="ok"] {
	--fs-state: var(--fsm-signal);
	--fs-state-wash: rgba(43, 212, 164, 0.17);
}
.fs-hero[data-state="attention"] {
	--fs-state: var(--fsm-warning);
	--fs-state-wash: rgba(251, 179, 21, 0.15);
}
/* Honeycomb lattice behind the emblem, fading out to the right. */
.fs-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='27.71' height='48'%3E%3Cpath d='M13.86 0L27.71 8v16L13.86 32 0 24V8zM13.86 32v16' fill='none' stroke='%23e8f3f1' stroke-opacity='.07'/%3E%3C/svg%3E");
	-webkit-mask-image: linear-gradient(90deg, #000, transparent 46%);
	mask-image: linear-gradient(90deg, #000, transparent 46%);
	pointer-events: none;
}
.fs-hero > * { position: relative; }

.fs-hero__emblem {
	width: 112px;
	height: 112px;
	color: var(--fs-state);
}
.fs-hero__emblem svg { display: block; width: 100%; height: 100%; }
.fs-hero__glyph { display: none; }
.fs-hero[data-state="ok"] .fs-hero__glyph--ok,
.fs-hero[data-state="attention"] .fs-hero__glyph--attention,
.fs-hero[data-state="quiet"] .fs-hero__glyph--quiet { display: inline; }
.fs-hero__sweep { display: none; transform-origin: 60px 60px; }
.fs-hero[data-state="ok"] .fs-hero__sweep {
	display: inline;
	animation: fs-sweep 9s linear infinite;
}
@keyframes fs-sweep {
	to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
	.fs-hero[data-state="ok"] .fs-hero__sweep { animation: none; }
}

.fs-hero__headline {
	font-size: 36px;
	line-height: 1.12;
	letter-spacing: -0.005em;
	margin: 0 0 8px;
}
.fs-hero__sub {
	color: var(--fsm-ink-2);
	max-width: 60ch;
	margin: 0;
}
.fs-hero__note {
	color: var(--fsm-ink-2);
	font-size: 14px;
	margin: 10px 0 0;
}

.fs-noscript {
	padding: 14px 18px;
	border: 1px solid var(--fsm-seam);
	border-radius: var(--fsm-radius);
	background: var(--fsm-hull);
}

@media (max-width: 600px) {
	.fs-page { padding: 0 16px 32px; }
	.fs-hero {
		grid-template-columns: minmax(0, 1fr);
		padding: 22px;
	}
	.fs-hero__emblem { width: 72px; height: 72px; }
	.fs-hero__headline { font-size: 27px; }
}

/* ------------------------------------------------------------------ */
/* Load strip: three readings in one divided panel                    */
/* ------------------------------------------------------------------ */

.fs-vitals {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--fsm-seam);
	border: 1px solid var(--fsm-seam);
	border-radius: var(--fsm-radius);
	overflow: hidden;
	margin: 0 0 16px;
}
.fs-tile {
	background: var(--fsm-hull);
	padding: 16px 20px 15px;
	min-width: 0;
}
.fs-tile__label {
	color: var(--fsm-ink-2);
	font-size: 14px;
}
.fs-tile__value {
	font-family: var(--fsm-display);
	font-size: 34px;
	font-weight: 500;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
	margin: 0 0 10px;
}
.fs-tile__sub {
	color: var(--fsm-ink-2);
	font-size: 13px;
	margin-top: 9px;
	min-height: 20px;
}
@media (max-width: 600px) {
	.fs-tile { padding: 13px 12px 12px; }
	.fs-tile__value { font-size: 27px; }
}

/* Meter: the fill carries severity, the track is a dim step of the same hue. */
.fs-meter {
	height: 4px;
	border-radius: 2px;
	background: rgba(43, 212, 164, 0.2);
	overflow: hidden;
}
.fs-meter > span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 2px;
	background: var(--fsm-signal);
	transition: width 0.3s ease;
}
.fs-meter[data-level="warning"] { background: rgba(251, 179, 21, 0.22); }
.fs-meter[data-level="warning"] > span { background: var(--fsm-warning); }
.fs-meter[data-level="critical"] { background: rgba(240, 96, 93, 0.26); }
.fs-meter[data-level="critical"] > span { background: var(--fsm-critical); }
.fs-meter[data-level="none"] { background: var(--fsm-grid); }
@media (prefers-reduced-motion: reduce) {
	.fs-meter > span { transition: none; }
}

/* ------------------------------------------------------------------ */
/* Cards                                                              */
/* ------------------------------------------------------------------ */

.fs-card {
	background: var(--fsm-hull);
	border: 1px solid var(--fsm-seam);
	border-radius: var(--fsm-radius);
	padding: 20px 22px;
	margin: 0 0 16px;
	min-width: 0;
}
.fs-card h2 {
	font-size: 18px;
	margin: 0 0 14px;
}
.fs-card h3 {
	font-family: inherit;
	font-size: 15px;
	margin: 24px 0 8px;
}
@media (max-width: 600px) {
	.fs-card { padding: 16px; }
}

/* Status marker: a shape plus a label, never colour alone. */
.fs-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}
.fs-pill__dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--fsm-neutral);
	flex: none;
}
.fs-pill--good .fs-pill__dot { background: var(--fsm-signal); }
.fs-pill--critical .fs-pill__dot { background: var(--fsm-critical); border-radius: 1px; }

.fs-services {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 0 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.fs-services li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--fsm-grid);
}

/* ------------------------------------------------------------------ */
/* Uptime                                                             */
/* ------------------------------------------------------------------ */

.fs-uptime__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 24px;
	margin-bottom: 14px;
}
.fs-uptime__head h2 { margin: 0; }
.fs-uptime__figure {
	margin: 0;
	color: var(--fsm-ink-2);
	font-size: 14px;
}
.fs-uptime__figure strong {
	font-family: var(--fsm-display);
	font-size: 26px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--fsm-ink);
	margin-right: 4px;
}

/* One bar per day. Height carries the level as well as colour. */
.fs-uptime__bar {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 44px;
}
.fs-day {
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	display: flex;
	align-items: flex-end;
}
.fs-day::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 1.5px;
	background: var(--fsm-signal);
}
.fs-day[data-level="minor"]::before { height: 68%; background: var(--fsm-warning); }
.fs-day[data-level="major"]::before { height: 40%; background: var(--fsm-critical); }
.fs-day[data-level="none"]::before { height: 10%; background: var(--fsm-seam); }
.fs-day:hover::before,
.fs-day[data-on]::before { filter: brightness(1.35); }
@media (max-width: 600px) {
	.fs-uptime__bar { gap: 1px; }
}

.fs-uptime__axis {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	color: var(--fsm-ink-2);
	font-size: 13px;
}
.fs-uptime__readout {
	min-height: 1.55em;
	margin: 10px 0 0;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.fs-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	color: var(--fsm-ink-2);
	font-size: 13px;
}
.fs-legend li {
	display: inline-flex;
	align-items: flex-end;
	gap: 7px;
	line-height: 14px;
}
.fs-key {
	width: 5px;
	height: 14px;
	border-radius: 1.5px;
	background: var(--fsm-signal);
}
.fs-key[data-level="minor"] { height: 10px; background: var(--fsm-warning); }
.fs-key[data-level="major"] { height: 6px; background: var(--fsm-critical); }
.fs-key[data-level="none"] { height: 2px; background: var(--fsm-neutral); }

.fs-gaps {
	margin: 0;
	padding: 0;
	list-style: none;
	font-variant-numeric: tabular-nums;
}
.fs-gaps li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 2px 16px;
	padding: 8px 0;
	border-bottom: 1px solid var(--fsm-grid);
}
.fs-gaps li span:last-child { color: var(--fsm-ink-2); }

.fs-footnote {
	margin: 20px 0 0;
	color: var(--fsm-ink-2);
	font-size: 13px;
	max-width: 80ch;
}

/* ------------------------------------------------------------------ */
/* Notices and articles                                               */
/* ------------------------------------------------------------------ */

.fs-section {
	font-size: 21px;
	margin: 34px 0 12px;
}
.fs-title {
	font-size: 30px;
	margin: 0 0 16px;
}
.fs-back { margin: 0 0 14px; font-size: 14px; }
.fs-back a::before { content: "\2190\00a0"; }
.fs-more { margin: 14px 0 0; }

.fs-notice-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.fs-notice {
	padding: 16px 0;
	border-top: 1px solid var(--fsm-seam);
}
.fs-notice:last-child { border-bottom: 1px solid var(--fsm-seam); }
.fs-notice__date {
	display: block;
	color: var(--fsm-ink-2);
	font-size: 13px;
	margin-bottom: 2px;
}
.fs-notice__title { font-size: 18px; }
.fs-notice__title a { color: var(--fsm-ink); text-decoration: none; }
.fs-notice__title a:hover { color: var(--fsm-signal); text-decoration: underline; }
.fs-notice__text { color: var(--fsm-ink-2); margin-top: 6px; max-width: 75ch; }
.fs-notice__text p:last-child { margin-bottom: 0; }

.fs-article { padding: 26px 30px; }
.fs-article .fs-notice__date { margin-bottom: 6px; }
@media (max-width: 600px) {
	.fs-article { padding: 18px 16px; }
	.fs-title { font-size: 25px; }
}

.fs-content { max-width: 72ch; overflow-wrap: break-word; }
.fs-content > :last-child { margin-bottom: 0; }
.fs-content h2 { font-size: 21px; margin: 1.6em 0 0.5em; }
.fs-content h3 { font-family: var(--fsm-display); font-size: 18px; margin: 1.4em 0 0.4em; }
.fs-content ul,
.fs-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.fs-content li { margin-bottom: 0.3em; }
.fs-content blockquote {
	margin: 0 0 1em;
	padding: 2px 0 2px 16px;
	border-left: 1px solid var(--fsm-seam);
	color: var(--fsm-ink-2);
}
.fs-content code,
.fs-content pre {
	background: var(--fsm-abyss);
	border: 1px solid var(--fsm-seam);
	border-radius: var(--fsm-radius-sm);
	font-family: Consolas, Monaco, "Courier New", monospace;
	font-size: 0.9em;
}
.fs-content code { padding: 1px 5px; }
.fs-content pre { padding: 12px 14px; overflow-x: auto; }
.fs-content pre code { border: 0; padding: 0; background: none; }
.fs-content table { border-collapse: collapse; margin: 0 0 1em; }
.fs-content th,
.fs-content td { padding: 7px 12px; border: 1px solid var(--fsm-seam); text-align: left; }
.fs-content hr { border: 0; border-top: 1px solid var(--fsm-seam); margin: 1.6em 0; }
.fs-content figure { margin: 0 0 1em; }
.fs-content figcaption,
.wp-caption-text { color: var(--fsm-ink-2); font-size: 13px; }
.alignleft { float: left; margin: 4px 20px 12px 0; }
.alignright { float: right; margin: 4px 0 12px 20px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

.navigation.pagination { margin-top: 18px; }
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.page-numbers {
	min-width: 36px;
	padding: 5px 10px;
	border: 1px solid var(--fsm-seam);
	border-radius: var(--fsm-radius-sm);
	color: var(--fsm-ink);
	text-align: center;
	text-decoration: none;
}
.page-numbers.current {
	background: var(--fsm-raised);
	border-color: var(--fsm-signal);
}
a.page-numbers:hover { border-color: var(--fsm-signal); color: var(--fsm-ink); }
