/*
Theme Name: How to Save Money
Theme URI: https://example.com/how-to-save-money
Author: How to Save Money
Description: A practical editorial guide to spending less and keeping more, with a tip library, a savings plan, and a goal calculator.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: how-to-save-money
*/

@font-face {
	font-family: "Source Serif 4";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Source Serif 4";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Source Serif 4";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/source-serif-4-latin-700-normal.woff2") format("woff2");
}

:root {
	--paper: #f3eee6;
	--paper-2: #e7e0d4;
	--card: #fffdf8;
	--ink: #142033;
	--ink-soft: #3d4a5c;
	--line: #ddd4c6;
	--forest: #1b5e45;
	--forest-deep: #123c2d;
	--moss: #e5f2eb;
	--header: 4.75rem;
	--serif: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
	--sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
	--shell: 1120px;
	--shadow: 0 24px 50px rgba(20, 32, 51, 0.08);
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header) + 0.75rem);
}

body {
	margin: 0;
	color: var(--ink);
	background:
		radial-gradient(ellipse at 0% -10%, rgba(255, 255, 255, 0.9), transparent 46%),
		radial-gradient(ellipse at 100% 0%, rgba(27, 94, 69, 0.06), transparent 42%),
		var(--paper);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	text-rendering: optimizeLegibility;
}

body.nav-open {
	overflow: hidden;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

h1,
h2,
h3,
p {
	margin-top: 0;
}

h1,
h2,
h3,
.logo-text,
.calc-figure,
.split-card__title {
	font-family: var(--serif);
	font-weight: 600;
	letter-spacing: -0.03em;
}

h1 {
	margin-bottom: 0.85rem;
	font-size: clamp(2.7rem, 6.4vw, 5.15rem);
	line-height: 0.98;
}

h2 {
	margin-bottom: 0.75rem;
	font-size: clamp(2rem, 3.4vw, 3rem);
	line-height: 1.08;
}

h3 {
	margin-bottom: 0.4rem;
	font-size: 1.45rem;
	line-height: 1.2;
}

p {
	margin-bottom: 0;
}

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

:focus-visible {
	outline: 2px solid var(--forest);
	outline-offset: 3px;
}

::selection {
	background: #d5e8df;
}

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

.skip-link {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 40;
	padding: 0.55rem 0.9rem;
	background: var(--ink);
	color: var(--paper);
	text-decoration: none;
}

.skip-link:focus {
	top: 1rem;
}

.shell {
	width: min(var(--shell), calc(100% - 2.5rem));
	margin-inline: auto;
}

.eyebrow {
	margin-bottom: 0.7rem;
	color: var(--forest);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.eyebrow a {
	color: inherit;
	text-decoration: none;
}

.eyebrow--light {
	color: #d7efe4;
}

.lede,
.section-lede {
	max-width: 42rem;
	color: var(--ink-soft);
	font-size: 1.14rem;
	line-height: 1.55;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 30;
	background: rgba(243, 238, 230, 0.96);
	border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
	border-bottom-color: var(--line);
}

.header-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--header);
	gap: 1rem;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--ink);
	text-decoration: none;
}

.logo-mark,
.topic-card__icon,
.nav-toggle__icon,
.search-form svg {
	display: inline-flex;
	color: var(--forest);
}

.logo-mark svg,
.nav-toggle svg,
.search-form svg {
	width: 1.35rem;
	height: 1.35rem;
}

.custom-logo-link {
	display: inline-flex;
}

.custom-logo {
	width: 2rem;
	height: 2rem;
	object-fit: contain;
}

