/*
Theme Name: Crafterify
Theme URI: https://crafterify.com/
Author: Crafterify
Author URI: https://crafterify.com/
Description: A fast, lightweight magazine theme for Crafterify: renter-friendly storage and small space guides. No page builder, no external requests.
Version: 1.2.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: crafterify
*/

/* Fonts: Bricolage Grotesque and Literata, SIL Open Font License 1.1 */
@font-face { font-family: "Bricolage Grotesque"; src: url("assets/fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("assets/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
	--ink: #1E2B2F;
	--ink-soft: #4B5B5F;
	--paper: #FFFFFF;
	--wash: #EEF3F1;
	--line: #D5DDDA;
	--teal: #24615C;
	--teal-dark: #1A4844;
	--tape: #F3C44B;
	--tape-soft: #FDF4D8;

	--sans: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
	--serif: "Literata", Georgia, "Times New Roman", serif;

	--wrap: 1180px;
	--narrow: 720px;
	--gutter: clamp(16px, 4vw, 32px);
	--radius: 10px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: 1.0625rem;
	line-height: 1.7;
	text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--teal-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; color: var(--ink); }
p { margin: 0 0 1.1em; }
button, input { font: inherit; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-family: var(--sans); }
.skip-link:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: calc(960px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* Header */
.site-header { background: var(--paper); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.brand { margin-right: auto; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; }
.wordmark:hover { color: var(--ink); }
.wordmark__icon { width: 34px; height: 34px; color: var(--ink); }
.custom-logo { max-height: 48px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav .menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav .menu a { display: block; white-space: nowrap; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 500; font-size: 0.97rem; }
.site-nav .menu a:hover, .site-nav .current-menu-item > a, .site-nav .current-cat > a { background: var(--wash); }

.nav-search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 14px; }
.nav-search input { border: 0; outline: 0; width: 110px; background: transparent; font-family: var(--sans); font-size: 0.95rem; padding: 6px 0; }
.nav-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36, 97, 92, 0.15); }
.nav-search button { border: 0; background: transparent; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--ink); border-radius: 50%; }
.nav-search button svg { width: 18px; height: 18px; }

.nav-toggle { display: none; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 8px 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; color: var(--ink); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform 0.2s ease; }
.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-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* The tape-measure strip under the header */
.ruler {
	height: 14px;
	background-color: var(--tape);
	background-image:
		repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 48px),
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 12px);
	background-size: 100% 9px, 100% 5px;
	background-repeat: no-repeat;
	background-position: 0 0, 0 0;
	border-bottom: 1px solid #C99A1F;
}

