/*
Theme Name: FredNH
Theme URI: https://www.frednh.fr
Author: FredNH
Description: Theme block sombre et sobre pour le blog personnel frednh.fr.
Version: 0.1.2
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: frednh
*/

:root {
	--frednh-header-height: 6rem;
	--frednh-header-height-compact: 4.25rem;
}

html {
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	padding-top: var(--frednh-header-height);
	overflow-x: hidden;
}

a {
	text-underline-offset: 0.22em;
	text-decoration-thickness: 0.08em;
}

a:hover,
a:focus-visible {
	text-decoration-thickness: 0.14em;
}

:where(.wp-site-blocks) {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

:where(main) {
	flex: 1;
}

.wp-site-blocks > header.wp-block-template-part {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 20;
}

.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.frednh-site-header {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--background) 92%, transparent);
	backdrop-filter: blur(18px);
	transition: padding 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.frednh-site-header .wp-block-site-title {
	letter-spacing: 0;
}

.frednh-site-header .wp-block-site-title a {
	text-decoration: none;
}

.frednh-site-header .wp-block-navigation__submenu-container {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 12%, transparent);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.frednh-site-header .wp-block-navigation-item__content {
	border-radius: 6px;
}

.frednh-site-header .wp-block-navigation-item__content:hover,
.frednh-site-header .wp-block-navigation-item__content:focus-visible,
.frednh-site-header .current-menu-item > .wp-block-navigation-item__content,
.frednh-site-header .current-menu-ancestor > .wp-block-navigation-item__content,
.frednh-site-header .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}

.frednh-header-search {
	flex: 0 1 13rem;
	min-width: 11rem;
	max-width: 15rem;
}

.frednh-header-search .wp-block-search__inside-wrapper {
	gap: 0.35rem;
}

.frednh-header-search .wp-block-search__input {
	min-height: 2.35rem;
	padding: 0.35rem 0.55rem;
	font-size: var(--wp--preset--font-size--small);
}

.frednh-header-search .wp-block-search__button {
	min-width: 2.35rem;
	min-height: 2.35rem;
	padding: 0.4rem;
}

.frednh-header-inner {
	min-height: var(--frednh-header-height);
	transition: min-height 180ms ease;
}

.is-scrolled .frednh-site-header {
	box-shadow: 0 18px 50px color-mix(in srgb, var(--wp--preset--color--background) 70%, transparent);
}

.is-scrolled .frednh-header-inner {
	min-height: var(--frednh-header-height-compact);
}

.frednh-mark {
	display: inline-flex;
	width: 2.6rem;
	height: 2.6rem;
	align-items: center;
	justify-content: center;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent);
	border-radius: 999px;
	background:
		radial-gradient(circle at 68% 30%, color-mix(in srgb, var(--wp--preset--color--accent-2) 70%, transparent), transparent 34%),
		linear-gradient(135deg, color-mix(in srgb, var(--wp--preset--color--accent) 34%, transparent), transparent);
	color: var(--wp--preset--color--foreground);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.frednh-post-card {
	padding: var(--wp--preset--spacing--50);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 78%, transparent);
	transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.frednh-post-list .wp-block-post-template {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

.frednh-post-card:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--accent) 38%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--surface) 92%, transparent);
	transform: translateY(-1px);
}

.frednh-post-card .wp-block-post-featured-image {
	margin-bottom: var(--wp--preset--spacing--40);
	overflow: hidden;
}

.frednh-post-card .wp-block-post-featured-image img {
	display: block;
	transition: transform 220ms ease;
}

.frednh-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.015);
}

.frednh-post-card .wp-block-post-title a {
	text-decoration: none;
}

.frednh-post-card .wp-block-post-title a:hover,
.frednh-post-card .wp-block-post-title a:focus-visible {
	color: var(--wp--preset--color--accent);
}

.frednh-post-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.frednh-post-meta a {
	color: var(--wp--preset--color--muted);
}

.frednh-surface {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 88%, transparent);
}

.frednh-page-heading {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	padding-bottom: var(--wp--preset--spacing--50);
}

.frednh-page-heading.frednh-surface {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
}

.frednh-article-header {
	padding-bottom: var(--wp--preset--spacing--40);
}

.frednh-post-content {
	color: color-mix(in srgb, var(--wp--preset--color--foreground) 92%, var(--wp--preset--color--muted));
}

.frednh-post-content :where(p, li) {
	max-width: 68ch;
}

