/*
Theme Name: Cozy Loops
Theme URI: https://example.com/cozy-loops
Author: Cozy Loops
Description: A calm, fast and Pinterest-friendly classic theme for free crochet pattern sites. Built for posts published automatically through the REST API: it creates the pattern categories on activation, turns the CROCHET_FRONTMATTER_JSON block into a "Pattern info" card, and styles Gutenberg content for easy-to-follow rounds and rows. No page builder, no required plugins, no jQuery.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cozy-loops
Tags: blog, one-column, grid-layout, custom-logo, custom-colors, custom-menu, featured-images, translation-ready, accessibility-ready, threaded-comments
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	--cl-accent: #c0674f;
	--cl-accent-dark: #92503d;
	--cl-accent-soft: #f6e5e0;
	--cl-accent-tint: #fbf3f0;
	--cl-on-accent: #fff;

	--cl-sage: #6f8466;
	--cl-sage-soft: #e9eee4;
	--cl-butter: #f3e3b5;
	--cl-cream: #faf4ec;
	--cl-bg: #fffdf9;
	--cl-surface: #fff;
	--cl-ink: #2e2925;
	--cl-ink-soft: #4a423c;
	--cl-muted: #6c625a;
	--cl-line: #ebe1d5;

	--cl-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
	--cl-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--cl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--cl-radius-lg: 28px;
	--cl-radius: 18px;
	--cl-radius-sm: 10px;
	--cl-shadow: 0 1px 2px rgba(46, 41, 37, .05), 0 8px 24px -12px rgba(46, 41, 37, .18);
	--cl-shadow-hover: 0 2px 4px rgba(46, 41, 37, .06), 0 18px 36px -16px rgba(46, 41, 37, .28);

	--cl-container: 1200px;
	--cl-narrow: 760px;
	--cl-gutter: clamp(16px, 4vw, 32px);
	--cl-space: clamp(48px, 7vw, 88px);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

body {
	margin: 0;
	background: var(--cl-bg);
	color: var(--cl-ink);
	font-family: var(--cl-sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe { max-width: 100%; }

img { height: auto; vertical-align: middle; }

a {
	color: var(--cl-accent-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
}
a:hover { color: var(--cl-ink); }

:focus-visible {
	outline: 3px solid var(--cl-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--cl-serif);
	font-weight: 600;
	line-height: 1.2;
	color: var(--cl-ink);
	margin: 0 0 .5em;
	letter-spacing: -.01em;
}

p { margin: 0 0 1.1em; }

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

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	left: 16px;
	top: 16px;
	z-index: 1000;
	padding: 12px 18px;
	background: var(--cl-ink);
	color: #fff;
	border-radius: var(--cl-radius-sm);
	text-decoration: none;
}

.container {
	width: 100%;
	max-width: calc(var(--cl-container) + 2 * var(--cl-gutter));
	margin-inline: auto;
	padding-inline: var(--cl-gutter);
}
.container.narrow { max-width: calc(var(--cl-narrow) + 2 * var(--cl-gutter)); }

.icon { flex: none; }

/* Buttons */
.button,
button.button,
input[type="submit"],
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	min-height: 46px;
	padding: .7em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--cl-accent-dark);
	color: var(--cl-on-accent);
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease;
}
.button:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover {
	background: var(--cl-ink);
	color: #fff;
}
.button.is-ghost {
	background: transparent;
	color: var(--cl-ink);
	box-shadow: inset 0 0 0 1.5px var(--cl-ink);
}
.button.is-ghost:hover { background: var(--cl-ink); color: #fff; }

.eyebrow {
	margin: 0 0 .6rem;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--cl-accent-dark);
}

.pill {
	display: inline-block;
	padding: .3em .9em;
	border-radius: 999px;
	background: var(--cl-accent-soft);
	color: var(--cl-accent-dark);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
}
.pill:hover { background: var(--cl-accent-dark); color: var(--cl-on-accent); }

/* Running-stitch decorative line: the theme's signature detail. */
.stitch-line,
.stitch-strip {
	height: 4px;
	background-image: repeating-linear-gradient(90deg, var(--cl-accent) 0 14px, transparent 14px 24px);
	background-size: 24px 4px;
	opacity: .55;
}
.stitch-strip {
	height: 6px;
	opacity: 1;
	background-color: var(--cl-accent);
	background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 10px, transparent 10px 20px);
	background-size: 20px 2px;
	background-repeat: repeat-x;
	background-position: 0 2px;
}

/* ==========================================================================
   3. Header
   ========================================================================== */
.site-header {
	position: relative;
	z-index: 20;
	background: var(--cl-bg);
	border-bottom: 1px solid var(--cl-line);
}

