/* web/static/css/base.css */
/* ==========================================================================
   Reset & Basic Page Styles
   ========================================================================== */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
body,
ul {
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

h1,
h2,
h3 {
  font-family: 'Georgia', 'Times New Roman', serif;
  letter-spacing: 0.03em;
}

/* Slightly rounder corners for a softer, joyful feel */
:root {
  --radius-sm: 6px;
  --radius-md: 12px;
}
/* Space below fixed header */
main {
  padding: 1.5rem 1rem 4.5rem;
  margin-top: 80px;
}

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */
:root {
  /* 1) Brand / Nav colors (Default: Radiance - Orange & Cream) */
  --brand-bg: #ea580c; /* Vibrant Orange */
  --brand-fg: #fff7ed; /* Warm Off-white */
  --brand-accent: #fcd34d; /* Sunny Yellow */

  /* 2) Theme (light) */
  --bg-primary: #fffbeb; /* Very subtle warm tint */
  --bg-secondary: #fef3c7bd;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --fg-primary: #451a03; /* Dark warm brown text is softer than black */
  --fg-secondary: #78350f;
  --border: #fde68a;
  --accent: #d97706;

  /* 3) Feedback messages */
  --bg-success: #ecfdf5;
  --fg-success: #059669;
  --bg-error: #fef2f2;
  --fg-error: #dc2626;

  /* Layout helpers */
  --radius-sm: 8px; /* Rounder corners = Friendlier */
  --radius-md: 16px;
  --shadow-soft: 0 10px 30px rgba(245, 158, 11, 0.15); /* Warm shadow */
  --transition-fast: 0.2s ease-out;
}

/* JOY CONSULTANT BRAND PALETTES */

/* Primary brand: warm golden sunrise = joy + prosperity */
:root[data-scheme='joy-gold'] {
  --brand-bg: #f59e0b; /* warm golden amber */
  --brand-accent: #fef3c7; /* soft radiant gold highlight */
  --accent: #fbbf24; /* bright prosperity gold */
}

/* Soft, heart-centered pink-coral */
:root[data-scheme='joy-blush'] {
  --brand-bg: #ec4899; /* joyful pink */
  --brand-accent: #ffe4e6; /* pale rose highlight */
  --accent: #fb7185; /* coral-pink accent */
}

/* Fresh mint + teal: calm, optimistic growth */
:root[data-scheme='joy-mint'] {
  --brand-bg: #0f766e; /* deep teal */
  --brand-accent: #a7f3d0; /* mint highlight */
  --accent: #1fab53; /* growth green */
}

/* Sky & sunshine: light, airy happiness */
:root[data-scheme='joy-sky'] {
  --brand-bg: #2563eb; /* clear blue sky */
  --brand-accent: #bfdbfe; /* soft sky highlight */
  --accent: #facc15; /* sun yellow accent */
}

/* ==========================================================================
   Theme override: dark mode
   ========================================================================== */
:root[data-theme='dark'] {
  --bg-primary: #1c1917; /* Warm dark gray */
  --bg-secondary: #292524;
  --bg-card: #292524;
  --bg-input: #0c0a09;
  --fg-primary: #f5f5f4;
  --fg-secondary: #a8a29e;
  --border: #44403c;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Scheme overrides
   ========================================================================== */

/* 1. RADIANCE (Default - Energy & Joy) */
:root[data-scheme='radiance'] {
  --brand-bg: #ea580c;
  --brand-accent: #fcd34d;
  --accent: #ea580c;
}

/* 2. ABUNDANCE (Prosperity - Green & Gold) */
:root[data-scheme='abundance'] {
  --brand-bg: #059669; /* Emerald */
  --brand-accent: #fcd34d;
  --accent: #059669;
}

/* 3. BERRY (Playful & Passionate) */
:root[data-scheme='berry'] {
  --brand-bg: #db2777; /* Pink/Magenta */
  --brand-accent: #fbcfe8;
  --accent: #be185d;
}

/* 4. SERENITY (Peaceful Blue) */
:root[data-scheme='serenity'] {
  --brand-bg: #0284c7; /* Sky Blue */
  --brand-accent: #e0f2fe;
  --accent: #0284c7;
}

/*
Legacy Themes
*/

:root[data-scheme='blue'] {
  --brand-bg: #1e3a5f;
  --brand-accent: #c0a354;
  --accent: #c0a354;
}

/* Slightly tuned olive so dark mode still works */
:root[data-scheme='olive'] {
  --brand-bg: #2f4f2f; /* olive */
  --brand-accent: #877444;
  --accent: #d4b76e;
}

/* Rich red but high-contrast nav text */
:root[data-scheme='red'] {
  --brand-bg: #5a1e1e;
  --brand-accent: #ffb3a8;
  --accent: #ff826a;
}

/* PROFESSIONAL / ACADEMIC PALETTES */
:root[data-scheme='charcoal'] {
  --brand-bg: #262626;
  --brand-accent: #d2b365;
  --accent: #d2b365;
}
:root[data-scheme='maroon'] {
  --brand-bg: #781c2e;
  --brand-accent: #fbe9d0;
  --accent: #f6c89f;
}
:root[data-scheme='slate'] {
  --brand-bg: #374151;
  --brand-accent: #d1d5db;
  --accent: #9ca3af;
}
:root[data-scheme='forest'] {
  --brand-bg: #14532d;
  --brand-accent: #bbf7d0;
  --accent: #6ee7b7;
}

/* JOYFUL / INSPIRING PALETTES */
:root[data-scheme='sunrise'] {
  --brand-bg: #f97316;
  --brand-accent: #fed7aa;
  --accent: #fb923c;
}
:root[data-scheme='sunset'] {
  --brand-bg: #ec4899;
  --brand-accent: #f9a8d4;
  --accent: #f973ab;
}
:root[data-scheme='lavender'] {
  --brand-bg: #6d28d9;
  --brand-accent: #ede9fe;
  --accent: #c4b5fd;
}
:root[data-scheme='spring'] {
  --brand-bg: #16a34a;
  --brand-accent: #bbf7d0;
  --accent: #4ade80;
}

/* ACADEMIC / INSTITUTIONAL PALETTE */
:root[data-scheme='academic'] {
  /* Deep blue header, gentle accent */
  --brand-bg: #1d3557; /* deep academic blue */
  --brand-accent: #f1faee; /* soft off-white */
  --accent: #a8dadc; /* muted teal accent */
}

/* YOUTH / ENERGETIC PALETTE */
:root[data-scheme='youth'] {
  /* Friendly purple with teal accent */
  --brand-bg: #5b21b6; /* deep purple */
  --brand-accent: #fef3c7; /* warm pale yellow */
  --accent: #22c55e; /* bright but readable green */
}

/* ==========================================================================
   APPLY VARIABLES TO ELEMENTS
   ========================================================================== */
body {
  background: var(--bg-primary);
  color: var(--fg-primary);
}

main {
  background: var(--bg-primary);
}

.main-inner {
  max-width: 960px;
  margin: 0 auto;
}

.page-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem 0.75rem;
  border: 1px solid var(--border);
}

/* Typography - REMOVED Serif fonts for a modern, happy look */
h1,
h2,
h3 {
  font-weight: 700;
  color: var(--fg-primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.75rem;
}
p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--fg-secondary);
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition-fast);
}
a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Generic form + controls */
button,
select,
input,
textarea {
  font: inherit;
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--brand-accent);
}

