/*
Theme Name: The Wealth Margin
Theme URI: https://thewealthmargin.co.uk
Author: The Wealth Margin
Description: A warm, editorial WordPress theme for practical UK personal-finance publishing.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: wealth-margin
*/

:root {
  --wm-ink: #10241f;
  --wm-green: #073f31;
  --wm-green-2: #0c5542;
  --wm-cream: #f5efe2;
  --wm-paper: #fbf7ee;
  --wm-terracotta: #a53b1d;
  --wm-orange: #bb5b28;
  --wm-gold: #c88a2b;
  --wm-line: rgba(85, 62, 34, .22);
  --wm-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --wm-sans: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --wm-shadow: 0 18px 44px rgba(34, 26, 15, .10);
  --wm-radius: 12px;
  --wm-max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--wm-ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(181, 115, 54, .055), transparent 28%),
    radial-gradient(circle at 80% 32%, rgba(7, 63, 49, .035), transparent 34%),
    var(--wm-cream);
  font-family: var(--wm-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--wm-terracotta); }
button, input, textarea, select { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { clip: auto; width: auto; height: auto; margin: 0; padding: 12px 16px; left: 8px; top: 8px; background: #fff; z-index: 10000; }
.wm-shell { width: min(100% - 64px, var(--wm-max)); margin-inline: auto; }

/* Header */
.wm-site-header { position: sticky; top: 0; z-index: 100; background: rgba(248, 242, 231, .94); border-bottom: 1px solid var(--wm-line); backdrop-filter: blur(12px); }
.wm-header-inner { min-height: 80px; display: flex; align-items: center; gap: 32px; }
.wm-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: max-content; }
.wm-mark { width: 33px; height: 39px; flex: none; }
.wm-brand-name { font-family: var(--wm-serif); font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.wm-nav { margin-left: auto; display: flex; align-items: center; gap: 34px; }
.wm-nav ul { display: flex; gap: 34px; align-items: center; list-style: none; margin: 0; padding: 0; }
.wm-nav a { text-decoration: none; font-size: .98rem; }
.wm-header-cta, .wm-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: var(--wm-green); color: #fff; padding: 12px 27px; text-decoration: none; border: 1px solid var(--wm-green); transition: transform .2s ease, background .2s ease; }
.wm-header-cta:hover, .wm-button:hover { color: #fff; background: var(--wm-green-2); transform: translateY(-1px); }
.wm-menu-toggle { display: none; margin-left: auto; border: 0; background: transparent; padding: 9px; color: var(--wm-ink); }
.wm-menu-toggle span { display: block; width: 26px; height: 2px; background: currentColor; margin: 5px 0; }

/* Hero */
.wm-hero { border-bottom: 1px solid var(--wm-line); }
.wm-hero-grid { width: min(100%, var(--wm-max)); margin-inline: auto; display: grid; grid-template-columns: minmax(0, .454fr) minmax(0, .546fr); min-height: 548px; }
.wm-hero-copy { padding: 62px 22px 62px 54px; display: flex; flex-direction: column; justify-content: center; }
.wm-eyebrow { color: var(--wm-terracotta); font-weight: 700; letter-spacing: .15em; text-transform: uppercase; font-size: .86rem; margin: 0 0 23px; }
.wm-hero h1 { font-family: var(--wm-serif); font-size: clamp(3.5rem, 4.05vw, 4rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.01; margin: 0; max-width: 620px; }
.wm-hero h1 em { font-style: normal; position: relative; }
.wm-hero h1 em::after { content: ""; position: absolute; left: 5%; right: 3%; bottom: -.04em; height: .07em; border-radius: 50%; background: var(--wm-terracotta); transform: rotate(-1.5deg); }
.wm-hero-summary { font-size: clamp(1.05rem, 1.45vw, 1.28rem); max-width: 590px; margin: 32px 0 0; color: #172824; }
.wm-actions { display: flex; align-items: center; gap: 38px; margin-top: 30px; }
.wm-text-link { text-decoration-color: var(--wm-terracotta); text-decoration-thickness: 2px; }
.wm-hero-art { min-height: 548px; background: var(--wm-green); overflow: hidden; }
.wm-hero-art img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }

.wm-topic-strip { border-bottom: 1px solid var(--wm-line); padding: 13px 24px; text-align: center; text-transform: uppercase; letter-spacing: .19em; font-size: .82rem; font-weight: 700; }
.wm-topic-strip span + span::before { content: "•"; margin: 0 22px; color: var(--wm-ink); }

/* Editorial cards */
.wm-thinking { padding: 4px 0 70px; }
.wm-section-title { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; font-family: var(--wm-serif); font-size: clamp(2.1rem, 4vw, 3.25rem); font-weight: 400; line-height: 1; text-align: center; margin: 0 0 26px; }
.wm-section-title::before, .wm-section-title::after { content: ""; height: 1px; background: var(--wm-gold); }
.wm-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.wm-card { min-width: 0; border: 1px solid var(--wm-line); border-radius: var(--wm-radius); overflow: hidden; background: rgba(251, 247, 238, .66); box-shadow: 0 4px 18px rgba(45, 30, 12, .035); transition: transform .22s ease, box-shadow .22s ease; }
.wm-card:hover { transform: translateY(-3px); box-shadow: var(--wm-shadow); }
.wm-card a { text-decoration: none; }
.wm-card-image { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--wm-line); background: #eadfca; }
.wm-card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; transition: transform .35s ease; }
.wm-card-image--art { aspect-ratio: auto; background: var(--wm-paper); }
.wm-card-image--art img { height: auto; object-fit: contain; }
.wm-card:hover .wm-card-image img { transform: scale(1.015); }
.wm-card-body { padding: 20px 28px 26px; }
.wm-card-kicker { margin: 0 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--wm-terracotta); }
.wm-card h3 { font-family: var(--wm-serif); font-size: clamp(1.55rem, 2.25vw, 2.2rem); font-weight: 400; line-height: 1.03; letter-spacing: -.025em; margin: 0; }
.wm-card h3::after { content: ""; display: block; width: 42px; height: 3px; margin-top: 16px; background: var(--wm-terracotta); border-radius: 50%; }

/* Newsletter and footer */
.wm-newsletter { background: var(--wm-green); color: #fff; padding: 68px 0; }
.wm-newsletter-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.wm-newsletter h2 { font-family: var(--wm-serif); font-weight: 400; font-size: clamp(2.4rem, 4vw, 4rem); line-height: 1; margin: 0 0 14px; }
.wm-newsletter p { margin: 0; max-width: 610px; color: rgba(255,255,255,.82); }
.wm-newsletter .jetpack_subscription_widget, .wm-newsletter form { margin: 0; }
.wm-newsletter #subscribe-submit { margin-top: 12px; }
.wm-newsletter input[type="email"] { width: min(100%, 420px); border: 0; border-radius: 8px; padding: 15px 17px; background: var(--wm-paper); color: var(--wm-ink); }
.wm-newsletter input[type="submit"], .wm-newsletter button { margin-left: 8px; border: 1px solid #fff; border-radius: 8px; padding: 14px 22px; color: var(--wm-green); background: #fff; cursor: pointer; }
.wm-site-footer { padding: 44px 0 28px; background: #082e25; color: rgba(255,255,255,.76); font-size: .9rem; }
.wm-footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items: start; }
.wm-site-footer .wm-brand { color: #fff; }
.wm-footer-nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 25px; margin: 0; padding: 0; list-style: none; }
.wm-footer-nav a { color: rgba(255,255,255,.8); text-decoration: none; }
.wm-legal-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 20px; margin: 18px 0 0; font-size: .8rem; }
.wm-footer-note { max-width: 720px; margin: 22px 0 0; font-size: .82rem; }
.wm-footer-bottom { margin-top: 35px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.14); display: flex; justify-content: space-between; gap: 20px; }

/* Articles and general content */
.wm-content-shell { width: min(100% - 44px, 1160px); margin-inline: auto; }
.wm-article-header { padding: 82px 0 42px; text-align: center; }
.wm-article-header h1, .wm-page-title { font-family: var(--wm-serif); font-weight: 400; font-size: clamp(2.7rem, 6vw, 5rem); line-height: 1.01; letter-spacing: -.035em; margin: 10px auto 18px; max-width: 960px; }
.wm-meta { color: #5d665f; font-size: .88rem; }
.wm-featured { margin: 0 auto 54px; max-width: 1160px; border-radius: var(--wm-radius); overflow: hidden; }
.wm-featured img { width: 100%; max-height: 660px; object-fit: cover; display: block; }
.wm-prose { width: min(100% - 44px, 760px); margin: 0 auto; padding-bottom: 80px; }
.wm-prose > * { margin-top: 0; margin-bottom: 1.35em; }
.wm-prose .wm-page-intro { font-family: var(--wm-serif); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.35; color: var(--wm-green); margin-bottom: 1.55em; }
.wm-prose h2, .wm-prose h3 { font-family: var(--wm-serif); font-weight: 400; line-height: 1.1; margin-top: 1.8em; }
.wm-prose h2 { font-size: 2.2rem; }
.wm-prose h3 { font-size: 1.65rem; }
.wm-prose blockquote { border-left: 4px solid var(--wm-terracotta); margin-left: 0; padding: 8px 0 8px 24px; font-family: var(--wm-serif); font-size: 1.35rem; }
.wm-prose a { color: var(--wm-green-2); }
.wm-disclaimer { margin-top: 50px; padding: 22px 24px; background: rgba(201, 139, 43, .10); border: 1px solid rgba(158, 104, 23, .22); border-radius: 8px; font-size: .84rem; }
.wm-archive { padding: 70px 0 90px; }
.wm-archive .wm-card-grid { margin-top: 36px; }
.pagination { margin-top: 40px; }

@media (max-width: 1050px) {
  .wm-shell { width: min(100% - 40px, var(--wm-max)); }
  .wm-brand-name { font-size: 1.35rem; }
  .wm-nav, .wm-header-cta { display: none; }
  .wm-menu-toggle { display: block; }
  .wm-nav.is-open { display: block; position: absolute; inset: 80px 0 auto; padding: 24px; background: var(--wm-paper); border-bottom: 1px solid var(--wm-line); }
  .wm-nav.is-open ul { display: grid; gap: 0; }
  .wm-nav.is-open li a { display: block; padding: 13px 4px; border-bottom: 1px solid var(--wm-line); }
  .wm-hero-grid { grid-template-columns: 1fr; }
  .wm-hero-copy { padding: 74px 42px; }
  .wm-hero-art { min-height: 520px; }
  .wm-card-grid { grid-template-columns: 1fr 1fr; }
  .wm-card:last-child { grid-column: 1 / -1; }
  .wm-newsletter-inner { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .wm-shell { width: min(100% - 28px, var(--wm-max)); }
  .wm-header-inner { min-height: 68px; }
  .wm-brand-name { font-size: 1rem; }
  .wm-mark { width: 27px; height: 32px; }
  .wm-nav.is-open { top: 68px; }
  .wm-hero-copy { padding: 56px 25px 48px; }
  .wm-hero h1 { font-size: clamp(3rem, 14vw, 4.2rem); }
  .wm-hero-summary { margin-top: 25px; }
  .wm-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .wm-hero-art { min-height: 390px; }
  .wm-topic-strip { display: flex; gap: 9px 18px; flex-wrap: wrap; justify-content: center; letter-spacing: .12em; }
  .wm-topic-strip span + span::before { display: none; }
  .wm-thinking { padding-top: 25px; }
  .wm-section-title { grid-template-columns: 1fr; text-align: left; }
  .wm-section-title::before, .wm-section-title::after { display: none; }
  .wm-card-grid { grid-template-columns: 1fr; }
  .wm-card:last-child { grid-column: auto; }
  .wm-card-image { aspect-ratio: 16 / 9; }
  .wm-card-image--art { aspect-ratio: auto; }
  .wm-newsletter { padding: 52px 0; }
  .wm-newsletter input[type="email"] { width: 100%; }
  .wm-newsletter input[type="submit"], .wm-newsletter button { width: 100%; margin: 9px 0 0; }
  .wm-footer-top { grid-template-columns: 1fr; }
  .wm-footer-nav ul { justify-content: flex-start; }
  .wm-footer-bottom { flex-direction: column; }
}