.header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 28px;
	padding-block: 18px;
}

.site-branding {
	display: flex;
	flex-direction: column;
	margin-right: auto;
	min-width: 0;
}

.site-title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--cl-serif);
	font-size: clamp(1.4rem, 2.6vw, 1.75rem);
	font-weight: 700;
	line-height: 1.1;
	color: var(--cl-ink);
	text-decoration: none;
	letter-spacing: -.02em;
}
.site-title:hover { color: var(--cl-accent-dark); }
.site-title-mark {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--cl-accent-soft);
	color: var(--cl-accent-dark);
}

.site-description {
	margin: 4px 0 0;
	font-size: .82rem;
	color: var(--cl-muted);
}

.custom-logo-link { display: inline-block; }
.custom-logo { max-height: 72px; width: auto; }

.header-actions {
	display: flex;
	gap: 6px;
	order: 3;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cl-ink);
	cursor: pointer;
}
.icon-button:hover,
.icon-button[aria-expanded="true"] { background: var(--cl-accent-soft); color: var(--cl-accent-dark); }

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
	display: block;
	width: 20px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.primary-nav { width: 100%; order: 4; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu > li > a {
	display: block;
	padding: 12px 4px;
	border-top: 1px solid var(--cl-line);
	color: var(--cl-ink);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-cat > a { color: var(--cl-accent-dark); }
.primary-nav .sub-menu a {
	display: block;
	padding: 8px 16px;
	color: var(--cl-ink-soft);
	text-decoration: none;
	font-size: .92rem;
}

.js .primary-nav { display: none; }
.js .primary-nav.is-open { display: block; }

.header-search { padding-bottom: 18px; }
.js .header-search { display: none; }
.js .header-search.is-open { display: block; }

@media (min-width: 960px) {
	.header-inner { flex-wrap: nowrap; }
	.nav-toggle { display: none; }
	.primary-nav,
	.js .primary-nav { display: block; width: auto; order: 2; }
	.primary-nav .menu { display: flex; gap: 4px; align-items: center; }
	.primary-nav .menu > li { position: relative; }
	.primary-nav .menu > li > a {
		border: 0;
		padding: 8px 12px;
		border-radius: 999px;
		font-size: .9rem;
	}
	.primary-nav .menu > li > a:hover,
	.primary-nav .menu > .current-menu-item > a,
	.primary-nav .menu > .current-cat > a { background: var(--cl-accent-tint); }
	.primary-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 220px;
		padding: 8px;
		background: var(--cl-surface);
		border-radius: var(--cl-radius-sm);
		box-shadow: var(--cl-shadow-hover);
		opacity: 0;
		visibility: hidden;
		transform: translateY(6px);
		transition: opacity .15s ease, transform .15s ease, visibility .15s;
	}
	.primary-nav li:hover > .sub-menu,
	.primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
	.header-actions { order: 3; }
}

/* ==========================================================================
   4. Forms
   ========================================================================== */
.search-form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 560px;
	padding: 6px;
	background: var(--cl-surface);
	border: 1.5px solid var(--cl-line);
	border-radius: 999px;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.search-form:focus-within {
	border-color: var(--cl-accent);
	box-shadow: 0 0 0 4px var(--cl-accent-soft);
}
.search-form-icon { display: inline-grid; padding-left: 12px; color: var(--cl-muted); }
.search-field {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 8px 4px;
	font-size: 1rem;
}
.search-field:focus { outline: none; }
.search-submit { min-height: 42px; padding-inline: 1.2em; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--cl-line);
	border-radius: var(--cl-radius-sm);
	background: var(--cl-surface);
}
input:focus,
textarea:focus { border-color: var(--cl-accent); outline: none; box-shadow: 0 0 0 4px var(--cl-accent-soft); }

/* ==========================================================================
   5. Sections & cards
   ========================================================================== */
.site-main { display: block; padding-bottom: var(--cl-space); }

.section-band { background: var(--cl-cream); }
.collections,
.latest,
.category-band,
.related,
.section-band { padding-block: var(--cl-space); }

.section-head { margin-bottom: clamp(24px, 4vw, 40px); }
.section-head.is-center { text-align: center; }
.section-head.is-split {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 12px 24px;
}
.section-title {
	margin: 0;
	font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}