.frednh-post-content :where(h2, h3, h4) {
	margin-top: var(--wp--preset--spacing--60);
}

.frednh-post-content :where(blockquote) {
	border-left: 4px solid var(--wp--preset--color--accent);
	margin-left: 0;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
	background: color-mix(in srgb, var(--wp--preset--color--surface) 70%, transparent);
	color: var(--wp--preset--color--foreground);
}

.frednh-post-content :where(code) {
	border-radius: 4px;
	background: color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	padding: 0.12em 0.35em;
	font-size: 0.92em;
}

.frednh-post-content :where(pre) {
	overflow-x: auto;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	border-radius: 8px;
	background: #111317;
	padding: var(--wp--preset--spacing--40);
}

.frednh-post-content :where(pre code) {
	background: transparent;
	padding: 0;
}

.frednh-post-content :where(table) {
	border-collapse: collapse;
	width: 100%;
}

.frednh-post-content :where(th, td) {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 14%, transparent);
	padding: 0.65rem 0.75rem;
	text-align: left;
}

.frednh-post-content :where(figcaption) {
	margin-top: var(--wp--preset--spacing--20);
}

.frednh-article-footer {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
}

.frednh-post-nav {
	align-items: stretch;
	gap: var(--wp--preset--spacing--30);
}

.frednh-post-nav-link {
	flex: 1 1 18rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	border-radius: 8px;
	padding: var(--wp--preset--spacing--40);
	background: color-mix(in srgb, var(--wp--preset--color--surface) 76%, transparent);
}

.frednh-post-nav-link a {
	text-decoration: none;
}

.frednh-related {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
}

.frednh-related-list .wp-block-post-template {
	gap: var(--wp--preset--spacing--40);
}

.frednh-archives-aside {
	position: sticky;
	top: calc(var(--frednh-header-height-compact) + var(--wp--preset--spacing--50));
}

.frednh-archives-aside .wp-block-categories {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.frednh-archives-aside .wp-block-categories ul {
	margin-top: var(--wp--preset--spacing--20);
}

.wp-block-query-pagination {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--foreground) 10%, transparent);
	padding-top: var(--wp--preset--spacing--50);
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	border-radius: 6px;
	padding: 0.35rem 0.65rem;
}

.wp-block-query-pagination .current {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
}

.wp-block-search__input {
	border-color: color-mix(in srgb, var(--wp--preset--color--foreground) 18%, transparent);
	border-radius: 6px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--foreground);
}

.wp-block-search__button,
.wp-block-button__link {
	border-radius: 6px;
}

.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
}

.frednh-footer-grid {
	align-items: start;
	gap: var(--wp--preset--spacing--50);
}

.frednh-footer-links h3 {
	color: var(--wp--preset--color--foreground);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.frednh-footer-links ul {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	margin: 0;
	padding: 0;
	list-style: none;
}

.frednh-footer-links a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.frednh-footer-links a:hover,
.frednh-footer-links a:focus-visible {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}

.frednh-back-to-top {
	position: fixed;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	z-index: 18;
	display: inline-flex;
	width: 2.5rem;
	height: 2.5rem;
	align-items: center;
	justify-content: center;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 42%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 92%, transparent);
	color: var(--wp--preset--color--foreground);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
	text-decoration: none;
}

.frednh-back-to-top:hover,
.frednh-back-to-top:focus-visible {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
	text-decoration: none;
}

@media (max-width: 720px) {
	:root {
		--frednh-header-height: 8.25rem;
		--frednh-header-height-compact: 7rem;
	}

	.frednh-mark {
		width: 2.25rem;
		height: 2.25rem;
	}

	.frednh-header-inner {
		gap: var(--wp--preset--spacing--30);
	}

	.frednh-header-search {
		flex-basis: 100%;
		max-width: none;
		order: 3;
	}

	.frednh-site-header .wp-block-site-tagline {
		display: none;
	}

	.frednh-post-card {
		padding: var(--wp--preset--spacing--40);
	}

	.frednh-page-heading.frednh-surface {
		padding: var(--wp--preset--spacing--40) !important;
	}

	.frednh-archives-aside {
		position: static;
	}

	.wp-block-search {
		display: flex;
		flex-direction: column;
	}

	.frednh-back-to-top {
		right: var(--wp--preset--spacing--30);
		bottom: var(--wp--preset--spacing--30);
	}
}
