/*
Theme Name: Money & Planet Magazine
Theme URI: https://moneyandplanet.com
Description: A magazine-style child theme for Money & Planet — personal finance, minimalist living, and smart money tools.
Author: Money & Planet
Author URI: https://moneyandplanet.com
Template: kadence
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: moneyandplanet-child
*/

/* ============================================
   CSS VARIABLES — BRAND IDENTITY
   ============================================ */
:root {
  /* Primary palette — fresh sage green + warm golden yellow */
  --mp-primary: #4A9D6E;
  --mp-primary-light: #6BBF8A;
  --mp-primary-dark: #3A7D58;
  --mp-accent: #E6B44C;
  --mp-accent-light: #F0CC72;

  /* Neutrals — warm cream and soft tones */
  --mp-bg: #FBF9F3;
  --mp-bg-card: #FFFDF7;
  --mp-bg-alt: #F5F1E8;
  --mp-text: #2D3A2E;
  --mp-text-light: #5F6E60;
  --mp-text-muted: #8D9A8E;
  --mp-border: #E6E1D5;

  /* Category colors — warm natural tones */
  --mp-cat-investing: #3B8A5A;
  --mp-cat-saving: #2E8B8B;
  --mp-cat-earning: #C9952C;
  --mp-cat-minimalist: #8B6AAE;
  --mp-cat-mindset: #C47D4E;
  --mp-cat-tools: #4A9D6E;

  /* Typography */
  --mp-font-display: 'DM Serif Display', Georgia, serif;
  --mp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mp-font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --mp-gap: 1.5rem;
  --mp-gap-lg: 2.5rem;
  --mp-radius: 6px;
  --mp-radius-lg: 12px;

  /* Shadows */
  --mp-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --mp-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --mp-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ============================================
   GLOBAL RESETS & BASE
   ============================================ */
body {
  background-color: var(--mp-bg);
  color: var(--mp-text);
  font-family: var(--mp-font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6,
.entry-title,
.post-title {
  font-family: var(--mp-font-display);
  font-weight: 400;
  color: var(--mp-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.entry-title a,
.post-title a {
  color: var(--mp-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.entry-title a:hover,
.post-title a:hover {
  color: var(--mp-primary);
}

/* ============================================
   HEADER — MAGAZINE STYLE
   ============================================ */
.site-header {
  background: var(--mp-bg-card);
  border-bottom: 1px solid var(--mp-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Top bar accent stripe */
.site-header::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--mp-primary) 0%, var(--mp-accent) 100%);
}

.site-branding .site-title {
  font-family: var(--mp-font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.site-branding .site-title a {
  color: #2D4A35;
}

/* Navigation styling */
.main-navigation .menu > li > a,
.header-navigation .menu > li > a {
  font-family: var(--mp-font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mp-text);
  transition: color 0.2s ease;
}

.main-navigation .menu > li > a:hover,
.header-navigation .menu > li > a:hover {
  color: var(--mp-primary);
}

/* ============================================
   MAGAZINE HOMEPAGE — HERO SECTION
   ============================================ */
.mp-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--mp-gap);
  margin-bottom: var(--mp-gap-lg);
}

.mp-hero-main {
  position: relative;
  border-radius: var(--mp-radius-lg);
  overflow: hidden;
  min-height: 420px;
}

.mp-hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-hero-main .mp-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: white;
}

.mp-hero-main .mp-hero-overlay h2 {
  font-family: var(--mp-font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.mp-hero-main .mp-hero-overlay h2 a {
  color: white;
  text-decoration: none;
}

.mp-hero-main .mp-hero-overlay h2 a:hover {
  color: var(--mp-accent-light);
}

.mp-hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--mp-gap);
}

.mp-hero-sidebar .mp-hero-card {
  flex: 1;
  position: relative;
  border-radius: var(--mp-radius);
  overflow: hidden;
  min-height: 195px;
}

.mp-hero-sidebar .mp-hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-hero-sidebar .mp-hero-card .mp-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.mp-hero-sidebar .mp-hero-card .mp-hero-overlay h3 {
  font-family: var(--mp-font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: white;
  margin: 0;
  line-height: 1.4;
}

.mp-hero-sidebar .mp-hero-card .mp-hero-overlay h3 a {
  color: white;
  text-decoration: none;
}

/* ============================================
   CATEGORY BADGE
   ============================================ */
.mp-category-badge {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--mp-font-body);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: white;
  border-radius: 3px;
  margin-bottom: 0.5rem;
  background: var(--mp-primary);
}

.mp-category-badge.cat-investing { background: var(--mp-cat-investing); }
.mp-category-badge.cat-saving { background: var(--mp-cat-saving); }
.mp-category-badge.cat-earning { background: var(--mp-cat-earning); }
.mp-category-badge.cat-minimalist { background: var(--mp-cat-minimalist); }
.mp-category-badge.cat-mindset { background: var(--mp-cat-mindset); }
.mp-category-badge.cat-tools { background: var(--mp-cat-tools); }

/* ============================================
   MAGAZINE SECTION HEADERS
   ============================================ */
.mp-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--mp-border);
}

.mp-section-header h2 {
  font-family: var(--mp-font-body);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.mp-section-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--mp-accent);
}

.mp-section-header .mp-view-all {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mp-primary);
  text-decoration: none;
  white-space: nowrap;
}

.mp-section-header .mp-view-all:hover {
  color: var(--mp-accent);
}

/* ============================================
   POST CARDS — MAGAZINE GRID
   ============================================ */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--mp-gap);
  margin-bottom: var(--mp-gap-lg);
}

