/* Self-hosted Inter Variable — Latin subsets, weight axis 100–900 */

/* inter-latin-ext-wght-normal */
@font-face {
	font-family: 'Inter Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-wght-normal */
@font-face {
	font-family: 'Inter Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* inter-latin-ext-wght-italic */
@font-face {
	font-family: 'Inter Variable';
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-ext-wght-italic.woff2') format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* inter-latin-wght-italic */
@font-face {
	font-family: 'Inter Variable';
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url('/assets/fonts/inter/files/inter-latin-wght-italic.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Custom properties */
:root {
	--font-family-heading: 'Inter Variable', var(--pico-font-family-sans-serif);
	--content-max-width: 90%;
	--navbar-bg: rgb(255 255 255 / 85%);
}

@media (prefers-color-scheme: dark) {
	:root {
		--navbar-bg: rgb(19 23 31 / 85%);
	}
}

/* Anchor scroll offset for sticky header */
html {
	scroll-padding-top: 4rem;
}

/* Headings and UI elements use the self-hosted variable font */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-family-heading);
}

/* SVG icons/logos need explicit sizing — the global img rules would shrink them */
img[src$=".svg"] {
	width: 100%;
	height: auto;
	max-width: none;
}

video,
iframe {
	width: 100%;
	height: auto;
}

iframe {
	aspect-ratio: 16/9;
}

.visually-hidden:not(:focus, :active) {
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

#skip-link {
	text-decoration: none;
	background: var(--pico-background-color);
	color: var(--pico-color);
	padding: 0.5rem 1rem;
	border: 1px solid var(--pico-color);
	border-radius: var(--pico-border-radius);
}

#skip-link.visually-hidden:focus {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 999;
}

/* ===== Header ===== */

body > header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--navbar-bg);
	backdrop-filter: blur(8px);
	border-bottom: 1px dashed var(--pico-muted-border-color);
	padding: 0;
}

.header-inner {
	display: flex;
	gap: 1em;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	padding: 1em 1rem;
	max-width: var(--content-max-width);
	margin-inline: auto;
	font-size: clamp(1rem, 1.25vw, 1.5rem);
}

.home-link {
	font-family: var(--font-family-heading);
	font-size: 1em;
	font-weight: 700;
}

.home-link:link:not(:hover) {
	text-decoration: none;
}

.home-link .home-link__logo {
	display: block;
	width: auto;
	height: 2em;
	max-width: none;
}

.nav {
	display: flex;
	gap: 0.5em 1em;
	padding: 0;
	margin: 0;
	list-style: none;
}

.nav-item {
	display: inline-block;
}

.nav-item a[href]:not(:hover) {
	text-decoration: none;
}

.nav a[href][aria-current="page"] {
	text-decoration: underline;
}

.menu-link {
	font-family: var(--font-family-heading);
	font-weight: 700;
}

.menu-link:link:not(:hover) {
	text-decoration: none;
}

/* ===== Main content ===== */

body > main {
	max-width: var(--content-max-width);
	margin-inline: auto;
}

body > main :first-child {
	margin-top: 0;
}

/* ===== Post navigation ===== */

.links-nextprev {
	display: flex;
	justify-content: space-between;
	gap: 0.5em 1em;
	list-style: none;
	border-top: 1px dashed var(--pico-muted-border-color);
	padding: 1em 0;
}

.links-nextprev > * {
	flex-grow: 1;
}

.links-nextprev-next {
	text-align: right;
}

/* ===== Post list ===== */

.postlist {
	counter-reset: start-from var(--postlist-index);
	list-style: none;
	padding: 0;
	padding-left: 1.5rem;
}

.postlist-item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	counter-increment: start-from -1;
	margin-bottom: 1em;
}

.postlist-item::before {
	display: inline-block;
	pointer-events: none;
	content: "" counter(start-from, decimal-leading-zero) ". ";
	line-height: 100%;
	text-align: right;
	margin-left: -1.5rem;
}

.postlist-date,
.postlist-item::before {
	font-size: 0.8125em;
	color: var(--pico-color);
}

.postlist-date {
	word-spacing: -0.5px;
}

.postlist-link {
	font-size: 1.1875em;
	font-weight: 700;
	flex-basis: calc(100% - 1.5rem);
	padding-left: 0.25em;
	padding-right: 0.5em;
	text-underline-position: from-font;
	text-underline-offset: 0;
	text-decoration-thickness: 1px;
}

.postlist-item-active .postlist-link {
	font-weight: bold;
}

/* ===== Tags ===== */

.post-tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-transform: capitalize;
	font-style: italic;
}

.postlist-item > .post-tag {
	align-self: center;
}

.post-metadata {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5em;
	list-style: none;
	padding: 0;
	margin: 0;
}

.post-metadata time {
	margin-right: 1em;
}

/* ===== Blog roll ===== */

.blogroll {
	display: flex;
	flex-direction: column;
}

.blogroll-item {
	border-bottom: 1px dashed var(--pico-muted-border-color);
	padding-bottom: 1.5rem;
	margin-bottom: 1.5rem;
}

.blogroll-item:last-child {
	border-bottom: none;
}

.blogroll-text h2 {
	margin: 0 0 0.25rem;
	font-size: 1.1875em;
}

.blogroll-text h2 a[href]:not(:hover) {
	text-decoration: none;
}

.blogroll-meta {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin-bottom: 0.5rem;
}

.blogroll-excerpt {
	margin: 0.5rem 0 0;
	line-height: 1.5;
}

.blogroll-image {
	padding-bottom: 0;
	border-bottom: none;
	margin-left: -1rem;
	margin-right: -1rem;
	margin-bottom: 0;
}

.blogroll-image a {
	display: block;
}

.blogroll-image img {
	display: block;
	width: 100%;
	height: auto;
}

