/* SA Budget Calculator — blog (listing, latest posts, single post).
   Colours come from Settings → Blog as CSS variables, preset to the Studio Amateur site:
   taupe page, charcoal title band, light warm cards, red accent. */

.sb {
	--sb-accent: #d60000;
	--sb-heading: #1f1b19;
	--sb-text: #3b3430;
	--sb-card: #ebe6e1;
	--sb-band: #68605a;
	--sb-muted: color-mix(in srgb, var(--sb-text) 68%, transparent);
	--sb-line: color-mix(in srgb, var(--sb-text) 16%, transparent);
	--sb-radius: 16px;
	--sb-shadow: 0 14px 34px rgba(40, 30, 25, .16), 0 2px 6px rgba(40, 30, 25, .08);
	--sb-display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
	--sb-body: 'Open Sans', 'Myriad Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
	box-sizing: border-box;
	color: var(--sb-text);
	font-family: var(--sb-body);
	font-size: 16px;
	line-height: 1.6;
	text-align: left;
}
.sb--theme-font { --sb-display: inherit; --sb-body: inherit; }
.sb *,
.sb *::before,
.sb *::after { box-sizing: border-box; }
.sb :where(h1, h2, h3, p, figure, nav, ul, ol) { margin: 0; }
.sb a { color: inherit; text-decoration: none; }
.sb img { max-width: 100%; height: auto; }
.sb :focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 3px; }
.sb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ shared bits */
.sb-chip {
	display: inline-block;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--sb-accent);
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .01em;
}
.sb-chip:hover { filter: brightness(1.08); }
.sb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 13px; color: var(--sb-muted); }
.sb-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; margin: 0 9px; opacity: .7; }
.sb-band {
	display: inline-block;
	background: var(--sb-band);
	color: #fff;
	font-family: var(--sb-display);
	font-weight: 400;
	font-size: clamp(24px, 3vw, 34px);
	line-height: 1.15;
	padding: 6px 20px 8px;
	margin: 0 0 20px !important;
}
.sb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 24px;
	border-radius: 10px;
	background: var(--sb-accent);
	color: #fff !important;
	font-family: var(--sb-display);
	font-size: 19px;
	letter-spacing: .01em;
	white-space: nowrap;
	transition: filter .15s;
}
.sb-btn:hover { filter: brightness(1.1); }

/* ------------------------------------------------------------ listing */
.sb-list { width: 100%; max-width: 1200px; min-width: 0; margin: 0 auto; scroll-margin-top: 90px; }
.sb-toolbar { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.sb-filter { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
.sb-filter__item {
	padding: 7px 16px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--sb-card) 82%, transparent);
	color: var(--sb-heading) !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	box-shadow: 0 1px 2px rgba(40, 30, 25, .08);
	transition: background .15s, color .15s;
}
.sb-filter__item:hover { background: var(--sb-card); }
.sb-filter__item.is-on { background: var(--sb-accent); color: #fff !important; }
.sb-search { display: flex; flex: 0 1 340px; min-width: 220px; }
.sb-search input {
	flex: 1;
	min-width: 0;
	height: 42px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid transparent;
	border-radius: 10px 0 0 10px;
	background: var(--sb-card);
	color: var(--sb-heading);
	font: inherit;
	font-size: 15px;
	box-shadow: none;
}
.sb-search input:focus { outline: none; border-color: var(--sb-accent); }
.sb-search button {
	height: 42px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 0 10px 10px 0;
	background: var(--sb-accent);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.sb-result-note { margin: -10px 0 20px !important; font-size: 14px; color: var(--sb-heading); background: color-mix(in srgb, var(--sb-card) 80%, transparent); display: inline-block; padding: 6px 12px; border-radius: 8px; }
.sb-result-note a { color: var(--sb-accent); text-decoration: underline; }

/* cards */
.sb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.sb-grid--1 { grid-template-columns: minmax(0, 1fr); }
.sb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.sb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--sb-radius);
	background: var(--sb-card);
	box-shadow: var(--sb-shadow);
}
.sb-card__media { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: color-mix(in srgb, var(--sb-band) 22%, var(--sb-card)); }
.sb-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.sb-card:hover .sb-card__media img:not(.sb-card__placeholder) { transform: scale(1.04); }
.sb-card__media.is-empty { display: flex; align-items: center; justify-content: center; }
.sb-card__placeholder { width: 64px !important; height: auto !important; opacity: .35; }
.sb-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.sb .sb-card__title { font-family: var(--sb-display); font-weight: 400; font-size: 23px; line-height: 1.2; color: var(--sb-heading); letter-spacing: .005em; }
.sb-card__title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1.5px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .25s; }
.sb-card__title a:hover { background-size: 100% 1.5px; }
.sb-card__title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.sb-card .sb-chip { position: relative; z-index: 2; }
.sb-card__excerpt { font-size: 15px; line-height: 1.6; color: var(--sb-text); flex: 1; }
.sb-card .sb-meta { margin-top: 2px; padding-top: 12px; border-top: 1px solid var(--sb-line); }