.logo-text {
	font-size: 1.2rem;
	letter-spacing: -0.03em;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.nav-list {
	display: flex;
	gap: 1.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav-list a {
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
}

.nav-list .current-menu-item > a,
.nav-list .current_page_item > a {
	color: var(--forest-deep);
	box-shadow: inset 0 -2px 0 var(--forest);
}

.nav-toggle {
	display: none;
	align-items: center;
	gap: 0.4rem;
	border: 0;
	background: transparent;
	padding: 0.35rem 0;
	cursor: pointer;
}

.nav-toggle__icon--close {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon--open {
	display: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon--close {
	display: inline-flex;
}

.search-form {
	display: flex;
	align-items: center;
	border-bottom: 1px solid var(--line);
}

.search-form input {
	width: 8.5rem;
	border: 0;
	background: transparent;
	padding: 0.35rem 0;
}

.search-form input:focus {
	outline: none;
}

.search-form button {
	display: inline-flex;
	border: 0;
	background: transparent;
	padding: 0.3rem;
	cursor: pointer;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.7rem 1.15rem;
	border: 1px solid transparent;
	text-decoration: none;
	font-weight: 700;
	line-height: 1;
}

.button--solid {
	background: var(--forest);
	color: #f4fbf7;
}

.button--solid:hover {
	background: var(--forest-deep);
}

.button--ghost {
	border-color: var(--ink);
	background: transparent;
	color: var(--ink);
}

.button--ghost:hover {
	background: rgba(20, 32, 51, 0.04);
}

.button--light {
	background: #f6f1e8;
	color: var(--ink);
}

.button--light:hover {
	background: #fff;
}

.hero {
	padding: 3.5rem 0 4rem;
}

.hero-grid,
.feature-grid,
.faq-layout {
	display: grid;
	grid-template-columns: 1.3fr 0.9fr;
	gap: 3rem;
}

.hero-grid {
	align-items: center;
	grid-template-columns: 1.05fr 0.95fr;
}

.hero-visual {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.hero-photo,
.picture-break img,
.feature-photo {
	display: block;
	width: 100%;
	height: auto;
}

.hero-photo,
.picture-break img {
	border: 1px solid var(--line);
}

.picture-break {
	margin: 2.5rem auto 0;
	padding: 0;
}

.faq-layout {
	align-items: start;
}

.hero-copy h1 {
	max-width: 11ch;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.6rem;
}

.split-card {
	background: var(--card);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
	padding: 1.5rem 1.4rem 1.35rem;
}

.split-card__kicker {
	margin-bottom: 0.35rem;
	color: var(--forest);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.split-card__title {
	margin-bottom: 1.1rem;
	font-size: 1.7rem;
}

.split-bars {
	margin: 0;
	padding: 0;
	list-style: none;
}

.split-bars li + li {
	margin-top: 0.9rem;
}

.split-bars__meta {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.35rem;
	font-size: 0.95rem;
}

.split-bars__meta strong {
	font-family: var(--serif);
	font-size: 1.2rem;
}

.split-bars__track {
	display: block;
	height: 0.45rem;
	background: var(--paper-2);
}

.split-bars__fill {
	display: block;
	height: 100%;
	background: var(--ink);
}

.split-bars__fill--needs {
	width: 50%;
}

.split-bars__fill--wants {
	width: 30%;
	background: #8d97a3;
}

.split-bars__fill--save {
	width: 20%;
	background: var(--forest);
}

.split-card__note {
	margin-top: 1.1rem;
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.method,
.topics,
.tips-preview,
.calc-section,
.faq-section,
.related {
	padding: 4.25rem 0;
}

.section-head {
	margin-bottom: 1.75rem;
	max-width: 40rem;
}

.section-head--row {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 1.5rem;
	max-width: none;
}

.text-link {
	color: var(--forest-deep);
	font-weight: 700;
	text-underline-offset: 0.18em;
}

.method-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.method-list li {
	padding: 1.6rem 1.5rem 1.7rem 0;
	border-bottom: 1px solid var(--line);
}

.method-list li:nth-child(odd) {
	padding-right: 2rem;
	border-right: 1px solid var(--line);
}

.method-list li:nth-child(even) {
	padding-left: 2rem;
}

.method-list__num {
	display: block;
	margin-bottom: 0.55rem;
	color: var(--forest);
	font-family: var(--serif);
	font-size: 1.7rem;
}

.method-list p,
.topic-card__text,
.tip-row__excerpt,
.footer-brand p,
.calc-caption,
.calc-weekly,
.calculator__hint {
	color: var(--ink-soft);
}

.topic-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	border-top: 1px solid var(--line);
	border-left: 1px solid var(--line);
}

.topic-card {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	min-height: 13.5rem;
	padding: 1.35rem 1.2rem 1.4rem;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	color: inherit;
	text-decoration: none;
	background: transparent;
}

.topic-card:hover {
	background: var(--card);
}

.topic-card__icon svg {
	width: 1.8rem;
	height: 1.8rem;
}

.topic-card__name {
	font-family: var(--serif);
	font-size: 1.45rem;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.feature {
	background: var(--ink);
	color: #f6f1e8;
	padding: 4.25rem 0;
}

.feature-grid > div > p:not(.eyebrow) {
	max-width: 38rem;
	color: #d9dee6;
	font-size: 1.12rem;
}

.feature-grid {
	align-items: center;
	grid-template-columns: minmax(0, 1.15fr) minmax(220px, 340px);
}

.feature .button {
	margin-top: 1.5rem;
}

.feature-photo {
	width: 100%;
	height: auto;
}

.tip-list {
	border-top: 1px solid var(--line);
}

.tip-row {
	display: grid;
	grid-template-columns: 4.2rem minmax(0, 1fr) auto;
	gap: 1rem 1.25rem;
	align-items: start;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--line);
}

.tip-row__index {
	margin: 0.15rem 0 0;
	font-family: var(--serif);
	font-size: 1.35rem;
	color: var(--forest);
}

.tip-row__topic {
	margin-bottom: 0.2rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.tip-row__topic a {
	color: var(--forest);
	text-decoration: none;
}

.tip-row__title {
	margin-bottom: 0.35rem;
	font-size: 1.55rem;
}

.tip-row__title a {
	color: inherit;
	text-decoration: none;
}

.tip-row__title a:hover,
.topic-card:hover .topic-card__name,
.tip-row__topic a:hover {
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.tip-row__go {
	align-self: center;
	color: var(--forest-deep);
	font-weight: 700;
	text-decoration: none;
}

.calculator {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	background: var(--card);
	border: 1px solid var(--line);
	box-shadow: var(--shadow);
}

.calculator__fields,
.calculator__result {
	padding: 1.6rem;
}

.calculator__kicker,
.calculator__result-label {
	margin-bottom: 1rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.calculator__kicker {
	color: var(--forest);
}

.field + .field {
	margin-top: 0.9rem;
}

.field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 700;
}

.field input {
	width: 100%;
	border: 1px solid var(--line);
	background: var(--paper);
	padding: 0.75rem 0.85rem;
	font-size: 1.2rem;
}

.calculator__hint {
	margin-top: 1rem;
	font-size: 0.92rem;
}

.calculator__result {
	background: var(--forest);
	color: #f4fbf7;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.calculator__result-label,
.calc-caption,
.calc-weekly {
	color: #d7efe4;
}

.calc-figure {
	font-size: clamp(2.6rem, 5vw, 4.4rem);
	line-height: 0.95;
	letter-spacing: -0.04em;
	overflow-wrap: anywhere;
}

.calc-caption {
	margin-top: 0.45rem;
	font-size: 1.15rem;
}

.calc-weekly {
	margin-top: 0.8rem;
}

.calculator.is-error .calc-figure {
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	line-height: 1.15;
}

.calculator__noscript {
	grid-column: 1 / -1;
	margin: 0;
	padding: 0 1.6rem 1.4rem;
}

.faq-item {
	border-top: 1px solid var(--line);
}

.faq-item:last-child {
	border-bottom: 1px solid var(--line);
}

.faq-item summary {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.05rem 0;
	cursor: pointer;
	font-weight: 700;
	list-style: none;
}

.faq-item summary::-webkit-details-marker {
	display: none;
}

.faq-item summary::after {
	content: "+";
	font-family: var(--serif);
	font-size: 1.5rem;
	line-height: 1;
	color: var(--forest);
}

.faq-item[open] summary::after {
	content: "–";
}

.faq-item p {
	margin: 0 0 1.1rem;
	max-width: 62ch;
	color: var(--ink-soft);
}

.closing {
	padding: 1rem 0 4.5rem;
}

.closing-inner {
	padding-top: 2.5rem;
	border-top: 1px solid var(--line);
}

.closing-inner p {
	max-width: 36rem;
	margin: 0.4rem 0 1.3rem;
	color: var(--ink-soft);
}

.page-hero {
	padding: 3.2rem 0 1.5rem;
}

.page-hero h1 {
	max-width: 16ch;
	font-size: clamp(2.5rem, 5vw, 4.4rem);
}

.contact-email {
	margin-top: 1.6rem;
}

.contact-email a {
	font-family: var(--serif);
	font-size: clamp(1.7rem, 3vw, 2.5rem);
	letter-spacing: -0.03em;
	color: var(--forest-deep);
	text-underline-offset: 0.14em;
}

.contact-page {
	padding-bottom: 3rem;
}

.guide-layout {
	display: grid;
	grid-template-columns: 220px minmax(0, 68ch);
	gap: 3rem;
	align-items: start;
	padding-bottom: 4rem;
}

.toc {
	position: sticky;
	top: calc(var(--header) + 1rem);
}

.toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: toc;
}

.toc li {
	counter-increment: toc;
	margin: 0.45rem 0;
}

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

.toc a::before {
	content: counter(toc, decimal-leading-zero) " ";
	color: var(--forest);
	font-variant-numeric: tabular-nums;
}

.toc a:hover,
.entry-content a {
	color: var(--forest-deep);
}

.entry-content {
	font-size: 1.08rem;
	line-height: 1.7;
}

.entry-content h2 {
	margin: 2.3rem 0 0.75rem;
	font-size: 2rem;
}

.entry-content p,
.entry-content ul {
	margin: 0 0 1rem;
}

.entry-content blockquote {
	margin: 1.8rem 0;
	padding: 0.15rem 0 0.15rem 1.15rem;
	border-left: 2px solid var(--forest);
}

.entry-content blockquote p {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.55rem;
	line-height: 1.35;
	color: var(--ink);
}

.entry-content h2.start-this-week {
	margin: 2.4rem 0 0;
	padding: 1rem 1.15rem 0.25rem;
	background: var(--moss);
	font-size: 1.35rem;
}

.entry-content h2.start-this-week + p {
	margin-top: 0;
	padding: 0.2rem 1.15rem 1.1rem;
	background: var(--moss);
}

.tip-meta {
	margin-top: 0.8rem;
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.calc-page {
	padding-bottom: 4rem;
}

.calc-help {
	max-width: 68ch;
	margin-top: 2.4rem;
}

.topic-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.topic-pill {
	display: inline-flex;
	align-items: center;
	min-height: 2.3rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
}

.topic-pill.is-current,
.topic-pill:hover {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.empty-note {
	margin: 1rem 0 3rem;
	color: var(--ink-soft);
}

.index-item {
	padding: 1.2rem 0;
	border-top: 1px solid var(--line);
}

.index-item h2 {
	font-size: 1.8rem;
}

.index-item a {
	color: inherit;
	text-decoration: none;
}

.pagination {
	margin: 2rem 0 4rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.7rem;
	border: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.site-footer {
	background: var(--ink);
	color: #f6f1e8;
	padding: 3rem 0 2rem;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 0.8fr 1fr;
	gap: 2rem;
}

.footer-brand .logo-text {
	margin-bottom: 0.45rem;
	font-size: 1.6rem;
}

.footer-brand p,
.footer-note p {
	color: #c9d0da;
}

.footer-brand a {
	color: #f6f1e8;
}

.footer-label {
	margin-bottom: 0.7rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #d7efe4;
}

.footer-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-nav li + li {
	margin-top: 0.4rem;
}

.footer-nav a {
	color: #f6f1e8;
	text-decoration: none;
}

.footer-nav a:hover {
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.footer-note {
	margin-top: 2.2rem;
	padding-top: 1.2rem;
	border-top: 1px solid rgba(246, 241, 232, 0.16);
}

.footer-note p {
	max-width: 70ch;
	font-size: 0.95rem;
}

@media (max-width: 980px) {
	.hero-grid,
	.feature-grid,
	.faq-layout,
	.guide-layout,
	.calculator,
	.footer-grid {
		grid-template-columns: 1fr;
	}

	.topic-grid {
		grid-template-columns: 1fr 1fr;
	}

	.hero-copy h1,
	.page-hero h1 {
		justify-self: start;
		max-width: 16ch;
	}

	.feature-grid {
		grid-template-columns: 1fr;
	}

	.feature-photo {
		max-width: 340px;
	}

	.toc {
		position: static;
	}
}

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

	.site-nav {
		position: fixed;
		inset: var(--header) 0 0 0;
		flex-direction: column;
		align-items: stretch;
		gap: 1.25rem;
		padding: 1.25rem 1.25rem 2rem;
		background: var(--paper);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}

	.site-nav.is-open {
		z-index: 40;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		overflow: auto;
	}

	.nav-list {
		flex-direction: column;
		gap: 0.35rem;
	}

	.nav-list a {
		display: block;
		padding: 0.7rem 0;
		font-family: var(--serif);
		font-size: 1.8rem;
		font-weight: 600;
	}

	.search-form input {
		width: 100%;
		font-size: 1.1rem;
	}
}

@media (max-width: 720px) {
	.shell {
		width: min(var(--shell), calc(100% - 1.6rem));
	}

	.method-list,
	.topic-grid {
		grid-template-columns: 1fr;
	}

	.method-list li:nth-child(odd),
	.method-list li:nth-child(even) {
		padding-left: 0;
		padding-right: 0;
		border-right: 0;
	}

	.section-head--row {
		flex-direction: column;
		align-items: start;
	}

	.tip-row {
		grid-template-columns: 3rem minmax(0, 1fr);
	}

	.tip-row__go {
		grid-column: 2;
	}

	.hero {
		padding-top: 2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
