/* blog/static/blog/css/blog.css
   ZGF Design Technology Blog — full rewrite with dark mode */

/* ---------------------------------------------------------------------------
   Blog-scoped custom properties (light defaults, dark overrides below)
   ------------------------------------------------------------------------- */
:root {
  --blog-bg: #ffffff;
  --blog-surface: #f5f5f4;
  --blog-border: #e5e5e3;
  --blog-text: #1a1a1a;
  --blog-text-muted: var(--zgfgray);
  --blog-accent: var(--zgfred);
  --blog-card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --blog-reading-progress: var(--zgfred);
  --blog-code-bg: #1e1e2e;
  --blog-code-text: #cdd6f4;
}

[data-theme="dark"] {
  --blog-bg: var(--darkbg);
  --blog-surface: var(--appbg);
  --blog-border: #333;
  --blog-text: #f0f0f0;
  --blog-text-muted: var(--zgflightgray);
  --blog-card-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ---------------------------------------------------------------------------
   Index layout
   ------------------------------------------------------------------------- */
.blog-index-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

.blog-index-header {
  margin-bottom: 40px;
}

.blog-index-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--blog-text);
  margin: 0 0 16px;
}

.blog-intro {
  font-size: 1.125rem;
  color: var(--blog-text-muted);
  max-width: 640px;
}

/* ---------------------------------------------------------------------------
   Filter bar
   ------------------------------------------------------------------------- */
.blog-filter-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 44px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--blog-border);
}

.filter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--blog-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}

.filter-btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -17px;
  height: 2px;
  background: var(--blog-accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.filter-btn:hover {
  color: var(--blog-text);
}

.filter-btn.active {
  color: var(--blog-text);
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-select {
  padding: 4px 2px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--blog-border);
  background: transparent;
  color: var(--blog-text);
  font-size: 0.8rem;
  cursor: pointer;
  display: none; /* shown via JS when that mode is active */
}

.filter-select.visible {
  display: block;
}


/* ---------------------------------------------------------------------------
   Featured hero card
   ------------------------------------------------------------------------- */
.featured-card {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--blog-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 48px;
  transition: box-shadow 0.2s;
  background: var(--blog-surface);
}

.featured-card:hover {
  box-shadow: var(--blog-card-shadow);
}

.featured-card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--blog-surface);
}

.featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.featured-card:hover .featured-card-image img {
  transform: scale(1.03);
}

.featured-card-content {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.featured-card-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--blog-text);
}

/* Minimal hashtag-style category label + short rule, shared by the
   featured card and the grid cards below */
.tag-list {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--blog-text-muted);
  text-transform: lowercase;
  margin: 0 0 10px;
}

.tag-rule {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--blog-border);
  margin-bottom: 14px;
  transition: background-color 0.3s ease;
}

.featured-card-excerpt {
  font-size: 1rem;
  color: var(--blog-text-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Post grid — minimal title rows; hero image reveals on hover
   ------------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--blog-border);
  border-left: 1px solid var(--blog-border);
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 156px;
  padding: 28px 40px;
  border-right: 1px solid var(--blog-border);
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: min-height 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Only rows with a hero image grow to reveal it on hover */
.blog-card:has(.blog-card-media):hover {
  min-height: 340px;
}

.blog-card-media {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.5s ease, transform 0.6s ease;
}

.blog-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.65) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

.blog-card:hover .blog-card-media {
  opacity: 1;
  transform: scale(1);
}

.blog-card:hover .blog-card-media::after {
  opacity: 1;
}

.blog-card-body {
  position: relative;
  z-index: 1;
}

.blog-card:hover .blog-card-body .tag-list {
  color: rgba(255, 255, 255, 0.75);
}

.blog-card:hover .blog-card-body .tag-rule {
  background: rgba(255, 255, 255, 0.55);
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
  color: var(--blog-text);
  transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
  color: #fff;
}

.card-no-image {
  width: 100%;
  height: 100%;
  background: var(--blog-border);
}

/* ---------------------------------------------------------------------------
   Shared card meta (authors + date)
   ------------------------------------------------------------------------- */
.card-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--blog-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

a.category-chip:hover {
  opacity: 0.85;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  margin-top: auto;
}

.card-author {
  font-weight: 500;
}

.card-date::before {
  content: '·';
  margin-right: 8px;
}

.no-posts {
  color: var(--blog-text-muted);
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------------
   Post hero
   ------------------------------------------------------------------------- */
.post-hero {
  position: fixed;
  top: 30px; /* height of the nav bar */
  left: 0;
  width: 100%;
  height: 70vh;
  overflow: hidden;
  background: var(--blog-surface);
  z-index: 0;
}

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

/* Spacer that holds the scroll position while hero is fixed */
.post-hero-spacer {
  height: 70vh;
}

/* Content scrolls over the fixed hero */
.blog-post.has-hero .post-layout {
  position: relative;
  z-index: 1;
  background: var(--page-bg);
}

/* ---------------------------------------------------------------------------
   Post header
   ------------------------------------------------------------------------- */
.blog-post {
  background: var(--blog-bg);
  color: var(--blog-text);
}

.post-header {
  padding: 24px 0 32px;
}

.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.post-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 28px;
  color: var(--blog-text);
}

