/*
Theme Name: FCP Cream
Theme URI: https://freecrochetpatterns.org/
Author: Free Crochet Patterns
Description: A warm, cream-toned block-free theme built for crochet pattern libraries: hero, pattern grids, category hubs, beginner tutorials and a calm reading experience.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fcp-cream
Tags: blog, custom-menu, featured-images, translation-ready
*/

:root {
	--cream: #fdfaf5;
	--cream-deep: #f7f0e6;
	--surface: #ffffff;
	--ink: #2f2a25;
	--ink-soft: #4a423a;
	--muted: #766a60;
	--line: #e9dfd2;
	--rose: #b96a52;
	--rose-soft: #f8e9e2;
	--sage: #6f8763;
	--sage-soft: #eaf1e5;
	--amber-soft: #fbf1d8;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 10px 30px rgba(47, 42, 37, 0.07);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1140px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--rose);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: #8f4c37;
}

h1,
h2,
h3,
h4 {
	font-family: var(--serif);
	line-height: 1.22;
	letter-spacing: -0.012em;
	color: var(--ink);
	margin: 0 0 0.55em;
}

h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.15em; }

ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; }
li { margin-bottom: 0.4em; }

blockquote {
	margin: 1.6em 0;
	padding: 0.9em 1.3em;
	background: var(--cream-deep);
	border-left: 3px solid var(--rose);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-family: var(--serif);
	font-size: 1.06em;
}

code, pre {
	font-family: Consolas, Monaco, monospace;
	font-size: 0.9em;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--ink);
	color: #fff;
	padding: 10px 16px;
	border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
	left: 0;
	color: #fff;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 22px;
}

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

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(253, 250, 245, 0.94);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--line);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 74px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--ink);
}

.brand__mark {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: radial-gradient(circle at 30% 30%, var(--rose-soft), var(--rose));
	box-shadow: inset 0 0 0 2px #fff;
	flex: none;
}

.brand__name {
	font-family: var(--serif);
	font-size: 1.2rem;
	font-weight: 600;
	line-height: 1.1;
}

.brand__tag {
	display: block;
	font-family: var(--sans);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	font-weight: 500;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav a {
	display: inline-block;
	padding: 8px 10px;
	border-radius: 999px;
	color: var(--ink-soft);
	text-decoration: none;
	font-size: 0.92rem;
	white-space: nowrap;
	font-weight: 500;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
	background: var(--rose-soft);
	color: #8f4c37;
}

.nav-toggle {
	display: none;
	border: 1px solid var(--line);
	background: var(--surface);
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 0.9rem;
	cursor: pointer;
	color: var(--ink);
}

@media (max-width: 860px) {
	.nav-toggle { display: inline-block; }

	.site-nav {
		display: none;
		width: 100%;
		padding-bottom: 14px;
	}

	.site-nav.is-open { display: block; }

	.site-nav ul { flex-direction: column; gap: 0; }

	.site-nav a { display: block; padding: 10px 8px; border-radius: var(--radius-sm); }
}

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

.hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(1000px 420px at 12% -10%, var(--rose-soft), transparent 60%),
		radial-gradient(800px 380px at 92% 0%, var(--sage-soft), transparent 62%),
		var(--cream);
	border-bottom: 1px solid var(--line);
}

.hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
	gap: 34px;
	align-items: center;
	padding: 64px 0 58px;
}

@media (max-width: 900px) {
	.hero__inner {
		grid-template-columns: 1fr;
		padding: 44px 0 40px;
	}
}

.hero__eyebrow {
	display: inline-block;
	margin-bottom: 14px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--surface);
	border: 1px solid var(--line);
	font-size: 0.76rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
}

.hero h1 {
	max-width: 22ch;
}

.hero__lede {
	font-size: 1.1rem;
	color: var(--ink-soft);
	max-width: 52ch;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}

.hero__art {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 22px;
	background:
		repeating-conic-gradient(from 45deg at 50% 50%, var(--rose-soft) 0deg 90deg, var(--sage-soft) 90deg 180deg),
		var(--cream-deep);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.hero__art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	border: 1px solid transparent;
	transition: transform 0.12s ease, background 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
	background: var(--rose);
	color: #fff;
}