.mp-card {
  background: var(--mp-bg-card);
  border-radius: var(--mp-radius);
  overflow: hidden;
  box-shadow: var(--mp-shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.mp-card:hover {
  box-shadow: var(--mp-shadow-md);
  transform: translateY(-3px);
}

.mp-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.mp-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.mp-card:hover .mp-card-image img {
  transform: scale(1.04);
}

.mp-card-body {
  padding: 1.25rem 1.25rem 1rem;
}

.mp-card-body h3 {
  font-family: var(--mp-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.5rem 0 0.6rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.mp-card-body h3 a {
  color: var(--mp-text);
  text-decoration: none;
}

.mp-card-body h3 a:hover {
  color: var(--mp-primary);
}

.mp-card-excerpt {
  font-size: 0.82rem;
  color: var(--mp-text-light);
  line-height: 1.6;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--mp-border);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--mp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mp-card-meta .mp-read-time {
  margin-left: auto;
}

/* ============================================
   HORIZONTAL POST ROW (2-col: image + text)
   ============================================ */
.mp-horizontal-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  background: var(--mp-bg-card);
  border-radius: var(--mp-radius);
  overflow: hidden;
  box-shadow: var(--mp-shadow-sm);
  margin-bottom: var(--mp-gap);
  transition: box-shadow 0.3s ease;
}

.mp-horizontal-card:hover {
  box-shadow: var(--mp-shadow-md);
}

.mp-horizontal-card .mp-card-image {
  aspect-ratio: auto;
  height: 100%;
}

.mp-horizontal-card .mp-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.mp-horizontal-card .mp-card-body h3 {
  font-size: 1.15rem;
}

/* ============================================
   TOOLS / CALCULATOR PROMO SECTION
   ============================================ */
.mp-tools-section {
  background: linear-gradient(135deg, #2D4A35 0%, #3A7D58 60%, #4A9D6E 100%);
  border-radius: var(--mp-radius-lg);
  padding: 2.5rem;
  margin-bottom: var(--mp-gap-lg);
  color: white;
}

.mp-tools-section h2 {
  font-family: var(--mp-font-body);
  color: white;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.mp-tools-section p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.mp-tools-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.mp-tool-card {
  background: #1F3A27;
  border: 1px solid #2D5538;
  border-radius: var(--mp-radius);
  padding: 1.25rem 1rem;
  text-align: center;
  text-decoration: none;
  color: white;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mp-tool-card:hover {
  background: #274832;
  border-color: #4A9D6E;
  transform: translateY(-2px);
  color: white;
}

.mp-tool-card .mp-tool-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.mp-tool-card h4 {
  font-family: var(--mp-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: #FFFFFF;
}

.mp-tool-card span {
  font-size: 0.72rem;
  font-weight: 500;
  color: #E6B44C;
}

/* ============================================
   NEWSLETTER SIGNUP SECTION
   ============================================ */
.mp-newsletter {
  background: var(--mp-bg-alt);
  border: 2px solid var(--mp-border);
  border-radius: var(--mp-radius-lg);
  padding: 2.5rem;
  margin-bottom: var(--mp-gap-lg);
  text-align: center;
}

.mp-newsletter h3 {
  font-family: var(--mp-font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.mp-newsletter p {
  color: var(--mp-text-light);
  margin-bottom: 1.25rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.mp-newsletter form {
  display: flex;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.mp-newsletter input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius);
  font-size: 0.95rem;
  font-family: var(--mp-font-body);
}

.mp-newsletter button {
  padding: 0.75rem 1.5rem;
  background: var(--mp-primary);
  color: white;
  border: none;
  border-radius: var(--mp-radius);
  font-family: var(--mp-font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mp-newsletter button:hover {
  background: var(--mp-primary-light);
}

/* ============================================
   SIDEBAR — FOR ARCHIVE/SINGLE PAGES
   ============================================ */
.mp-sidebar-widget {
  background: var(--mp-bg-card);
  border-radius: var(--mp-radius);
  padding: 1.25rem;
  box-shadow: var(--mp-shadow-sm);
  margin-bottom: var(--mp-gap);
}

.mp-sidebar-widget h4 {
  font-family: var(--mp-font-display);
  font-size: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--mp-accent);
  margin-bottom: 1rem;
}

/* ============================================
   SINGLE POST STYLES
   ============================================ */
.single .entry-content {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 720px;
  font-weight: 400;
}

.single .entry-content h2 {
  font-family: var(--mp-font-body);
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--mp-accent);
}

.single .entry-content h3 {
  font-family: var(--mp-font-body);
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
}

.single .entry-content blockquote {
  border-left: 4px solid var(--mp-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--mp-bg-alt);
  border-radius: 0 var(--mp-radius) var(--mp-radius) 0;
  font-style: italic;
  color: var(--mp-text-light);
}

/* Author bio box — E-E-A-T signal */
.mp-author-box {
  display: flex;
  gap: 1.25rem;
  background: var(--mp-bg-alt);
  border-radius: var(--mp-radius);
  padding: 1.5rem;
  margin-top: 2rem;
  border: 1px solid var(--mp-border);
}

.mp-author-box img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.mp-author-box .mp-author-info h4 {
  font-family: var(--mp-font-display);
  margin: 0 0 0.3rem;
}

.mp-author-box .mp-author-info p {
  font-size: 0.88rem;
  color: var(--mp-text-light);
  margin: 0;
}

/* ============================================
   FOOTER — MAGAZINE STYLE
   ============================================ */
.site-footer {
  background: #2D4A35;
  color: rgba(255,255,255,0.7);
}

.site-footer a {
  color: var(--mp-accent-light);
}

.site-footer a:hover {
  color: white;
}

/* ============================================
   BLOG ARCHIVE — MAGAZINE GRID OVERRIDE
   ============================================ */
.loop-entry.type-post {
  background: var(--mp-bg-card);
  border-radius: var(--mp-radius);
  overflow: hidden;
  box-shadow: var(--mp-shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.loop-entry.type-post:hover {
  box-shadow: var(--mp-shadow-md);
  transform: translateY(-2px);
}

.loop-entry .post-thumbnail img {
  transition: transform 0.4s ease;
}

.loop-entry:hover .post-thumbnail img {
  transform: scale(1.03);
}

.loop-entry .entry-content-wrap {
  padding: 1.25rem;
}

.loop-entry .entry-title {
  font-family: var(--mp-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Category in archive entries */
.loop-entry .entry-taxonomies {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.loop-entry .entry-taxonomies a {
  color: var(--mp-primary);
  text-decoration: none;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
  .mp-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mp-hero {
    grid-template-columns: 1fr;
  }

  .mp-hero-sidebar {
    flex-direction: row;
  }

  .mp-hero-sidebar .mp-hero-card {
    min-height: 180px;
  }

  .mp-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mp-tools-section {
    padding: 2rem;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 640px) {

  /* Hero stacks vertically */
  .mp-hero {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .mp-hero-main {
    min-height: 260px;
  }

  .mp-hero-main .mp-hero-overlay h2 {
    font-size: 1.25rem;
  }

  .mp-hero-sidebar {
    flex-direction: row;
  }

  .mp-hero-sidebar .mp-hero-card {
    min-height: 140px;
  }

  .mp-hero-sidebar .mp-hero-card .mp-hero-overlay h3 {
    font-size: 0.8rem;
  }

  /* Post grid stacks to single column */
  .mp-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Cards become horizontal on mobile */
  .mp-card {
    display: grid;
    grid-template-columns: 120px 1fr;
  }

  .mp-card .mp-card-image {
    aspect-ratio: 1 / 1;
    height: 100%;
  }

  .mp-card-body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .mp-card-body h3 {
    font-size: 0.88rem;
    margin: 0.25rem 0 0.3rem;
  }

  .mp-card-excerpt {
    display: none;
  }

  .mp-card-meta {
    margin-top: 0.4rem;
    padding-top: 0;
    border-top: none;
    font-size: 0.68rem;
  }

  /* Horizontal cards stack */
  .mp-horizontal-card {
    grid-template-columns: 1fr;
  }

  .mp-horizontal-card .mp-card-body {
    padding: 1rem;
  }

  /* ---- MOBILE TOOLS: compact horizontal scroll ---- */
  .mp-tools-section {
    padding: 1.25rem !important;
    border-radius: 8px !important;
  }

  .mp-tools-section h2 {
    font-size: 1.1rem !important;
    margin-bottom: 0.15rem !important;
  }

  .mp-tools-section p {
    font-size: 0.8rem !important;
    margin-bottom: 1rem !important;
  }

  .mp-tools-grid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    gap: 0.6rem !important;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .mp-tools-grid::-webkit-scrollbar {
    height: 3px;
  }

  .mp-tools-grid::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
  }

  .mp-tools-grid::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
  }

  .mp-tool-card {
    min-width: 110px !important;
    max-width: 110px !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    padding: 0.75rem 0.5rem !important;
  }

  .mp-tool-card .mp-tool-icon {
    font-size: 1.25rem !important;
    margin-bottom: 0.3rem !important;
  }

  .mp-tool-card h4 {
    font-size: 0.7rem !important;
    line-height: 1.3 !important;
  }

  .mp-tool-card span {
    font-size: 0.6rem !important;
    line-height: 1.3 !important;
  }

  /* Newsletter */
  .mp-newsletter {
    padding: 1.5rem;
  }

  .mp-newsletter form {
    flex-direction: column;
  }

  .mp-newsletter h3 {
    font-size: 1.15rem;
  }

  /* Section headers */
  .mp-section-header h2 {
    font-size: 1rem;
  }

  .mp-section-header {
    margin-bottom: 1rem;
  }

  /* Single post */
  .single .entry-content {
    font-size: 0.95rem;
  }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE
   ============================================ */
@media (max-width: 400px) {
  .mp-hero-sidebar {
    flex-direction: column;
  }

  .mp-hero-sidebar .mp-hero-card {
    min-height: 120px;
  }

  .mp-card {
    grid-template-columns: 100px 1fr;
  }

  .mp-tool-card {
    min-width: 100px !important;
    max-width: 100px !important;
  }
}

/* ============================================
   KADENCE-SPECIFIC OVERRIDES
   Ensures our fonts win over Kadence defaults
   ============================================ */
.site-branding .site-title,
.wp-site-blocks .site-branding .site-title {
  font-family: var(--mp-font-display) !important;
  font-weight: 400 !important;
}

.site-header .header-navigation .menu > li > a,
.site-header .main-navigation .menu > li > a,
.site-header .header-menu-container .menu > li > a,
#masthead .header-navigation a,
.header-desktop-inner-wrap .menu > li > a {
  font-family: var(--mp-font-body) !important;
  font-weight: 500 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
}

/* Override Kadence's global heading font */
body .entry-title,
body .post-title,
.content-area .entry-title {
  font-family: var(--mp-font-display) !important;
}

/* Override Kadence body font */
body,
body .entry-content,
body .entry-content p,
.content-area .entry-content {
  font-family: var(--mp-font-body) !important;
}

/* Kadence archive grid entries */
body .loop-entry .entry-title,
body .loop-entry .entry-title a {
  font-family: var(--mp-font-body) !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
}
