/* Blog front-end design refresh — editorial polish on Bootstrap 5.
   Loaded only from blog templates via {% block extra_css %}.
   Preserve SEO markup; this file is visual only. */

/* --- Page shell ---------------------------------------------------------- */

.blog-page {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.blog-page__header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.blog-page__title {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.blog-page__lede {
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.75));
  font-size: 1.1rem;
  max-width: 40rem;
  margin-bottom: 0;
}

.blog-page__main {
  max-width: 48rem; /* ~readable column for list + detail */
}

/* --- Post cards (list / category / author) ------------------------------- */

.blog-post-card {
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.5rem;
  background-color: var(--bs-body-bg, #fff);
}

.blog-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1);
}

.blog-post-card__media {
  display: block;
  min-height: 100%;
  background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.blog-post-card__media img {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .blog-post-card__media img {
    min-height: 100%;
    position: absolute;
    inset: 0;
  }

  .blog-post-card__media-col {
    position: relative;
    min-height: 11rem;
  }
}

.blog-post-card__body {
  padding: 1.25rem 1.35rem;
}

.blog-post-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.blog-post-card__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.blog-post-card__title a {
  color: inherit;
  text-decoration: none;
}

.blog-post-card__title a:hover,
.blog-post-card__title a:focus-visible {
  color: var(--bs-link-color, #0d6efd);
}

.blog-post-card__excerpt {
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.75));
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.blog-post-card__readmore {
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

/* --- Category chip ------------------------------------------------------- */

.blog-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.35em 0.7em;
  border-radius: 2rem;
  text-decoration: none;
  background-color: var(--bs-primary-bg-subtle, #cfe2ff);
  color: var(--bs-primary-text-emphasis, #052c65);
  border: 1px solid var(--bs-primary-border-subtle, #9ec5fe);
  line-height: 1.2;
}

.blog-chip:hover,
.blog-chip:focus-visible {
  background-color: var(--bs-primary, #0d6efd);
  color: #fff;
  border-color: var(--bs-primary, #0d6efd);
  text-decoration: none;
}

.blog-meta-date {
  font-size: 0.875rem;
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.75));
}

/* --- Article detail ------------------------------------------------------ */

.blog-article {
  max-width: 42rem; /* ~65–70ch at body size */
}

.blog-article__breadcrumb .breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.blog-article__title {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.blog-article__byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.75));
  font-size: 0.95rem;
}

.blog-article__byline a {
  font-weight: 600;
  text-decoration: none;
}

.blog-article__byline a:hover {
  text-decoration: underline;
}

.blog-article__hero {
  width: 100%;
  height: auto;
  border-radius: 1rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

/* Markdown body */
.blog-content {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--bs-body-color, #212529);
}

.blog-content > *:first-child {
  margin-top: 0;
}

.blog-content h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.blog-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.blog-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.blog-content p {
  margin-bottom: 1.15rem;
}

.blog-content ul,
.blog-content ol {
  margin-bottom: 1.15rem;
  padding-left: 1.35rem;
}

.blog-content li {
  margin-bottom: 0.35rem;
}

.blog-content li > p {
  margin-bottom: 0.35rem;
}

.blog-content a {
  font-weight: 500;
  text-underline-offset: 0.15em;
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.blog-content blockquote {
  border-left: 4px solid var(--bs-primary-border-subtle, #9ec5fe);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.15rem;
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.85));
  font-style: italic;
}

.blog-content pre {
  background: var(--bs-tertiary-bg, #f8f9fa);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.15rem;
}

.blog-content code {
  font-size: 0.9em;
}

.blog-content hr {
  margin: 2rem 0;
  opacity: 0.2;
}

/* --- Author bio ---------------------------------------------------------- */

.blog-author-bio {
  margin-top: 2.5rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    var(--bs-primary-bg-subtle, #cfe2ff) 0%,
    var(--bs-tertiary-bg, #f8f9fa) 55%
  );
  border: 1px solid var(--bs-primary-border-subtle, #9ec5fe);
}

.blog-author-bio__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-primary-text-emphasis, #052c65);
  margin-bottom: 0.15rem;
}

.blog-author-bio__name {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}

.blog-author-bio__name:hover {
  color: var(--bs-link-color, #0d6efd);
}

.blog-author-bio__text {
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.8));
  font-size: 0.95rem;
  line-height: 1.5;
}

.blog-author-bio__photo {
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.1);
}

/* --- Related resources --------------------------------------------------- */

.blog-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.blog-related__title {
  font-weight: 700;
  margin-bottom: 1rem;
}

.blog-related .card {
  border: 0;
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.blog-related .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.1);
}

/* --- Empty state / pagination -------------------------------------------- */

.blog-empty {
  padding: 2rem 0;
  color: var(--bs-secondary-color, rgba(33, 37, 41, 0.75));
}

.blog-page .pagination {
  margin-top: 2rem;
}

/* Draft banner already uses Bootstrap alert; slight spacing only */
.blog-draft-banner {
  border-radius: 0;
  margin-bottom: 0;
}