.section-more { margin: 36px 0 0; text-align: center; }

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	font-size: .82rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cl-ink);
	border-bottom: 2px solid var(--cl-accent);
	padding-bottom: 4px;
}
.link-arrow:hover { color: var(--cl-accent-dark); }
.link-arrow .icon,
.collection-count .icon { transition: transform .2s ease; }
.link-arrow:hover .icon,
.collection-tile a:hover .icon { transform: translateX(4px); }

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: clamp(18px, 2.4vw, 28px);
}
@media (min-width: 1100px) {
	.card-grid { grid-template-columns: repeat(4, 1fr); }
	.card-grid.is-three { grid-template-columns: repeat(3, 1fr); }
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--cl-surface);
	border-radius: var(--cl-radius);
	box-shadow: var(--cl-shadow);
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--cl-shadow-hover); }

.card-media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	background: var(--cl-cream);
	overflow: hidden;
}
.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}
.card:hover .card-media img { transform: scale(1.04); }

.card-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--cl-accent);
	background:
		radial-gradient(circle at 30% 20%, var(--cl-accent-soft), transparent 60%),
		var(--cl-cream);
}

.card-number {
	position: absolute;
	top: 12px;
	left: 12px;
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	border-radius: 999px;
	background: rgba(255, 253, 249, .92);
	color: var(--cl-ink);
	font-family: var(--cl-serif);
	font-weight: 700;
	font-size: 1rem;
}

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 20px; flex: 1; }
.card-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.card-category {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cl-accent-dark);
}
.card-title { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.card-title a { color: var(--cl-ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-title a:hover { color: var(--cl-accent-dark); }
.card-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: auto 0 0;
	color: var(--cl-muted);
	font-size: .8rem;
}

.difficulty-badge {
	display: inline-block;
	padding: .2em .7em;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 700;
	background: var(--cl-sage-soft);
	color: #44583c;
}
.difficulty-badge.is-easy { background: #e3eef0; color: #2f5a63; }
.difficulty-badge.is-intermediate { background: #f8ecd0; color: #74531a; }
.difficulty-badge.is-advanced { background: var(--cl-accent-soft); color: var(--cl-accent-dark); }

/* ==========================================================================
   6. Home
   ========================================================================== */
.home-hero { padding-top: clamp(20px, 4vw, 40px); }

.hero-panel {
	position: relative;
	display: grid;
	gap: 32px;
	align-items: center;
	padding: clamp(28px, 6vw, 72px);
	background:
		radial-gradient(circle at 92% 8%, var(--cl-accent-soft) 0, transparent 38%),
		radial-gradient(circle at 4% 100%, var(--cl-sage-soft) 0, transparent 40%),
		var(--cl-cream);
	border-radius: var(--cl-radius-lg);
	overflow: hidden;
}
.hero-panel::after {
	/* stitched inner border */
	content: "";
	position: absolute;
	inset: 12px;
	border: 2px dashed rgba(192, 103, 79, .22);
	border-radius: calc(var(--cl-radius-lg) - 10px);
	pointer-events: none;
}

.hero-title {
	font-size: clamp(2.1rem, 5.4vw, 3.6rem);
	line-height: 1.06;
	letter-spacing: -.025em;
	max-width: 16ch;
}
.hero-text {
	max-width: 52ch;
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	color: var(--cl-ink-soft);
	margin-bottom: 1.6em;
}

.hero-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 36px;
	list-style: none;
	margin: 32px 0 0;
	padding: 0;
}
.hero-stats strong {
	display: block;
	font-family: var(--cl-serif);
	font-size: 2rem;
	line-height: 1;
	color: var(--cl-ink);
}
.hero-stats span {
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cl-muted);
}

.hero-art {
	position: relative;
	min-height: 280px;
	display: grid;
	place-items: center;
}
.hero-yarn { color: var(--cl-accent); opacity: .85; }
.hero-art.has-collage { min-height: 360px; }
.collage-item {
	position: absolute;
	width: 52%;
	aspect-ratio: 4 / 5;
	border-radius: var(--cl-radius);
	overflow: hidden;
	box-shadow: var(--cl-shadow-hover);
	border: 6px solid #fff;
	background: #fff;
}
.collage-item img { width: 100%; height: 100%; object-fit: cover; }
.collage-1 { left: 4%; top: 6%; transform: rotate(-4deg); z-index: 2; }
.collage-2 { right: 2%; top: 0; transform: rotate(5deg); width: 44%; }
.collage-3 { right: 12%; bottom: 0; transform: rotate(-2deg); width: 40%; z-index: 3; }

@media (min-width: 900px) {
	.hero-panel { grid-template-columns: 1.15fr .85fr; }
	.hero-art.has-collage { min-height: 440px; }
}

.collection-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.collection-tile a {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 100%;
	padding: 22px 22px 20px;
	border-radius: var(--cl-radius);
	background: var(--cl-surface);
	border: 1.5px solid var(--cl-line);
	color: var(--cl-ink);
	text-decoration: none;
	transition: border-color .2s ease, transform .2s ease, background-color .2s ease;
}
.collection-tile a::before {
	content: "";
	width: 34px;
	height: 34px;
	margin-bottom: 10px;
	border-radius: 50%;
	background:
		repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .55) 5px 7px),
		var(--tile, var(--cl-accent));
}
.collection-tile:nth-child(7n+2) a { --tile: var(--cl-sage); }
.collection-tile:nth-child(7n+3) a { --tile: #d9a441; }
.collection-tile:nth-child(7n+4) a { --tile: #6f8fa3; }
.collection-tile:nth-child(7n+5) a { --tile: #b9798f; }
.collection-tile:nth-child(7n+6) a { --tile: #8a7a62; }
.collection-tile:nth-child(7n+7) a { --tile: #a3664a; }
.collection-tile a:hover {
	border-color: var(--cl-accent);
	background: var(--cl-accent-tint);
	transform: translateY(-3px);
}
.collection-name { font-family: var(--cl-serif); font-size: 1.25rem; font-weight: 600; }
.collection-tagline { font-size: .88rem; color: var(--cl-muted); }
.collection-count {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 14px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--cl-accent-dark);
}

.about { padding-top: var(--cl-space); }
.about-panel {
	display: grid;
	gap: 24px;
	align-items: center;
	padding: clamp(28px, 5vw, 60px);
	border-radius: var(--cl-radius-lg);
	background: var(--cl-sage-soft);
}
.about-mark {
	display: grid;
	place-items: center;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: var(--cl-surface);
	color: var(--cl-sage);
	box-shadow: var(--cl-shadow);
}
.about-copy p { max-width: 62ch; color: var(--cl-ink-soft); }
@media (min-width: 760px) {
	.about-panel { grid-template-columns: auto 1fr; gap: 48px; }
}

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 20px 0 0;
	padding: 0;
}
.social-links a {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--cl-surface);
	color: var(--cl-ink);
	box-shadow: inset 0 0 0 1.5px var(--cl-line);
	transition: background-color .2s ease, color .2s ease;
}
.social-links a:hover { background: var(--cl-accent-dark); color: var(--cl-on-accent); box-shadow: none; }

/* ==========================================================================
   7. Archive / search / 404
   ========================================================================== */
.archive-header { padding-block: clamp(20px, 4vw, 40px) clamp(28px, 4vw, 44px); }
.archive-panel {
	position: relative;
	padding: clamp(28px, 5vw, 56px);
	border-radius: var(--cl-radius-lg);
	background:
		radial-gradient(circle at 100% 0, var(--cl-accent-soft) 0, transparent 45%),
		var(--cl-cream);
	text-align: center;
}
.archive-panel .search-form { margin: 20px auto 0; }
.archive-title { font-size: clamp(2rem, 4.6vw, 3rem); margin-bottom: .3em; }
.archive-description { max-width: 60ch; margin-inline: auto; color: var(--cl-ink-soft); }
.archive-description p:last-child { margin-bottom: 0; }
.archive-count {
	margin: 12px 0 0;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cl-muted);
}

.chip-nav { margin-top: 20px; }
.chip-nav ul,
.chip-nav-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.chip-nav-list { margin: 24px 0; }
.chip-link {
	display: inline-block;
	padding: .45em 1em;
	border-radius: 999px;
	border: 1.5px solid var(--cl-line);
	background: var(--cl-surface);
	color: var(--cl-ink);
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
}
.chip-link:hover { border-color: var(--cl-accent); color: var(--cl-accent-dark); }
.chip-link.is-current { background: var(--cl-ink); border-color: var(--cl-ink); color: #fff; }

.listing { padding-bottom: 8px; }

.pagination { margin-top: 48px; }
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}
.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--cl-surface);
	box-shadow: inset 0 0 0 1.5px var(--cl-line);
	color: var(--cl-ink);
	font-weight: 600;
	text-decoration: none;
}
.pagination .page-numbers.current { background: var(--cl-ink); color: #fff; box-shadow: none; }
.pagination a.page-numbers:hover { box-shadow: inset 0 0 0 1.5px var(--cl-accent); color: var(--cl-accent-dark); }

.empty-state {
	max-width: 620px;
	margin: 24px auto 0;
	text-align: center;
}
.empty-state .search-form { margin: 0 auto; }
.empty-icon { color: var(--cl-accent); }

.not-found { padding-top: clamp(24px, 5vw, 56px); }
.not-found-panel { text-align: center; }
.not-found-panel .search-form { margin: 0 auto; }
.not-found-code {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-family: var(--cl-serif);
	font-size: clamp(5rem, 16vw, 8rem);
	font-weight: 700;
	line-height: 1;
	color: var(--cl-ink);
}
.not-found-code span { display: inline-grid; color: var(--cl-accent); }
.not-found + .section-band { margin-top: var(--cl-space); }

/* ==========================================================================
   8. Single post
   ========================================================================== */
.entry-hero { padding-top: clamp(16px, 3vw, 32px); }
.entry-hero-text { text-align: center; }

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	font-size: .8rem;
	color: var(--cl-muted);
}
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--cl-line); color: var(--cl-muted); }
.breadcrumbs a { color: var(--cl-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--cl-accent-dark); text-decoration: underline; }

