/*
 * Frau Masche: component styles.
 * Tokens come from theme.json (var(--wp--preset--...)). Spacing steps used here:
 * 0.5 / 0.75 / 1 / 1.5 / 2 / 3 / 4 / 6 rem.
 *
 * Signature element: the "Banderole", styled after the paper label around a ball of yarn
 * (dashed stitch line, label facts). Everything else stays quiet.
 */

:root {
	--fm-petrol: var(--wp--preset--color--petrol);
	--fm-petrol-dark: var(--wp--preset--color--petrol-dark);
	--fm-ink: var(--wp--preset--color--ink);
	--fm-muted: var(--wp--preset--color--muted);
	--fm-paper: var(--wp--preset--color--paper);
	--fm-white: var(--wp--preset--color--white);
	--fm-line: var(--wp--preset--color--line);
	--fm-senf: var(--wp--preset--color--senf);
	--fm-senf-soft: var(--wp--preset--color--senf-soft);
	--fm-rosa-soft: var(--wp--preset--color--rosa-soft);
	--fm-display: var(--wp--preset--font-family--display);
	--fm-radius-s: 6px;
	--fm-radius: 14px;
	--fm-radius-l: 20px;
	--fm-stitch: 1.5px dashed rgba(10, 51, 55, 0.42);
}

/* ---------- Base ---------- */

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-variant-numeric: lining-nums;
}

:where(a, button, input, summary):focus-visible {
	outline: 3px solid var(--fm-senf);
	outline-offset: 3px;
	border-radius: 4px;
}

.fm-main {
	padding-top: 2rem;
	padding-bottom: 6rem;
}

.fm-section-title {
	margin-top: 0;
	margin-bottom: 1.5rem;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid var(--fm-petrol);
	color: var(--fm-petrol);
	background: transparent;
	padding-top: calc(0.8rem - 2px);
	padding-bottom: calc(0.8rem - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--fm-petrol);
	color: var(--fm-white);
}

/* ---------- Header ---------- */

.fm-header {
	padding-top: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--fm-line);
	background: var(--fm-paper);
}

.fm-header__bar {
	gap: 1.5rem;
}

.fm-logo {
	display: inline-flex;
	line-height: 0;
	flex-shrink: 0;
}

.fm-logo img {
	height: 44px;
	width: auto;
}

.fm-header__nav {
	gap: 1.5rem;
}

.fm-header .wp-block-navigation a {
	text-decoration: none;
	color: var(--fm-ink);
}

.fm-header .wp-block-navigation a:hover {
	color: var(--fm-petrol);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

.fm-header__search .wp-block-search__button {
	background: transparent;
	color: var(--fm-petrol);
	padding: 0.5rem;
	border: 0;
}

.fm-header__search .wp-block-search__button svg {
	width: 26px;
	height: 26px;
}

@media (max-width: 781px) {
	.fm-logo img {
		height: 34px;
	}
}

/* ---------- Hero ---------- */

.fm-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: 4rem;
	align-items: center;
	padding-top: 0.5rem;
	padding-bottom: 4rem;
}

.fm-hero__title {
	font-size: clamp(2.5rem, 5.6vw, 4.5rem);
	line-height: 1.02;
	letter-spacing: -0.03em;
	margin: 0;
	max-width: 13ch;
}

.fm-hero__lead {
	font-size: clamp(1.1875rem, 1.6vw, 1.375rem);
	line-height: 1.55;
	color: var(--fm-muted);
	max-width: 34rem;
	margin-top: 1.5rem;
}

.fm-hero__actions {
	margin-top: 2rem;
	gap: 0.75rem;
}

.fm-hero__media {
	position: relative;
	padding-bottom: 2rem;
}

.fm-hero__img {
	margin: 0;
}

.fm-hero__img img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--fm-radius-l);
	display: block;
}

@media (max-width: 900px) {
	.fm-hero {
		grid-template-columns: 1fr;
		gap: 2.5rem;
		padding-top: 1rem;
	}

	.fm-hero__media {
		max-width: 30rem;
	}

	.fm-hero__img img {
		aspect-ratio: 4 / 3;
	}
}

/* ---------- Band: the yarn label ---------- */

.fm-band,
.fm-banderole {
	position: relative;
	background: var(--fm-senf);
	color: var(--fm-ink);
	border-radius: var(--fm-radius-s);
	padding: 1.25rem 1.5rem;
}

