/* ==========================================================================
   FinanceCalcwise theme — color tokens
   Matches the original site's HSL design system (deep green + warm gold),
   including its dark mode palette. Toggle with the .dark class on <html>.
   A site owner can override --fcw-primary-h/s/l via the Customizer without
   losing the rest of the palette.
   ========================================================================== */
:root {
	--fcw-background: 40 20% 97%;
	--fcw-foreground: 160 25% 10%;
	--fcw-card: 0 0% 100%;
	--fcw-card-foreground: 160 25% 10%;
	--fcw-primary: 160 45% 22%;
	--fcw-primary-foreground: 40 20% 97%;
	--fcw-secondary: 40 30% 92%;
	--fcw-muted: 40 15% 94%;
	--fcw-muted-foreground: 160 10% 45%;
	--fcw-accent: 36 80% 55%;
	--fcw-accent-foreground: 160 25% 10%;
	--fcw-destructive: 0 72% 51%;
	--fcw-border: 40 15% 88%;
	--fcw-radius: 0.75rem;
	--fcw-hero-gradient: linear-gradient(135deg, hsl(160 45% 22%), hsl(160 35% 30%), hsl(170 40% 25%));
	--fcw-card-shadow: 0 2px 16px -2px hsl(160 25% 10% / .08);
	--fcw-card-shadow-hover: 0 8px 30px -4px hsl(160 25% 10% / .15);
	--fcw-container: 1140px;
}

html.dark {
	--fcw-background: 160 15% 7%;
	--fcw-foreground: 40 15% 93%;
	--fcw-card: 160 14% 12%;
	--fcw-card-foreground: 40 15% 93%;
	--fcw-primary: 160 50% 45%;
	--fcw-primary-foreground: 160 25% 8%;
	--fcw-secondary: 160 12% 18%;
	--fcw-muted: 160 10% 18%;
	--fcw-muted-foreground: 40 12% 70%;
	--fcw-accent: 36 85% 58%;
	--fcw-accent-foreground: 160 25% 8%;
	--fcw-destructive: 0 65% 45%;
	--fcw-border: 160 10% 22%;
	--fcw-hero-gradient: linear-gradient(135deg, hsl(160 40% 12%), hsl(160 30% 16%), hsl(170 35% 14%));
}

/* A Customizer color override replaces --fcw-primary directly (see functions.php: fcw_hex_to_hsl_triplet). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: hsl(var(--fcw-foreground));
	background: hsl(var(--fcw-background));
	line-height: 1.65;
	transition: background-color .2s, color .2s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: hsl(var(--fcw-primary)); text-decoration: none; }
a:hover { text-decoration: underline; }
.screen-reader-text { position: absolute; left: -9999px; }
.fcw-container { max-width: var(--fcw-container); margin: 0 auto; padding: 0 20px; }

/* ==========================================================================
   Header
   ========================================================================== */
.fcw-site-header { border-bottom: 1px solid hsl(var(--fcw-border)); background: hsl(var(--fcw-card)); position: sticky; top: 0; z-index: 50; }
.fcw-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }
.fcw-logo-text { font-size: 1.3rem; font-weight: 800; color: hsl(var(--fcw-foreground)); }
.fcw-primary-nav { flex: 1; }
.fcw-menu { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
.fcw-menu a { color: hsl(var(--fcw-foreground)); font-weight: 600; }
.fcw-menu a:hover { color: hsl(var(--fcw-primary)); text-decoration: none; }

.fcw-header-actions { display: flex; align-items: center; gap: 8px; }
.fcw-theme-toggle {
	display: flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 999px; border: 1px solid hsl(var(--fcw-border));
	background: hsl(var(--fcw-muted)); color: hsl(var(--fcw-foreground)); cursor: pointer;
}
.fcw-theme-toggle:hover { background: hsl(var(--fcw-secondary)); }
.fcw-icon-moon { display: none; }
html.dark .fcw-icon-sun { display: none; }
html.dark .fcw-icon-moon { display: block; }

.fcw-menu-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 4px; padding: 8px; }
.fcw-menu-toggle span { width: 22px; height: 2px; background: hsl(var(--fcw-foreground)); display: block; }

/* ==========================================================================
   Hero
   ========================================================================== */