/* Layout helpers for joyful sections */
.page-intro {
  font-size: 1.05rem;
  max-width: 40rem;
  margin-bottom: 1.75rem;
  color: var(--fg-secondary);
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  color: var(--brand-accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 40rem;
  margin: 0.75rem auto 2rem;
  color: var(--fg-secondary);
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--fg-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

.hero-metric {
  text-align: left;
}
.hero-metric span {
  display: block;
}
.hero-metric .metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
}
.hero-metric .metric-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Section layout */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.badge {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--fg-secondary);
}

.card-soft {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem 0.25rem;
}

.card-soft h3 {
  margin-top: 0;
}

/* Blog cards */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.blog-card {
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-card-title {
  font-size: 1.15rem;
  margin: 0;
}

.blog-card-meta {
  font-size: 0.8rem;
  color: var(--fg-secondary);
  opacity: 0.85;
}

.blog-card a.read-more {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

/* Make hero stack on small screens */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
  }
}

/* ==========================================================================
   Navbar / Header Styles
   ========================================================================== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--brand-bg);
  /* Added a subtle gradient to make the header pop */
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  color: var(--brand-fg);
  padding: 0.85rem 2rem;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#site-header.shrink {
  padding: 0.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand block */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand:hover {
  text-decoration: none;
  opacity: 1;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  /* Removed border radius on image to let the SVG shape shine, or make it round */
  border-radius: 50%;
  margin-right: 0.75rem;
  background: #fff;
  padding: 2px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: none; /* Removed uppercase for friendliness */
  letter-spacing: -0.01em;
}
.brand-line-2 {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.9;
}

/* Desktop navigation */
#main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}
#main-nav a {
  color: var(--brand-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
#main-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}
#main-nav a::after {
  display: none; /* Removed the underline effect */
}

/* Hamburger */
#hamburger {
  display: none;
  font-size: 1.65rem;
  background: none;
  border: none;
  color: var(--brand-fg);
  cursor: pointer;
  padding: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #hamburger {
    display: block;
  }
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--brand-bg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  #main-nav.open {
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
  }
  #main-nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }
  #main-nav a {
    display: block;
  }
}
@media (min-width: 769px) {
  #main-nav {
    display: block !important;
    height: auto !important;
    max-height: none;
  }
}

/* Buttons */
button {
  background: var(--brand-bg);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  background: var(--accent);
}

/* Feedback messages */
.success,
.error {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 500;
}
.success {
  background: var(--bg-success);
  color: var(--fg-success);
  border: 1px solid var(--fg-success);
}
.error {
  background: var(--bg-error);
  color: var(--fg-error);
  border: 1px solid var(--fg-error);
}

/* Add this near the .badge styles */
.badge.draft {
  background: var(--bg-input);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
}

/* Featured Image in Blog Post */
.blog-featured-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover; /* Crops nicely if aspect ratio differs */
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* Text Formatting Options */
.blog-post-body.format-text {
  white-space: pre-wrap; /* Preserves newlines/spaces */
  font-family: system-ui, sans-serif; /* Keep it looking nice, not monospace */
}

.blog-actions {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.blog-card.highlight {
  border-color: var(--accent);
}

.blog-post-body {
  color: var(--fg-primary);
  line-height: 1.7;
}
.blog-post-body p {
  /* override the lighter .fg-secondary */
  margin-bottom: 1rem;
}