.fm-band::before,
.fm-banderole::before {
	content: "";
	position: absolute;
	inset: 6px;
	border: var(--fm-stitch);
	border-radius: 3px;
	pointer-events: none;
}

.fm-band--hero {
	position: absolute;
	left: -2.5rem;
	right: 2rem;
	bottom: 0;
	transform: rotate(-1.5deg);
}

@media (max-width: 900px) {
	.fm-hero__media {
		padding-bottom: 0;
	}

	.fm-band--hero {
		position: relative;
		left: auto;
		right: auto;
		margin: -2.25rem 1rem 0;
	}
}

.fm-band > * {
	margin: 0;
}

.fm-band__kicker {
	font-size: 0.9375rem;
	font-weight: 600;
}

.fm-band__name {
	font-family: var(--fm-display);
	font-weight: 800;
	font-size: 1.75rem;
	line-height: 1.1;
	letter-spacing: -0.015em;
	margin-top: 0.25rem !important;
}

.fm-band__name a {
	color: var(--fm-petrol-dark);
	text-decoration: none;
}

.fm-band__name a:hover {
	text-decoration: underline;
}

.fm-band__facts {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-top: 0.75rem !important;
	font-weight: 700;
	font-size: 1.0625rem;
}

.fm-band__facts span {
	display: block;
	font-weight: 400;
	font-size: 0.875rem;
}

/* Banderole inside a pattern post */

.fm-banderole {
	background: var(--fm-senf-soft);
	padding: 2rem 2rem 1.75rem;
	margin-top: 2rem;
	margin-bottom: 2.5rem;
}

.fm-banderole > * {
	margin-top: 0;
	margin-bottom: 0;
}

.fm-banderole__title {
	font-family: var(--fm-display);
	font-weight: 800;
	font-size: 1.5rem;
	color: var(--fm-petrol-dark);
	margin-bottom: 1rem !important;
}

.fm-banderole__facts {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2.5rem;
	font-weight: 700;
	padding-bottom: 1.5rem !important;
	border-bottom: var(--fm-stitch);
}

.fm-banderole__facts span {
	display: block;
	font-weight: 400;
	font-size: 0.9375rem;
	color: var(--fm-muted);
}

.fm-banderole__subtitle {
	font-family: var(--fm-display);
	font-weight: 700;
	font-size: 1.125rem;
	color: var(--fm-petrol-dark);
	margin-top: 1.5rem !important;
	margin-bottom: 0.5rem !important;
}

.fm-banderole__material {
	padding-left: 1.25rem;
}

.fm-banderole__material li + li {
	margin-top: 0.25rem;
}

.fm-banderole__abbr {
	font-size: 1rem;
	line-height: 1.7;
}

.fm-banderole__actions {
	margin-top: 1.5rem !important;
}

/* ---------- Topics ---------- */

.fm-topics {
	padding-top: 2rem;
	padding-bottom: 4rem;
}

.fm-topics__grid {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.75rem;
}

@media (max-width: 900px) {
	.fm-topics__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.fm-topics__grid a {
		padding: 0.9rem 1rem 1rem;
	}

	.fm-topics__grid strong {
		font-size: 1.0625rem;
	}

	.fm-topics__grid span {
		font-size: 0.9375rem;
	}
}

@media (max-width: 340px) {
	.fm-topics__grid {
		grid-template-columns: 1fr;
	}
}

.fm-topics__grid a {
	display: block;
	height: 100%;
	box-sizing: border-box;
	padding: 1.1rem 1.25rem 1.2rem;
	background: var(--fm-white);
	border: 1.5px solid var(--fm-line);
	border-radius: var(--fm-radius);
	text-decoration: none;
	color: var(--fm-ink);
	transition: border-color 0.15s ease;
}

.fm-topics__grid a:hover {
	border-color: var(--fm-petrol);
}

.fm-topics__grid strong {
	display: block;
	font-family: var(--fm-display);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--fm-petrol);
	line-height: 1.2;
}

.fm-topics__grid span {
	display: block;
	margin-top: 0.25rem;
	font-size: 1rem;
	color: var(--fm-muted);
	line-height: 1.45;
}

/* ---------- Post cards ---------- */

.fm-latest {
	padding-bottom: 6rem;
}

.fm-cards {
	gap: 3rem 2rem !important;
}

