/*
Theme Name:  FinancePeakHub
Theme URI:   https://gitlab.com/midwest2/financepeakhub
Author:      FinancePeakHub
Description: Ultra-minimalist fintech/SaaS style theme for a hybrid digital products, affiliate, and content hub. Master your money. Master your health. Live at your peak.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: financepeakhub
*/

/* =====================================================================
   1. DESIGN TOKENS (CSS Custom Properties)
   Edit these variables to re-skin the entire theme.
   ===================================================================== */
:root {
  /* Brand palette */
  --color-navy: #0B132B;          /* Primary text / dark surfaces */
  --color-navy-soft: #1C2541;     /* Secondary dark */
  --color-emerald: #00A86B;       /* Finance / conversion accent */
  --color-emerald-dark: #008a58;
  --color-coral: #FF7849;         /* Warm coral CTA */
  --color-gold: #F4B942;          /* Gold highlight */
  --color-slate-bg: #F6F8FB;      /* Soft slate page background */
  --color-surface: #FFFFFF;       /* Card surface */
  --color-border: #E4E9F1;        /* Hairline borders / grid lines */
  --color-muted: #5C6784;         /* Muted body text */

  /* Typography scale (mobile-first, fluid) */
  --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: clamp(1.25rem, 2vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 3vw, 2rem);
  --text-hero: clamp(2.25rem, 5vw, 3.75rem);

  /* Spacing + shape */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 19, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 19, 43, 0.08);
  --shadow-lg: 0 20px 48px rgba(11, 19, 43, 0.14);

  /* Motion */
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);

  --container: 1180px;
}

/* =====================================================================
   2. RESET + BASE
   ===================================================================== */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-navy);
  background-color: var(--color-slate-bg);
  /* Subtle grid lines for the fintech aesthetic */
  background-image:
    linear-gradient(rgba(11, 19, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 19, 43, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a { color: var(--color-emerald); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-emerald-dark); }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section { padding-block: var(--space-6); }

.section-head { max-width: 620px; margin-bottom: var(--space-4); }
.section-head .eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-emerald);
  margin-bottom: var(--space-1);
}
.section-head h2 { font-size: var(--text-2xl); margin-bottom: var(--space-1); }
.section-head p { color: var(--color-muted); }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* =====================================================================
   3. BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85em 1.75em;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background-color: var(--color-emerald);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 168, 107, 0.35);
}
.btn-primary:hover { background-color: var(--color-emerald-dark); color: #fff; }

.btn-cta {
  background: linear-gradient(120deg, var(--color-coral), var(--color-gold));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 120, 73, 0.35);
}
.btn-cta:hover { color: #fff; box-shadow: 0 10px 24px rgba(255, 120, 73, 0.45); }

.btn-outline {
  background: transparent;
  border-color: var(--color-navy);
  color: var(--color-navy);
}
.btn-outline:hover { background-color: var(--color-navy); color: #fff; }

/* =====================================================================
   4. HEADER + NAVIGATION
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-2);
}
.site-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-navy);
}
.site-logo span { color: var(--color-emerald); }

.primary-nav ul {
  display: flex;
  gap: var(--space-3);
  list-style: none;
}
.primary-nav a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-navy-soft);
  position: relative;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--color-emerald);
  transition: width var(--transition);
}
.primary-nav a:hover::after,
.primary-nav .current-menu-item a::after { width: 100%; }

/* =====================================================================
   5. HERO
   ===================================================================== */
.hero { padding-block: var(--space-6); }
.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: center;
}
.hero-tagline {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-emerald);
  background: rgba(0, 168, 107, 0.1);
  padding: 0.4em 1em;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-2);
}
.hero h1 { font-size: var(--text-hero); margin-bottom: var(--space-2); }
.hero h1 .accent { color: var(--color-emerald); }
.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 520px;
  margin-bottom: var(--space-3);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Hero image card frame */
.hero-media {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
}
.hero-media:hover { transform: translateY(-6px) rotate(-0.5deg); }
.hero-media img {
  border-radius: calc(var(--radius-lg) - 6px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.hero-media .floating-stat {
  position: absolute;
  bottom: var(--space-3);
  left: calc(-1 * var(--space-2));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
}
.hero-media .floating-stat strong { color: var(--color-emerald); display: block; font-size: var(--text-lg); }

/* =====================================================================
   6. DIGITAL PRODUCTS GRID
   ===================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.product-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.product-card .card-body { padding: var(--space-3); display: flex; flex-direction: column; flex: 1; gap: var(--space-1); }
.product-card h3 { font-size: var(--text-xl); }
.product-card p { color: var(--color-muted); font-size: var(--text-sm); flex: 1; }

.badge {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35em 0.9em;
  border-radius: var(--radius-pill);
}
.badge-finance { background: var(--color-navy); color: #fff; }
.badge-health  { background: rgba(0, 168, 107, 0.12); color: var(--color-emerald-dark); }
.badge-premium { background: linear-gradient(120deg, var(--color-coral), var(--color-gold)); color: #fff; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
}
.price { font-family: var(--font-heading); font-weight: 800; font-size: var(--text-xl); }
.price .from { font-size: var(--text-xs); font-weight: 600; color: var(--color-muted); display: block; }

/* =====================================================================
   7. BLOG SECTION (grid + sticky affiliate sidebar)
   ===================================================================== */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  align-items: start;
}

.post-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.post-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card .card-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }
.post-card h3 { font-size: var(--text-lg); }
.post-card h3 a { color: var(--color-navy); }
.post-card h3 a:hover { color: var(--color-emerald); }
.post-card .excerpt { color: var(--color-muted); font-size: var(--text-sm); flex: 1; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.reading-time::before { content: '\2022'; margin-right: 0.6em; color: var(--color-border); }

.tag {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.25em 0.8em;
  border-radius: var(--radius-pill);
}
.tag-finance { background: rgba(11, 19, 43, 0.08); color: var(--color-navy); }
.tag-health  { background: rgba(0, 168, 107, 0.12); color: var(--color-emerald-dark); }
.tag-editors-pick { background: rgba(244, 185, 66, 0.2); color: #9a6b12; }

.disclosure-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-xs);
  color: var(--color-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-1);
  margin-top: var(--space-1);
}

