/**
 * Dock base styles.
 *
 * Minimal element defaults plus a small set of reusable classes.
 * Everything uses tokens from variables.css. Add a class only when it will be
 * reused; never style one element in isolation.
 *
 * Sections:
 *   1. Elements
 *   2. Accessibility
 *   3. Layout classes (.container, .flow, .cluster)
 *   4. Site regions
 *   5. Content and WordPress core classes
 *   6. Reduced motion
 *
 * @package Dock
 * @since   1.0.0
 */

/* =============================================================================
 * 1. Elements
 * ========================================================================== */

body {
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--font-size-base);
	line-height: var(--line-height-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block-start: 0;
	font-family: var(--font-heading);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p,
ul,
ol,
dl,
figure,
blockquote,
pre {
	margin-block-start: 0;
}

a {
	color: var(--color-link);
	text-underline-offset: var(--underline-offset);
}

a:hover {
	color: var(--color-link-hover);
}

code,
kbd,
pre,
samp {
	font-family: var(--font-mono);
	font-size: var(--font-size-sm);
}

pre {
	overflow-x: auto;
	padding: var(--space-sm);
	background-color: var(--color-surface);
	border-radius: var(--radius-sm);
}

blockquote {
	margin-inline: 0;
	padding-inline-start: var(--space-md);
	border-inline-start: var(--border-width-thick) solid var(--color-border);
}

hr {
	border: 0;
	border-block-start: var(--border-width) solid var(--color-border);
}

img,
video {
	height: auto;
}

input,
select,
textarea {
	padding: var(--space-2xs) var(--space-xs);
	border: var(--border-width) solid var(--color-input-border);
	border-radius: var(--radius-sm);
	background-color: var(--color-bg);
	color: var(--color-text);
}

button,
input[type="submit"],
input[type="button"] {
	padding: var(--space-2xs) var(--space-sm);
	border: var(--border-width) solid var(--color-link);
	border-radius: var(--radius-sm);
	background-color: var(--color-link);
	color: var(--color-on-link);
	cursor: pointer;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
	background-color: var(--color-link-hover);
	border-color: var(--color-link-hover);
}

/* =============================================================================
 * 2. Accessibility
 * ========================================================================== */

/* Visible focus for keyboard users on every interactive element. */
:focus-visible {
	outline: var(--focus-width) solid var(--color-focus);
	outline-offset: var(--focus-offset);
}

/* <main> receives focus from the skip link; no ring needed on a landmark. */
.site-main:focus {
	outline: none;
}

/* Hide visually, keep available to screen readers (WordPress core class).
 * The 0.1rem values are the standard 1px clip pattern, not design sizes. */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 0.1rem;
	margin: -0.1rem;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 0.1rem;
	word-wrap: normal !important;
}

/* Reveal when focused (skip link and similar). */
.screen-reader-text:focus {
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	z-index: 100000;
	inset-block-start: var(--space-2xs);
	inset-inline-start: var(--space-2xs);
	padding: var(--space-xs) var(--space-sm);
	background-color: var(--color-bg);
	color: var(--color-link);
	font-size: var(--font-size-sm);
	font-weight: var(--font-weight-bold);
	text-decoration: none;
	border-radius: var(--radius-sm);
	box-shadow: 0 0 0 var(--focus-width) var(--color-focus);
}

/* =============================================================================
 * 3. Layout classes
 * ========================================================================== */

/* Centered, padded content column. */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Vertical rhythm: space between siblings. Override per use with --flow-space. */
.flow > * + * {
	margin-block-start: var(--flow-space);
}

/* Horizontal group that wraps: menus, meta, header rows. */
.cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs) var(--space-md);
}

/* =============================================================================
 * 4. Site regions
 * ========================================================================== */

.site-header,
.site-footer {
	padding-block: var(--space-md);
}

.site-header {
	border-block-end: var(--border-width) solid var(--color-border);
}

.site-footer {
	border-block-start: var(--border-width) solid var(--color-border);
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}

.site-header__inner,
.site-footer__inner {
	justify-content: space-between;
}

.site-title {
	margin: 0;
	font-size: var(--font-size-lg);
	font-weight: var(--font-weight-bold);
	line-height: var(--line-height-tight);
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-main {
	padding-block: var(--space-xl);
}

/* Menus: wp_nav_menu() output with menu_class "menu cluster". */
.menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.menu a {
	text-decoration: none;
}

.menu a:hover,
.menu .current-menu-item > a {
	text-decoration: underline;
}

.site-footer__copy {
	margin: 0;
}

/* =============================================================================
 * 5. Content and WordPress core classes
 * ========================================================================== */

/* Readable line length for long-form content. */
.entry-content > *:not(.alignwide):not(.alignfull) {
	max-width: var(--measure);
	margin-inline: auto;
}

.entry-content > .alignwide {
	max-width: var(--container-wide);
	margin-inline: auto;
}

.entry-header,
.page-header {
	max-width: var(--measure);
	margin-inline: auto;
}

.entry-title a {
	color: inherit;
	text-decoration: none;
}

.entry-title a:hover {
	text-decoration: underline;
}

.entry-meta {
	margin: 0;
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}

.entry-thumbnail img {
	width: 100%;
}

/* Spacing between posts in lists. */
.flow > .entry + .entry {
	--flow-space: var(--space-xl);
}

/* Pagination and post navigation (core markup). */
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs) var(--space-md);
	justify-content: space-between;
	max-width: var(--measure);
	margin-inline: auto;
	margin-block-start: var(--space-xl);
}

/* Core alignment classes. */
.alignleft {
	float: inline-start;
	margin-inline-end: var(--space-md);
}

.alignright {
	float: inline-end;
	margin-inline-start: var(--space-md);
}

.aligncenter {
	margin-inline: auto;
}

.alignfull {
	width: 100%;
	max-width: none;
}

/* Captions (classic and block). */
.wp-caption,
.wp-element-caption,
figcaption {
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
	margin-block-start: var(--space-2xs);
}

/* =============================================================================
 * 6. Reduced motion
 * ========================================================================== */

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