.entry-title {
	margin: 16px auto 14px;
	font-size: clamp(2rem, 5vw, 3.1rem);
	line-height: 1.1;
	letter-spacing: -.02em;
}
.entry-lede {
	max-width: 60ch;
	margin: 0 auto 20px;
	font-size: clamp(1.05rem, 1.8vw, 1.2rem);
	color: var(--cl-ink-soft);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 22px;
	color: var(--cl-muted);
	font-size: .88rem;
}
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-button {
	padding: 6px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--cl-accent-soft);
	color: var(--cl-accent-dark);
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
}
.meta-button:hover { background: var(--cl-accent-dark); color: var(--cl-on-accent); }

.entry-cover {
	position: relative;
	max-width: 820px;
	margin: clamp(24px, 4vw, 40px) auto 0;
	padding-inline: var(--cl-gutter);
}
.entry-cover img {
	display: block;
	width: 100%;
	max-height: 1100px;
	object-fit: cover;
	border-radius: var(--cl-radius-lg);
	background: var(--cl-cream);
	box-shadow: var(--cl-shadow);
}
.entry-cover.is-page { margin-bottom: 8px; }

/* Pin it */
.pin-wrap { position: relative; }
.pin-it {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 999px;
	background: #e60023;
	color: #fff;
	font-size: .82rem;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .2s ease, transform .2s ease;
}
.entry-cover .pin-it { right: calc(var(--cl-gutter) + 14px); }
.pin-it:hover { color: #fff; background: #ad081b; }
.pin-wrap:hover .pin-it,
.pin-it:focus-visible { opacity: 1; transform: none; }
@media (hover: none) {
	.pin-it { opacity: 1; transform: none; }
}

.entry-body { padding-top: clamp(28px, 4vw, 44px); }

/* Pattern info card */
.pattern-info {
	position: relative;
	margin: 0 0 32px;
	padding: clamp(22px, 4vw, 34px);
	border-radius: var(--cl-radius-lg);
	background: var(--cl-cream);
}
.pattern-info::before {
	content: "";
	position: absolute;
	inset: 10px;
	border: 2px dashed rgba(111, 132, 102, .35);
	border-radius: calc(var(--cl-radius-lg) - 8px);
	pointer-events: none;
}
.pattern-info-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	padding-bottom: 18px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--cl-line);
}
.pattern-info-title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 1.45rem;
}
.pattern-info-title .icon { color: var(--cl-accent); }
.pattern-label {
	display: block;
	margin: 0 0 4px;
	font-family: var(--cl-sans);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cl-muted);
}
.pattern-difficulty {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 14px 6px 16px;
	border-radius: 999px;
	background: var(--cl-surface);
}
.pattern-difficulty .pattern-label { margin: 0; }
.pattern-difficulty strong { font-size: .95rem; }
.skill-dots { display: inline-flex; gap: 4px; }
.skill-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--cl-line);
}
.skill-dot.is-on { background: var(--cl-sage); }
.is-easy .skill-dot.is-on { background: #4f8794; }
.is-intermediate .skill-dot.is-on { background: #d29a2c; }
.is-advanced .skill-dot.is-on { background: var(--cl-accent); }

.pattern-facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 0 0 6px;
}
.pattern-fact {
	padding: 12px 14px;
	border-radius: var(--cl-radius-sm);
	background: var(--cl-surface);
}
.pattern-fact dd { margin: 0; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }

.pattern-group { margin-top: 18px; }
.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
}
.chip {
	padding: .3em .85em;
	border-radius: 999px;
	background: var(--cl-surface);
	box-shadow: inset 0 0 0 1px var(--cl-line);
	font-size: .88rem;
}
.is-colors .chip::before {
	content: "";
	display: inline-block;
	width: .65em;
	height: .65em;
	margin-right: .45em;
	border-radius: 50%;
	background: var(--cl-accent);
	vertical-align: .02em;
}
.is-colors .chip:nth-child(4n+2)::before { background: var(--cl-sage); }
.is-colors .chip:nth-child(4n+3)::before { background: #d9a441; }
.is-colors .chip:nth-child(4n+4)::before { background: #6f8fa3; }

.materials-list {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	columns: 2 240px;
	column-gap: 24px;
}
.materials-list li {
	position: relative;
	padding: 4px 0 4px 26px;
	break-inside: avoid;
}
.materials-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .55em;
	width: 14px;
	height: 14px;
	border: 2px solid var(--cl-sage);
	border-radius: 4px;
}

/* Table of contents */
.toc {
	margin: 0 0 36px;
	border: 1.5px solid var(--cl-line);
	border-radius: var(--cl-radius);
	background: var(--cl-surface);
}
.toc summary {
	padding: 16px 22px;
	font-family: var(--cl-serif);
	font-size: 1.15rem;
	font-weight: 600;
	cursor: pointer;
	list-style-position: inside;
}
.toc ol {
	margin: 0;
	padding: 0 22px 18px 44px;
	columns: 2 220px;
	column-gap: 32px;
}
.toc li { padding: 3px 0; break-inside: avoid; }
.toc li::marker { color: var(--cl-accent); font-weight: 700; }
.toc a { color: var(--cl-ink-soft); text-decoration: none; }
.toc a:hover { color: var(--cl-accent-dark); text-decoration: underline; }

/* ==========================================================================
   9. Entry content (Gutenberg markup)
   ========================================================================== */
.entry-content { font-size: 1.09rem; line-height: 1.75; overflow-wrap: break-word; }
.entry-content > * { margin-block: 0 1.25em; }
.entry-content > :last-child { margin-bottom: 0; }

.entry-content h2 {
	position: relative;
	margin: 2.2em 0 .7em;
	padding-top: .9em;
	font-size: clamp(1.55rem, 3vw, 1.95rem);
}
.entry-content h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 64px;
	height: 4px;
	background-image: repeating-linear-gradient(90deg, var(--cl-accent) 0 12px, transparent 12px 20px);
}
.entry-content h3 {
	margin: 1.8em 0 .6em;
	font-size: clamp(1.25rem, 2.3vw, 1.45rem);
	color: var(--cl-ink);
}
.entry-content h4 { margin: 1.6em 0 .5em; font-size: 1.1rem; }
.entry-content h2:first-child,
.entry-content h3:first-child { margin-top: 0; }

