/*!
Theme Name: Finance Hamster
Theme URI: https://financehamster.com
Author: Finance Hamster
Description: Beginner-first, fast, accessible classic theme for Finance Hamster — a friendly ETF screener and finance-education site. Owns the site chrome and design; the Finance Hamster plugin supplies the tools via shortcodes. No page builder.
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: finance-hamster
*/

/* ============================================================ Design tokens */
:root {
	--bg: #faf7f2; --card: #ffffff; --ink: #2b2118; --muted: #6f6357;
	--accent: #f59e0b; --accent-d: #b9770a; --soft: #fff5e1; --bd: #ece4d8;
	--pos: #15803d; --neg: #b91c1c; --ring: rgba(245,158,11,.35);

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;

	/* type scale */
	--t-xs: .78rem; --t-sm: .88rem; --t-base: 1rem; --t-md: 1.15rem; --t-lg: 1.4rem;
	--t-xl: 1.9rem; --t-2xl: 2.5rem; --t-3xl: 3.2rem;

	/* spacing scale */
	--s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
	--s-7: 48px; --s-8: 64px; --s-9: 96px;

	--radius: 16px; --radius-sm: 10px; --radius-lg: 24px;
	--shadow: 0 1px 3px rgba(43,33,24,.06);
	--shadow-lg: 0 14px 40px rgba(43,33,24,.12);
	--maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #181410; --card: #221c16; --ink: #f2ebe0; --muted: #b7ab9a;
		--accent: #f59e0b; --accent-d: #fbbf24; --soft: #2c2114; --bd: #3a3026;
		--pos: #4ade80; --neg: #f87171; --ring: rgba(251,191,36,.4);
		--shadow: 0 1px 3px rgba(0,0,0,.3); --shadow-lg: 0 14px 40px rgba(0,0,0,.45);
	}
}

/* ============================================================ Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; font-family: var(--font); font-size: var(--t-base); line-height: 1.65;
	color: var(--ink); background: var(--bg);
	-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 var(--s-4); font-weight: 800; }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
p { margin: 0 0 var(--s-4); }
:focus-visible { outline: 2px solid var(--accent-d); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

.fh-container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-4); }
.fh-skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #2b2118; padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; z-index: 999; font-weight: 700; }
.fh-skip:focus { left: 0; }

/* ============================================================ Buttons */
.fh-btn { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: var(--t-base);
	padding: 12px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .1s, background .12s, box-shadow .12s; text-decoration: none; }
.fh-btn-primary { background: var(--accent); color: #3b2a12; box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.fh-btn-primary:hover { background: var(--accent-d); color: #fff; text-decoration: none; }
.fh-btn-ghost { background: transparent; color: var(--ink); border-color: var(--bd); }
.fh-btn-ghost:hover { background: var(--card); text-decoration: none; }
.fh-btn:active { transform: translateY(1px); }

/* ============================================================ Header */
.fh-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--bd); }
.fh-header-in { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--s-4); max-width: var(--maxw); margin: 0 auto; position: relative; }
.fh-logo { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 900; font-size: var(--t-md); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.fh-logo:hover { text-decoration: none; }
.fh-logo-mark { font-size: 1.5rem; line-height: 1; }
/* A custom logo always renders at a tidy header size (never a giant banner). */
.fh-header .custom-logo-link { display: inline-flex; align-items: center; line-height: 0; flex: 0 0 auto; }
.fh-header .custom-logo { max-height: 44px; width: auto; height: auto; }
.fh-header-in { min-height: 56px; flex-wrap: wrap; }
/* Long menu-item labels (e.g. an old mega-menu) wrap instead of exploding the bar. */
.fh-nav a { max-width: 22ch; }
.fh-nav .menu-item-has-children > a::after { content: ""; }
.fh-nav { margin-left: auto; }
.fh-nav-list, .fh-nav ul { list-style: none; display: flex; gap: var(--s-5); margin: 0; padding: 0; align-items: center; }
.fh-nav a { color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
.fh-nav a:hover { color: var(--accent-d); text-decoration: none; }
.fh-nav .current-menu-item > a { color: var(--accent-d); }
.fh-cta-wrap .fh-btn { padding: 9px 18px; font-size: var(--t-sm); }
.fh-nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--bd); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
@media (max-width: 860px) {
	.fh-nav-toggle { display: inline-block; }
	.fh-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--bd); margin: 0; display: none; }
	.fh-nav.is-open { display: block; }
	.fh-nav-list, .fh-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-2) var(--s-4) var(--s-4); }
	.fh-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--bd); }
	.fh-cta-wrap { display: none; }
}

