/* MoneyUnder40 design system — clean full-width pages, no theme chrome. */
:root {
  --navy: #0a2540;
  --navy-2: #0e3a4d;
  --green: #00a67e;
  --green-dark: #007a5c;
  --ink: #1a2b3c;
  --muted: #5b6b7b;
  --line: #e2e8f0;
  --bg-soft: #f7f9fc;
  --white: #ffffff;
  --radius: 14px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background: var(--white);
}
a { color: var(--green-dark); }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--green);
  color: #fff; padding: 10px 16px; font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Header — white, sticky, like the reference: dark-navy wordmark, green mark */
.site-header {
  background: #fff; color: var(--navy); position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(10, 37, 64, 0.06);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  color: var(--navy); font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  text-decoration: none; white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--green-dark); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: center; }
.site-nav a, .site-nav button.dropdown-toggle {
  color: var(--navy); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 9px 14px; border-radius: 8px; background: none; border: none;
  cursor: pointer; font-family: inherit;
}
.site-nav a:hover, .site-nav button.dropdown-toggle:hover { background: var(--bg-soft); text-decoration: none; }
.has-dropdown { position: relative; }
.has-dropdown .dropdown {
  display: none; position: absolute; right: 0; top: 100%; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(10, 37, 64, 0.18); padding: 8px; flex-direction: column;
}
.has-dropdown.open .dropdown { display: flex; }
.has-dropdown .dropdown a { color: var(--navy); display: block; }
.has-dropdown .dropdown a:hover { background: var(--bg-soft); }
.nav-toggle { display: none; background: var(--green); color: #fff; border: none;
  border-radius: 8px; padding: 9px 14px; font-weight: 700; cursor: pointer; }

/* Main layout — edge to edge sections, centred content column */
main { width: 100%; }
.section, .page-hero, .trust-band, .marquee { width: 100%; }
.section { max-width: var(--max); margin: 0 auto; padding: 28px 24px; }
.section h2, .page-hero h1 { color: var(--navy); font-size: 32px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin: 0 0 16px; }
.page-hero { max-width: var(--max); margin: 0 auto; padding: 40px 24px 8px; }
.page-hero p { color: var(--muted); font-size: 18px; margin: 0; max-width: 720px; }

/* Hero — bright, like the reference: white with a whisper of green, big navy headline */
.hero {
  background: linear-gradient(180deg, #eefaf5 0%, #ffffff 62%);
  color: var(--ink); width: 100%; border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--max); margin: 0 auto; padding: 72px 24px; }
.hero h1 { font-size: 52px; line-height: 1.1; font-weight: 800; letter-spacing: -1px; color: var(--navy); margin: 0 0 14px; max-width: 720px; }
.hero h1 span { color: var(--green); }
.hero-sub { color: var(--muted); font-size: 19px; line-height: 1.6; margin: 0 0 24px; max-width: 640px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; margin-bottom: 18px; }
.hero-search input[type="search"] {
  flex: 1; padding: 13px 16px; border: 1.5px solid #cbd5e1; border-radius: 10px; font-size: 16px; font-family: inherit;
  box-shadow: 0 4px 16px rgba(10, 37, 64, 0.08);
}
.hero-search button, .newsletter-section button {
  padding: 13px 22px; border: none; border-radius: 10px; background: var(--green);
  color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; font-family: inherit;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 24px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 15px; }
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-gold { background: var(--green); color: #fff; }
.btn-ghost { border: 1.5px solid var(--navy); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.center { text-align: center; }
.search-results { max-width: 560px; margin: 0 0 18px; }
.search-results ul { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 12px; overflow: hidden; }
.search-results li a { display: block; padding: 12px 16px; color: var(--navy); font-weight: 600; text-decoration: none; }
.search-results li a:hover { background: var(--bg-soft); }
.search-results li span { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

/* Category cards */
.category-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.topic-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 2px 10px rgba(10, 37, 64, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10, 37, 64, 0.10); }
.topic-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 18px; }
.topic-card p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.topic-card a { color: var(--green-dark); font-weight: 700; text-decoration: none; font-size: 14px; }

/* Trust band */
.trust-band {
  max-width: var(--max); margin: 8px auto; background: #fff;
  border: none; padding: 22px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.trust-band div { flex: 1; min-width: 140px; text-align: center; }
.trust-band strong { display: block; font-size: 34px; font-weight: 800; color: var(--navy); }
.trust-band span { font-size: 13px; color: var(--muted); }

/* Carousel */
.carousel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.slide { display: none; }
.slide.is-active { display: block; }
.slide h3 { margin: 0 0 8px; font-size: 21px; }
.slide h3 a { color: var(--navy); text-decoration: none; }
.slide p { color: var(--muted); font-size: 15px; margin: 0; }
.carousel-nav { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.carousel-nav button {
  border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; font-family: inherit; font-weight: 700; color: var(--navy);
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #cbd5e1; margin: 0 3px; cursor: pointer; border: none; padding: 0; }
.dot.on { background: var(--green-dark); }

/* Marquee ribbon */
.marquee { overflow: hidden; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; margin: 8px 0; }
.marquee-track { display: inline-flex; white-space: nowrap; animation: marquee-scroll 26s linear infinite; }
.marquee-track span { color: var(--green-dark); font-weight: 700; letter-spacing: 1px; font-size: 14px; padding-right: 48px; }
@keyframes marquee-scroll { to { transform: translateX(-50%); } }

/* Tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.tab {
  border: 1.5px solid var(--green-dark); background: #fff; color: var(--green-dark); border-radius: 20px;
  padding: 9px 18px; cursor: pointer; font-weight: 700; font-family: inherit; font-size: 14px;
}
.tab.on { background: var(--green); color: #fff; border-color: var(--green); }
.tab-panel { display: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 14px; }
.tab-panel.is-active { display: block; }
.tab-panel ul { margin: 0; padding-left: 20px; line-height: 1.9; }
.tab-panel a { color: var(--green-dark); font-weight: 600; text-decoration: none; }

/* Post grid */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: var(--max); margin: 0 auto; padding: 8px 24px 32px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(10, 37, 64, 0.05); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10, 37, 64, 0.10); }
.post-card .card-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); }
.post-card .card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px; }
.card-meta { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.card-meta a { font-weight: 700; text-decoration: none; }
.card-body h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.card-body h3 a { color: var(--navy); text-decoration: none; }
.card-body p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.read-more { font-weight: 700; font-size: 14px; text-decoration: none; }

/* Newsletter */
.newsletter-section { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.newsletter-section form { max-width: 520px; display: flex; flex-direction: column; gap: 8px; }
.newsletter-section label { font-weight: 600; font-size: 14px; }
.newsletter-section input[type="text"], .newsletter-section input[type="email"] {
  padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 16px; font-family: inherit;
}
.newsletter-section button { align-self: flex-start; margin-top: 6px; }

/* Footer */
.site-footer { background: var(--navy); color: #c7d6e2; width: 100%; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 32px 24px; }
.footer-inner nav { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-inner nav a { color: #fff; font-weight: 600; text-decoration: none; }
.footer-inner p { margin: 6px 0; font-size: 14px; }

@media (max-width: 900px) {
  .category-cards { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 40px; }
}
@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .has-dropdown .dropdown { position: static; box-shadow: none; border: 1px solid var(--line); background: #fff; }
  .has-dropdown .dropdown a { color: var(--navy); }
  .header-inner { flex-wrap: wrap; }
  .category-cards, .post-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 48px 20px; }
  .hero h1 { font-size: 34px; }
  .hero-search { flex-direction: column; }
}

/* Brand mark: M lettermark beside the wordmark */
.logo, .site-logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; display: block; }

/* Featured promo card — mirrors the reference's featured-card position and treatment */
.feature-card {
  background: linear-gradient(135deg, #eefaf5 0%, #ffffff 70%);
  border: 1px solid #c8ecdf; border-radius: var(--radius); padding: 32px;
}
.feature-card h2 { margin: 0 0 10px; }
.feature-card p { color: var(--muted); font-size: 17px; margin: 0 0 20px; max-width: 640px; }

/* Animations — same feel as the reference: soft fades, gentle lifts, smooth hovers */
@keyframes mu40-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mu40-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hero-inner { animation: mu40-rise 0.5s ease both; }
.slide.is-active { animation: mu40-fade 0.45s ease; }
.btn { transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 166, 126, 0.35); }
.btn-navy:hover { box-shadow: 0 8px 18px rgba(10, 37, 64, 0.30); }
.post-card .card-image img { transition: transform 0.3s ease; }
.post-card:hover .card-image img { transform: scale(1.04); }
.tab { transition: background 0.15s ease, color 0.15s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Article pages — post template (added 2026-11-11: the post template uses
   .article-layout/.post/.nav-dropdown/.dropdown-menu/.footer-nav, which the
   original stylesheet never styled, so posts rendered unstyled while the
   homepage looked right). */
.article-layout { max-width: 820px; margin: 0 auto; padding: 40px 24px 64px; }
.post h1 { color: var(--navy); font-size: 38px; line-height: 1.2; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 12px; }
.post-meta { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.post-meta a { font-weight: 700; text-decoration: none; }
.featured-image { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; }
.featured-image img { width: 100%; height: auto; }
.post h2 { color: var(--navy); font-size: 26px; line-height: 1.3; font-weight: 800; margin: 32px 0 12px; }
.post h3 { color: var(--navy); font-size: 20px; line-height: 1.35; font-weight: 700; margin: 28px 0 10px; }
.post p { margin: 0 0 16px; font-size: 17px; }
.post ul, .post ol { margin: 0 0 16px; padding-left: 24px; line-height: 1.7; }
.post li { margin-bottom: 6px; }
.post table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; }
.post th { background: var(--navy); color: #fff; text-align: left; padding: 10px 12px; }
.post td { border-bottom: 1px solid var(--line); padding: 10px 12px; }
.post blockquote { border-left: 3px solid var(--green); margin: 0 0 16px; padding: 4px 0 4px 16px; color: var(--muted); }
.post a { font-weight: 600; }
.post h2 a, .post h3 a { color: var(--navy); text-decoration: none; }

/* Post header — the post template has no .header-inner wrapper and no mobile
   toggle, so lay its logo + nav out like the homepage header. */
.site-header:has(> .site-nav) { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 24px; }
@media (min-width: 1230px) {
  .site-header:has(> .site-nav) { padding-left: calc((100% - var(--max)) / 2 + 24px); padding-right: calc((100% - var(--max)) / 2 + 24px); }
}

/* Topics menu on post pages — mirrors the homepage .has-dropdown rules. */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(10, 37, 64, 0.18); padding: 8px; flex-direction: column;
  list-style: none; margin: 0; gap: 0; align-items: stretch; z-index: 60;
}
.nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu { display: flex; }
.nav-dropdown .dropdown-menu a { color: var(--navy); display: block; }
.nav-dropdown .dropdown-menu a:hover { background: var(--bg-soft); }

/* Post footer — the post template has no .footer-inner wrapper. */
.site-footer:not(:has(.footer-inner)) { padding: 32px 24px; }
.site-footer .footer-nav { display: flex; gap: 20px; flex-wrap: wrap; margin: 0 0 12px; }
.site-footer .footer-nav a { color: #fff; font-weight: 600; text-decoration: none; }
.site-footer p { margin: 6px 0; font-size: 14px; }

@media (max-width: 700px) {
  .article-layout { padding: 28px 20px 48px; }
  .post h1 { font-size: 30px; }
  .post h2 { font-size: 23px; }
  .post p { font-size: 16px; }
  .site-header:has(> .site-nav) { flex-wrap: wrap; padding: 12px 20px; }
  .site-header:has(> .site-nav) > .site-nav { display: block; width: 100%; }
  .site-header:has(> .site-nav) > .site-nav ul { flex-wrap: wrap; }
  .nav-dropdown .dropdown-menu { position: static; box-shadow: none; border: 1px solid var(--line); background: #fff; }
}