.sb-card--featured { flex-direction: row; margin-bottom: 30px; min-height: 360px; }
.sb-card--featured .sb-card__media { flex: 0 0 56%; aspect-ratio: auto; }
.sb-card--featured .sb-card__body { justify-content: center; padding: 34px 38px; gap: 14px; }
.sb .sb-card--featured .sb-card__title { font-size: clamp(28px, 3vw, 38px); line-height: 1.12; }
.sb-card--featured .sb-card__excerpt { font-size: 16px; flex: 0; }
.sb-card--featured .sb-meta { border-top: 0; padding-top: 0; }

.sb-empty { max-width: 560px; margin: 0 auto; padding: 44px 28px; text-align: center; border-radius: var(--sb-radius); background: var(--sb-card); box-shadow: var(--sb-shadow); }
.sb .sb-empty h3 { font-family: var(--sb-display); font-weight: 400; font-size: 28px; color: var(--sb-heading); margin-bottom: 6px; }

.sb-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 36px; }
.sb-pager__num,
.sb-pager__btn,
.sb-pager__gap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--sb-card);
	color: var(--sb-heading) !important;
	font-weight: 600;
	font-size: 15px;
}
.sb-pager__gap { background: transparent; color: var(--sb-card) !important; }
.sb-pager__num:hover,
.sb-pager__btn:not(.is-off):hover { background: #fff; }
.sb-pager__num.is-on { background: var(--sb-accent); color: #fff !important; }
.sb-pager__btn.is-off { opacity: .45; }

/* ------------------------------------------------------------ latest posts section */
.sb-latest { width: 100%; max-width: 1200px; margin: 0 auto; }
.sb-latest__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.sb .sb-latest__head h2 { background: var(--sb-band); color: #fff; font-family: var(--sb-display); font-weight: 400; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; padding: 6px 22px 8px; }
.sb-latest__head a { color: #fff !important; background: var(--sb-accent); padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; }

/* ------------------------------------------------------------ single post */
.sb-single { width: 100%; max-width: 1240px; margin: 0 auto; padding: calc(56px + var(--sb-top, 0px)) 28px 90px; box-sizing: border-box; }
.sb-list { padding-top: var(--sb-top, 0px); }
.sb-preview-bar { margin-bottom: 18px; padding: 10px 16px; border-radius: 10px; background: #fff4d6; color: #5a4200; font-size: 14px; }
.sb-article { overflow: hidden; border-radius: 20px; background: var(--sb-card); box-shadow: var(--sb-shadow); }
.sb-article { --sb-gut: max(56px, calc((100% - 860px) / 2)); }
.sb-article__head { padding: 48px var(--sb-gut) 30px; }
.sb-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 14px !important; }
.sb-crumbs a { color: var(--sb-accent) !important; }
.sb-crumbs span { color: var(--sb-muted); }
.sb .sb-article__title { font-family: var(--sb-display); font-weight: 400; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.08; color: var(--sb-heading); letter-spacing: .003em; margin-bottom: 14px; overflow-wrap: break-word; }
.sb-article__head .sb-meta { font-size: 14px; }
.sb-article__hero { margin: 0; }
.sb-article__hero img { display: block; width: 100%; height: auto; max-height: 640px; object-fit: cover; }
.sb-article__hero figcaption { padding: 8px var(--sb-gut) 0; font-size: 13px; color: var(--sb-muted); }
.sb-article__body { padding: 40px var(--sb-gut) 12px; }
.sb-article__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 0 var(--sb-gut); padding: 22px 0 34px; border-top: 1px solid var(--sb-line); }
.sb-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--sb-muted); }
.sb-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.sb-share > span { color: var(--sb-muted); margin-right: 4px; }
.sb-share a,
.sb-share button {
	padding: 6px 12px;
	margin: 0;
	border: 1px solid var(--sb-line);
	border-radius: 999px;
	background: transparent;
	color: var(--sb-heading) !important;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}
.sb-share a:hover,
.sb-share button:hover { border-color: var(--sb-accent); color: var(--sb-accent) !important; }

.sb-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 28px;
	margin-top: 30px;
	padding: 28px 34px;
	border-radius: 20px;
	background: var(--sb-band);
	color: #fff;
	box-shadow: var(--sb-shadow);
}
.sb-cta > div { flex: 1 1 380px; }
.sb .sb-cta h2 { font-family: var(--sb-display); font-weight: 400; font-size: 30px; line-height: 1.15; color: #fff; margin-bottom: 6px; }
.sb-cta p { color: rgba(255, 255, 255, .86); font-size: 15px; }

.sb-adjacent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.sb-adjacent a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 16px 20px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--sb-card) 88%, transparent);
	color: var(--sb-heading) !important;
	font-family: var(--sb-display);
	font-size: 19px;
	line-height: 1.25;
	box-shadow: 0 2px 8px rgba(40, 30, 25, .1);
}
.sb-adjacent a:hover { background: var(--sb-card); }
.sb-adjacent small { font-family: var(--sb-body); font-size: 12.5px; font-weight: 600; color: var(--sb-accent); }
.sb-adjacent__next { grid-column: 2; text-align: right; }
.sb-related { margin-top: 48px; }
.sb-related .sb-grid .sb-card__title { font-size: 21px; }