/* Hero */
.hero { background: var(--wash); border-bottom: 1px solid var(--line); }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 6vw, 72px); }
.hero__title { font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 14ch; margin-bottom: 0.45em; }
.hero__lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 40ch; }
.hero__figure { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.hero-plan text { font-family: var(--sans); font-size: 14px; font-weight: 700; fill: var(--ink); }
.hero-plan .lbl { font-weight: 500; font-size: 12px; fill: var(--ink-soft); }
.hero-plan .note { font-weight: 500; font-size: 12px; fill: var(--teal); }

.room-chips { list-style: none; margin: 1.6em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.room-chips a { display: inline-block; padding: 7px 14px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-family: var(--sans); font-weight: 500; font-size: 0.95rem; }
.room-chips a:hover { background: var(--ink); color: #fff; }

/* Sections */
.section { padding-block: clamp(40px, 6vw, 72px); }
.section--tint { background: var(--wash); border-block: 1px solid var(--line); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0; }

/* Category labels */
.cat-label { display: inline-block; font-family: var(--sans); font-weight: 500; font-size: 0.85rem; color: var(--teal); text-decoration: none; margin-bottom: 6px; }
.cat-label::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--tape); margin-right: 7px; vertical-align: -0.05em; }

/* Fallback thumbnail: graph paper with the room name */
.thumb-fallback {
	display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9;
	background-color: var(--wash);
	background-image:
		linear-gradient(var(--line) 1px, transparent 1px),
		linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 22px 22px;
	color: var(--ink); font-family: var(--sans); font-weight: 700; font-size: 1.1rem;
}
.thumb-fallback span { background: #fff; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 6px; }

/* Lead story */
.row-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; padding-bottom: clamp(28px, 4vw, 44px); margin-bottom: clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); }
.row-card__media { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.row-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.row-card__title { font-size: clamp(1.6rem, 3vw, 2.25rem); line-height: 1.1; letter-spacing: -0.025em; }
.row-card__title a { color: var(--ink); text-decoration: none; }
.row-card__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.row-card__excerpt { color: var(--ink-soft); font-size: 1.05rem; }
.row-card__meta { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.card__media { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; }
.card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card__title { font-size: 1.25rem; line-height: 1.2; margin-bottom: 0.4em; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.card__excerpt { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.6; margin: 0; }

/* Rooms list */
.room-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.room-list__item a { display: flex; flex-direction: column; height: 100%; padding: 18px 18px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.room-list__item a:hover { border-color: var(--ink); }
.room-list__name { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; }
.room-list__desc { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; margin: 6px 0 14px; }
.room-list__count { margin-top: auto; font-family: var(--sans); font-size: 0.85rem; color: var(--teal); }

/* How our guides work */
.promise__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: 24px; }
.promise__grid h3 { font-size: 1.15rem; padding-top: 14px; border-top: 3px solid var(--ink); }
.promise__grid p { color: var(--ink-soft); margin: 0; }
.promise__links { display: flex; flex-wrap: wrap; gap: 20px; margin: 28px 0 0; font-family: var(--sans); font-weight: 500; }

/* Breadcrumbs */
.breadcrumbs { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 8px; color: var(--line); }

/* Article */
.article__header { padding-top: clamp(28px, 5vw, 56px); }
.article__title { font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 0.4em; }
.article__dek { font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); margin-bottom: 0.9em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--sans); font-size: 0.92rem; color: var(--ink-soft); padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.post-meta a { color: var(--ink); font-weight: 500; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.article__hero { margin-top: 28px; margin-bottom: 0; }
.article__hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.article__hero figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); margin-top: 8px; }
.article__body { padding-top: 32px; padding-bottom: 24px; }
.article--page .article__body { padding-bottom: 64px; }

/* Guide outline */
.toc { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 32px; background: #fff; }
.toc summary { font-family: var(--sans); font-weight: 700; cursor: pointer; list-style-position: outside; }
.toc ol { margin: 10px 0 2px; padding-left: 1.3em; font-family: var(--sans); font-size: 0.98rem; line-height: 1.5; }
.toc li { margin: 6px 0; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }

/* Prose */
.prose > * + * { margin-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 1.85rem); margin-top: 1.9em; padding-top: 0.2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--teal); }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--ink); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose figcaption, .prose .wp-element-caption { font-family: var(--sans); font-size: 0.86rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; text-align: left; }
.prose .wp-block-image { margin: 1.8em 0; }

