/*
Theme Name: Masinovic
Theme URI: https://www.masinovic.dev
Author: Faruk Masinovic
Description: A colourful block theme with light and dark modes for a software engineer's personal site and blog. System fonts only, no external requests.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.3.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: masinovic
Tags: blog, one-column, block-patterns, full-site-editing, custom-colors, light, dark
*/

/* ---------------------------------------------------------------
   0. Colour tokens

   Every colour lives here so light and dark are two value sets over one
   set of rules. Gradients are written out literally rather than through
   var(--wp--preset--gradient--*), because those presets do not resolve
   reliably for every block and a button silently losing its background is
   worse than a little duplication.
   --------------------------------------------------------------- */

:root {
	/* Surfaces */
	--fm-bg: #fbfcff;
	--fm-card: #ffffff;
	--fm-tint: #f4f2ff;
	--fm-tint-2: #ecfdff;

	/* Text */
	--fm-ink: #16123a;
	--fm-body: #35325c;
	--fm-muted: #5d5a86;

	/* Lines */
	--fm-line: #e5e2f8;
	--fm-line-strong: #cfc8f0;

	/* Accents */
	--fm-violet: #6d28d9;
	--fm-blue: #1d4ed8;
	--fm-cyan: #0e7490;
	--fm-pink: #be1d74;
	--fm-link: #1d4ed8;

	/* Chrome */
	--fm-header-bg: rgba(255, 255, 255, 0.78);
	--fm-header-line: rgba(22, 18, 58, 0.09);
	--fm-grid: rgba(109, 40, 217, 0.055);
	--fm-code-bg: #f4f2ff;
	--fm-code-ink: #4c1d95;
	--fm-code-border: rgba(109, 40, 217, 0.2);

	/* Ambient wash */
	--fm-wash-1: rgba(124, 58, 237, 0.20);
	--fm-wash-2: rgba(6, 182, 212, 0.18);
	--fm-wash-3: rgba(236, 72, 153, 0.13);

	--fm-shadow-sm: 0 1px 2px rgba(22, 18, 58, 0.05), 0 8px 24px -14px rgba(22, 18, 58, 0.25);
	--fm-shadow-md: 0 1px 3px rgba(22, 18, 58, 0.07), 0 18px 42px -18px rgba(76, 29, 149, 0.3);
	--fm-shadow-lg: 0 2px 6px rgba(22, 18, 58, 0.07), 0 34px 70px -30px rgba(76, 29, 149, 0.42);

	/* Fixed across both modes */
	--fm-grad-brand: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
	--fm-grad-display: linear-gradient(120deg, #7c3aed 0%, #2563eb 50%, #0891b2 100%);
	--fm-grad-line: linear-gradient(90deg, #7c3aed 0%, #2563eb 50%, #06b6d4 100%);

	--fm-radius: 20px;
	--fm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
	--fm-bg: #080a18;
	--fm-card: #141a30;
	--fm-tint: #171b34;
	--fm-tint-2: #0e2430;

	--fm-ink: #f2f0ff;
	--fm-body: #cdd3ea;
	--fm-muted: #9fa6c9;

	--fm-line: #2a3054;
	--fm-line-strong: #414a7d;

	--fm-violet: #a78bfa;
	--fm-blue: #93c5fd;
	--fm-cyan: #67e8f9;
	--fm-pink: #f9a8d4;
	--fm-link: #93c5fd;

	--fm-header-bg: rgba(8, 10, 24, 0.74);
	--fm-header-line: rgba(255, 255, 255, 0.1);
	--fm-grid: rgba(167, 139, 250, 0.075);
	--fm-code-bg: #10152b;
	--fm-code-ink: #ddd6fe;
	--fm-code-border: rgba(167, 139, 250, 0.28);

	--fm-wash-1: rgba(139, 92, 246, 0.34);
	--fm-wash-2: rgba(34, 211, 238, 0.24);
	--fm-wash-3: rgba(244, 114, 182, 0.2);

	--fm-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 26px -16px rgba(0, 0, 0, 0.7);
	--fm-shadow-md: 0 1px 3px rgba(0, 0, 0, 0.45), 0 20px 46px -20px rgba(0, 0, 0, 0.75);
	--fm-shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 38px 76px -32px rgba(0, 0, 0, 0.85);
}

/* No-JS fallback: honour the OS preference when the head script never ran. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme]) {
		--fm-bg: #080a18;
		--fm-card: #141a30;
		--fm-tint: #171b34;
		--fm-tint-2: #0e2430;
		--fm-ink: #f2f0ff;
		--fm-body: #cdd3ea;
		--fm-muted: #9fa6c9;
		--fm-line: #2a3054;
		--fm-line-strong: #414a7d;
		--fm-violet: #a78bfa;
		--fm-blue: #93c5fd;
		--fm-cyan: #67e8f9;
		--fm-pink: #f9a8d4;
		--fm-link: #93c5fd;
		--fm-header-bg: rgba(8, 10, 24, 0.74);
		--fm-header-line: rgba(255, 255, 255, 0.1);
		--fm-grid: rgba(167, 139, 250, 0.075);
		--fm-code-bg: #10152b;
		--fm-code-ink: #ddd6fe;
		--fm-code-border: rgba(167, 139, 250, 0.28);
		--fm-wash-1: rgba(139, 92, 246, 0.34);
		--fm-wash-2: rgba(34, 211, 238, 0.24);
		--fm-wash-3: rgba(244, 114, 182, 0.2);
	}
}

/* ---------------------------------------------------------------
   1. Page canvas
   --------------------------------------------------------------- */

html {
	background-color: var(--fm-bg);
}

body {
	position: relative;
	overflow-x: hidden;
	background-color: var(--fm-bg) !important;
	color: var(--fm-ink) !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background:
		radial-gradient(58rem 38rem at 6% -12%, var(--fm-wash-1), transparent 62%),
		radial-gradient(52rem 34rem at 94% 0%, var(--fm-wash-2), transparent 60%),
		radial-gradient(46rem 32rem at 52% 104%, var(--fm-wash-3), transparent 62%);
}

body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		linear-gradient(to right, var(--fm-grid) 1px, transparent 1px),
		linear-gradient(to bottom, var(--fm-grid) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(70rem 50rem at 50% 0%, #000 0%, transparent 76%);
	-webkit-mask-image: radial-gradient(70rem 50rem at 50% 0%, #000 0%, transparent 76%);
}

::selection {
	background: rgba(124, 58, 237, 0.25);
	color: var(--fm-ink);
}

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

/* Core writes body colours from theme.json; re-assert the tokens. */
:where(h1, h2, h3, h4, h5, h6) {
	color: var(--fm-ink) !important;
}

a:where(:not(.wp-block-button__link):not(.fm-brand)) {
	color: var(--fm-link) !important;
}

/* ---------------------------------------------------------------
   2. Header
   --------------------------------------------------------------- */

.fm-header {
	position: sticky;
	top: 0;
	z-index: 60;
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	background: var(--fm-header-bg);
	border-bottom: 1px solid var(--fm-header-line);
}

/* Thin brand hairline along the very top of the page. */
.fm-header::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: var(--fm-grad-line);
}

.fm-brand {
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none !important;
	color: var(--fm-ink) !important;
	font-size: 1.0625rem;
}

.fm-monogram {
	display: inline-grid;
	place-items: center;
	width: 2.125rem;
	height: 2.125rem;
	border-radius: 10px;
	background: var(--fm-grad-brand);
	color: #ffffff;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
	font-size: 0.8125rem;
	letter-spacing: -0.02em;
	box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
	flex: 0 0 auto;
}

.fm-nav a {
	color: var(--fm-muted) !important;
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none !important;
	transition: color 0.18s var(--fm-ease);
}

.fm-nav a:hover,
.fm-nav .current-menu-item a {
	color: var(--fm-violet) !important;
}

/* ---------------------------------------------------------------
   3. Theme toggle
   --------------------------------------------------------------- */

.fm-theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border-radius: 999px;
	border: 1px solid var(--fm-line);
	background: var(--fm-card);
	color: var(--fm-violet);
	cursor: pointer;
	flex: 0 0 auto;
	transition: border-color 0.18s var(--fm-ease), transform 0.18s var(--fm-ease), color 0.18s var(--fm-ease);
}

.fm-theme-toggle:hover {
	border-color: var(--fm-line-strong);
	transform: translateY(-1px);
}

.fm-theme-toggle svg {
	width: 1.05rem;
	height: 1.05rem;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.fm-theme-toggle .fm-icon-sun {
	display: none;
}

:root[data-theme="dark"] .fm-theme-toggle .fm-icon-sun {
	display: block;
}

:root[data-theme="dark"] .fm-theme-toggle .fm-icon-moon {
	display: none;
}

/* ---------------------------------------------------------------
   4. Buttons
   --------------------------------------------------------------- */

.wp-block-button__link {
	background-image: var(--fm-grad-brand);
	background-color: #7c3aed;
	color: #ffffff !important;
	border: 0;
	transition: transform 0.2s var(--fm-ease), box-shadow 0.2s var(--fm-ease), filter 0.2s var(--fm-ease);
	box-shadow: 0 8px 22px -8px rgba(124, 58, 237, 0.6);
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 32px -12px rgba(124, 58, 237, 0.7);
	filter: saturate(118%);
	text-decoration: none !important;
}

.fm-btn-ghost .wp-block-button__link {
	background-image: none;
	background-color: var(--fm-card);
	color: var(--fm-violet) !important;
	border: 1px solid var(--fm-line-strong);
	box-shadow: var(--fm-shadow-sm);
}

.fm-btn-ghost .wp-block-button__link:hover {
	border-color: var(--fm-violet);
	box-shadow: var(--fm-shadow-md);
	filter: none;
}

.fm-btn-sm .wp-block-button__link {
	padding: 0.55rem 1.05rem;
	font-size: 0.875rem;
}

/* Outlined white pill, for use on the gradient CTA panel. */
.fm-btn-outline-white .wp-block-button__link {
	background-image: none;
	background-color: transparent;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.6);
	box-shadow: none;
}

.fm-btn-outline-white .wp-block-button__link:hover {
	background-color: rgba(255, 255, 255, 0.14);
	border-color: #ffffff;
	filter: none;
}

/* Icon-only link in the header (GitHub). */
.fm-icon-link {
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 999px;
	border: 1px solid var(--fm-line);
	background: var(--fm-card);
	color: var(--fm-muted) !important;
	flex: 0 0 auto;
	text-decoration: none !important;
	transition: color 0.18s var(--fm-ease), border-color 0.18s var(--fm-ease), transform 0.18s var(--fm-ease);
}

.fm-icon-link:hover {
	color: var(--fm-violet) !important;
	border-color: var(--fm-line-strong);
	transform: translateY(-1px);
}

.fm-icon-link svg {
	width: 1.05rem;
	height: 1.05rem;
	display: block;
	fill: currentColor;
}

/* On the gradient CTA panel, invert to a solid white pill. */
.fm-cta .wp-block-button__link {
	background-image: none;
	background-color: #ffffff;
	color: #4c1d95 !important;
	box-shadow: 0 10px 26px -12px rgba(2, 6, 23, 0.6);
}

.fm-cta .wp-block-button__link:hover {
	background-color: #f5f3ff;
	filter: none;
}

/* ---------------------------------------------------------------
   5. Cards and panels
   --------------------------------------------------------------- */

.fm-glass {
	position: relative;
	background: var(--fm-card);
	border: 1px solid var(--fm-line);
	border-radius: var(--fm-radius);
	box-shadow: var(--fm-shadow-sm);
	overflow: hidden;
}

.fm-glass-brand,
.fm-cta {
	position: relative;
	overflow: hidden;
	border-radius: var(--fm-radius);
	background: var(--fm-grad-brand);
	box-shadow: var(--fm-shadow-lg);
	color: #ffffff;
}

.fm-cta::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(30rem 20rem at 92% 118%, rgba(6, 182, 212, 0.55), transparent 68%),
		radial-gradient(24rem 16rem at 0% -20%, rgba(236, 72, 153, 0.35), transparent 70%);
}

.fm-cta > * {
	position: relative;
	z-index: 1;
}

/* Core's constrained layout centres narrow children with
   `margin-left/right: auto !important`. Physical properties (not the
   logical `margin-inline`) are what actually win that head-to-head, so the
   heading lines up with the eyebrow above it. */
.wp-block-group.fm-cta > * {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.fm-cta .fm-lead {
	max-width: 42rem;
}

.fm-cta :where(h1, h2, h3, p) {
	color: #ffffff !important;
}

.fm-cta .fm-eyebrow {
	color: rgba(255, 255, 255, 0.92) !important;
}

.fm-cta .fm-lead {
	color: rgba(255, 255, 255, 0.94) !important;
}

.fm-cta a:where(:not(.wp-block-button__link)) {
	color: #ffffff !important;
}

/* ---------------------------------------------------------------
   6. Typography helpers
   --------------------------------------------------------------- */

.fm-eyebrow {
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.8125rem !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fm-cyan) !important;
	margin: 0 0 0.5rem !important;
}

.fm-gradient-text {
	background: var(--fm-grad-display);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	-webkit-text-fill-color: transparent;
	padding-bottom: 0.08em;
}

:root[data-theme="dark"] .fm-gradient-text {
	background: linear-gradient(120deg, #a78bfa 0%, #60a5fa 50%, #22d3ee 100%);
	-webkit-background-clip: text;
	background-clip: text;
}

.fm-lead {
	color: var(--fm-muted) !important;
	font-size: clamp(1.0625rem, 1.6vw, 1.3125rem) !important;
	line-height: 1.65;
}

/* Same physical-margin override as the CTA, so narrow leads stay left. */
.is-layout-constrained > .fm-lead,
.fm-hero > .fm-lead {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.fm-muted {
	color: var(--fm-muted) !important;
}

.fm-mono {
	font-family: var(--wp--preset--font-family--mono) !important;
}

.fm-section-label {
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.8125rem !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fm-violet) !important;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin: 0 0 1.25rem !important;
}

.fm-section-label::after {
	content: "";
	flex: 1;
	height: 2px;
	border-radius: 2px;
	background: var(--fm-grad-line);
	opacity: 0.55;
}

/* ---------------------------------------------------------------
   7. Hero
   --------------------------------------------------------------- */

.fm-hero {
	padding-top: clamp(3.5rem, 9vh, 6.5rem) !important;
	padding-bottom: clamp(2.5rem, 6vh, 4rem) !important;
}

.fm-hero h1 {
	margin: 0 0 1.25rem !important;
	font-size: clamp(2.75rem, 8.5vw, 5.75rem) !important;
	line-height: 1.02;
	letter-spacing: -0.04em;
}

.fm-hero .fm-lead {
	max-width: 34rem;
}

.fm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--fm-line);
	background: var(--fm-card);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--fm-muted);
	box-shadow: var(--fm-shadow-sm);
}