.fm-cards > li {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.fm-card__img {
	margin-bottom: 0.5rem;
}

.fm-card__img img {
	border-radius: var(--fm-radius);
}

.fm-card__img a:hover img {
	filter: brightness(1.04) saturate(1.05);
}

.fm-card__cat {
	margin: 0;
	font-size: 0.9375rem;
}

.fm-card__cat a {
	color: var(--fm-petrol);
}

.fm-card__title {
	margin: 0;
	font-size: 1.375rem;
	line-height: 1.22;
}

.fm-card__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.fm-card__excerpt {
	margin: 0;
}

.fm-card__excerpt p {
	margin: 0;
}

/* ---------- Learning path ---------- */

.fm-learn {
	padding-top: 4rem;
	padding-bottom: 4.5rem;
}

.fm-learn__lead {
	max-width: 38rem;
	margin-top: -0.5rem;
	color: var(--fm-ink);
}

.fm-steps {
	list-style: none;
	padding: 0;
	margin: 2.5rem 0 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem;
	counter-reset: fm-step;
}

.fm-steps li {
	position: relative;
	counter-increment: fm-step;
	padding-top: 4rem;
}

/* Each step is one chain loop; the loops are joined by a line, like a chain of stitches. */
.fm-steps li::before {
	content: counter(fm-step);
	position: absolute;
	top: 0;
	left: 0;
	width: 2.3rem;
	height: 3.1rem;
	border: 3px solid var(--fm-petrol);
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-family: var(--fm-display);
	font-weight: 800;
	font-size: 1.125rem;
	color: var(--fm-petrol);
	background: var(--fm-senf-soft);
	z-index: 1;
}

.fm-steps li:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 1.45rem;
	left: 2.4rem;
	right: -1.5rem;
	border-top: 3px solid var(--fm-petrol);
}

.fm-steps a {
	display: block;
	text-decoration: none;
	color: var(--fm-ink);
}

.fm-steps strong {
	display: block;
	font-family: var(--fm-display);
	font-size: 1.25rem;
	color: var(--fm-petrol-dark);
	line-height: 1.2;
}