.blogroll-image .blogroll-meta {
	padding: 0.5rem 1rem 1.5rem;
	border-bottom: 1px dashed var(--pico-muted-border-color);
	margin-bottom: 1.5rem;
}

/* ===== Footer navigation ===== */

body > footer {
	padding: 0;
}

#site-nav {
	border-top: 1px dashed var(--pico-muted-border-color);
	margin-top: 2rem;
	min-height: 100dvh;
	font-size: clamp(1rem, 1.25vw, 1.5rem);
}

.site-nav-inner {
	padding: 1em 1rem;
	max-width: var(--content-max-width);
	margin-inline: auto;
}

.footer-nav-back {
	display: inline-block;
	font-family: var(--font-family-heading);
	font-size: 1.125em;
	font-weight: 700;
	margin-bottom: 1.5rem;
}

.footer-nav-back:link:not(:hover) {
	text-decoration: none;
}

/* 1 col on small Android */
.footer-nav-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-bottom: 1.5rem;
}

/* 2 cols from iPhone-sized screens */
@media (width >= 390px) {
	.footer-nav-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 3 cols from tablet (1440px) */
@media (width >= 1440px) {
	.footer-nav-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* 4 cols from laptop (2560px) */
@media (width >= 2560px) {
	.footer-nav-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* 5 cols from desktop (2880px) */
@media (width >= 2880px) {
	.footer-nav-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* 6 cols from ultrawide (3840px) */
@media (width >= 3840px) {
	.footer-nav-grid {
		grid-template-columns: repeat(6, 1fr);
	}
}

.footer-nav-section {
	margin-bottom: 0;
}

.footer-nav-section h2 {
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--pico-muted-color);
	margin: 0 0 0.5rem;
}

/* PicoCSS makes nav ul a flex row and adds ±0.5rem margins — restore vertical list layout */
.footer-nav-section ul {
	display: block;
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-nav-section ul:first-of-type,
.footer-nav-section ul:last-of-type {
	margin: 0;
}

.footer-nav-section li {
	display: block;
	padding: 0;
	margin-bottom: 0.25rem;
}

.footer-nav-section li a {
	display: inline;
	margin: 0;
	padding: 0;
}

.footer-brand {
	margin: 0 0 0.5rem;
}

.footer-brand .footer-logo {
	display: block;
	width: auto;
	height: 1.5rem;
	max-width: none;
	margin-bottom: 0.25rem;
}

.footer-brand__name {
	display: block;
	font-size: 1.25em;
	font-weight: 700;
}

.footer-supporter-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.footer-supporter-logo {
	display: block;
	height: 8rem;
	width: auto;
	max-width: 100%;
}

.footer-copyright__legal {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin: 0;
}

.footer-built-with {
	font-size: 0.8125em;
	color: var(--pico-muted-color);
	margin: 1.5rem 0 0;
}

/* ===== Landing page ===== */

.landing-main {
	max-width: none;
	padding: 2rem 0 0;
}

/* 1 column on mobile — full-width, no gap */
.landing {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

/* From tablet up: align block edges with the navbar content column */
@media (width >= 768px) {
	.landing {
		max-width: var(--content-max-width);
		margin-inline: auto;
		padding-inline: 1rem;
		gap: 2rem;
	}
}

/* 2 columns from tablet (1440px) */
@media (width >= 1440px) {
	.landing {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
	}
}

/* 3 columns at desktop (2880px) */
@media (width >= 2880px) {
	.landing {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* 4 columns at ultrawide (3840px) */
@media (width >= 3840px) {
	.landing {
		grid-template-columns: repeat(4, 1fr);
	}
}

.landing__block {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	min-height: 20rem;
	overflow: hidden;
	padding: 2rem;
	border-radius: 0;
}

@media (width >= 768px) {
	.landing__block {
		border-radius: 1rem;
	}
}

.landing__block h2 {
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	margin-bottom: 0.75rem;
}

.landing__block p,
.landing__block li {
	font-size: clamp(1.125rem, 2.5vw, 1.75rem);
	line-height: 1.4;
}

.landing__block--hero {
	align-items: center;
	background-color: var(--pico-background-color);
	text-align: center;
	min-height: 0;
	padding: 5rem 2rem;
	grid-column: 1 / -1;
}

@media (width >= 768px) {
	.landing__block--hero {
		padding: 5rem 2vw;
	}
}

.landing__block--hero h1 {
	font-size: clamp(2.5rem, 5vw, 5rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin-bottom: 1rem;
}

.landing__hero-subtitle {
	font-size: clamp(1.5rem, 3vw, 2.5rem);
	font-weight: 500;
	margin: 0;
}

.landing__block--bg-image {
	background-image:
		linear-gradient(rgb(0 0 0 / 55%), rgb(0 0 0 / 55%)),
		url("/assets/landing-block2-bg.jpg");
	background-size: cover;
	background-position: center;
	color: #fff;
}

.landing__block--bg-image h2,
.landing__block--bg-image ol,
.landing__block--bg-image li {
	color: #fff;
}

.landing__block--bg-color {
	--landing-accent: #00a600;

	background-color: var(--landing-accent);
	color: #fff;
}

.landing__block--bg-color h2,
.landing__block--bg-color h3 {
	color: #fff;
}

.landing__block--bg-color h3 {
	font-size: clamp(1.125rem, 2.5vw, 1.75rem);
	font-weight: 400;
	margin: 0.25rem 0;
}

.landing__block--card {
	border: 1px solid var(--pico-muted-border-color);
	box-shadow: var(--pico-card-box-shadow);
}

.landing__block--plain {
	min-height: 0;
}

.landing__block--plain h2 {
	font-size: clamp(2rem, 4vw, 4rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}