.btn--primary:hover { background: #a35a44; color: #fff; }

.btn--ghost {
	background: var(--surface);
	border-color: var(--line);
	color: var(--ink);
}

.btn--ghost:hover { background: var(--cream-deep); color: var(--ink); }

/* ---------- Sections ---------- */

.section {
	padding: 56px 0;
}

.section--tint {
	background: linear-gradient(180deg, var(--cream-deep), var(--cream));
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 26px;
}

.section__head h2 { margin: 0; }

.section__head p {
	margin: 6px 0 0;
	color: var(--muted);
	max-width: 60ch;
}

.section__more {
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* ---------- Cards ---------- */

.grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
	color: inherit;
}

.card__media {
	aspect-ratio: 3 / 2;
	background: linear-gradient(135deg, var(--rose-soft), var(--sage-soft));
	overflow: hidden;
}

.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card__body {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.card__kicker {
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rose);
	font-weight: 700;
}

.card__title {
	font-family: var(--serif);
	font-size: 1.14rem;
	line-height: 1.3;
	margin: 0;
}

.card__meta {
	margin-top: auto;
	font-size: 0.82rem;
	color: var(--muted);
}

/* Featured pattern */

.feature {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
}

@media (max-width: 820px) {
	.feature { grid-template-columns: 1fr; }
}

.feature__media {
	min-height: 280px;
	background: linear-gradient(135deg, var(--sage-soft), var(--rose-soft));
}

.feature__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.feature__body {
	padding: 30px 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* ---------- Category chips ---------- */

.chips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.chips li { margin: 0; }

.chip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	text-decoration: none;
	color: var(--ink);
	font-weight: 600;
	font-size: 0.94rem;
}

.chip:hover {
	background: var(--rose-soft);
	color: #8f4c37;
}

.chip__count {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--muted);
}

/* ---------- Newsletter ---------- */

.newsletter {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: 28px;
	align-items: center;
	padding: 36px 38px;
	background: linear-gradient(120deg, var(--rose-soft), var(--amber-soft));
	border: 1px solid var(--line);
	border-radius: 20px;
}

@media (max-width: 820px) {
	.newsletter { grid-template-columns: 1fr; padding: 26px; }
}

.newsletter h2 { margin-top: 0; }

.newsletter p { margin-bottom: 0; color: var(--ink-soft); }

.newsletter__form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.newsletter__form input[type="email"] {
	flex: 1 1 200px;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 0.95rem;
	background: var(--surface);
}

/* ---------- Single post ---------- */

.post-hero {
	padding: 44px 0 26px;
	border-bottom: 1px solid var(--line);
	background: linear-gradient(180deg, var(--cream-deep), var(--cream));
}

.breadcrumbs {
	font-size: 0.82rem;
	color: var(--muted);
	margin-bottom: 14px;
}

.breadcrumbs a {
	color: var(--muted);
	text-decoration: none;
}

.breadcrumbs a:hover { color: var(--rose); }

.post-hero h1 {
	max-width: 30ch;
	margin-bottom: 14px;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	font-size: 0.86rem;
	color: var(--muted);
}

.post-meta__pill {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--surface);
	border: 1px solid var(--line);
}

.post-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 44px;
	padding: 40px 0 60px;
	align-items: start;
}

@media (max-width: 980px) {
	.post-layout { grid-template-columns: 1fr; gap: 30px; }
}

.entry {
	font-size: 1.06rem;
	color: var(--ink-soft);
}

.entry > p:first-of-type {
	font-size: 1.12rem;
}

.entry h2 {
	margin-top: 1.9em;
	padding-top: 0.2em;
}

.entry h2::after {
	content: "";
	display: block;
	width: 46px;
	height: 3px;
	margin-top: 10px;
	border-radius: 3px;
	background: var(--rose-soft);
}

.entry h3 { margin-top: 1.5em; }

.entry figure { margin: 1.8em 0; }

.entry img { border-radius: var(--radius-sm); }

.entry figcaption {
	margin-top: 8px;
	font-size: 0.85rem;
	color: var(--muted);
	text-align: center;
}

.entry table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.6em 0;
	font-size: 0.95rem;
	background: var(--surface);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.entry th,