.fm-chip::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10b981;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

/* ---------------------------------------------------------------
   8. Tech stack cards

   Each card carries its own accent colour through --card-accent.
   --------------------------------------------------------------- */

.fm-stack-card {
	padding: clamp(1.5rem, 3vw, 2.25rem) !important;
	height: 100%;
	--card-accent: #7c3aed;
	--card-accent-soft: rgba(124, 58, 237, 0.1);
	--card-accent-line: rgba(124, 58, 237, 0.28);
}

.fm-accent-cyan {
	--card-accent: #0e7490;
	--card-accent-soft: rgba(8, 145, 178, 0.1);
	--card-accent-line: rgba(8, 145, 178, 0.3);
}

:root[data-theme="dark"] .fm-stack-card {
	--card-accent: #a78bfa;
	--card-accent-soft: rgba(167, 139, 250, 0.14);
	--card-accent-line: rgba(167, 139, 250, 0.34);
}

:root[data-theme="dark"] .fm-accent-cyan {
	--card-accent: #67e8f9;
	--card-accent-soft: rgba(34, 211, 238, 0.14);
	--card-accent-line: rgba(34, 211, 238, 0.34);
}

.fm-stack-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 4px;
	background: linear-gradient(90deg, var(--card-accent), transparent 85%);
}