.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.95rem; line-height: 1.45; }
.prose .wp-block-table { margin: 1.6em 0; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose thead th { border-bottom: 2px solid var(--ink); font-weight: 700; }
.prose .wp-block-table figcaption { margin-top: 8px; }

/* Quick answer box */
.prose .quick-answer {
	background: var(--tape-soft);
	border-left: 6px solid var(--tape);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 18px 22px 6px;
	margin: 0 0 2em;
}
.prose .quick-answer p:first-child { font-family: var(--sans); font-weight: 700; margin-bottom: 0.4em; }

/* Measure-first callout */
.prose .measure-box { border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px 22px 4px; margin: 1.8em 0; }
.prose .measure-box p:first-child { font-family: var(--sans); font-weight: 700; margin-bottom: 0.3em; }

/* Author box */
.author-box { margin-top: 44px; padding: 20px 22px 6px; background: var(--wash); border-radius: var(--radius); font-size: 0.98rem; }
.author-box__name { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.3em; }
.author-box__name a { color: var(--ink); text-decoration: none; }

/* Related */
.related { padding-block: 36px 72px; border-top: 1px solid var(--line); margin-top: 32px; }
.related h2 { font-size: 1.6rem; margin-bottom: 22px; }

/* Archives */
.archive-head { background: var(--wash); border-bottom: 1px solid var(--line); padding-block: clamp(28px, 5vw, 52px); }
.archive-head__title { font-size: clamp(2rem, 4.4vw, 2.8rem); letter-spacing: -0.03em; margin-bottom: 0.3em; }
.archive-head__desc { color: var(--ink-soft); font-size: 1.1rem; max-width: 60ch; }
.archive-head__desc p { margin: 0; }
.empty-state { color: var(--ink-soft); }
.empty-state > p { margin-bottom: 28px; }

.pagination { margin-top: 40px; font-family: var(--sans); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

.search-form { display: flex; gap: 8px; max-width: 520px; margin: 16px 0; }
.search-form input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.search-form button, .button { display: inline-block; padding: 10px 18px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-family: var(--sans); font-weight: 500; cursor: pointer; text-decoration: none; }
.search-form button:hover, .button:hover { background: var(--teal); color: #fff; }

/* Footer */
.site-footer { background: var(--ink); color: #D9E2DF; font-size: 0.97rem; margin-top: 0; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 36px; padding-block: 52px 36px; }
.site-footer__name { font-family: var(--sans); font-weight: 700; font-size: 1.35rem; color: #fff; margin-bottom: 0.4em; }
.site-footer__about p:last-child { max-width: 44ch; }
.site-footer__heading { font-family: var(--sans); font-weight: 700; color: var(--tape); margin-bottom: 0.6em; }
.site-footer .menu { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.site-footer .menu li { margin: 0 0 8px; }
.site-footer__base { border-top: 1px solid rgba(255, 255, 255, 0.15); padding-block: 18px 26px; font-family: var(--sans); font-size: 0.85rem; color: #A9B8B4; }
.site-footer__base p { margin: 0; }

/* Core blocks used in guides (the block library stylesheet is not loaded) */
.wp-block-image img { height: auto; }
.wp-block-image a { display: block; }
.wp-block-table table { width: 100%; }
.wp-block-group { box-sizing: border-box; }
.wp-block-group__inner-container > :last-child { margin-bottom: 1.1em; }
.wp-block-list { padding-left: 1.3em; }

/* Block editor alignment helpers */
.alignwide { margin-inline: calc(-1 * min(120px, 8vw)); }
.alignfull { margin-inline: calc(50% - 50vw); }
.aligncenter { margin-inline: auto; }
.has-text-align-center { text-align: center; }

/* Tablet */
@media (max-width: 1100px) {
	.nav-toggle { display: inline-flex; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 12px;
		background: #fff; border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px;
		box-shadow: 0 12px 24px rgba(30, 43, 47, 0.08);
	}
	.nav-open .site-nav { display: flex; }
	.site-nav .menu { flex-direction: column; }
	.site-nav .menu a { padding: 12px 8px; font-size: 1.05rem; border-bottom: 1px solid var(--wash); border-radius: 0; }
	.nav-search input { width: 100%; }
	.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hero__inner { grid-template-columns: 1fr; }
	.hero__title { max-width: 18ch; }
}

/* Phone */
@media (max-width: 640px) {
	body { font-size: 1.03rem; }
	.site-header__inner { min-height: 62px; }
	.wordmark { font-size: 1.25rem; }
	.wordmark__icon { width: 30px; height: 30px; }
	.nav-toggle__label { display: none; }
	.row-card { grid-template-columns: 1fr; }
	.card-grid { grid-template-columns: 1fr; }
	.promise__grid { grid-template-columns: 1fr; }
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
	.site-footer__about { grid-column: 1 / -1; }
	.prose .quick-answer, .prose .measure-box { padding-inline: 16px; }
	.alignwide { margin-inline: 0; }
}

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

@media print {
	.site-header, .site-footer, .related, .toc, .author-box { display: none; }
}