.fcw-hero { background: var(--fcw-hero-gradient); padding: 80px 0; position: relative; overflow: hidden; }
.fcw-hero-inner { max-width: 640px; position: relative; z-index: 1; }
.fcw-hero-badge {
	display: inline-flex; align-items: center; gap: 8px; border-radius: 999px;
	background: hsl(var(--fcw-primary-foreground) / 0.1); border: 1px solid hsl(var(--fcw-primary-foreground) / 0.15);
	color: hsl(var(--fcw-primary-foreground) / 0.9); font-size: 0.85rem; padding: 6px 16px; margin-bottom: 20px;
}
.fcw-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; color: hsl(var(--fcw-primary-foreground)); line-height: 1.15; margin: 0 0 18px; }
.fcw-hero p { font-size: 1.1rem; color: hsl(var(--fcw-primary-foreground) / 0.8); line-height: 1.6; margin: 0 0 28px; }
.fcw-hero-cta {
	display: inline-flex; align-items: center; gap: 8px; border-radius: 10px;
	background: hsl(var(--fcw-accent)); color: hsl(var(--fcw-accent-foreground));
	padding: 13px 26px; font-weight: 700; transition: opacity .15s;
}
.fcw-hero-cta:hover { opacity: 0.9; text-decoration: none; }

/* ==========================================================================
   Category / tool grid sections
   ========================================================================== */
.fcw-category-section { padding: 40px 0; }
.fcw-category-section h2 { font-size: 1.5rem; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.fcw-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.fcw-tool-card {
	display: block; padding: 20px; border: 1px solid hsl(var(--fcw-border)); border-radius: var(--fcw-radius);
	background: hsl(var(--fcw-card)); box-shadow: var(--fcw-card-shadow); transition: transform .15s, box-shadow .15s;
}
.fcw-tool-card:hover { transform: translateY(-3px); box-shadow: var(--fcw-card-shadow-hover); text-decoration: none; }
.fcw-tool-card h3 { margin: 0 0 8px; color: hsl(var(--fcw-foreground)); font-size: 1.02rem; }
.fcw-tool-card p { margin: 0; color: hsl(var(--fcw-muted-foreground)); font-size: 0.88rem; }

/* Trust / "Why FinanceCalcwise" section */
.fcw-trust-section { padding: 20px 0 50px; }
.fcw-trust-box { border-radius: 1.2rem; background: hsl(var(--fcw-primary) / 0.06); border: 1px solid hsl(var(--fcw-primary) / 0.12); padding: 40px; text-align: center; }
.fcw-trust-box h2 { font-size: 1.7rem; margin: 0 0 28px; }
.fcw-trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; text-align: left; }
.fcw-trust-grid h3 { margin: 0 0 6px; font-size: 1.05rem; }
.fcw-trust-grid p { margin: 0; color: hsl(var(--fcw-muted-foreground)); font-size: 0.92rem; }

/* Blog cards */
.fcw-recent-posts-section { padding: 50px 0; background: hsl(var(--fcw-muted)); }
.fcw-recent-posts-section h2 { text-align: center; margin-bottom: 28px; font-size: 1.7rem; }
.fcw-posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.fcw-post-card { display: block; border: 1px solid hsl(var(--fcw-border)); border-radius: var(--fcw-radius); overflow: hidden; background: hsl(var(--fcw-card)); box-shadow: var(--fcw-card-shadow); }
.fcw-post-card img { width: 100%; }
.fcw-post-card h3, .fcw-post-card h2 { padding: 16px 16px 0; margin: 0 0 8px; font-size: 1.08rem; color: hsl(var(--fcw-foreground)); }
.fcw-post-card p { padding: 0 16px 16px; color: hsl(var(--fcw-muted-foreground)); margin: 0; font-size: 0.88rem; }
.fcw-view-all { text-align: center; margin-top: 24px; font-weight: 700; }
.fcw-post-category { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--fcw-primary)); margin: 16px 16px 0; }

/* ==========================================================================
   Tool page
   ========================================================================== */
.fcw-tool-page { padding: 48px 0; max-width: 780px; }
.fcw-tool-article h1 { font-size: 2rem; }
.fcw-tool-intro { color: hsl(var(--fcw-muted-foreground)); margin-bottom: 24px; }
.fcw-faqs { margin-top: 40px; }
.fcw-faq-item { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid hsl(var(--fcw-border)); }
.fcw-related-tools { margin-top: 48px; }
.fcw-related-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.fcw-related-grid a { padding: 8px 14px; border: 1px solid hsl(var(--fcw-border)); border-radius: 999px; font-size: 0.85rem; }

/* ==========================================================================
   Single post / archive / tables
   ========================================================================== */