.fm-stack-card h3 {
	margin: 0 0 0.35rem !important;
	font-size: 1.1875rem !important;
	color: var(--card-accent) !important;
}

.fm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
	padding: 0;
	list-style: none;
}

.fm-chips li {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--card-accent, var(--fm-violet));
	padding: 0.34rem 0.72rem;
	border-radius: 8px;
	border: 1px solid var(--card-accent-line, var(--fm-line));
	background: var(--card-accent-soft, var(--fm-tint));
	transition: transform 0.18s var(--fm-ease), box-shadow 0.18s var(--fm-ease);
}

.fm-chips li:hover {
	transform: translateY(-1px);
	box-shadow: var(--fm-shadow-sm);
}

/* Chips used outside a stack card (the About page) fall back to violet. */
.fm-content .fm-chips li {
	color: var(--fm-violet);
	border-color: var(--fm-code-border);
	background: var(--fm-code-bg);
}

/* ---------------------------------------------------------------
   9. Post cards
   --------------------------------------------------------------- */

.fm-posts .wp-block-post-template,
.fm-posts ul.wp-block-post-template {
	display: flex;
	flex-direction: column;
	gap: 1.25rem !important;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-posts .wp-block-post-template > li {
	display: flex;
	width: 100%;
	margin: 0;
}

.fm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: clamp(1.5rem, 3vw, 2.1rem);
	border-radius: var(--fm-radius);
	border: 1px solid var(--fm-line);
	background: var(--fm-card);
	box-shadow: var(--fm-shadow-sm);
	height: 100%;
	width: 100%;
	overflow: hidden;
	transition: transform 0.25s var(--fm-ease), border-color 0.25s var(--fm-ease), box-shadow 0.25s var(--fm-ease);
}