.entry-content a { color: var(--cl-accent-dark); font-weight: 500; }
.entry-content strong { color: var(--cl-ink); }

/* Lists: rounds & rows must be easy to follow. */
.entry-content ul,
.entry-content ol { padding-left: 0; list-style: none; }
.entry-content li { margin-bottom: .55em; }
.entry-content li > ul,
.entry-content li > ol { margin-top: .55em; margin-bottom: 0; }

.entry-content ul > li {
	position: relative;
	padding-left: 1.7em;
}
.entry-content ul > li::before {
	content: "";
	position: absolute;
	left: .35em;
	top: .62em;
	width: .55em;
	height: .55em;
	border-radius: 50%;
	border: 2px solid var(--cl-accent);
	background: var(--cl-accent-soft);
}

.entry-content ol { counter-reset: step; }
.entry-content ol > li {
	position: relative;
	counter-increment: step;
	padding: .75em 1em .75em 3.6em;
	margin-bottom: .5em;
	border-radius: var(--cl-radius-sm);
	background: var(--cl-surface);
	box-shadow: inset 0 0 0 1px var(--cl-line);
	transition: background-color .2s ease, opacity .2s ease;
}
.entry-content ol > li:nth-child(even) { background: var(--cl-accent-tint); }
.entry-content ol > li::before {
	content: counter(step);
	position: absolute;
	left: .8em;
	top: .7em;
	display: grid;
	place-items: center;
	width: 1.95em;
	height: 1.95em;
	border-radius: 50%;
	background: var(--cl-accent-dark);
	color: var(--cl-on-accent);
	font-size: .85em;
	font-weight: 700;
	line-height: 1;
}
.entry-content ol[start] { counter-reset: none; }
.entry-content ol > li > ol > li,
.entry-content ol > li > ul > li { box-shadow: none; background: transparent; }

