/* =========================================================
   BLOG — index card grid, post hero/meta, rich-text content
   Loaded only on /blog/ pages; reuses base.css/theme.css/
   components.css tokens and components (.badge, .btn, .container,
   .page-hero, .home-closing) rather than redefining them.
   ========================================================= */

/* =========================
   Post hero (title/meta) — sits on .page-hero, just adds meta row
   ========================= */

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.post-meta .badge {
  color: var(--accent-blue);
}

/* =========================
   Featured image
   ========================= */

.post-featured-image {
  max-width: 900px;
  margin: 0 auto 48px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Same visual language as .phone-placeholder (components.css) for when a
   post doesn't have a sourced photo yet — gradient + icon, not a fake photo. */
.post-featured-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, var(--surface-2), var(--accent-blue-soft));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent-blue);
}

.post-featured-placeholder svg {
  width: 40px;
  height: 40px;
}

.post-featured-placeholder span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* A post with no image shouldn't show an empty "Featured image" box: when the slot
   only holds the placeholder, drop the whole slot so the title flows straight into
   the text. Posts that have a real <img> there are unaffected. (Done in CSS so the
   page template and the publish script that fills it need no change.) */
.post-featured-image:has(.post-featured-placeholder) {
  display: none;
}

/* =========================
   Post rich-text content
   ========================= */

.post-content {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.post-content h2 {
  margin: 48px 0 16px;
}

.post-content h3 {
  margin: 36px 0 12px;
}

.post-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 20px;
}

.post-content p:first-child {
  margin-top: 0;
}

.post-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent-blue);
  background: var(--surface-2);
  border-radius: 0 12px 12px 0;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-primary);
}

.post-content blockquote p {
  margin-bottom: 0;
}

/* Bulleted / numbered lists from the rich-text editor. base.css strips list
   markers site-wide, so they have to be put back here for post bodies. */
.post-content ul,
.post-content ol {
  margin: 0 0 20px;
  padding-left: 1.6em;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 8px;
}

.post-content li::marker {
  color: var(--accent-blue);
}

.post-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 32px 0;
  border: 1px solid var(--border);
}

.post-content a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================
   Blog index — card grid
   ========================= */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  padding-bottom: 96px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.35);
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-card-body .badge {
  align-self: flex-start;
}

.blog-card-body h2 {
  font-size: 1.25rem;
  margin: 0;
}

.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

.blog-card-date {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* =========================
   Empty / loading / error states
   ========================= */

.blog-status {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-secondary);
}

.blog-status[hidden] {
  display: none;
}