/* ============================================================ Footer */
.fh-footer { background: var(--card); border-top: 1px solid var(--bd); margin-top: var(--s-9); padding: var(--s-7) 0 var(--s-6); }
.fh-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); }
.fh-footer h4 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--s-3); }
.fh-footer ul { list-style: none; margin: 0; padding: 0; }
.fh-footer li { margin-bottom: var(--s-2); }
.fh-footer a { color: var(--ink); font-size: var(--t-sm); }
.fh-footer-brand .fh-logo { margin-bottom: var(--s-3); }
.fh-footer-tag { color: var(--muted); font-size: var(--t-sm); max-width: 34ch; }
.fh-legal-strip { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--bd); color: var(--muted); font-size: var(--t-xs); line-height: 1.6; }
.fh-legal-strip p { margin: 0 0 var(--s-2); }
@media (max-width: 720px) { .fh-footer-grid { grid-template-columns: 1fr; gap: var(--s-5); } }

/* ============================================================ Homepage */
.fh-hero { padding: var(--s-9) 0 var(--s-7); text-align: center; position: relative; overflow: hidden; }
.fh-hero::before { content: ""; position: absolute; inset: 0; background:
	radial-gradient(60% 50% at 50% 0%, var(--soft), transparent 70%); z-index: -1; }
.fh-hero-mascot { font-size: 4rem; line-height: 1; margin-bottom: var(--s-3); }
.fh-hero h1 { font-size: var(--t-3xl); max-width: 16ch; margin: 0 auto var(--s-4); }
.fh-hero-sub { font-size: var(--t-md); color: var(--muted); max-width: 56ch; margin: 0 auto var(--s-6); }
.fh-hero-cta { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; }
.fh-hero-note { margin-top: var(--s-5); color: var(--muted); font-size: var(--t-sm); }
.fh-hero-search { display: flex; gap: var(--s-2); max-width: 560px; margin: 0 auto var(--s-4); background: var(--card); border: 1px solid var(--bd); border-radius: 999px; padding: 6px 6px 6px 8px; box-shadow: var(--shadow); }
.fh-hero-search input[type=search] { flex: 1; border: none; background: transparent; padding: 10px 12px; font-size: var(--t-base); color: var(--ink); }
.fh-hero-search input[type=search]:focus { outline: none; }
.fh-hero-search .fh-btn { padding: 10px 20px; }
@media (max-width: 640px) { .fh-hero h1 { font-size: var(--t-2xl); } }

/* Homepage fund tiles */
.fh-fund-tile { gap: var(--s-2); }
.fh-fund-tile-name { font-weight: 800; font-size: var(--t-base); line-height: 1.3; color: var(--ink); }
.fh-fund-tile-issuer { color: var(--muted); font-size: var(--t-sm); }
.fh-fund-tile-stats { display: flex; gap: var(--s-4); flex-wrap: wrap; margin: var(--s-3) 0 var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--bd); }
.fh-fund-tile-stats span { display: flex; flex-direction: column; font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.fh-fund-tile-stats b { font-size: var(--t-md); font-weight: 800; color: var(--ink); text-transform: none; letter-spacing: 0; }
.fh-fund-tile-stats .fh-pos { color: var(--pos); } .fh-fund-tile-stats .fh-neg { color: var(--neg); }

.fh-section { padding: var(--s-8) 0; }
.fh-section-head { text-align: center; max-width: 60ch; margin: 0 auto var(--s-7); }
.fh-section-head p { color: var(--muted); font-size: var(--t-md); }
.fh-eyebrow { display: inline-block; font-size: var(--t-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-d); background: var(--soft); border: 1px solid #f6d9a3; border-radius: 999px; padding: 4px 12px; margin-bottom: var(--s-3); }

.fh-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.fh-step { background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow); }
.fh-step-n { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--soft); color: var(--accent-d); font-weight: 900; border: 1px solid #f6d9a3; margin-bottom: var(--s-3); }
.fh-step h3 { font-size: var(--t-md); margin-bottom: var(--s-2); }
.fh-step p { color: var(--muted); font-size: var(--t-sm); margin: 0; }

.fh-cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.fh-tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; color: inherit; }
.fh-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.fh-tile-ico { font-size: 1.8rem; margin-bottom: var(--s-3); }
.fh-tile h3 { font-size: var(--t-md); margin-bottom: var(--s-2); }
.fh-tile p { color: var(--muted); font-size: var(--t-sm); flex: 1; margin-bottom: var(--s-3); }
.fh-tile-go { color: var(--accent-d); font-weight: 700; font-size: var(--t-sm); }