/* Round tracker (JS) */
.entry-content ol.is-trackable > li { padding-right: 3.4em; }
.round-check {
	position: absolute;
	right: .7em;
	top: .65em;
	width: 2em;
	height: 2em;
	padding: 0;
	border: 2px solid var(--cl-line);
	border-radius: 50%;
	background: var(--cl-surface);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}
.round-check::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 45%;
	width: .45em;
	height: .8em;
	border: solid transparent;
	border-width: 0 2.5px 2.5px 0;
	transform: translate(-50%, -50%) rotate(45deg);
}
.round-check:hover { border-color: var(--cl-sage); }
.round-check[aria-pressed="true"] { background: var(--cl-sage); border-color: var(--cl-sage); }
.round-check[aria-pressed="true"]::after { border-color: #fff; }
.entry-content ol > li.is-done { opacity: .55; background: var(--cl-sage-soft); }
.entry-content ol > li.is-done::before { background: var(--cl-sage); }

/* Images */
.entry-content figure { margin-inline: 0; }
.entry-content .wp-block-image { margin-block: 2em; }
.entry-content .wp-block-image img {
	display: block;
	border-radius: var(--cl-radius);
}
.entry-content .wp-block-image.aligncenter,
.entry-content .wp-block-image .aligncenter { margin-inline: auto; text-align: center; }
.entry-content .wp-block-image.aligncenter img { margin-inline: auto; }
.entry-content figcaption,
.entry-content .wp-element-caption {
	margin-top: .7em;
	color: var(--cl-muted);
	font-size: .88rem;
	line-height: 1.5;
	text-align: center;
}
.entry-content figcaption small { font-size: inherit; }

.alignwide { margin-inline: calc(-1 * min(80px, 6vw)); max-width: none; }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.alignwide img,
.alignfull img { width: 100%; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; max-width: 50%; }
.alignright { float: right; margin: .3em 0 1em 1.5em; max-width: 50%; }
.aligncenter { margin-inline: auto; display: block; }
@media (max-width: 600px) {
	.alignleft,
	.alignright { float: none; margin-inline: 0; max-width: 100%; }
	.alignwide { margin-inline: 0; }
}

/* Tables */
.entry-content .wp-block-table {
	margin: 2em 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: var(--cl-radius);
	box-shadow: inset 0 0 0 1.5px var(--cl-line);
}
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: .95rem;
	line-height: 1.5;
}
.entry-content th,
.entry-content td {
	padding: .75em 1em;
	text-align: left;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid var(--cl-line);
}
.entry-content thead th,
.entry-content table tr:first-child th {
	background: var(--cl-cream);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cl-ink-soft);
}
.entry-content tbody tr:nth-child(even) td { background: var(--cl-accent-tint); }
.entry-content tbody tr:last-child td { border-bottom: 0; }
.entry-content .wp-block-table figcaption { padding: 0 1em .8em; }

