/* Blog-only styles. Loaded by blog/_template.html and blog/index.html. */

/* ─── Blog archive: dark editorial header ─── */
.bl-header {
  background: var(--color-dark);
  padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(3.5rem, 7vw, 5.5rem);
}
.bl-header__inner { max-width: 54rem; }
.bl-header__inner h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.125rem, 4.2vw, 3.25rem);
  font-weight: 500;
  line-height: 1.12;
  color: #fff;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.bl-header__inner h1 em {
  font-style: italic;
  color: var(--teal-100);
}
.bl-header__sub {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  max-width: 46rem;
  margin: 0;
}

/* ─── Blog archive: post grid section ─── */
.bl-posts {
  background: var(--color-paper);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.bl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 640px) {
  .bl-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}
@media (min-width: 900px) {
  .bl-grid { gap: 2.5rem; }
}

/* ─── Blog card (archive + sidebar) ─── */
.blog-card {
  background: #fff;
  border: 1px solid rgb(13 36 36 / 0.1);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.blog-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.blog-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}
.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 440ms var(--ease);
}
.blog-card:hover .blog-card__media img { transform: scale(1.04); }

.blog-card__body {
  padding: 1.5rem 1.75rem 1.875rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__date {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.625rem;
}
.blog-card__title a {
  color: var(--color-ink);
  text-decoration: none;
  transition: color 180ms var(--ease);
}
.blog-card__title a:hover { color: var(--color-primary); }

.blog-card__summary {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-muted);
  margin: 0 0 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: auto 0 0.875rem;
}

.blog-tag {
  display: inline-block;
  background: #E8F0F0;
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.25em 0.65em;
  border-radius: 999px;
}

.blog-card__read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: auto;
  transition: gap 180ms var(--ease);
}
.blog-card__read:hover { gap: 0.65rem; }
.blog-card__read svg { flex-shrink: 0; transition: transform 180ms var(--ease); }
.blog-card__read:hover svg { transform: translateX(3px); }

.blog-empty {
  color: var(--color-muted);
  font-size: 1.0625rem;
  padding: 2rem 0;
}

/* ─── Sidebar overrides: compact, no image, no summary ─── */
.blog-post__sidebar .blog-card {
  border-radius: var(--r-md);
  transform: none !important;
  box-shadow: none;
}
.blog-post__sidebar .blog-card + .blog-card { margin-top: 0.625rem; }
.blog-post__sidebar .blog-card:hover { box-shadow: var(--shadow-sm); transform: none !important; }
.blog-post__sidebar .blog-card__media { display: none; }
.blog-post__sidebar .blog-card__body { padding: 0.875rem 1rem 1rem; }
.blog-post__sidebar .blog-card__title { font-size: 0.9375rem; }
.blog-post__sidebar .blog-card__summary { display: none; }
.blog-post__sidebar .blog-card__tags { display: none; }
.blog-post__sidebar .blog-card__read { font-size: 0.8125rem; margin-top: 0.25rem; }

/* ─── Blog post page ─── */
.blog-post { padding: 0; }

.blog-post__header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 4vw, 2rem) 2.5rem;
}
.blog-post__meta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-bottom: 1rem;
}
.blog-post__header h1 {
  font-size: clamp(1.875rem, 3.8vw, 2.875rem);
  line-height: 1.15;
  font-weight: 500;
  max-width: 22ch;
  margin-bottom: 0.875rem;
  text-wrap: balance;
}
.blog-post__summary {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-muted);
  max-width: 54ch;
}
.blog-post__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin-top: 2rem;
  display: block;
}

.blog-post__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 4vw, 2rem) 0;
  align-items: start;
}
@media (min-width: 1024px) {
  .blog-post__layout { grid-template-columns: minmax(0, 1fr) 268px; }
}

/* ─── Blog post content ─── */
.blog-post__content {
  font-size: 1.0625rem;
  line-height: 1.78;
}
.blog-post__content h2 {
  font-size: clamp(1.375rem, 2.6vw, 1.8125rem);
  font-weight: 500;
  line-height: 1.25;
  margin: 3rem 0 0.625rem;
}
.blog-post__content h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 2.25rem 0 0.5rem;
}
.blog-post__content p { margin-bottom: 1.25rem; }
.blog-post__content ul, .blog-post__content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.blog-post__content li { margin-bottom: 0.4rem; }
.blog-post__content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.blog-post__content a:hover { text-decoration-thickness: 2px; }
.blog-post__content strong { font-weight: 600; }
.blog-post__content hr {
  border: none;
  border-top: 1px solid rgb(13 36 36 / 0.12);
  margin: 2.5rem 0;
}
.blog-post__content blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--font-heading);
  font-style: italic;
  color: var(--color-primary);
  font-size: 1.25rem;
}
.blog-post__content code {
  background: #EEF3F3;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.blog-post__content pre {
  background: var(--color-ink);
  color: #E8F0F0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: 0.9em;
}
.blog-post__content pre code { background: none; padding: 0; }

/* ─── Blog post sidebar ─── */
.blog-post__sidebar {
  position: sticky;
  top: 2rem;
}
.blog-post__sidebar > h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin: 0 0 0.625rem;
}
.blog-post__sidebar > ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.blog-post__sidebar > ul li { padding: 0; border: none; }
.blog-post__sidebar > ul a {
  display: block;
  padding: 0.4rem 0;
  color: var(--color-ink);
  text-decoration: none;
  font-size: 0.9375rem;
  border-bottom: 1px solid rgb(13 36 36 / 0.08);
  transition: color 160ms var(--ease);
}
.blog-post__sidebar > ul a:hover { color: var(--color-primary); }