.fcw-single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; padding: 48px 0; align-items: start; }
.fcw-post-header h1 { font-size: 2.1rem; margin-bottom: 6px; }
.fcw-post-meta { color: hsl(var(--fcw-muted-foreground)); font-size: 0.9rem; margin-bottom: 6px; }
.fcw-post-category-badge { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--fcw-primary)); background: hsl(var(--fcw-primary) / 0.08); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.fcw-post-body h2 { margin-top: 1.8em; }
.fcw-post-body h3 { margin-top: 1.4em; }
.fcw-post-body ul { padding-left: 22px; }
.fcw-post-body hr { border: none; border-top: 1px solid hsl(var(--fcw-border)); margin: 32px 0; }

/* Tables: every table in article/post content renders as a real, readable table */
.fcw-table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid hsl(var(--fcw-border)); border-radius: 10px; }
.fcw-post-body table, .fcw-page-content table {
	width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 480px;
}
.fcw-post-body th, .fcw-post-body td,
.fcw-page-content th, .fcw-page-content td { padding: 10px 16px; text-align: left; border-bottom: 1px solid hsl(var(--fcw-border)); }
.fcw-post-body thead th, .fcw-page-content thead th { background: hsl(var(--fcw-muted)); font-weight: 700; }
.fcw-post-body tbody tr:last-child td, .fcw-page-content tbody tr:last-child td { border-bottom: none; }
.fcw-post-body tbody tr:nth-child(even), .fcw-page-content tbody tr:nth-child(even) { background: hsl(var(--fcw-muted) / 0.4); }

.fcw-sidebar { position: sticky; top: 90px; }
.fcw-archive { padding: 48px 0; }
.fcw-archive-title { margin-bottom: 12px; }
.fcw-archive-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.fcw-archive-filters a { padding: 6px 14px; border-radius: 999px; border: 1px solid hsl(var(--fcw-border)); font-size: 0.85rem; color: hsl(var(--fcw-muted-foreground)); }
.fcw-archive-filters a.is-active, .fcw-archive-filters a:hover { background: hsl(var(--fcw-primary)); color: hsl(var(--fcw-primary-foreground)); border-color: transparent; text-decoration: none; }

/* Static pages */
.fcw-page { padding: 48px 0; max-width: 780px; }
.fcw-page-content h2 { margin-top: 1.6em; }
.fcw-calculators-page { max-width: var(--fcw-container); }
.fcw-calculators-page .fcw-category-section { padding: 24px 0; }

/* ==========================================================================
   Ads — labelled, spaced away from interactive elements
   ========================================================================== */
.fcw-ad-slot { margin: 32px 0; text-align: center; }
.fcw-ad-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--fcw-muted-foreground)); margin-bottom: 6px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.fcw-site-footer { border-top: 1px solid hsl(var(--fcw-border)); background: hsl(var(--fcw-muted)); padding: 36px 0; margin-top: 40px; }
.fcw-footer-inner { text-align: center; }
.fcw-footer-menu { list-style: none; display: flex; justify-content: center; gap: 20px; padding: 0; margin: 0 0 12px; flex-wrap: wrap; }
.fcw-footer-menu a { color: hsl(var(--fcw-foreground)); }
.fcw-footer-social { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; }
.fcw-footer-text { color: hsl(var(--fcw-muted-foreground)); font-size: 0.85rem; margin: 0; }

/* ==========================================================================
   Cookie notice — fixed: visibility is controlled by the .is-visible class,
   not the [hidden] attribute, so display:flex below can't fight it.
   ========================================================================== */
.fcw-cookie-notice {
	display: none;
	position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
	background: hsl(var(--fcw-foreground)); color: hsl(var(--fcw-background));
	padding: 14px 20px; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; font-size: 0.85rem;
}
.fcw-cookie-notice.is-visible { display: flex; }
.fcw-cookie-notice a { color: hsl(var(--fcw-background)); text-decoration: underline; }
.fcw-cookie-notice button {
	background: hsl(var(--fcw-accent)); color: hsl(var(--fcw-accent-foreground));
	border: 0; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 700;
}
.fcw-cookie-notice button:hover { opacity: 0.9; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 860px) {
	.fcw-single-layout { grid-template-columns: 1fr; }
	.fcw-sidebar { position: static; }
}
@media (max-width: 720px) {
	.fcw-menu-toggle { display: flex; }
	.fcw-primary-nav { display: none; width: 100%; order: 3; }
	.fcw-primary-nav.is-open { display: block; }
	.fcw-menu { flex-direction: column; gap: 0; }
	.fcw-menu li { border-top: 1px solid hsl(var(--fcw-border)); }
	.fcw-menu a { display: block; padding: 12px 0; }
	.fcw-header-inner { flex-wrap: wrap; }
}
