/**
 * Base — reset, document defaults, typography and accessibility utilities.
 *
 * @package FlorenStyle
 */

/* -------------------------------------------------------------------------
 * 1. Reset
 * ---------------------------------------------------------------------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Offset in-page anchors so the fixed header never covers the target. */
	scroll-padding-top: calc(var(--fs-header-height) + var(--fs-space-l));
}

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

body {
	background-color: var(--fs-surface);
	color: var(--fs-text);
	font-family: var(--fs-font-body);
	font-size: var(--fs-step-0);
	font-weight: var(--fs-weight-regular);
	line-height: var(--fs-leading-body);
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-kerning: normal;
	overflow-x: hidden;
}

/* Locks scrolling behind the mobile navigation overlay. */
body.fs-no-scroll {
	overflow: hidden;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

img {
	/* Keeps a neutral field while lazy images decode, avoiding a white flash. */
	background-color: var(--fs-stone);
	font-style: italic;  /* Styles the alt text if an image fails to load. */
}

.fs-invert img {
	background-color: rgba(255, 255, 255, 0.06);
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	background: none;
	border: 0;
	cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
figcaption,
dd,
dt {
	overflow-wrap: break-word;
}

ul,
ol {
	padding: 0;
}

table {
	border-collapse: collapse;
	width: 100%;
}

hr {
	border: 0;
	border-top: var(--fs-hairline-width) solid var(--fs-border);
	margin-block: var(--fs-space-xl);
}

iframe {
	max-width: 100%;
	border: 0;
}

/* -------------------------------------------------------------------------
 * 2. Typography
 * ---------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6,
.fs-display,
.fs-title {
	font-family: var(--fs-font-display);
	font-weight: var(--fs-weight-light);
	line-height: var(--fs-leading-display);
	letter-spacing: var(--fs-tracking-title);
	color: var(--fs-text);
	text-wrap: balance;
}

h1 {
	font-size: var(--fs-step-5);
	line-height: var(--fs-leading-tight);
	letter-spacing: var(--fs-tracking-display);
}

h2 {
	font-size: var(--fs-step-4);
	line-height: var(--fs-leading-tight);
}

h3 {
	font-size: var(--fs-step-3);
}

h4 {
	font-size: var(--fs-step-2);
	font-weight: var(--fs-weight-regular);
}

h5 {
	font-size: var(--fs-step-1);
	font-weight: var(--fs-weight-medium);
}

h6 {
	font-size: var(--fs-step-0);
	font-weight: var(--fs-weight-medium);
	letter-spacing: var(--fs-tracking-eyebrow);
	text-transform: uppercase;
}

p {
	text-wrap: pretty;
}

p + p {
	margin-top: var(--fs-space-m);
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.28em;
	transition: color var(--fs-duration-fast) var(--fs-ease);
}

a:hover {
	color: var(--fs-accent);
}

strong,
b {
	font-weight: var(--fs-weight-bold);
}

em,
i {
	font-style: italic;
}

small {
	font-size: var(--fs-step--1);
}

blockquote {
	font-family: var(--fs-font-display);
	font-size: var(--fs-step-2);
	font-weight: var(--fs-weight-light);
	line-height: var(--fs-leading-snug);
	letter-spacing: var(--fs-tracking-title);
	border-left: 2px solid var(--fs-accent);
	padding-left: var(--fs-space-l);
	margin-block: var(--fs-space-xl);
}

blockquote cite {
	display: block;
	margin-top: var(--fs-space-m);
	font-family: var(--fs-font-body);
	font-size: var(--fs-step--1);
	font-style: normal;
	font-weight: var(--fs-weight-regular);
	letter-spacing: var(--fs-tracking-eyebrow);
	text-transform: uppercase;
	color: var(--fs-text-muted);
}

code,
kbd,
samp,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

pre {
	overflow-x: auto;
	padding: var(--fs-space-m);
	background-color: var(--fs-surface-alt);
	border: var(--fs-hairline-width) solid var(--fs-border);
}

::selection {
	background-color: var(--fs-accent);
	color: var(--fs-white);
}

/* -------------------------------------------------------------------------
 * 3. Type utilities
 * ---------------------------------------------------------------------- */

/*
 * The eyebrow — a small, widely tracked label that sits above a title.
 * It is the connective tissue of the whole editorial system.
 */
.fs-eyebrow {
	display: block;
	font-family: var(--fs-font-body);
	font-size: var(--fs-step--1);
	font-weight: var(--fs-weight-bold);
	letter-spacing: var(--fs-tracking-eyebrow);
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--fs-text-muted);
	margin-bottom: var(--fs-space-m);
}

.fs-eyebrow--accent {
	color: var(--fs-accent);
}

/* An eyebrow preceded by a short rule, used to open major sections. */
/*
 * The rule aligns to the first line rather than to the block's centre, so a
 * label that wraps on a narrow screen still reads as one unit.
 */
.fs-eyebrow--ruled {
	display: flex;
	align-items: flex-start;
	gap: var(--fs-space-s);
}

.fs-eyebrow--ruled::before {
	content: "";
	display: block;
	inline-size: clamp(2rem, 4vw, 3.5rem);
	block-size: 1px;
	margin-block-start: 0.62em;
	background-color: currentColor;
	flex: none;
	opacity: 0.55;
}

.fs-lede {
	font-size: var(--fs-step-1);
	font-weight: var(--fs-weight-light);
	line-height: var(--fs-leading-snug);
	color: var(--fs-text);
	max-width: var(--fs-measure-narrow);
}

.fs-prose {
	max-width: var(--fs-measure);
	color: var(--fs-text-muted);
}

.fs-prose > * + * {
	margin-top: var(--fs-space-m);
}

.fs-measure-narrow {
	max-width: var(--fs-measure-narrow);
}

.fs-text-center {
	text-align: center;
}

.fs-text-center .fs-lede,
.fs-text-center .fs-prose {
	margin-inline: auto;
}

.fs-text-center .fs-eyebrow--ruled {
	justify-content: center;
}

/* An accented word inside a display heading. */
.fs-accent-word {
	color: var(--fs-accent);
}

/* Italic serif emphasis, used sparingly for editorial voice. */
.fs-emphasis {
	font-family: var(--fs-font-display);
	font-style: italic;
	font-weight: var(--fs-weight-regular);
}

/* -------------------------------------------------------------------------
 * 4. Accessibility
 * ---------------------------------------------------------------------- */

/*
 * Visually hidden but available to assistive technology.
 * Matches the WordPress core .screen-reader-text contract.
 */
.screen-reader-text,
.fs-visually-hidden {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus,
.fs-visually-hidden:focus {
	background-color: var(--fs-white);
	clip: auto !important;
	clip-path: none;
	color: var(--fs-black);
	display: block;
	font-size: var(--fs-step--1);
	font-weight: var(--fs-weight-bold);
	height: auto;
	left: var(--fs-space-s);
	line-height: normal;
	padding: var(--fs-space-s) var(--fs-space-m);
	text-decoration: none;
	top: var(--fs-space-s);
	width: auto;
	z-index: var(--fs-z-skiplink);
	box-shadow: var(--fs-shadow-lift);
	outline: 2px solid var(--fs-accent);
	outline-offset: 2px;
}

/*
 * Focus is shown for keyboard users only. :focus-visible keeps the ring off
 * mouse interactions without ever removing it from keyboard navigation.
 */
:focus-visible {
	outline: 2px solid var(--fs-focus);
	outline-offset: 3px;
	border-radius: var(--fs-radius-subtle);
}

:focus:not(:focus-visible) {
	outline: none;
}

.fs-skip-link {
	position: absolute;
	top: 0;
	left: 0;
}

/* -------------------------------------------------------------------------
 * 5. WordPress core alignment and caption classes
 * ---------------------------------------------------------------------- */

.alignleft {
	float: left;
	margin: var(--fs-space-2xs) var(--fs-space-l) var(--fs-space-m) 0;
}

.alignright {
	float: right;
	margin: var(--fs-space-2xs) 0 var(--fs-space-m) var(--fs-space-l);
}

.aligncenter {
	display: block;
	margin-inline: auto;
	margin-block: var(--fs-space-l);
}

.alignwide,
.alignfull {
	margin-block: var(--fs-space-xl);
}

.alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
figcaption {
	font-size: var(--fs-step--1);
	line-height: var(--fs-leading-snug);
	color: var(--fs-text-muted);
	margin-top: var(--fs-space-s);
	letter-spacing: 0.02em;
}

.sticky .fs-entry-title::after {
	content: "";
	display: inline-block;
	inline-size: 0.4em;
	block-size: 0.4em;
	margin-left: 0.4em;
	background-color: var(--fs-accent);
	border-radius: 50%;
	vertical-align: middle;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: var(--fs-space-m);
	margin-block: var(--fs-space-xl);
}

.gallery-caption {
	font-size: var(--fs-step--2);
	color: var(--fs-text-muted);
}

.bypostauthor > .comment-body {
	border-left: 2px solid var(--fs-accent);
	padding-left: var(--fs-space-m);
}

/* -------------------------------------------------------------------------
 * 6. Print
 * ---------------------------------------------------------------------- */

@media print {
	.fs-header,
	.fs-footer,
	.fs-nav-toggle,
	.fs-cta,
	.fs-back-to-top,
	.fs-skip-link {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		word-break: break-all;
	}
}