.fm-card > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* Always-on accent rail; it brightens on hover. */
.fm-card::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	background: var(--fm-grad-line);
	opacity: 0.75;
	transition: opacity 0.25s var(--fm-ease);
}

.fm-card:hover {
	transform: translateY(-3px);
	border-color: var(--fm-line-strong);
	box-shadow: var(--fm-shadow-md);
}

.fm-card:hover::before {
	opacity: 1;
}

.fm-card .wp-block-post-title {
	font-size: clamp(1.1875rem, 2.2vw, 1.5rem) !important;
	line-height: 1.25;
	margin: 0 !important;
}

.fm-card .wp-block-post-title a {
	color: var(--fm-ink) !important;
	text-decoration: none !important;
	transition: color 0.18s var(--fm-ease);
}

.fm-card .wp-block-post-title a:hover {
	color: var(--fm-violet) !important;
}

.fm-card .wp-block-post-date {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.78125rem !important;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fm-cyan) !important;
	margin: 0 !important;
}

.fm-card .wp-block-post-excerpt {
	margin: 0 !important;
}

.fm-card .wp-block-post-excerpt__excerpt {
	color: var(--fm-muted);
	font-size: 0.9375rem;
	line-height: 1.65;
	max-width: 68ch;
}

.fm-card .wp-block-post-excerpt__more-text {
	margin-top: 0.85rem;
}

