/*
Theme Name: Neškudla
Theme URI: https://neskudla.cz/
Author: Jan Neškudla
Author URI: https://neskudla.cz/
Description: Vlastní tmavá bloková šablona pro neskudla.cz (směr „Terminál“).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.2.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: neskudla
*/

/* ---------- Základ ---------- */

:root {
	color-scheme: dark;
	--nk-outline: #343e4c;
	--nk-dot: #3a4350;
	--nk-text-soft: #c9cfd8;
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

.wp-site-blocks > *,
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

:where(section[id]) {
	scroll-margin-top: 24px;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

:where(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

/* ---------- Hlavička ---------- */

.nk-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.nk-header .wp-block-site-title {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0;
}

.nk-header .wp-block-site-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.nk-header .wp-block-site-title a::before {
	content: "~/";
	color: var(--wp--preset--color--accent);
}

.nk-header .wp-block-navigation a {
	text-decoration: none;
}

/* Přepínač světlý/tmavý režim */
.nk-theme-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--nk-outline);
	border-radius: 8px;
	background: transparent;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.nk-js .nk-theme-toggle {
	display: inline-flex;
}

.nk-theme-toggle:hover {
	color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}

.nk-theme-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* V tmavém režimu ukazuje slunce (přepne na světlý), ve světlém měsíc. */
.nk-theme-toggle .nk-icon-moon,
.nk-theme-toggle[data-current="light"] .nk-icon-sun {
	display: none;
}

.nk-theme-toggle[data-current="light"] .nk-icon-moon {
	display: block;
}

.nk-header .wp-block-button__link {
	padding: 0.625rem 1.125rem;
	min-height: 44px;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
}

/* ---------- Sekce ---------- */

.nk-section {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--70);
}

.nk-section--alt {
	background: var(--wp--preset--color--base-2);
}

.nk-hero {
	padding-top: clamp(4rem, 10vw, 7.5rem);
	padding-bottom: clamp(4rem, 9vw, 7rem);
}

.nk-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9375rem;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.75rem !important;
}

.nk-kicker + .wp-block-heading {
	margin-top: 0 !important;
}

.nk-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.35;
}

.nk-muted {
	color: var(--wp--preset--color--muted);
	max-width: 34rem;
}

.nk-section .wp-block-columns {
	gap: clamp(2.5rem, 6vw, 4rem);
}

.nk-section .wp-block-columns:has(> .nk-card) {
	gap: 20px;
}

/* ---------- Tlačítka ---------- */

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--nk-outline);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
	background: transparent;
}

/* ---------- Kódová karta ---------- */

.nk-code {
	margin: 0;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	overflow: hidden;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9375rem;
	line-height: 1.9;
}

.nk-code__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--subtle);
	font-size: 0.8125rem;
}

.nk-code__bar i {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--nk-dot);
}

/* Barevná kolečka okna jako v macOS: zavřít, minimalizovat, maximalizovat. */
.nk-code__bar i:nth-of-type(1) { background: #FF5F57; }
.nk-code__bar i:nth-of-type(2) { background: #FEBC2E; }
.nk-code__bar i:nth-of-type(3) { background: #28C840; }

.nk-code__bar span {
	margin-left: 12px;
}

.nk-code pre {
	margin: 0;
	padding: 24px 28px;
	white-space: pre-wrap;
	color: var(--wp--preset--color--contrast);
	font: inherit;
}

.nk-code .k { color: var(--wp--preset--color--accent-2); }
.nk-code .s { color: var(--wp--preset--color--accent); }
.nk-code .b { color: var(--wp--preset--color--accent-3); }

/* ---------- Karty ---------- */

.nk-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 2rem;
}

.nk-card > * + * {
	margin-top: 0.75rem !important;
}

.nk-card .wp-block-heading {
	font-size: 1.5rem;
}

.nk-card p:not(.nk-num) {
	color: var(--wp--preset--color--muted);
}

.nk-num {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9375rem;
	color: var(--wp--preset--color--accent);
}

/* ---------- O mně ---------- */

.nk-avatar img {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--wp--preset--color--border);
}

.nk-about p:not(.nk-kicker) {
	color: var(--nk-text-soft);
	max-width: 40rem;
}

/* ---------- Kontakt ---------- */

.nk-contact .wp-block-columns {
	align-items: flex-end;
}

.nk-contact h2 {
	font-size: clamp(2.5rem, 6vw, 4rem);
	line-height: 1;
	letter-spacing: -0.03em;
}

.nk-email {
	font-size: 1.75rem;
	font-weight: 500;
}

.nk-email a {
	text-underline-offset: 6px;
}

.nk-billing {
	font-size: 1rem;
	color: var(--wp--preset--color--muted);
}

.nk-billing > * + * {
	margin-top: 0.375rem !important;
}

.nk-billing strong {
	display: inline-block;
	min-width: 4.5rem;
	color: var(--wp--preset--color--subtle);
	font-weight: 400;
}

.nk-billing .nk-note {
	margin-top: 1rem !important;
	font-size: 0.875rem;
}

/* ---------- Patička ---------- */

.nk-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: 0.9375rem;
	color: var(--wp--preset--color--subtle);
}

.nk-footer a {
	color: var(--wp--preset--color--muted);
}

.nk-footer a:hover {
	color: var(--wp--preset--color--contrast);
}

.nk-footer .nk-social {
	gap: 1rem;
}

.nk-footer .nk-social .wp-social-link {
	color: var(--wp--preset--color--muted);
	transition: color 0.15s ease;
}

.nk-footer .nk-social .wp-social-link:hover,
.nk-footer .nk-social .wp-social-link:focus-within {
	color: var(--wp--preset--color--accent);
}

.nk-footer .nk-social .wp-social-link a {
	padding: 10px;
	margin: -10px;
}

.nk-footer .nk-social svg {
	width: 22px;
	height: 22px;
}

/* ---------- Obsahové stránky ---------- */

.nk-content {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--70);
}

.nk-content .nk-muted {
	max-width: 760px;
}
