/*
 * LinuxWhiz — colours, type and block styles.
 * Loaded on the site and inside the block editor, so posts look the same while you write them.
 */

/* ------------------------------------------------------------------
   Tokens — ink, text, mint and amber are sampled from the logo
   ------------------------------------------------------------------ */
:root {
	--ink: #0f1417;        /* logo background */
	--well: #0a0e10;       /* code blocks, a step below ink */
	--panel: #151c20;      /* the icon's lighter edge */
	--panel-2: #1c252a;
	--line: #26323a;
	--text: #edeff1;       /* "linux" */
	--muted: #9aa7ad;
	--mint: #34d399;       /* "whiz" and the prompt chevron */
	--mint-soft: rgba(52, 211, 153, 0.12);
	--amber: #f2a65a;      /* the underline and the cursor */
	--amber-soft: rgba(242, 166, 90, 0.12);

	--font-display: "Red Hat Display", "Segoe UI", system-ui, sans-serif;
	--font-text: "Red Hat Text", "Segoe UI", system-ui, sans-serif;
	--font-mono: "Red Hat Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	--wrap: 73rem;
	--measure: 46rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--radius: 10px;
	--radius-lg: 14px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 1.5rem;
}

body {
	margin: 0;
	background: var(--ink);
	color: var(--text);
	font-family: var(--font-text);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

::selection {
	background: var(--mint);
	color: var(--ink);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3125rem; font-weight: 700; }
h4 { font-size: 1.0625rem; font-weight: 700; letter-spacing: 0; }
h5,
h6 { font-size: 0.9375rem; font-weight: 700; letter-spacing: 0; }

p {
	margin: 0;
}

a {
	color: var(--mint);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration-color: var(--amber);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--amber);
	outline-offset: 3px;
	border-radius: 3px;
}

img,
video,
iframe,
embed,
object {
	max-width: 100%;
}

img {
	height: auto;
	border-radius: var(--radius);
}

ul,
ol {
	margin: 0;
	padding-left: 1.4em;
}

li + li {
	margin-top: 0.35em;
}

li > ul,
li > ol {
	margin-top: 0.35em;
}

ul li::marker {
	color: var(--mint);
}

ol li::marker {
	color: var(--muted);
	font-family: var(--font-mono);
	font-size: 0.9em;
}

hr {
	height: 2px;
	margin: 0;
	border: 0;
	background: var(--line);
}

blockquote {
	margin: 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid var(--amber);
	color: var(--text);
	font-size: 1.1875rem;
}

blockquote cite,
.wp-block-quote__citation {
	display: block;
	margin-top: 0.6rem;
	color: var(--muted);
	font-size: 0.9375rem;
	font-style: normal;
}

mark {
	padding: 0.05em 0.25em;
	border-radius: 3px;
	background: var(--amber);
	color: var(--ink);
}

code,
kbd,
samp,
pre {
	font-family: var(--font-mono);
	font-size: 0.875em;
	font-variant-ligatures: none;
}

:not(pre) > code {
	padding: 0.12em 0.4em;
	border: 1px solid var(--line);
	border-radius: 5px;
	background: var(--panel);
	color: var(--text);
}

kbd {
	padding: 0.1em 0.45em;
	border: 1px solid var(--line);
	border-bottom-width: 3px;
	border-radius: 5px;
	background: var(--panel-2);
	white-space: nowrap;
}

pre {
	margin: 0;
	padding: 1.1rem 1.25rem;
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--well);
	color: var(--text);
	font-size: 0.875rem;
	line-height: 1.7;
	tab-size: 4;
	white-space: pre;
}

pre code {
	font-size: inherit;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

th,
td {
	padding: 0.65rem 0.9rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

th {
	border-bottom-color: var(--muted);
	font-family: var(--font-display);
	font-weight: 700;
}

figure {
	margin: 0;
}

figcaption,
.wp-caption-text,
.gallery-caption {
	margin-top: 0.6rem;
	color: var(--muted);
	font-size: 0.875rem;
}

/* ------------------------------------------------------------------
   Blocks
   ------------------------------------------------------------------ */
.wp-block-button__link {
	display: inline-block;
	padding: 0.7rem 1.25rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--mint);
	color: var(--ink);
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.wp-block-button__link:hover {
	background: var(--text);
	color: var(--ink);
}

.is-style-outline > .wp-block-button__link {
	border: 2px solid var(--mint);
	background: transparent;
	color: var(--mint);
}

/* Code scrolls sideways rather than wrapping, so command output keeps its columns. */
pre code,
.wp-block-code code {
	display: block;
	overflow-wrap: normal;
	white-space: pre;
}

.wp-block-table td,
.wp-block-table th {
	border: 0;
	border-bottom: 1px solid var(--line);
}

.wp-block-table thead {
	border-bottom: 1px solid var(--muted);
}

.wp-block-table th {
	border-bottom-color: var(--muted);
}

.wp-block-separator {
	margin-block: 2.75rem;
}

.entry-content::after {
	display: block;
	clear: both;
	content: "";
}

.alignleft {
	float: left;
	margin: 0.3rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.3rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
	text-align: center;
}

.wp-caption {
	max-width: 100%;
}

.wp-block-separator {
	border: 0;
}

.wp-block-table {
	overflow-x: auto;
}

.wp-block-pullquote {
	padding: 1.5rem 0;
	border-block: 2px solid var(--amber);
	text-align: left;
}

.wp-block-pullquote blockquote {
	padding: 0;
	border: 0;
	font-family: var(--font-display);
	font-size: 1.625rem;
	font-weight: 700;
	line-height: 1.25;
}

.wp-block-image img,
.wp-block-embed iframe {
	border-radius: var(--radius);
}

/* Callouts — mint means "good to know", amber means "careful". */
.is-style-tip,
.is-style-warning {
	padding: 1rem 1.25rem;
	border: 1px solid var(--line);
	border-left: 3px solid var(--mint);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--mint-soft);
}

.is-style-warning {
	border-left-color: var(--amber);
	background: var(--amber-soft);
}

.is-style-tip > * + *,
.is-style-warning > * + * {
	margin-top: 0.75rem;
}
