/* Roselle site styles. Colors and fonts come from theme.json presets. */

:root {
	--ink: var(--wp--preset--color--spruce, #17322B);
	--ink-rgb: 23, 50, 43;
	--ink-rule: #2F4A42;
	--ink-deep: #1F3D35;
	--surface: var(--wp--preset--color--surface, #E6EBE3);
	--acc-rgb: 158, 34, 56;
	--acc-soft: #EBD9CC;
	--on-ink-muted: #9FB3AA;
	--ground: var(--wp--preset--color--ground, #F6F3EC);
	--card: var(--wp--preset--color--card, #FAF9F4);
	--white: #FFFFFF;
	--rule: var(--wp--preset--color--rule, #D7DCD2);
	--body: var(--wp--preset--color--body, #3A4A44);
	--muted: var(--wp--preset--color--muted, #5A6A63);
	--on-ink: var(--wp--preset--color--on-ink, #C4D2CC);
	--acc: var(--wp--preset--color--crimson, #9E2238);
	--acc-text: var(--wp--preset--color--crimson-text, #8E1F33);
	--rose: var(--wp--preset--color--rose, #E8A3AE);
	--serif: var(--wp--preset--font-family--serif, Fraunces, Georgia, serif);
	--sans: var(--wp--preset--font-family--sans, "Instrument Sans", system-ui, sans-serif);
	--ease: cubic-bezier(.2, .7, .2, 1);
	--hdr: 84px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
:where(.wp-site-blocks) > * { margin-block: 0; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:where(a, button, summary, input, textarea, select):focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1248px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
@media (min-width: 900px) { .wrap { padding-inline: 48px; } }

.btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--acc); color: var(--white); text-decoration: none;
	padding: 16px 26px; border-radius: 2px; font-weight: 600; font-size: 17px; line-height: 1.2;
	transition: background .25s, transform .25s var(--ease);
}
.btn:hover { background: #86192D; color: var(--white); transform: translateY(-1px); }
.eyebrow { font-size: 15px; font-weight: 600; color: var(--acc-text); margin: 0; }
.rk::before { content: ""; display: block; width: 32px; height: 3px; background: var(--acc); margin-bottom: 18px; }
.link { color: var(--acc-text); font-weight: 600; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.link .ar { transition: transform .3s var(--ease); }
.link:hover .ar, a:hover > .link .ar { transform: translateX(4px); }

/* Reveal on scroll (added by site.js, so content stays visible without JavaScript) */
.js [data-r] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-r].in { opacity: 1; transform: none; }

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

.hdr-part { display: contents; }
.hdr { position: sticky; top: 0; z-index: 50; background: var(--ground); border-bottom: 1px solid transparent; transition: box-shadow .3s, border-color .3s; }
.admin-bar .hdr { top: var(--wp-admin--admin-bar--height, 32px); }
.hdr.scrolled { border-color: var(--rule); box-shadow: 0 6px 24px rgba(var(--ink-rgb), .06); }
.hdr .wrap { display: flex; align-items: center; gap: 32px; height: var(--hdr); transition: height .3s var(--ease); }
.hdr.scrolled .wrap { height: 68px; }
.logo { display: block; width: 188px; color: var(--ink); line-height: 0; transition: width .3s var(--ease); }
.logo svg { display: block; width: 100%; height: auto; }
.logo .lg-rule { fill: var(--acc); }
.hdr.scrolled .logo { width: 160px; }

.nav { display: flex; align-items: center; gap: 28px; margin-left: 12px; }
.nav > a, .ddb { font: 500 16px/1.2 var(--sans); color: var(--body); text-decoration: none; }
.nav > a:hover { color: var(--ink); }
.hdr .right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.hdr .btn { padding: 12px 18px; font-size: 15px; }

/* Dropdowns */
.dd { position: relative; }
.ddb { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; }
.ddb:hover, .dd.open .ddb { color: var(--ink); }
.chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.dd.open .chev, .mdd[open] .chev { transform: rotate(180deg); }
.ddp {
	position: absolute; top: calc(100% + 18px); left: -24px; z-index: 60;
	display: flex; gap: 40px; padding: 22px 24px;
	background: var(--card); border: 1px solid var(--rule); border-radius: 2px;
	box-shadow: 0 18px 40px rgba(var(--ink-rgb), .10);
	opacity: 0; visibility: hidden; transform: translateY(-6px);
	transition: opacity .2s, transform .2s var(--ease), visibility 0s .2s;
}
.ddp::before { content: ""; position: absolute; left: 0; right: 0; top: -19px; height: 19px; }
.dd.open .ddp { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s var(--ease); }
.ddc { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.ddh { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ddp a { display: block; padding: 7px 0; font-size: 15px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ddp a:hover { color: var(--acc-text); }

/* Phone menu */
.menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--rule); background: transparent; border-radius: 2px; cursor: pointer; align-items: center; justify-content: center; }
.menu-btn span:first-child { display: block; width: 18px; height: 2px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
.mnav { display: none; border-top: 1px solid var(--rule); background: var(--ground); max-height: calc(100svh - var(--hdr)); overflow-y: auto; }
.mnav.open { display: block; }
.mnav > a, .mdd a { display: block; padding: 14px 16px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 600; }
.mdd { border-bottom: 1px solid var(--rule); }
.mdd summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.mdd summary::-webkit-details-marker { display: none; }
.mdd .ddh { padding: 6px 16px 0; margin: 0; }
.mdd a { border-bottom: 0; padding: 9px 16px 9px 28px; font-weight: 500; }
.mdd[open] { padding-bottom: 8px; }
.mnav .mcta { color: var(--acc-text); }

@media (max-width: 900px) {
	:root { --hdr: 72px; }
	.nav, .hdr .right { display: none; }
	.menu-btn { display: inline-flex; }
	.logo { width: 150px; }
	.hdr.scrolled .logo { width: 138px; }
	.hdr.scrolled .wrap { height: 64px; }
}

/* ---------- Page content (until each page type gets its own template) ---------- */

.site-main { padding-block: clamp(48px, 7vw, 96px) 0; }
.site-main.front { padding: 0; }
.site-main .page-title { margin-bottom: 32px; }

/* 404 */
.nf { padding-block: clamp(24px, 4vw, 48px) 0; }
.nf h1 { margin: 12px 0 0; }
.nf .lede { margin: 20px 0 0; max-width: 560px; font-size: 20px; color: var(--body); }
.nf-links { list-style: none; margin: 32px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.nf-links a { color: var(--acc-text); font-weight: 600; }

/* ---------- Insights listing ---------- */

.ins-head { padding-bottom: 8px; }
.ins-head h1, .ins-head .wp-block-query-title { font-size: clamp(40px, 5vw, 72px); line-height: 1.02; letter-spacing: -0.025em; max-width: 900px; margin: 0; }
.ins-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 8px; }
.ins-cats a { padding: 8px 14px; border: 1px solid var(--rule); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; transition: background .2s, border-color .2s; }
.ins-cats a:hover { border-color: var(--ink); }
.ins-cats a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.arts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; margin-top: 40px; }
.art { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); }
.art .im { aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.art .im img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.art:hover .im img { transform: scale(1.04); }
.art .meta { display: flex; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.art .meta b { color: var(--acc-text); }
.art h3 { font-family: var(--serif); font-weight: 600; font-size: 23px; line-height: 1.18; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
.art p { color: var(--body); font-size: 16px; margin: 0; }
.art .link { font-size: 15px; margin-top: auto; }
.ins-pages { display: flex; gap: 16px; justify-content: center; margin-top: 56px; font-weight: 600; }
.ins-pages a, .ins-pages span { color: var(--ink); text-decoration: none; }
.ins-pages .current { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.ins-empty { margin-top: 40px; color: var(--body); }
@media (max-width: 900px) { .arts { grid-template-columns: 1fr; } }
@media (min-width: 640px) and (max-width: 900px) { .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Article ---------- */

.article { --measure: 720px; }
.art-head, .art-body, .art-back { max-width: var(--measure); margin-inline: auto; padding-inline: 16px; }
.art-head { display: flex; flex-direction: column; gap: 18px; }
.art-head .eyebrow a { color: inherit; text-decoration: none; }
.art-head h1 { font-size: clamp(38px, 5vw, 64px); line-height: 1.04; letter-spacing: -0.025em; margin: 0; }
.art-date { color: var(--muted); font-size: 15px; }
.art-image { max-width: 1040px; margin: 40px auto 0; padding-inline: 16px; }
.art-image img { width: 100%; height: auto; display: block; }
.art-body { margin-top: 48px; font-size: 18px; line-height: 1.65; color: var(--body); }
.art-body > * { margin-block: 0 1.1em; }
.art-body h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; color: var(--ink); margin: 1.8em 0 .6em; }
.art-body h3 { font-size: 22px; color: var(--ink); margin: 1.6em 0 .5em; }
.art-body strong { color: var(--ink); }
.art-body ul, .art-body ol { padding-left: 1.3em; }
.art-body li { margin-bottom: .55em; }
.art-body ul li::marker { color: var(--acc); }
.art-body ol li::marker { color: var(--ink); font-weight: 600; }
.art-body .series { font-size: 17px; padding: 16px 20px; background: var(--card); border-left: 3px solid var(--rose); }
.art-body .cta { margin-top: 2.2em; padding: 24px 26px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--acc); color: var(--ink); }
.art-body .related { font-size: 15px; font-weight: 600; color: var(--muted); }
.art-body a { color: var(--acc-text); }
.wp-block-table.is-style-roselle { margin: 1.6em 0; overflow-x: auto; }
.wp-block-table.is-style-roselle table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.wp-block-table.is-style-roselle th, .wp-block-table.is-style-roselle td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--rule); text-align: left; }
.wp-block-table.is-style-roselle th { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--ink); }
.wp-block-table.is-style-roselle td:not(:first-child), .wp-block-table.is-style-roselle th:not(:first-child) { text-align: right; }
.wp-block-table.is-style-roselle td { color: var(--ink); }
.wp-block-table.is-style-roselle figcaption { font-size: 14px; color: var(--muted); font-style: italic; margin-top: 10px; }
.art-back { margin-top: 56px; }

/* ---------- Pages ---------- */

.page .art-body { margin-top: 28px; }
.art-body .lede { font-size: 20px; color: var(--body); }

/* ---------- Cash runway calculator ---------- */

.runway { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin: 32px 0 48px; border: 1px solid var(--rule); background: var(--card); }
.rw-form { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.rw-field { display: flex; flex-direction: column; gap: 4px; }
.rw-field label { font-weight: 600; color: var(--ink); }
.rw-hint { font-size: 14px; color: var(--muted); line-height: 1.4; }
.rw-input { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 0 14px; background: var(--white); border: 1px solid var(--rule); border-radius: 2px; transition: border-color .2s; }
.rw-input:focus-within { border-color: var(--ink); }
.rw-input span { color: var(--muted); font-weight: 600; }
.rw-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0; font: 600 18px/1.2 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.rw-out { padding: 28px; background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; gap: 22px; }
.rw-stat { display: flex; flex-direction: column; gap: 4px; padding-bottom: 20px; border-bottom: 1px solid var(--ink-rule); }
.rw-stat b { font: 600 clamp(44px, 5vw, 64px)/1 var(--serif); color: var(--white); font-variant-numeric: tabular-nums; }
.rw-stat span { font-size: 15px; }
.rw-read { color: var(--white); font-size: 17px; margin: 0; }
.rw-next { font-size: 15px; margin: auto 0 0; }
.rw-next .link { color: var(--rose); }
@media (max-width: 760px) { .runway { grid-template-columns: 1fr; } }

/* ---------- Closing band ---------- */

.close { position: relative; overflow: hidden; background: var(--ink); color: var(--white); margin-top: clamp(88px, 10vw, 128px); }
.close .bg { position: absolute; inset: -30% 0; background: var(--ink) url('../img/blue-ridge-mountains-morning-mist.webp') 50% 50% / cover no-repeat; will-change: transform; }
.close .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--ink-rgb), .92) 0%, rgba(var(--ink-rgb), .66) 55%, rgba(var(--ink-rgb), .3) 100%); }
.close .wrap { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap; padding-block: 112px; }
.close h2 { color: var(--white); font-size: clamp(40px, 4.8vw, 64px); line-height: 1.04; max-width: 640px; margin: 0; }
.close p { color: var(--on-ink); margin: 14px 0 0; }
@media (max-width: 900px) {
	.close .wrap { padding-block: 88px; }
	.close .shade { background: linear-gradient(180deg, rgba(var(--ink-rgb), .84) 0%, rgba(var(--ink-rgb), .62) 70%, rgba(var(--ink-rgb), .4) 100%); }
}

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

.ftr { background: var(--ink); color: var(--on-ink); padding-top: 72px; font-size: 15px; }
.ftr a { color: inherit; }
.ftr .top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 40px; }
.ftr .logo { width: 190px; color: var(--white); }
.ftr .logo .lg-rule { fill: var(--rose); }
.ftr .about { display: flex; flex-direction: column; gap: 18px; max-width: 340px; }
.ftr .about p { margin: 0; }
.ftr .mail { color: var(--white); font-weight: 600; text-decoration: none; }
.ftr .soc { align-self: flex-start; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink-rule); display: inline-flex; align-items: center; justify-content: center; color: var(--white); transition: background .25s, border-color .25s, color .25s, transform .25s var(--ease); }
.ftr .soc svg { width: 16px; height: 16px; fill: currentColor; }
.ftr .soc:hover, .ftr .soc:focus-visible { background: var(--rose); border-color: var(--rose); color: var(--ink); transform: translateY(-2px); }
.ftr b { display: block; color: var(--white); font-size: 14px; margin-bottom: 14px; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ftr ul a { text-decoration: none; }
.ftr ul a:hover { color: var(--white); }
.ftr .bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding: 22px 0 30px; border-top: 1px solid var(--ink-rule); font-size: 14px; }
.ftr .bar a { text-decoration: none; }
.ftr .bar a:hover { color: var(--white); }
@media (max-width: 1000px) {
	.ftr .top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ftr .about { grid-column: 1 / -1; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
	.js [data-r] { opacity: 1; transform: none; }
}
