/* ==========================================================
   Hearth Learning — Blog Styles
   Styles for blog index and individual post pages.
   Loaded with: fonts.css, hearth-tokens.css, base.css
   Does NOT load landing.css (avoids list-style/link resets).
   ========================================================== */

/* ==========================================================
   BASE
   ========================================================== */

html {
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--hearth-rich-brown);
  background: var(--hearth-cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--hearth-deep-navy);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}

/* ==========================================================
   NAVIGATION (replicated from landing.css for blog pages)
   Blog pages always show the nav in "scrolled" state.
   ========================================================== */

:root {
  --nav-height: 80px;
  --radius-btn: 10px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(253, 246, 236, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(27, 42, 74, 0.08);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--hearth-deep-navy);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: color 0.2s;
}

.logo-icon {
  height: 1.8em;
  width: 1.8em;
  border-radius: 6px;
  vertical-align: middle;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--hearth-rich-brown);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--hearth-amber);
  border-radius: 2px;
  transition: width 0.25s var(--ease-out-expo);
}

.nav-link:hover { color: var(--hearth-amber); }
.nav-link:hover::after { width: 100%; }

.nav-link.active { color: var(--hearth-amber); }
.nav-link.active::after { width: 100%; }

.nav-cta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.4rem;
  background: var(--hearth-amber);
  color: #fff;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(232, 168, 56, 0.3);
}

.nav-cta:hover {
  background: var(--hearth-amber-glow);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232, 168, 56, 0.4);
}

.nav-social {
  display: flex;
  align-items: center;
  color: var(--hearth-rich-brown);
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.nav-social:hover {
  opacity: 1;
  color: var(--hearth-amber);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--hearth-deep-navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ==========================================================
   BLOG POST
   ========================================================== */

.blog-content {
  max-width: 740px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 3rem) clamp(1.5rem, 4vw, 3rem) 4rem;
}

.blog-meta {
  margin-bottom: 2rem;
}

.blog-meta .category {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hearth-amber);
  background: rgba(232, 168, 56, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.blog-meta .date {
  font-size: 0.9rem;
  color: var(--hearth-rich-brown);
  opacity: 0.7;
}

.blog-post h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin-bottom: 1.5rem;
}

.blog-post h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hearth-border);
}

.blog-post h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-post p {
  margin-bottom: 1.25rem;
}

.blog-post a {
  color: var(--hearth-deep-teal);
  text-decoration: underline;
  text-decoration-color: rgba(45, 106, 106, 0.3);
  text-underline-offset: 2px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.blog-post a:hover {
  color: var(--hearth-amber);
  text-decoration-color: var(--hearth-amber);
}

.blog-post strong {
  color: var(--hearth-deep-navy);
  font-weight: 600;
}

.blog-post em {
  font-style: italic;
}

.blog-post ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1.25rem;
}

.blog-post ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin-bottom: 1.25rem;
}

.blog-post li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

.blog-post li p {
  margin-bottom: 0.5rem;
}

.blog-post hr {
  border: none;
  height: 1px;
  background: var(--hearth-border);
  margin: 2.5rem 0;
}

.blog-post blockquote {
  background: rgba(232, 168, 56, 0.06);
  border-left: 4px solid var(--hearth-amber);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}

.blog-post blockquote p:last-child {
  margin-bottom: 0;
}

.blog-post blockquote ul {
  list-style: none;
  padding-left: 0;
}

.blog-post code {
  font-family: monospace;
  font-size: 0.9em;
  background: rgba(27, 42, 74, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.blog-post pre {
  background: var(--hearth-deep-navy);
  color: var(--hearth-cream);
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.blog-post pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ==========================================================
   BLOG INDEX
   ========================================================== */

.blog-index {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 3rem) clamp(1.5rem, 4vw, 3rem) 4rem;
}

.blog-index h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--hearth-deep-navy);
  margin-bottom: 0.5rem;
}

.blog-index .subtitle {
  font-size: 1.1rem;
  color: var(--hearth-rich-brown);
  opacity: 0.8;
  margin-bottom: 2.5rem;
}

.blog-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  display: block;
  color: inherit;
}

.blog-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.blog-card .card-category {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hearth-amber);
  background: rgba(232, 168, 56, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.blog-card h2 {
  font-size: 1.4rem;
  color: var(--hearth-deep-navy);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.blog-card .card-date {
  font-size: 0.85rem;
  color: var(--hearth-rich-brown);
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.blog-card .card-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--hearth-rich-brown);
}

.blog-card .read-more {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--hearth-amber);
  transition: color 0.2s;
}

.blog-card:hover .read-more {
  color: var(--hearth-deep-teal);
}

/* ==========================================================
   FOOTER (replicated from landing.css)
   ========================================================== */

.footer {
  padding: 3rem 0;
  background: var(--hearth-deep-navy);
  color: var(--hearth-warm-white);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 0.95rem;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.95rem;
  opacity: 0.8;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--hearth-amber-glow);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {
  :root {
    --nav-height: 70px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--hearth-cream);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--hearth-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-110%);
    transition: transform 0.3s var(--ease-out-expo);
  }

  .nav-links.open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}
