/*
Theme Name:        Dr. Hacker 2026
Theme URI:         https://dr-hacker.at
Author:            mkln.io
Author URI:        https://mkln.io
Description:       Block-Theme (Full Site Editing) für den Relaunch 2026 von dr-hacker.at. Design: Lukas Diemling.
Version:           0.1.0
Requires at least: 6.8
Tested up to:      7.1
Requires PHP:      8.2
License:           GNU General Public License v3.0 or later
License URI:       https://www.gnu.org/licenses/gpl-3.0.html
Text Domain:       dr-hacker-2026
Update URI:        false
*/

/* Global base styles. Block-specific styles live in assets/css/blocks and load only when the block is used. */

:root {
	--dh-focus: 2px solid var(--wp--preset--color--ink);
	--dh-ease: var(--wp--custom--transition);
}

html {
	scroll-padding-top: calc(var(--wp--custom--header-height) + 1rem);
	-webkit-text-size-adjust: 100%;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-optical-sizing: auto;
}

img,
video {
	max-width: 100%;
	height: auto;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--dh-focus);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--nude);
	color: var(--wp--preset--color--ink);
}

/* Skip link (WordPress adds it for block themes; this makes it visible on focus). */
.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	clip-path: none;
	height: auto;
	width: auto;
	padding: 1rem 1.25rem;
	z-index: 100000;
	font-size: 1rem;
	outline: var(--dh-focus);
}

/* Utility: caps label (Figma "Cap"), min. 14px for readability. */
.is-style-caps,
.has-caps-font-size {
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1.2;
}

/* Display type (Figma D/H1-D/H3): leading 1.0; the H3 size (36-64px) uses 1.2 on mobile (Figma M/H3). */
.has-huge-font-size,
.has-xx-large-font-size,
.has-x-large-font-size,
.wp-block-post-title {
	line-height: 1 !important;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 300;
}

@media (max-width: 781px) {
	.has-x-large-font-size,
	.wp-block-post-title:not(.dh-card__title) {
		line-height: 1.2 !important;
	}
}

.has-large-font-size,
.has-medium-font-size {
	line-height: 1.2;
}

.is-style-uppercase {
	text-transform: uppercase;
}

.is-style-display-italic,
.is-style-display-italic-underline {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 300;
}

.is-style-display-italic-underline {
	text-decoration: underline;
	text-decoration-thickness: 0.04em;
	text-underline-offset: 0.12em;
}

/* Long German compounds: break only where the editor put a soft hyphen (&shy;).
   Automatic hyphenation of display type looks broken ("BE-WUSST"); on very
   small screens we allow it for running headings only. */
:where(h1, h2, h3, h4) {
	overflow-wrap: break-word;
	hyphens: manual;
}

@media (max-width: 480px) {
	/* Only running article headings; display/section headings keep whole words. */
	:where(.dh-content--article, .dh-content--treatment) > :is(h2, h3),
	.dh-card__title {
		hyphens: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