.fm-card .wp-block-post-excerpt__more-link {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--fm-link) !important;
	text-decoration: none !important;
}

.fm-card .wp-block-post-excerpt__more-link:hover {
	text-decoration: underline !important;
}

/* Pagination */
.wp-block-query-pagination {
	margin-top: 3rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875rem;
}

.wp-block-query-pagination a {
	color: var(--fm-muted) !important;
}

.wp-block-query-pagination a:hover {
	color: var(--fm-violet) !important;
}

.wp-block-query-pagination-numbers .current {
	color: var(--fm-violet);
	font-weight: 700;
}

/* ---------------------------------------------------------------
   10. Single post / page content
   --------------------------------------------------------------- */

.fm-post-header {
	padding-top: clamp(3rem, 8vh, 5.5rem) !important;
	padding-bottom: clamp(1.5rem, 4vh, 2.5rem) !important;
}

.fm-post-header h1 {
	font-size: clamp(2rem, 5.2vw, 3.25rem) !important;
	line-height: 1.08;
	margin: 0.75rem 0 1rem !important;
}

.fm-post-meta {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fm-cyan);
}

.fm-post-meta a {
	color: var(--fm-cyan) !important;
}

.fm-post-meta a:hover {
	color: var(--fm-violet) !important;
}

.fm-content p,
.fm-content li {
	color: var(--fm-body);
}