.fm-steps a:hover strong {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.fm-steps span {
	display: block;
	margin-top: 0.5rem;
	font-size: 1rem;
	line-height: 1.5;
}

@media (max-width: 900px) {
	.fm-steps {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.fm-steps li {
		padding: 0 0 2rem 3.75rem;
		min-height: 3rem;
	}

	.fm-steps li:not(:last-child)::after {
		top: 2.9rem;
		bottom: 0;
		left: 1.125rem;
		right: auto;
		border-top: 0;
		border-left: 3px solid var(--fm-petrol);
	}
}

/* ---------- About ---------- */

.fm-about {
	padding-top: 5rem;
}

.fm-about__points {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 2rem 3rem;
	color: var(--fm-muted);
}

.fm-about__points strong {
	display: block;
	font-family: var(--fm-display);
	font-size: 1.25rem;
	color: var(--fm-petrol);
	margin-bottom: 0.5rem;
	line-height: 1.25;
}

/* ---------- Article ---------- */

.fm-article__head {
	padding-top: 1rem;
}

.fm-article__cat {
	margin: 0 0 0.75rem;
}

.fm-article__title {
	margin: 0;
	font-size: clamp(2.25rem, 4.6vw, 3.5rem);
}

.fm-article__dates {
	margin-top: 1rem;
}

.fm-article__date {
	margin: 0;
}

/* WordPress only renders the "modified" date when the post was edited after publishing.
   If it is there, it replaces the publish date. */
.fm-article__date--mod::before {
	content: "Aktualisiert am ";
}

.fm-article__date--pub::before {
	content: "Veröffentlicht am ";
}

.fm-article__date--mod ~ .fm-article__date--pub {
	display: none;
}

.fm-article__img {
	margin-top: 2rem;
	margin-bottom: 1rem;
}

.fm-article__img img {
	border-radius: var(--fm-radius-l);
}

.fm-article__content {
	font-size: 1.1875rem;
}

.fm-article__content > p,
.fm-article__content > ul,
.fm-article__content > ol {
	line-height: 1.7;
}

.fm-article__content h2 {
	scroll-margin-top: 1.5rem;
}

/* Pattern rounds: a list whose items start with <strong>Runde 1:</strong> (ranges like "Runde 6–10" work too). */
.fm-article__content .fm-runden {
	list-style: none;
	padding: 0;
	border-top: 1px solid var(--fm-line);
}

.fm-article__content .fm-runden > li {
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--fm-line);
	font-variant-numeric: tabular-nums;
	margin: 0;
}

.fm-article__content .fm-runden > li strong:first-child {
	display: inline-block;
	min-width: 7.5rem;
	color: var(--fm-petrol);
}

/* Pinterest save button (added by frontend.js) */
.fm-has-pin {
	position: relative;
}

.fm-pin {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	padding: 0.45rem 0.9rem;
	border-radius: 999px;
	background: #E60023; /* Pinterest red, so readers recognise the button */
	color: #fff !important;
	font-family: var(--fm-display);
	font-weight: 700;
	font-size: 0.9375rem;
	text-decoration: none !important;
	line-height: 1.2;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.fm-has-pin:hover .fm-pin,
.fm-pin:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.fm-pin {
		opacity: 1;
	}
}

.fm-more {
	margin-top: 5rem;
	padding-top: 3rem;
	border-top: 1px solid var(--fm-line);
}

/* Table of contents (built by frontend.js) */
.fm-toc {
	background: var(--fm-white);
	border: 1.5px solid var(--fm-line);
	border-radius: var(--fm-radius);
	padding: 1rem 1.5rem;
	margin: 0 0 2.5rem;
}

.fm-toc summary {
	font-family: var(--fm-display);
	font-weight: 700;
	font-size: 1.125rem;
	color: var(--fm-petrol-dark);
	cursor: pointer;
}

.fm-toc ol {
	margin: 0.75rem 0 0.25rem;
	padding-left: 1.5rem;
}

.fm-toc li + li {
	margin-top: 0.25rem;
}

/* ---------- Row counter (built by frontend.js) ---------- */

.fm-counter {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.5rem 0.5rem 1rem;
	background: var(--fm-petrol-dark);
	color: var(--fm-paper);
	border-radius: 16px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 18px rgba(10, 51, 55, 0.28);
	font-family: var(--fm-display);
}

.fm-counter__label {
	display: flex;
	flex-direction: column;
	line-height: 1.05;
	min-width: 4.5rem;
}

.fm-counter__label small {
	font-size: 0.8125rem;
	font-weight: 500;
	color: #C9D6D4;
}

.fm-counter__value {
	font-size: 1.875rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.fm-counter button {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	min-width: 44px;
	min-height: 44px;
	border-radius: 12px;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
}

.fm-counter__minus {
	background: rgba(246, 247, 244, 0.12);
	color: var(--fm-paper);
}

.fm-counter__plus {
	background: var(--fm-senf);
	color: var(--fm-ink);
	min-width: 56px !important;
}

.fm-counter__reset,
.fm-counter__toggle {
	background: transparent;
	color: #C9D6D4;
	font-size: 0.875rem !important;
	font-weight: 500 !important;
	min-width: 0 !important;
	padding: 0 0.5rem;
}

.fm-counter.is-collapsed .fm-counter__minus,
.fm-counter.is-collapsed .fm-counter__plus,
.fm-counter.is-collapsed .fm-counter__reset {
	display: none;
}

.fm-counter.is-collapsed .fm-counter__label {
	min-width: 0;
}

.fm-anleitung {
	padding-bottom: 5rem;
}

@media (max-width: 600px) {
	.fm-counter {
		left: 0.75rem;
		right: 0.75rem;
		bottom: 0.75rem;
		justify-content: space-between;
	}
}

/* ---------- Ads ---------- */

.fm-ad {
	margin: 2.5rem 0;
	padding: 0.5rem 0 1rem;
	min-height: 300px;
	border-top: 1px solid var(--fm-line);
	border-bottom: 1px solid var(--fm-line);
	text-align: center;
}

.fm-ad__label {
	display: block;
	font-size: 0.8125rem;
	color: var(--fm-muted);
	margin-bottom: 0.5rem;
}

/* ---------- Archive / search ---------- */

.fm-archive__head {
	padding-top: 1rem;
	padding-bottom: 2.5rem;
}

.fm-archive__title {
	margin: 0;
}

.fm-archive__desc {
	max-width: 40rem;
	color: var(--fm-muted);
	margin-top: 1rem;
}

.fm-search {
	max-width: 34rem;
	margin-top: 1.5rem;
}

.fm-search .wp-block-search__input {
	border: 1.5px solid var(--fm-line);
	border-radius: 10px;
	padding: 0.75rem 1rem;
	font-size: 1.0625rem;
	background: var(--fm-white);
}

.fm-pagination {
	margin-top: 4rem;
	gap: 0.75rem;
	font-family: var(--fm-display);
	font-weight: 600;
}

.fm-pagination a {
	text-decoration: none;
}

/* ---------- Comments ---------- */

.fm-comments-wrap {
	margin-top: 4rem;
}

.fm-comment {
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--fm-line);
}

.fm-comment .wp-block-comment-author-name {
	font-weight: 700;
}

.fm-comment .wp-block-comment-date {
	color: var(--fm-muted);
	font-size: 0.9375rem;
}

.fm-comments textarea,
.fm-comments input[type="text"],
.fm-comments input[type="email"],
.fm-comments input[type="url"] {
	border: 1.5px solid var(--fm-line);
	border-radius: 10px;
	padding: 0.75rem;
	font: inherit;
	background: var(--fm-white);
	width: 100%;
	box-sizing: border-box;
}

/* ---------- Contact form (Contact Form 7) ---------- */

.wpcf7 form {
	display: grid;
	gap: 1.25rem;
	margin: 2rem 0 1rem;
}

.wpcf7 form > p {
	margin: 0;
}

.wpcf7 label {
	display: grid;
	gap: 0.4rem;
	font-weight: 700;
	color: var(--fm-ink);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1.5px solid var(--fm-line);
	border-radius: 10px;
	padding: 0.75rem 1rem;
	font: inherit;
	font-weight: 400;
	color: var(--fm-ink);
	background: var(--fm-white);
}

.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: 3px solid var(--fm-senf);
	outline-offset: 1px;
	border-color: var(--fm-petrol);
}