/* Editor's Picks feature card spans full width of the post grid */
.post-card.is-featured { border: 2px solid var(--color-gold); }

/* Sticky affiliate sidebar */
.affiliate-sidebar {
  position: sticky;
  top: 96px; /* clears the sticky header */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.affiliate-sidebar h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.affiliate-sidebar ul { list-style: none; display: grid; gap: var(--space-2); }
.affiliate-item {
  display: flex;
  gap: var(--space-1);
  align-items: flex-start;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}
.affiliate-item:hover { background: var(--color-slate-bg); }
.affiliate-item .num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-emerald);
  color: #fff;
  font-weight: 800;
  font-size: var(--text-xs);
}
.affiliate-item strong { display: block; font-size: var(--text-sm); }
.affiliate-item span { font-size: var(--text-xs); color: var(--color-muted); }
.affiliate-sidebar .fine-print { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-2); }

/* =====================================================================
   8. TRUST + ABOUT
   ===================================================================== */
.trust {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-lg);
}
.trust .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-block: var(--space-5);
  align-items: center;
}
.trust h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.trust p { color: rgba(255, 255, 255, 0.72); }

.testimonial {
  background: var(--color-navy-soft);
  border-left: 4px solid var(--color-emerald);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.testimonial blockquote { font-size: var(--text-lg); font-style: italic; margin-bottom: var(--space-1); }
.testimonial cite { font-size: var(--text-sm); color: var(--color-gold); font-style: normal; font-weight: 700; }

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-top: var(--space-3); }
.metric strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--color-emerald);
}
.metric span { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.72); }

/* =====================================================================
   9. SINGLE POST + ARCHIVE
   ===================================================================== */
.entry-header { max-width: 760px; margin-inline: auto; padding-block: var(--space-4) var(--space-2); }
.entry-header h1 { font-size: var(--text-2xl); margin-block: var(--space-1); }

.entry-content {
  max-width: 760px;
  margin-inline: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.entry-content > * + * { margin-top: var(--space-2); }
.entry-content h2 { font-size: var(--text-xl); }
.entry-content img { border-radius: var(--radius-sm); }

.featured-hero { max-width: 960px; margin-inline: auto; }
.featured-hero img { border-radius: var(--radius-lg); aspect-ratio: 21 / 9; object-fit: cover; width: 100%; box-shadow: var(--shadow-md); }

/* Affiliate callout box (use inside post content: <div class="callout callout-affiliate">) */
.callout {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
}
.callout-affiliate {
  background: rgba(0, 168, 107, 0.06);
  border-color: rgba(0, 168, 107, 0.3);
}
.callout-affiliate .callout-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-emerald-dark);
  display: block;
  margin-bottom: var(--space-1);
}

.pagination { display: flex; justify-content: center; gap: var(--space-1); padding-block: var(--space-4); }
.pagination .page-numbers {
  display: grid; place-items: center;
  min-width: 40px; height: 40px;
  padding-inline: 0.75em;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-navy);
  font-weight: 600;
  font-size: var(--text-sm);
}
.pagination .page-numbers.current { background: var(--color-emerald); border-color: var(--color-emerald); color: #fff; }

/* =====================================================================
   10. FOOTER
   ===================================================================== */
.site-footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--space-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding-block: var(--space-5);
}
.footer-grid h4 { color: #fff; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--space-2); }
.footer-grid ul { list-style: none; display: grid; gap: var(--space-1); }
.footer-grid a { color: rgba(255, 255, 255, 0.72); font-size: var(--text-sm); }
.footer-grid a:hover { color: var(--color-emerald); }
.footer-brand p { font-size: var(--text-sm); max-width: 280px; }

.newsletter-form { display: flex; gap: var(--space-1); margin-top: var(--space-1); }
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75em 1em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--color-navy-soft);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.newsletter-form input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.45); }
.newsletter-form button { padding: 0.75em 1.25em; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: var(--space-2);
  font-size: var(--text-xs);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1);
}

/* =====================================================================
   11. RESPONSIVE BREAKPOINTS
   ===================================================================== */
@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-card.is-featured { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .hero .container { grid-template-columns: 1.1fr 1fr; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-layout { grid-template-columns: 2fr 1fr; }
  .trust .container { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