.post-meta {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.post-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blog-text);
}

.author-title {
  font-size: 0.78rem;
  color: var(--blog-text-muted);
}

.post-date-readtime {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  margin-left: auto;
  white-space: nowrap;
  align-self: center;
}

.read-time::before {
  content: '·';
  margin-right: 8px;
}

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

.tag-chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--blog-border);
  background: transparent;
  color: var(--blog-text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
   Post body
   ------------------------------------------------------------------------- */
.post-body {
  padding: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--blog-text);
}

.post-body > * + * {
  margin-top: 1.5em;
}

.post-heading {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--blog-text);
  margin: 2em 0 0.5em;
}

.heading-anchor {
  color: inherit;
  text-decoration: none;
}

.heading-anchor:hover::after {
  content: ' #';
  color: var(--blog-accent);
  font-weight: 400;
}

.post-paragraph {
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.post-paragraph p {
  margin: 0 0 1em;
}

.post-paragraph a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-blockquote {
  margin: 2em 0;
  padding: 1em 1.5em;
  border-left: 3px solid var(--blog-accent);
  background: var(--blog-surface);
  font-style: italic;
  font-size: 1.1em;
  color: var(--blog-text-muted);
  border-radius: 0 4px 4px 0;
}

/* Post figure / image */
.post-figure {
  margin: 2em 0;
}

/* Responsive images everywhere inside the post body (covers nested blocks too) */
.post-body img {
  max-width: 100%;
  height: auto;
}

.blog-img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.image-caption {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  margin-top: 8px;
  text-align: center;
}

/* CTA */
.cta-section {
  margin: 2em 0;
  padding: 2em;
  background: var(--blog-surface);
  border-radius: 8px;
  text-align: center;
}

.btn.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: var(--zgfred);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.15s;
}

.btn.btn-primary:hover {
  opacity: 0.85;
}

/* Post divider */
.post-divider {
  border: none;
  border-top: 1px solid var(--blog-border);
  margin: 2em 0;
}

/* ---------------------------------------------------------------------------
   Callout block
   ------------------------------------------------------------------------- */
.callout-block {
  padding: 1.25em 1.5em;
  border-radius: 6px;
  border-left: 4px solid;
  margin: 1.5em 0;
}

.callout-block p { margin: 0; }

.callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a5f;
}

.callout-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

.callout-highlight {
  background: #fef2f2;
  border-color: var(--zgfred);
  color: #7f1d1d;
}

[data-theme="dark"] .callout-info {
  background: #1e2a3a;
  color: #93c5fd;
}

[data-theme="dark"] .callout-warning {
  background: #2a2010;
  color: #fcd34d;
}

[data-theme="dark"] .callout-highlight {
  background: #2a1010;
  color: #fca5a5;
}

/* ---------------------------------------------------------------------------
   Video embed block
   ------------------------------------------------------------------------- */
