/* Single blog post: header, cover, article typography, share, sidebar. */

.blog-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
}

.blog-post-header {
  max-width: 760px;
  margin: 0 auto 32px;
  text-align: center;
}

.blog-post-header h1 {
  margin: 14px 0 16px;
  font-size: 40px;
  line-height: 1.2;
  color: var(--brand-text);
}

.blog-post-header .blog-meta {
  justify-content: center;
}

.blog-post-cover {
  margin: 0 0 40px;
  border-radius: 20px;
  overflow: hidden;
  background: #f4f4f4;
}

.blog-post-cover img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.blog-post-cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.blog-post-cover--placeholder img {
  width: 200px;
  max-width: 50%;
  object-fit: contain;
  opacity: 0.6;
}

/* ===== Article typography ===== */
.blog-article {
  font-size: 18px;
  line-height: 1.8;
  color: #3d3d3d;
}

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

.blog-article p {
  margin: 0 0 1.4em;
  text-align: left;
}

.blog-article [class*="ql-align"] {
  text-align: left;
}

.blog-article h2,
.blog-article h3,
.blog-article h4 {
  margin: 1.8em 0 0.6em;
  font-weight: 700;
  line-height: 1.3;
  color: var(--brand-text);
}

.blog-article h2 { font-size: 30px; }
.blog-article h3 { font-size: 24px; }
.blog-article h4 { font-size: 20px; }

.blog-article a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-article ul,
.blog-article ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.blog-article ul { list-style: disc; }
.blog-article ol { list-style: decimal; }

.blog-article li {
  margin-bottom: 0.5em;
  padding-left: 0.3em;
}

.blog-article li::marker {
  color: var(--brand-primary);
}

.blog-article blockquote {
  margin: 1.8em 0;
  padding: 18px 24px;
  font-size: 20px;
  font-style: italic;
  color: var(--brand-text);
  background: color-mix(in srgb, var(--brand-primary) 7%, #fff);
  border-radius: 12px;
}

.blog-article img {
  max-width: 100%;
  height: auto;
  margin: 1.6em 0;
  border-radius: 14px;
}

.blog-article table {
  width: 100%;
  margin: 1.6em 0;
  border-collapse: collapse;
  font-size: 16px;
}

.blog-article th,
.blog-article td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #ececec;
}

.blog-article th {
  background: #f8f8f8;
}

/* ===== Share ===== */
.blog-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #ececec;
}

.blog-share > span {
  font-weight: 600;
  color: var(--brand-text);
}

.blog-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--brand-text);
  background: #f4f4f4;
  border-radius: 50%;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.blog-share a:hover {
  color: #fff;
  background: var(--brand-primary);
  transform: translateY(-3px);
}

/* ===== Sidebar ===== */
.blog-sidebar {
  position: sticky;
  top: 140px;
  padding: 24px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 16px;
}

.blog-sidebar h6 {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--brand-text);
}

.blog-recent {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
}

.blog-recent:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.blog-recent-thumb {
  flex: 0 0 84px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f4f4;
}

.blog-recent-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-recent-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-recent-thumb--placeholder img {
  width: 50%;
  height: auto;
  object-fit: contain;
  opacity: 0.6;
}

.blog-recent-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-text);
  transition: color 0.2s ease;
}

.blog-recent:hover .blog-recent-title {
  color: var(--brand-primary);
}

.blog-recent-date {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #8a8a8a;
}

@media (max-width: 991px) {
  .blog-post-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .blog-sidebar {
    position: static;
  }

  .blog-post-header h1 {
    font-size: 30px;
  }

  .blog-article {
    font-size: 17px;
  }
}

/* No sticky site header on the post page. */
header {
  position: relative;
}

.blog-sidebar {
  top: 24px;
}
