/* Crochet Pattern Maker – minimal modern card: white, hairlines, generous whitespace, one accent colour */
.cpm-card {
	--cpm-accent: #d9624b;
	--cpm-ink: #1c1b1a;
	--cpm-muted: #77716c;
	--cpm-bg: #ffffff;
	--cpm-tint: #f7f5f3;
	--cpm-line: #e8e4e0;
	position: relative;
	box-sizing: border-box;
	margin: 2.5em 0;
	padding: clamp(22px, 5vw, 48px);
	color: var(--cpm-ink);
	background: var(--cpm-bg);
	border: 1px solid var(--cpm-line);
	border-radius: 14px;
	font-family: "Helvetica Neue", Helvetica, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
.cpm-card *, .cpm-card *::before, .cpm-card *::after { box-sizing: border-box; }
.cpm-card h2, .cpm-card h3, .cpm-card h4 {
	margin: 0; color: var(--cpm-ink);
	font-family: "Avenir Next", "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif;
	font-weight: 700; letter-spacing: -.02em;
}

/* Header */
.cpm-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 44px); align-items: center; }
.cpm-head:not(:has(.cpm-photo)) { grid-template-columns: 1fr; }
.cpm-photo { order: 2; }
.cpm-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }
.cpm-eyebrow { display: block; margin-bottom: 14px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--cpm-accent); }
.cpm-title { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.08; margin-bottom: 14px; }
.cpm-summary { margin: 0 0 20px; color: var(--cpm-muted); }

/* Rating */
.cpm-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.cpm-stars { display: inline-flex; gap: 2px; }
.cpm-star { all: unset; cursor: pointer; font-size: 22px; line-height: 1; color: var(--cpm-line); transition: color .15s; }
.cpm-star.is-on { color: var(--cpm-ink); }
.cpm-star:hover { color: var(--cpm-accent); }
.cpm-star:focus-visible { outline: 2px solid var(--cpm-accent); outline-offset: 2px; border-radius: 3px; }
.cpm-rating-text { font-size: 13px; color: var(--cpm-muted); }

/* Buttons */
.cpm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cpm-card .cpm-btn {
	display: inline-flex; align-items: center; padding: 11px 20px; cursor: pointer;
	font: 600 13px/1 "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; text-decoration: none !important; text-transform: none; box-shadow: none;
	color: var(--cpm-ink); background: transparent; border: 1px solid var(--cpm-ink); border-radius: 6px;
	transition: background .15s, color .15s, border-color .15s;
}
.cpm-card .cpm-btn:hover { background: var(--cpm-ink); color: #fff; }
.cpm-card .cpm-btn-primary { background: var(--cpm-ink); color: #fff; }
.cpm-card .cpm-btn-primary:hover { background: var(--cpm-accent); border-color: var(--cpm-accent); }
.cpm-link { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cpm-muted); text-decoration: underline; text-underline-offset: 3px; }
.cpm-link:hover { color: var(--cpm-accent); }
.cpm-link:focus-visible { outline: 2px solid var(--cpm-accent); outline-offset: 2px; }

/* Facts */
.cpm-facts { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: clamp(28px, 5vw, 48px) 0 0; padding: 18px 0; border-top: 1px solid var(--cpm-line); border-bottom: 1px solid var(--cpm-line); }
.cpm-facts li { list-style: none; margin: 0; padding: 4px 16px; border-left: 1px solid var(--cpm-line); }
.cpm-facts li:first-child { padding-left: 0; border-left: 0; }
.cpm-fact-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cpm-muted); }
.cpm-fact-value { display: block; font-weight: 600; text-transform: none; }

/* Blocks */
.cpm-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 56px); margin-top: clamp(28px, 5vw, 48px); }
.cpm-cols:has(> .cpm-block:only-child) { grid-template-columns: 1fr; }
.cpm-block h3, .cpm-pattern h3 { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.cpm-block p { margin: 0; }
.cpm-materials { list-style: none; margin: 0; padding: 0; }
.cpm-materials li { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--cpm-line); }
.cpm-materials li:first-child { border-top: 1px solid var(--cpm-line); }
.cpm-gauge p { font-size: 18px; line-height: 1.4; font-weight: 500; }
.cpm-notes { margin-top: clamp(28px, 5vw, 48px); padding: 20px 24px; background: var(--cpm-tint); border-radius: 8px; }
.cpm-notes p { margin: 0 0 .8em; }
.cpm-notes p:last-child { margin: 0; }