/* Quotes */
.entry-content blockquote,
.entry-content .wp-block-quote {
	position: relative;
	margin: 2em 0;
	padding: 1.3em 1.5em 1.3em 1.6em;
	border: 0;
	border-left: 4px solid var(--cl-accent);
	border-radius: 0 var(--cl-radius) var(--cl-radius) 0;
	background: var(--cl-accent-tint);
	font-family: var(--cl-serif);
	font-size: 1.12rem;
	font-style: italic;
	color: var(--cl-ink-soft);
}
.entry-content blockquote p:last-of-type { margin-bottom: 0; }
.entry-content blockquote cite {
	display: block;
	margin-top: .8em;
	font-family: var(--cl-sans);
	font-size: .8rem;
	font-style: normal;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cl-muted);
}

/* Misc blocks */
.entry-content hr,
.entry-content .wp-block-separator {
	height: 4px;
	margin: 2.5em auto;
	border: 0;
	max-width: 160px;
	background-image: repeating-linear-gradient(90deg, var(--cl-accent) 0 12px, transparent 12px 22px);
	opacity: .6;
}
.entry-content code,
.entry-content kbd {
	padding: .1em .4em;
	border-radius: 6px;
	background: var(--cl-cream);
	font-family: var(--cl-mono);
	font-size: .88em;
}
.entry-content pre {
	padding: 1.2em;
	overflow-x: auto;
	border-radius: var(--cl-radius-sm);
	background: var(--cl-cream);
	font-size: .9rem;
}
.entry-content pre code { padding: 0; background: none; }
.entry-content abbr[title] { text-decoration: underline dotted; cursor: help; }
.entry-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.entry-content .wp-block-embed iframe { width: 100%; border-radius: var(--cl-radius); }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content::after { content: ""; display: table; clear: both; }

.page-links { margin-top: 2em; font-weight: 600; }

/* Entry footer */
.entry-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--cl-line); }
.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}
.tag-list a {
	display: inline-block;
	padding: .3em .9em;
	border-radius: 999px;
	background: var(--cl-cream);
	color: var(--cl-ink-soft);
	font-size: .85rem;
	text-decoration: none;
}
.tag-list a::before { content: "#"; color: var(--cl-accent); margin-right: 1px; }
.tag-list a:hover { background: var(--cl-accent-soft); color: var(--cl-accent-dark); }