.video-block {
  margin: 1.5em 0;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-caption {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  margin-top: 8px;
  text-align: center;
  display: block;
}

.video-unavailable {
  color: var(--blog-text-muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------------
   Two-column block
   ------------------------------------------------------------------------- */
.two-col {
  display: grid;
  gap: 32px;
  margin: 1.5em 0;
  align-items: start;
}

.two-col-50-50 { grid-template-columns: 1fr 1fr; }
.two-col-60-40 { grid-template-columns: 3fr 2fr; }
.two-col-40-60 { grid-template-columns: 2fr 3fr; }

/* Prevent grid columns from blowing past their track width */
.two-col-left,
.two-col-right {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ---------------------------------------------------------------------------
   Stat block
   ------------------------------------------------------------------------- */
.stat-block {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 2em 0;
  padding: 32px;
  background: var(--blog-surface);
  border-radius: 8px;
  border: 1px solid var(--blog-border);
}

.stat-item {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--blog-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blog-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-description {
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Code block
   ------------------------------------------------------------------------- */
.code-block {
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
}

.code-block-header {
  background: #2d2d2d;
  padding: 8px 16px;
  display: flex;
  align-items: center;
}

.code-language {
  font-size: 0.75rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code-block pre {
  margin: 0;
  border-radius: 0;
  background: var(--blog-code-bg) !important;
}

.code-block pre code {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Document / file download block
   ------------------------------------------------------------------------- */
.document-block {
  margin: 1.5em 0;
}

.document-download-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--blog-text);
  background: var(--blog-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 100%;
}

.document-download-link:hover {
  border-color: var(--blog-accent);
  box-shadow: 0 0 0 1px var(--blog-accent);
}

.doc-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--blog-accent);
}

.doc-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.doc-filename {
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  margin-left: 4px;
}

/* ---------------------------------------------------------------------------
   Reading progress bar
   ------------------------------------------------------------------------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--blog-reading-progress);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ---------------------------------------------------------------------------
   Image grid (existing styles preserved + updated)
   ------------------------------------------------------------------------- */
.image-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

.grid-1x1 { grid-template-columns: 1fr; }
.grid-1x2 { grid-template-columns: repeat(2, 1fr); }
.grid-1x3 { grid-template-columns: repeat(3, 1fr); }
.grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.grid-2x3 { grid-template-columns: repeat(3, 1fr); }
.grid-3x3 { grid-template-columns: repeat(3, 1fr); }

.grid-1x1 .grid-item {
  display: block;
  height: auto;
  min-width: 0;
}

.grid-1x1 .blog-img {
  width: 100%;
  height: auto;
}

.grid-item {
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Blog placeholder */
.blog-placeholder-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: var(--blog-surface);
}
.blog-placeholder-icon {
  height: 200px;
  width: 200px;
}

/* ---------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card-image {
    aspect-ratio: 16/9;
  }

  .two-col,
  .two-col-50-50,
  .two-col-60-40,
  .two-col-40-60 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .blog-index-layout {
    padding: 32px 20px 60px;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .post-header {
    padding: 20px 0 24px;
  }

  .post-body {
    padding: 0;
  }

  .post-meta {
    flex-direction: column;
    gap: 16px;
  }

  .post-date-readtime {
    margin-left: 0;
  }

  .stat-block {
    padding: 20px;
  }

  .image-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .blog-index-header h1 {
    font-size: 1.8rem;
  }

  .post-title {
    font-size: 1.6rem;
  }

  .filter-bar {
    gap: 6px;
  }

  .featured-card-content {
    padding: 24px 20px;
  }
}

/* Mobile hero behaviour */
@media (max-width: 768px) {
  /* Shorter hero on mobile so it doesn't dominate the viewport */
  .post-hero {
    height: 50vh;
  }

  .post-hero-spacer {
    height: 50vh;
  }

  /* Margin (not padding) so scroll travel exists without filling with bg color */
  .blog-post.has-hero .post-layout {
    margin-bottom: 100vh;
  }
}

/* ---------------------------------------------------------------------------
   Breadcrumb
   ------------------------------------------------------------------------- */
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  flex-wrap: wrap;
  padding: 36px 0 0;
}

.post-breadcrumb a {
  color: var(--blog-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.post-breadcrumb a:hover {
  color: var(--blog-accent);
}

.blog-index-header .post-breadcrumb {
  padding: 0 0 12px;
}

/* ---------------------------------------------------------------------------
   Post two-column layout (main + sidebar)
   ------------------------------------------------------------------------- */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 80px;
  align-items: start;
}

.post-layout-no-sidebar {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.post-main {
  min-width: 0;
}

/* ---------------------------------------------------------------------------
   Sticky sidebar
   ------------------------------------------------------------------------- */
.post-sidebar {
  position: sticky;
  top: 50px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: none;
}

.post-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blog-text-muted);
  margin: 0 0 10px;
}

/* Table of contents */
.sidebar-toc {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  padding: 16px 18px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  text-decoration: none;
  padding: 5px 0 5px 10px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.toc-link:hover,
.toc-link.active {
  color: var(--blog-accent);
  border-left-color: var(--blog-accent);
}

/* Related posts */
.sidebar-related {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: 6px;
  padding: 16px 18px;
}

.sidebar-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 10px 0;
  border-bottom: 1px solid var(--blog-border);
}

.sidebar-post-link:first-child {
  padding-top: 0;
}

.sidebar-post-link:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-post-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
  color: var(--blog-text);
  transition: color 0.15s;
}

.sidebar-post-link:hover .sidebar-post-title {
  color: var(--blog-accent);
}

.sidebar-post-date {
  font-size: 0.73rem;
  color: var(--blog-text-muted);
}

/* ---------------------------------------------------------------------------
   Responsive: collapse sidebar below content at narrow viewports
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .post-layout {
    grid-template-columns: 1fr;
    max-width: 760px;
  }

  .post-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-toc,
  .sidebar-related {
    flex: 1 1 260px;
  }

  .post-breadcrumb {
    padding-top: 24px;
  }
}

@media (max-width: 768px) {
  .post-layout {
    padding: 0 20px 60px;
  }

  .post-sidebar {
    flex-direction: column;
  }

  .post-breadcrumb {
    padding-top: 20px;
  }
}

/* ---------------------------------------------------------------------------
   Slideshow hero (Ken Burns + fade)
   ------------------------------------------------------------------------- */
.hero-slideshow {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

@keyframes kb-0 {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.08) translate(-1.5%, -1%); }
}
@keyframes kb-1 {
  from { transform: scale(1.08) translate(1.5%, 1%); }
  to   { transform: scale(1.0) translate(0, 0); }
}
@keyframes kb-2 {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.08) translate(1.5%, -1%); }
}
@keyframes kb-3 {
  from { transform: scale(1.08) translate(-1.5%, 1%); }
  to   { transform: scale(1.0) translate(0, 0); }
}