/* Pattern */
.cpm-pattern { margin-top: clamp(32px, 6vw, 56px); scroll-margin-top: 90px; }
.cpm-pattern-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.cpm-pattern-head h3 { margin: 0; }
.cpm-progress { flex: 1; height: 3px; background: var(--cpm-line); border-radius: 3px; overflow: hidden; }
.cpm-progress-bar { display: block; height: 100%; width: 0; background: var(--cpm-accent); transition: width .25s; }
.cpm-progress-text { font-size: 12px; color: var(--cpm-muted); font-variant-numeric: tabular-nums; }
.cpm-section { margin-top: 28px; }
.cpm-section h4 { font-size: 22px; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 2px solid var(--cpm-ink); }
.cpm-steps { list-style: none; margin: 0; padding: 0; }
.cpm-steps li, .cpm-materials li { list-style: none; }
.cpm-steps li { margin: 0; padding: 0; border-bottom: 1px solid var(--cpm-line); }
.cpm-steps label { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; cursor: pointer; }
.cpm-steps label:hover .cpm-step-text { color: #000; }
.cpm-step { position: absolute; opacity: 0; pointer-events: none; }
.cpm-box { flex: none; position: relative; width: 20px; height: 20px; margin-top: 3px; border: 1.5px solid var(--cpm-ink); border-radius: 4px; background: transparent; transition: background .15s, border-color .15s; }
.cpm-step:checked + .cpm-box { background: var(--cpm-accent); border-color: var(--cpm-accent); }
.cpm-step:checked + .cpm-box::after { content: ""; position: absolute; left: 5.5px; top: 1.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cpm-step:focus-visible + .cpm-box { outline: 2px solid var(--cpm-accent); outline-offset: 2px; }
.cpm-steps .is-done .cpm-step-text { color: var(--cpm-muted); text-decoration: line-through; }

/* Row counter – floats at the bottom while the card is in view */
.cpm-counter { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: center; gap: 14px; width: fit-content; max-width: 100%; margin: 32px auto 0; padding: 8px 10px 8px 20px; background: var(--cpm-ink); color: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .22); }
.cpm-counter-label { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .65; }
.cpm-count { min-width: 2ch; text-align: center; font: 600 24px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.cpm-count-btn { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; font-size: 20px; color: #fff; background: rgba(255, 255, 255, .14); border-radius: 6px; transition: background .15s; }
.cpm-count-btn:hover { background: var(--cpm-accent); }
.cpm-count-btn:active { transform: scale(.94); }
.cpm-count-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cpm-counter .cpm-link { color: #fff; opacity: .65; padding: 0 8px; }
.cpm-counter .cpm-link:hover { color: #fff; opacity: 1; }

/* Mobile */
@media (max-width: 680px) {
	.cpm-head, .cpm-cols { grid-template-columns: 1fr; }
	.cpm-photo { order: 0; }
	.cpm-photo img { aspect-ratio: 4 / 3; }
	.cpm-facts { grid-template-columns: 1fr 1fr; row-gap: 14px; }
	.cpm-facts li:nth-child(odd) { padding-left: 0; border-left: 0; }
	.cpm-counter-label { display: none; }
}

/* Print: show only the card being printed */
@media print {
	body.cpm-printing * { visibility: hidden !important; }
	body.cpm-printing .cpm-print-target, body.cpm-printing .cpm-print-target * { visibility: visible !important; }
	body.cpm-printing .cpm-print-target { position: absolute; left: 0; top: 0; width: 100%; margin: 0; border: 0; padding: 0; }
	.cpm-print-target .cpm-actions, .cpm-print-target .cpm-counter, .cpm-print-target .cpm-rating, .cpm-print-target .cpm-reset-steps, .cpm-print-target .cpm-progress { display: none !important; }
	.cpm-print-target .cpm-section { break-inside: avoid; }
}

/* "Jump to pattern" button after the first image (not sticky) */
.cpm-jump-wrap { margin: 1.4em 0; text-align: center; }
.cpm-jump-btn { cursor: pointer; display: inline-flex; align-items: center; padding: 14px 28px; font: 600 15px/1 "Helvetica Neue", Helvetica, "Segoe UI", system-ui, sans-serif; letter-spacing: .02em; text-transform: none; color: #fff; background: #1c1b1a; border: 0; border-radius: 10px; transition: background .15s; }
.cpm-jump-btn::after { content: "\2193"; margin-left: 10px; }
.cpm-jump-btn:hover, .cpm-jump-btn:focus-visible { background: #d9624b; color: #fff; }
.cpm-counter { display: none !important; }
html { scroll-behavior: smooth; }
@media print { .cpm-jump-wrap { display: none !important; } }

/* Quick Crochet Projects theme alignment: forest, terracotta, sage and warm ivory. */
.cpm-card {
	--cpm-accent: #a3492f;
	--cpm-ink: #244d3d;
	--cpm-muted: #62695f;
	--cpm-bg: #fffefa;
	--cpm-tint: #faf5eb;
	--cpm-line: #ddd4c5;
	margin: 3rem 0;
	padding: clamp(24px, 5vw, 46px);
	border: 1px solid var(--cpm-line);
	border-radius: 22px;
	box-shadow: 0 12px 28px rgba(36, 77, 61, .07);
	font-family: "DM Sans", Arial, sans-serif;
	line-height: 1.75;
}
.cpm-card h2,
.cpm-card h3,
.cpm-card h4 {
	color: var(--cpm-ink);
	font-family: "DM Serif Display", Georgia, serif;
	font-weight: 400;
	letter-spacing: 0;
}
.cpm-head { gap: clamp(24px, 4vw, 48px); }
.cpm-photo img { border-radius: 20px; }
.cpm-eyebrow {
	color: var(--cpm-accent);
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.8px;
}
.cpm-title { font-size: clamp(30px, 4.3vw, 43px); line-height: 1.16; }
.cpm-summary { color: var(--cpm-muted); }
.cpm-star.is-on { color: var(--cpm-accent); }
.cpm-card .cpm-btn,
.cpm-jump-btn {
	border-color: var(--cpm-ink);
	border-radius: 30px;
	font-family: "DM Sans", Arial, sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	padding: 12px 21px;
}
.cpm-card .cpm-btn { color: var(--cpm-ink); }
.cpm-card .cpm-btn:hover { background: #edf1e6; color: var(--cpm-ink); border-color: var(--cpm-ink); }
.cpm-card .cpm-btn-primary,
.cpm-jump-btn { background: var(--cpm-ink); color: #fff; }
.cpm-card .cpm-btn-primary:hover,
.cpm-jump-btn:hover,
.cpm-jump-btn:focus-visible { background: #193c2e; border-color: #193c2e; color: #fff; }
.cpm-facts {
	gap: 0;
	padding: 16px 18px;
	border: 1px solid var(--cpm-line);
	border-radius: 16px;
	background: #edf1e6;
}
.cpm-facts li { border-color: #c8d1bf; }
.cpm-fact-label { color: var(--cpm-ink); font-family: "DM Sans", Arial, sans-serif; font-weight: 700; }
.cpm-fact-value { color: #35483b; }
.cpm-block h3,
.cpm-pattern h3 { color: var(--cpm-ink); font-family: "DM Sans", Arial, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.cpm-materials li { border-color: var(--cpm-line); }
.cpm-gauge p { color: var(--cpm-ink); font-family: "DM Serif Display", Georgia, serif; }
.cpm-notes { border: 1px solid var(--cpm-line); border-radius: 16px; background: #faf5eb; }
.cpm-pattern-head { gap: 12px; }
.cpm-progress { height: 4px; background: #e6ddcd; }
.cpm-progress-bar { background: var(--cpm-accent); }
.cpm-section h4 { border-bottom-color: var(--cpm-ink); font-size: 25px; }
.cpm-steps li { border-color: var(--cpm-line); }
.cpm-steps label { padding: 14px 4px; }
.cpm-steps label:hover .cpm-step-text { color: var(--cpm-ink); }
.cpm-box { border-color: var(--cpm-ink); border-radius: 50%; }
.cpm-step:checked + .cpm-box { background: var(--cpm-accent); border-color: var(--cpm-accent); }
.cpm-link { color: var(--cpm-ink); }
.cpm-link:hover { color: var(--cpm-accent); }
.cpm-jump-wrap { margin: 1.8em 0; }
.cpm-jump-btn { border: 2px solid var(--cpm-ink); box-shadow: none; }
@media (max-width: 680px) {
	.cpm-card { border-radius: 18px; padding: 24px 19px; }
	.cpm-facts { padding: 15px 12px; }
	.cpm-facts li { padding: 4px 11px; }
}