.fm-content h2 {
	margin-top: 2.75rem !important;
}

.fm-content h3 {
	margin-top: 2rem !important;
}

.fm-content :where(img, .wp-block-image img) {
	border-radius: 14px;
	border: 1px solid var(--fm-line);
}

.fm-content code:not(.wp-block-code code) {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9em;
	background: var(--fm-code-bg);
	border: 1px solid var(--fm-code-border);
	border-radius: 6px;
	padding: 0.12em 0.4em;
	color: var(--fm-code-ink);
}

.fm-content .wp-block-code {
	overflow-x: auto;
	background: var(--fm-code-bg) !important;
	border-color: var(--fm-line) !important;
	color: var(--fm-ink) !important;
}

.fm-content .wp-block-quote {
	border-left: 3px solid var(--fm-violet);
}

.wp-block-separator {
	border-color: var(--fm-line) !important;
	color: var(--fm-line) !important;
}

/* ---------------------------------------------------------------
   11. Footer
   --------------------------------------------------------------- */

.fm-footer {
	border-top: 1px solid var(--fm-line);
	margin-top: clamp(4rem, 10vh, 7rem);
	background: var(--fm-tint);
}

.fm-footer a {
	color: var(--fm-muted) !important;
	text-decoration: none !important;
	font-size: 0.9375rem;
}

.fm-footer a:hover {
	color: var(--fm-violet) !important;
}

.fm-footer .fm-copy {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8125rem;
	color: var(--fm-muted);
}

/* ---------------------------------------------------------------
   12. Responsive
   --------------------------------------------------------------- */

@media (max-width: 781px) {
	.fm-section-label::after {
		display: none;
	}

	body::after {
		background-size: 40px 40px;
	}
}

/* The hamburger already carries navigation on small screens; the CTA pill
   next to it overflows the bar. The theme toggle stays. */
@media (max-width: 680px) {
	.fm-header .fm-btn-sm {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}

	.wp-block-button__link:hover,
	.fm-card:hover,
	.fm-chips li:hover,
	.fm-theme-toggle:hover {
		transform: none;
	}
}

/* Skip link */
.skip-link {
	position: absolute;
	left: -9999px;
}

.skip-link:focus {
	left: 1rem;
	top: 1rem;
	z-index: 100;
	background: var(--fm-card);
	color: var(--fm-ink);
	padding: 0.6rem 1rem;
	border-radius: 8px;
	box-shadow: var(--fm-shadow-md);
}
