/* ================================================
   Baseline Blog — blog.css
   Extends style.css tokens; load after style.css
   ================================================ */

/* ── Blog page base ── */
.blog-page {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══════════════════════════════════════
   BLOG LISTING PAGE
══════════════════════════════════════ */

/* Hero — matches homepage hero position exactly */
.blog-hero {
  padding: 140px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '';
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(248, 112, 9, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

/* Matches .hero-title in style.css exactly */
.blog-hero-title {
  font-family: var(--font-head);
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 20px;
}

.blog-hero-sub {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Shared post elements */
.category-pill {
  display: inline-block;
  background: rgba(226, 164, 145, 0.14);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(226, 164, 145, 0.22);
  margin-bottom: 14px;
  width: fit-content;
}

.post-title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--text);
}

.post-excerpt {
  color: var(--text-2);
  line-height: 1.72;
  font-size: 0.95rem;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  align-self: stretch;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.post-meta-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  font-family: var(--font-head);
  overflow: hidden;
}

.post-meta-sep { color: var(--text-3); font-size: 11px; }

.post-meta-date,
.post-meta-time {
  font-size: 13px;
  color: var(--text-3);
}

/* Posts Grid */
.posts-section {
  max-width: 1140px;
  margin: 0 auto 88px;
  padding: 0 24px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, background var(--trans), border-color var(--trans);
}

.post-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

.post-card-image .post-img-bg {
  position: absolute;
  inset: 0;
}

.post-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 24px 28px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: flex-start;
}

.post-card-body .category-pill {
  margin-left: -2px;
}

.post-card-body .post-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.post-card-body .post-excerpt {
  margin-bottom: auto;
  -webkit-line-clamp: 2;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  align-self: stretch;
  flex-wrap: wrap;
  gap: 12px;
}

/* Read Article button on cards */
.read-card-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   SINGLE POST PAGE
══════════════════════════════════════ */

/* Reading progress bar */
.post-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: rgb(94 118 240);
  width: 0%;
  z-index: 9999;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* Post hero / banner */
.post-hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.post-hero-bg {
  position: absolute;
  inset: 0;
}

.post-hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(27, 54, 93, 0.97) 0%,
    rgba(27, 54, 93, 0.65) 45%,
    rgba(27, 54, 93, 0.25) 100%
  );
}

.post-hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 24px 32px;
  width: 100%;
}

.post-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.post-hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 32px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
  color: var(--text);
}

.post-hero-byline {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.post-hero-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-hero-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F87009;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-head);
  color: white;
  flex-shrink: 0;
  border: 2px solid #F87009;
  overflow: hidden;
}

.post-hero-author-info {}

.post-hero-author-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.post-hero-author-role {
  font-size: 12px;
  color: var(--text-3);
  display: block;
}

.post-hero-divider {
  width: 1px;
  height: 32px;
  background: rgba(27, 54, 93, 0.15);
}

.post-hero-date-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-hero-date {
  font-size: 13px;
  color: var(--text-2);
}

.post-hero-time {
  font-size: 12px;
  color: var(--text-3);
}

/* Article */
.article-outer {
  background: var(--bg);
}

.article-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  animation: fadeUp 0.6s ease 0.1s both;
}

.article-body {
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.87;
  color: var(--text-2);
}

.article-body p { margin-bottom: 1.6rem; }

.article-body h2 {
  font-family: var(--font-head);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin: 3.2rem 0 1.3rem;
  line-height: 1.22;
}

.article-body h3 {
  font-family: var(--font-head);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.2rem 0 0.9rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.6rem 1.6rem;
}

.article-body li { margin-bottom: 0.55rem; }

.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 18px 28px;
  margin: 2.4rem 0;
  background: rgba(248, 112, 9, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--text);
  line-height: 1.7;
}

.article-body strong {
  color: var(--text);
  font-weight: 600;
}

.article-body em { color: rgba(27, 54, 93, 0.8); }

.article-body a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--trans);
}

.article-body a:hover { color: var(--secondary); }

.article-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3.5rem 0;
}

/* Author card */
.author-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 3rem 0 2rem;
}

.author-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-head);
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.post-meta-avatar img,
.post-hero-avatar img,
.author-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-card-body {}

.author-card-name {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.author-card-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.author-card-bio {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
}

.author-x-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  margin-top: 12px;
  transition: color var(--trans);
}
.author-x-link:hover { color: var(--primary-light); }

/* Tags */
.tags-section { margin: 2rem 0 3rem; }

.tags-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 12px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-block;
  padding: 6px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--trans), border-color var(--trans), color var(--trans);
}

.tag-pill:hover {
  background: var(--surface-hov);
  border-color: rgba(248, 112, 9, 0.4);
  color: var(--primary-light);
}

/* Related posts */
.related-posts-section {
  border-top: 1px solid var(--border);
  padding: 56px 24px 80px;
}

.related-posts-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.related-posts-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Scroll-to-top button */
.scroll-top {
  position: fixed;
  bottom: 36px;
  left: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  background: rgba(27, 54, 93, 0.05);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(27, 54, 93, 0.13);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, color var(--trans), border-color var(--trans);
  pointer-events: none;
  z-index: 100;
}
.scroll-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover {
  color: var(--primary-light);
  background: rgba(27, 54, 93, 0.09);
  border-color: rgba(248, 112, 9, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
@media (max-width: 600px) {
  .scroll-top {
    bottom: 20px;
    left: 16px;
    padding: 8px 10px;
  }
}

/* Back to blog link */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 48px;
  transition: color var(--trans);
}

.back-to-blog::before { content: '←'; }
.back-to-blog:hover { color: var(--primary-light); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

@media (max-width: 768px) {
  .posts-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
  .post-hero {
    min-height: 460px;
  }
  .post-hero-content {
    padding: 90px 20px 26px;
  }
  .article-container {
    padding-top: 16px;
  }
  .author-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    margin-bottom: 1.4rem;
  }
  .article-container {
    padding-bottom: 34px;
  }
  .related-posts-section {
    padding-top: 39px;
  }
  .posts-section {
    margin-bottom: 32px;
  }
  .post-card-image {
    aspect-ratio: 3/2;
  }
  .blog-hero-sub {
    font-size: 1rem;
  }
  .post-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .read-card-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .blog-hero-title {
    font-size: 34px;
    letter-spacing: -0.8px;
  }
  .blog-hero {
    padding: 110px 20px 52px;
  }
  .post-hero-divider {
    display: none;
  }
  .post-hero-byline {
    gap: 12px;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .blog-hero-title {
    font-size: 41px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .blog-hero-title {
    font-size: clamp(28px, 4vw, 42px);
  }
}

/* The article banner keeps the navy brand treatment on the otherwise light site. */
.post-hero-content .post-hero-title,
.post-hero-content .post-hero-author-name,
.post-hero-content .post-hero-author-role,
.post-hero-content .post-hero-date,
.post-hero-content .post-hero-time {
  color: #FEF8F1;
}

/* Keep the transparent navigation legible over the navy article banner. */
.post-page .navbar:not(.scrolled) .logo-text,
.post-page .navbar:not(.scrolled) .nav-item,
.post-page .navbar:not(.scrolled) .hamburger .bar {
  color: #FEF8F1;
}
.post-page .navbar:not(.scrolled) .hamburger .bar {
  background-color: #FEF8F1;
}
.post-page .post-hero-content .post-hero-date,
.post-page .post-hero-content .post-hero-time,
.post-page .post-hero-content .post-hero-author-role {
  color: #FEF8F1;
}
