/* ==========================================================================
   Blog Post Styles
   ========================================================================== */

/* --- Reading Progress Bar --- */
.blog-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}

.blog-progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.1s linear;
}

/* --- Sticky Header (shows on scroll past title) --- */
.blog-sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #fecdd3;
  padding: 0.625rem 1.5rem;
  transform: translateY(-100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.blog-sticky-header--visible {
  transform: translateY(0);
  pointer-events: auto;
}

.blog-sticky-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-sticky-header__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blog-sticky-header__progress {
  font-size: 0.75rem;
  color: #9ca3af;
  flex-shrink: 0;
}

/* --- Editorial Hero Image --- */
.blog-hero {
  position: relative;
  margin: -1.5rem -1.5rem 0;
  border-radius: 0.75rem 0.75rem 0 0;
  overflow: hidden;
  max-height: 28rem;
}

@media (min-width: 768px) {
  .blog-hero {
    margin: -2.5rem -2.5rem 0;
  }
}

.blog-hero {
  margin-bottom: 1rem;
}

.blog-hero img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.blog-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
  pointer-events: none;
}

.blog-hero figcaption {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

/* --- Meta Bar --- */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: #fff1f2;
  border-radius: 0.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.blog-meta__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.blog-meta__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #e11d48;
  color: #fff;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Table of Contents --- */
.blog-toc {
  border: 1px solid #fecdd3;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  overflow: hidden;
  background: #fff;
}

.blog-toc__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: #fff1f2;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f2937;
}

.blog-toc__toggle:hover {
  background: #ffe4e6;
}

.blog-toc__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-toc__icon {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  color: #9ca3af;
}

.blog-toc__toggle[aria-expanded="false"] .blog-toc__icon {
  transform: rotate(180deg);
}

.blog-toc__list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 1.25rem;
  counter-reset: none;
}

.blog-toc__list--collapsed {
  display: none;
}

.blog-toc__item {
  padding: 0;
  margin: 0;
}

.blog-toc__item::before {
  display: none;
}

.blog-toc__link {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.5rem 0.375rem;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
}

.blog-toc__link:hover {
  background: #fff1f2;
  color: #e11d48;
  text-decoration: none;
}

.blog-toc__number {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffe4e6;
  color: #e11d48;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Content Prose Spacing (Typography plugin not installed) --- */
.blog-content p {
  margin-bottom: 1.25em;
  line-height: 1.75;
}

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

.blog-content ul {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 0;
  list-style: disc inside;
}

.blog-content ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 0;
  list-style: decimal inside;
}

/* --- Content Section Visual Rhythm --- */
.blog-content h2 {
  position: relative;
  padding-top: 2.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.blog-content h2::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 0;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, #e11d48, #fda4af);
  border-radius: 2px;
}

/* Styled list items with bold leads */
.blog-content ul li,
.blog-content ol li {
  margin-bottom: 0.5rem;
}

.blog-content ul li strong:first-child,
.blog-content ol li strong:first-child {
  color: #e11d48;
}

/* Blockquote as tip/callout box */
.blog-content blockquote {
  position: relative;
  background: #fff1f2;
  border-left: 4px solid #e11d48;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.25rem 1.5rem 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: normal;
  color: #4b5563;
}

.blog-content blockquote p:first-child::before {
  content: '\f0eb';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 0.5rem;
  color: #e11d48;
}

/* --- Author/Expertise Box --- */
.blog-author-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 0.75rem;
  margin-top: 2rem;
}

.blog-author-box__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e11d48;
  color: #fff;
  border-radius: 9999px;
  font-size: 1.25rem;
}

.blog-author-box__title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.blog-author-box__text {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
}

.blog-author-box__link {
  color: #e11d48;
  text-decoration: none;
  font-weight: 500;
}

.blog-author-box__link:hover {
  text-decoration: underline;
}

/* --- Floating CTA --- */
.blog-floating-cta {
  position: fixed;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Desktop: bottom-right pill */
.blog-floating-cta {
  bottom: 1.5rem;
  right: 1.5rem;
  transform: translateY(1rem);
}

.blog-floating-cta--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.blog-floating-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #e11d48;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  transition: background 0.15s, box-shadow 0.15s;
}

.blog-floating-cta__btn:hover {
  background: #be123c;
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.45);
  color: #fff;
  text-decoration: none;
}

/* Mobile: full-width bottom bar */
@media (max-width: 767px) {
  .blog-floating-cta {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
  }

  .blog-floating-cta--visible {
    transform: translateY(0);
  }

  .blog-floating-cta__btn {
    border-radius: 0;
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
  }
}

/* --- Related Posts Enhancements --- */
.blog-related-card {
  transition: box-shadow 0.2s ease;
}

.blog-related-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.blog-related-card__image {
  overflow: hidden;
}

.blog-related-card__image img {
  transition: transform 0.3s ease;
}

.blog-related-card:hover .blog-related-card__image img {
  transform: scale(1.05);
}

/* --- Two-Column Layout Grid --- */
.blog-layout-grid {
  display: block;
  margin-top: 0.5rem;
}

@media (min-width: 1024px) {
  .blog-layout-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
  }

  .blog-hero {
    margin: -3rem -3rem 0;
  }
}

.blog-layout-grid__sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .blog-layout-grid__sidebar {
    display: block;
    position: sticky;
    top: 11.5rem;
    align-self: start;
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
    scrollbar-width: none;
  }

  .blog-layout-grid__sidebar::-webkit-scrollbar {
    display: none;
  }
}

/* --- ToC: inline vs sidebar visibility --- */
.blog-toc--inline {
  display: block;
}

.blog-toc--sidebar {
  display: block;
}

@media (min-width: 1024px) {
  .blog-toc--inline {
    display: none;
  }

  /* Force ToC always open in sidebar */
  .blog-toc--sidebar .blog-toc__toggle {
    display: none;
  }

  .blog-toc--sidebar .blog-toc__list {
    display: block !important;
  }

  .blog-toc--sidebar .blog-toc {
    border: none;
    background: transparent;
    margin-bottom: 1.5rem;
  }

  .blog-toc--sidebar .blog-toc__list {
    padding: 0;
  }
}

/* --- Author Box Variants --- */
.blog-author-box--sidebar {
  display: none;
}

.blog-author-box--mobile {
  display: flex;
}

@media (min-width: 1024px) {
  .blog-author-box--sidebar {
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
  }

  .blog-author-box--sidebar .blog-author-box__icon {
    margin-bottom: 0.75rem;
  }

  .blog-author-box--mobile {
    display: none;
  }
}

/* --- Mini Sidebar CTA --- */
.blog-sidebar-cta {
  display: none;
}

@media (min-width: 1024px) {
  .blog-sidebar-cta {
    display: block;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    border-radius: 0.75rem;
    text-align: center;
  }

  .blog-sidebar-cta__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem;
  }

  .blog-sidebar-cta__text {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 1rem;
  }

  .blog-sidebar-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #e11d48;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #fecdd3;
    transition: background 0.15s, border-color 0.15s;
  }

  .blog-sidebar-cta__btn:hover {
    background: #fff1f2;
    border-color: #e11d48;
    text-decoration: none;
    color: #e11d48;
  }
}

/* ==========================================================================
   Category Archive Card Styles
   ========================================================================== */

.blog-archive-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-archive-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.blog-archive-card__image {
  overflow: hidden;
}

.blog-archive-card__image img {
  transition: transform 0.3s ease;
}

.blog-archive-card:hover .blog-archive-card__image img {
  transform: scale(1.05);
}