.entry td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.entry th {
	width: 34%;
	background: var(--cream-deep);
	font-weight: 600;
}

.entry tr:last-child th,
.entry tr:last-child td { border-bottom: 0; }

.entry a { font-weight: 500; }

.entry .fcp-attribution {
	margin-top: 2em;
	padding: 12px 16px;
	background: var(--cream-deep);
	border-radius: var(--radius-sm);
	font-size: 0.92rem;
	color: var(--muted);
}

/* Sidebar */

.sidebar {
	display: grid;
	gap: 20px;
	position: sticky;
	top: 96px;
}

@media (max-width: 980px) {
	.sidebar { position: static; }
}

.widget {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 22px;
}

.widget h2,
.widget h3 {
	font-size: 1.02rem;
	margin: 0 0 12px;
}

.widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.93rem;
}

.widget li {
	margin: 0;
	padding: 8px 0;
	border-bottom: 1px dashed var(--line);
}

.widget li:last-child { border-bottom: 0; }

.widget a { text-decoration: none; color: var(--ink-soft); }

.widget a:hover { color: var(--rose); }

/* ---------- Archive / page ---------- */

.page-head {
	padding: 42px 0 26px;
	background: linear-gradient(180deg, var(--cream-deep), var(--cream));
	border-bottom: 1px solid var(--line);
}

.page-head h1 { margin-bottom: 8px; }

.page-head p { color: var(--muted); max-width: 62ch; margin: 0; }

.archive-list {
	display: grid;
	gap: 18px;
	padding: 34px 0 56px;
}

.post-row {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	gap: 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 16px;
	text-decoration: none;
	color: inherit;
}

@media (max-width: 640px) {
	.post-row { grid-template-columns: 1fr; }
}

.post-row:hover { box-shadow: var(--shadow); color: inherit; }

.post-row__media {
	aspect-ratio: 4 / 3;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: linear-gradient(135deg, var(--rose-soft), var(--sage-soft));
}

.post-row__media img { width: 100%; height: 100%; object-fit: cover; }

.post-row h2 {
	font-size: 1.2rem;
	margin: 0 0 6px;
}

.post-row p {
	margin: 0 0 10px;
	font-size: 0.94rem;
	color: var(--muted);
}

/* Pagination */

.pagination {
	padding: 10px 0 56px;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 38px;
	padding: 8px 12px;
	margin: 0 4px 6px 0;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	text-decoration: none;
	color: var(--ink-soft);
	font-size: 0.9rem;
	text-align: center;
}

.pagination .current {
	background: var(--rose);
	border-color: var(--rose);
	color: #fff;
}

/* ---------- 404 ---------- */

.empty-state {
	padding: 72px 0 90px;
	text-align: center;
}

.empty-state p { color: var(--muted); }

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

.site-footer {
	background: #241f1b;
	color: #ded5ca;
	margin-top: 20px;
	padding: 52px 0 26px;
}

.site-footer a { color: #f2e9df; text-decoration: none; }

.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: 30px;
}

@media (max-width: 860px) {
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .brand__name { color: #fff; }

.footer-brand p {
	margin-top: 12px;
	color: #b8ada2;
	font-size: 0.92rem;
	max-width: 34ch;
}

.footer-col h3 {
	color: #fff;
	font-family: var(--sans);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.footer-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.92rem;
}

/* wp_list_categories() prints bare <li> items, so the marker has to be cleared here. */
.footer-col li {
	margin-bottom: 9px;
	list-style: none;
}

.footer-col li::marker {
	content: "";
}

.footer-bottom {
	margin-top: 36px;
	padding-top: 18px;
	border-top: 1px solid #3a332d;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	font-size: 0.82rem;
	color: #9c9186;
}

.footer-licence {
	flex: 1 1 100%;
	max-width: 82ch;
	margin-top: 4px;
	line-height: 1.6;
}

.footer-licence a {
	color: #f2e9df;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.footer-licence__link {
	display: block;
	margin-top: 6px;
}

/* ---------- Accessibility & print ---------- */

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

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.sidebar,
	.newsletter { display: none !important; }

	body { background: #fff; color: #000; }
}