/* ------------------------------------------------------------ article typography */
.sb-prose { font-size: 17.5px; line-height: 1.78; color: var(--sb-text); overflow-wrap: break-word; }
.sb-prose > :first-child { margin-top: 0 !important; }
.sb-prose p { margin: 0 0 1.15em; }
.sb-prose h2,
.sb-prose h3 { font-family: var(--sb-display); font-weight: 400; color: var(--sb-heading); letter-spacing: .005em; }
.sb-prose h2 { font-size: 32px; line-height: 1.18; margin: 1.5em 0 .5em; }
.sb-prose h3 { font-size: 25px; line-height: 1.22; margin: 1.35em 0 .45em; }
.sb-prose h4 { font-size: 18px; font-weight: 700; color: var(--sb-heading); margin: 1.25em 0 .4em; }
.sb-prose a { color: var(--sb-accent); text-decoration: underline; text-underline-offset: 3px; }
.sb-prose strong,
.sb-prose b { color: var(--sb-heading); font-weight: 700; }
.sb-prose ul,
.sb-prose ol { margin: 0 0 1.15em 1.3em; padding: 0; }
.sb-prose li { margin: .35em 0; padding-left: .2em; }
.sb-prose ul li::marker { color: var(--sb-accent); }
.sb-prose blockquote {
	margin: 1.6em 0;
	padding: 18px 24px;
	border-left: 4px solid var(--sb-accent);
	border-radius: 0 12px 12px 0;
	background: color-mix(in srgb, var(--sb-band) 9%, transparent);
	font-family: var(--sb-display);
	font-size: 23px;
	line-height: 1.4;
	color: var(--sb-heading);
}
.sb-prose blockquote p:last-child { margin-bottom: 0; }
.sb-prose figure { margin: 1.8em 0; }
.sb-prose img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.sb-prose figcaption { margin-top: 8px; font-size: 14px; color: var(--sb-muted); text-align: center; }
.sb-prose hr { border: 0; border-top: 1px solid var(--sb-line); margin: 2.2em 0; }
.sb-prose .sb-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #000; }
.sb-prose .sb-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sb-prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 15px; }
.sb-prose th,
.sb-prose td { padding: 9px 12px; border-bottom: 1px solid var(--sb-line); text-align: left; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
	.sb-article { --sb-gut: 40px; }
	.sb-single { padding: calc(40px + var(--sb-top, 0px)) 20px 70px; }
	.sb-grid,
	.sb-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sb-card--featured { flex-direction: column; min-height: 0; }
	.sb-card--featured .sb-card__media { flex: none; aspect-ratio: 16 / 9; }
	.sb-card--featured .sb-card__body { padding: 24px 26px 26px; }
}
@media (max-width: 640px) {
	.sb-grid,
	.sb-grid--2,
	.sb-grid--3,
	.sb-grid--4 { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.sb-toolbar { flex-direction: column; align-items: stretch; }
	.sb-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -2px; scrollbar-width: none; }
	.sb-filter__item { white-space: nowrap; }
	.sb-search { flex: none; min-width: 0; width: 100%; }
	.sb-single { padding: calc(22px + var(--sb-top, 0px)) 14px 50px; }
	.sb-article { border-radius: 16px; --sb-gut: 20px; }
	.sb-article__head { padding: 26px var(--sb-gut) 20px; }
	.sb-article__body { padding: 24px var(--sb-gut) 6px; }
	.sb-prose { font-size: 16.5px; }
	.sb-prose h2 { font-size: 27px; }
	.sb-prose h3 { font-size: 22px; }
	.sb-cta { padding: 24px 22px; }
	.sb-cta .sb-btn { width: 100%; }
	.sb-adjacent { grid-template-columns: minmax(0, 1fr); }
	.sb-adjacent__next { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.sb-card__media img,
	.sb-card__title a { transition: none; }
}
