/* blog.css — blog-specific styles. Relies on ../assets/css/styles.css for
   fonts, colors, nav, footer, and base typography. */

:root {
  --blog-max-width: 720px;
  --blog-grid-gap: 1.75rem;
}

#blog-root {
  min-height: calc(100vh - 200px);
  padding: 6rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Index header */
.blog-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.blog-header h1 {
  font-family: "Outfit", sans-serif;
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
}
.blog-header p {
  color: #78716C;
  margin: 0;
}

/* Filter tabs */
.blog-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.blog-filter-tab {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1px solid #E7E5E4;
  background: #FDFCFA;
  border-radius: 999px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
}
.blog-filter-tab.active {
  background: #4A5A3C;
  color: #fff;
  border-color: #4A5A3C;
}

.blog-search {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 0.9rem;
  border: 1px solid #D6D3D1;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  display: block;
}

/* Card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--blog-grid-gap);
}
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .blog-grid { grid-template-columns: 1fr; } }

.blog-card[hidden] { display: none; }
.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #FDFCFA;
  border: 1px solid #E7E5E4;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.blog-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #F5F1EB;
}
.blog-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.blog-card-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4A5A3C;
  background: #E8EBE4;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.blog-card-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.blog-card-desc {
  color: #78716C;
  font-size: 0.9rem;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-meta {
  color: #A8A29E;
  font-size: 0.8rem;
}

.blog-load-more {
  display: block;
  margin: 2.5rem auto 0;
  padding: 0.75rem 2rem;
  border: 1px solid #4A5A3C;
  background: #FDFCFA;
  color: #4A5A3C;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
}

.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #78716C;
}

/* Post view */
.blog-post {
  max-width: var(--blog-max-width);
  margin: 0 auto;
}
.blog-back {
  display: inline-block;
  color: #4A5A3C;
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-family: "DM Sans", sans-serif;
}
.blog-post h1 {
  font-family: "Outfit", sans-serif;
  font-size: 2.25rem;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}
.blog-post-byline {
  color: #78716C;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.blog-post-hero {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.blog-post-body {
  font-family: "DM Sans", sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1C1917;
}
/* Match the Quill editor's paragraph rhythm: reset browser-default p margins
   to 0 (Quill Snow does the same in the editor), and force truly-empty
   paragraphs — which authors insert by pressing Enter twice for breathing
   room — to occupy one line of vertical space, exactly like the blank line
   they see while writing. Without this, empty <p></p> collapses to zero
   height and the published post reads as a wall of text. */
.blog-post-body p {
  margin: 0;
}
.blog-post-body p:empty {
  min-height: 1lh;
}
/* Body links. The site-wide `a { color: inherit; text-decoration: none }` in
   styles.css is correct for nav/CTA buttons but makes in-body links invisible
   here. Scope an override so prose links read as obvious, clickable. */
.blog-post-body a {
  color: #4A5A3C;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.blog-post-body a:hover {
  color: #D97706;
}
.blog-post-body h2 {
  font-family: "Outfit", sans-serif;
  margin-top: 2.5rem;
}
.blog-post-body h3 {
  font-family: "Outfit", sans-serif;
  margin-top: 2rem;
}
.blog-post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.blog-post-body video { max-width: 100%; height: auto; border-radius: 8px; display: block; }
/* Quill indent levels. Matches the editor's ql-indent-N steps at 3em each. */
.blog-post-body .ql-indent-1 { padding-left: 3em; }
.blog-post-body .ql-indent-2 { padding-left: 6em; }
.blog-post-body .ql-indent-3 { padding-left: 9em; }
.blog-post-body .ql-indent-4 { padding-left: 12em; }
.blog-post-body .ql-indent-5 { padding-left: 15em; }
.blog-post-body .ql-indent-6 { padding-left: 18em; }
.blog-post-body .ql-indent-7 { padding-left: 21em; }
.blog-post-body .ql-indent-8 { padding-left: 24em; }
/* Quill alignment. Matches the editor's ql-align-* classes. */
.blog-post-body .ql-align-center { text-align: center; }
.blog-post-body .ql-align-right { text-align: right; }
.blog-post-body .ql-align-justify { text-align: justify; }
.blog-post-body blockquote {
  border-left: 3px solid #4A5A3C;
  padding-left: 1rem;
  margin-left: 0;
  color: #78716C;
  font-style: italic;
}

.blog-post-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: #E8EBE4;
  border-radius: 12px;
  text-align: center;
}
.blog-post-cta a {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: #D97706;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