.fh-band { background: var(--card); border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.fh-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.fh-value h3 { font-size: var(--t-base); margin-bottom: var(--s-1); }
.fh-value p { color: var(--muted); font-size: var(--t-sm); margin: 0; }
.fh-value-ico { color: var(--accent-d); font-size: 1.3rem; }

.fh-cta-band { text-align: center; background: linear-gradient(135deg, var(--soft), var(--card)); border: 1px solid var(--bd); border-radius: var(--radius-lg); padding: var(--s-8) var(--s-5); }
.fh-cta-band h2 { margin-bottom: var(--s-3); }
.fh-cta-band p { color: var(--muted); max-width: 50ch; margin: 0 auto var(--s-5); }

@media (max-width: 820px) { .fh-steps, .fh-cards-3, .fh-values { grid-template-columns: 1fr; } }

/* ============================================================ Page / content */
.fh-page { padding: var(--s-7) 0 var(--s-6); }
.fh-page-narrow { max-width: 760px; }
.fh-page-head { margin-bottom: var(--s-6); }
.fh-page-head h1 { margin-bottom: var(--s-2); }
.fh-page-head .fh-lede { color: var(--muted); font-size: var(--t-md); }
.fh-prose { font-size: var(--t-md); }
.fh-prose h2 { margin-top: var(--s-7); }
.fh-prose h3 { margin-top: var(--s-6); }
.fh-prose img { border-radius: var(--radius); margin: var(--s-5) 0; }
.fh-prose blockquote { margin: var(--s-5) 0; padding: var(--s-3) var(--s-5); border-left: 4px solid var(--accent); background: var(--soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: #6b4e1f; }
.fh-prose code { background: var(--soft); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.fh-prose ul, .fh-prose ol { padding-left: 1.3em; }
.fh-prose li { margin: var(--s-2) 0; }
.fh-tool-wrap { padding: var(--s-5) 0; }
/* On full tool pages the theme header + page <h1> already brand the page, so
   hide the tool's own brand strip (it still shows in shortcode embeds). */
.fh-tool-wrap .fh-head, .fh-tool-wrap .fh-calc-head { display: none; }
.fh-tool-wrap .fh-screener, .fh-tool-wrap .fh-calc { margin-top: 0; }

/* breadcrumbs */
.fh-crumbs { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s-4); }
.fh-crumbs a { color: var(--muted); } .fh-crumbs a:hover { color: var(--accent-d); }
.fh-crumbs span { margin: 0 var(--s-1); }

/* ============================================================ Blog */
.fh-archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
.fh-post-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--bd); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.fh-post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.fh-post-thumb { aspect-ratio: 16/9; background: var(--soft); overflow: hidden; }
.fh-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fh-post-body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; flex: 1; }
.fh-post-meta { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: var(--s-2); }
.fh-post-card h2 { font-size: var(--t-md); margin-bottom: var(--s-2); }
.fh-post-card h2 a { color: var(--ink); }
.fh-post-card h2 a:hover { color: var(--accent-d); text-decoration: none; }
.fh-post-excerpt { color: var(--muted); font-size: var(--t-sm); flex: 1; }
.fh-single-hero { max-width: 760px; margin: 0 auto; padding-top: var(--s-6); }
.fh-single-hero h1 { font-size: var(--t-2xl); }
.fh-single-thumb { max-width: 980px; margin: var(--s-5) auto; }
.fh-single-thumb img { border-radius: var(--radius-lg); width: 100%; }
.fh-pagination { display: flex; justify-content: center; gap: var(--s-3); margin-top: var(--s-7); flex-wrap: wrap; }
.fh-pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--bd); border-radius: var(--radius-sm); color: var(--ink); }
.fh-pagination .current { background: var(--accent); color: #3b2a12; border-color: var(--accent); }
@media (max-width: 820px) { .fh-archive-grid { grid-template-columns: 1fr; } }

/* ============================================================ Search form / 404 */
.fh-searchform { display: flex; gap: var(--s-2); max-width: 520px; }
.fh-searchform input[type=search] { flex: 1; padding: 12px 16px; border: 1px solid var(--bd); border-radius: 999px; background: var(--card); color: var(--ink); font-size: var(--t-base); }
.fh-404 { text-align: center; padding: var(--s-9) 0; }
.fh-404 .fh-hero-mascot { font-size: 3.5rem; }

/* ============================================================ Utilities */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.fh-center { text-align: center; }
.fh-mt-6 { margin-top: var(--s-6); }