.share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 18px 20px;
	border-radius: var(--cl-radius);
	background: var(--cl-cream);
}
.share-label { margin-right: auto; font-family: var(--cl-serif); font-weight: 600; font-size: 1.05rem; }
.share-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--cl-surface);
	color: var(--cl-ink);
	font-size: .85rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	box-shadow: inset 0 0 0 1.5px var(--cl-line);
}
.share-button:hover { color: var(--cl-accent-dark); box-shadow: inset 0 0 0 1.5px var(--cl-accent); }
.share-button.is-pinterest { background: #e60023; color: #fff; box-shadow: none; }
.share-button.is-pinterest:hover { background: #ad081b; color: #fff; }
.copy-status { width: 100%; font-size: .85rem; color: var(--cl-sage); min-height: 0; }
.copy-status:empty { display: none; }

.related { margin-top: var(--cl-space); }

/* Comments */
.comments-area { margin-top: var(--cl-space); }
.comments-title,
.comment-reply-title { font-size: 1.6rem; }
.comment-list,
.comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: clamp(16px, 4vw, 40px); }
.comment-body {
	margin-bottom: 16px;
	padding: 20px;
	border-radius: var(--cl-radius);
	background: var(--cl-cream);
}
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .88rem; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-metadata a { color: var(--cl-muted); text-decoration: none; }
.comment-content { margin-top: 10px; }
.comment-reply-link { font-size: .85rem; font-weight: 700; }
.comment-form p { margin-bottom: 1em; }
.comment-form label { display: block; margin-bottom: 4px; font-weight: 600; font-size: .9rem; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* Page */
.page-header { padding-top: clamp(24px, 5vw, 56px); text-align: center; }

/* ==========================================================================
   10. Footer
   ========================================================================== */
.site-footer {
	margin-top: 0;
	background: var(--cl-ink);
	color: #e9e1d8;
}
.site-footer .stitch-line { opacity: .9; }
.footer-grid {
	display: grid;
	gap: 36px;
	padding-block: clamp(44px, 6vw, 72px);
}
@media (min-width: 760px) {
	.footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
}
.footer-title {
	font-family: var(--cl-serif);
	font-size: 1.6rem;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
}
.footer-brand p { margin: 8px 0 0; color: #bfb4a8; max-width: 40ch; }
.footer-heading {
	font-family: var(--cl-sans);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #bfb4a8;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0 0 8px; }
.footer-col a { color: #f4ede6; text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-social a { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: none; }
.footer-social a:hover { background: var(--cl-accent); color: #fff; }
.footer-bottom {
	padding-block: 20px;
	border-top: 1px solid rgba(255, 255, 255, .1);
	font-size: .82rem;
	color: #bfb4a8;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #f4ede6; }

/* ==========================================================================
   11. Motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

@media print {
	@page { margin: 1.6cm; }

	html,
	body {
		background: #fff !important;
		color: #000;
		font-size: 11pt;
	}
	.site-header,
	.site-footer,
	.breadcrumbs,
	.meta-button,
	.pin-it,
	.round-check,
	.toc,
	.entry-footer,
	.related,
	.comments-area,
	.skip-link { display: none !important; }

	.container,
	.container.narrow { max-width: none; padding: 0; }
	.entry-hero-text { text-align: left; }
	.entry-title { font-size: 22pt; margin: 0 0 6pt; }
	.entry-meta { justify-content: flex-start; }
	.entry-cover { max-width: none; margin: 12pt 0; padding: 0; }
	.entry-cover img { max-height: 9cm; width: auto; box-shadow: none; border-radius: 6px; }
	.entry-body { padding-top: 0; }

	.pattern-info { background: none; border: 1.5pt solid #999; break-inside: avoid; }
	.pattern-info::before { display: none; }
	.pattern-fact,
	.pattern-difficulty,
	.chip { background: none; box-shadow: none; border: 1px solid #ccc; }

	.entry-content { font-size: 11pt; line-height: 1.5; }
	.entry-content h2,
	.entry-content h3 { break-after: avoid; }
	.entry-content h2::before { display: none; }
	.entry-content ol > li,
	.entry-content ol > li:nth-child(even) {
		background: none;
		box-shadow: none;
		border-bottom: 1px solid #ddd;
		border-radius: 0;
		padding-right: 0;
		break-inside: avoid;
		opacity: 1;
	}
	.entry-content ol > li::before { background: #000; color: #fff; }
	.entry-content figure,
	.entry-content table,
	.entry-content blockquote { break-inside: avoid; }
	.entry-content .wp-block-image img { max-height: 8cm; width: auto; }
	.entry-content blockquote { background: none; }
	.entry-content tbody tr:nth-child(even) td { background: none; }
	.entry-content a { color: #000; text-decoration: none; }
}