.wpcf7 textarea {
	min-height: 10rem;
	resize: vertical;
}

.wpcf7 input[type="submit"] {
	justify-self: start;
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--fm-petrol);
	color: var(--fm-white);
	font-family: var(--fm-display);
	font-weight: 650;
	font-size: 1.0625rem;
	border-radius: 10px;
	padding: 0.8rem 1.4rem;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--fm-petrol-dark);
}

.wpcf7 .wpcf7-not-valid-tip {
	font-weight: 400;
	font-size: 0.9375rem;
	color: #A3261B;
}

.wpcf7 .wpcf7-response-output {
	margin: 0 !important;
	padding: 0.75rem 1rem !important;
	border-radius: 10px;
	font-size: 1rem;
}

/* ---------- Footer ---------- */

.fm-footer {
	padding-top: 4rem;
	padding-bottom: 2rem;
	margin-top: 0;
}

.fm-footer .fm-logo img {
	height: 40px;
}

.fm-footer__claim {
	color: #C9D6D4;
	max-width: 24rem;
	font-size: 1.0625rem;
	margin-top: 1.25rem;
}

.fm-footer__title {
	font-size: 1.0625rem;
	color: var(--fm-senf);
	margin: 0.5rem 0 1rem;
}

.fm-footer__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fm-footer__list li + li {
	margin-top: 0.5rem;
}

.fm-footer a {
	color: var(--fm-paper);
	text-decoration: none;
}

.fm-footer a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.fm-footer__copy {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(246, 247, 244, 0.16);
	color: #C9D6D4;
	font-size: 0.9375rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Print: a clean pattern page ---------- */

@media print {
	.fm-header,
	.fm-footer,
	.fm-more,
	.fm-comments-wrap,
	.fm-counter,
	.fm-ad,
	.fm-toc,
	.fm-banderole__actions,
	.wp-block-buttons {
		display: none !important;
	}

	body {
		background: #fff !important;
		font-size: 11pt;
	}

	.fm-main {
		padding: 0;
	}

	.fm-article__img img {
		max-height: 9cm;
		width: auto;
	}

	.fm-banderole {
		background: #fff !important;
		border: 1px solid #999;
	}

	.fm-banderole::before {
		display: none;
	}

	a {
		color: inherit !important;
		text-decoration: none !important;
	}

	h2,
	h3 {
		break-after: avoid;
	}

	li,
	img {
		break-inside: avoid;
	}
}
