/* === Blog Post Global Styles === */
/* Dark theme with centered card design matching case study pages */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
  width: 160px;
  height: min(600px, calc(100vh - var(--site-header-height, 64px) - 48px));
  z-index: 20;
}

.blog-side-ad--left {
  left: 24px;
}

.blog-side-ad--right {
  right: 24px;
}

.blog-side-ad ins {
  display: block;
  width: 100%;
  height: 100%;
}

@media (min-width: 1200px) {
  .blog-side-ad {
    display: block;
  }
}
  overflow-wrap: anywhere;
  word-break: break-word;
}

.blog-post img,
.blog-post svg,
.blog-post video,
.blog-post iframe {
  max-width: 100%;
}

.blog-post img {
  height: auto;
}

/* Responsive YouTube/iframe embeds (common in older posts) */
.blog-post iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
}

.blog-post .separator {
  max-width: 100%;
}

.blog-post .separator img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* Tables can overflow on small screens */
.blog-post table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
}

.blog-post table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === Container & Card === */

.blog-container {
  max-width: 900px;
  margin: 90px auto 0 auto;
}

.blog-card {
  background-color: var(--surface-2);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 48px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}



/* === Typography === */

.blog-post h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.post-meta {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 40px;
  font-weight: 400;
}

.blog-post h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.blog-post h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.blog-post p {
  font-size: 17px;
  color: color-mix(in srgb, var(--text) 88%, transparent);
  margin-bottom: 20px;
  line-height: 1.7;
}

@supports not (color: color-mix(in srgb, #000 50%, transparent)) {
  .blog-post p {
    color: #d0d0d0;
  }
}

/* === Lists === */

.blog-post ul,
.blog-post ol {
  margin-left: 24px;
  margin-bottom: 24px;
}

.blog-post li {
  font-size: 17px;
  color: color-mix(in srgb, var(--text) 88%, transparent);
  margin-bottom: 12px;
  line-height: 1.7;
}

@supports not (color: color-mix(in srgb, #000 50%, transparent)) {
  .blog-post li {
    color: #d0d0d0;
  }
}

.blog-post li::marker {
  color: var(--muted);
}

/* === Images === */

.post-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 32px 0;
  display: block;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Make all post images feel interactive (viewer) */
.blog-post img {
  cursor: zoom-in;
}

/* === Code Blocks (optional for future posts) === */

code {
  background-color: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 15px;
  color: var(--text);
}

pre {
  background-color: var(--surface);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-2);
  position: relative;
}

pre,
code {
  max-width: 100%;
}

pre code {
  background: none;
  padding: 0;
}

pre.has-copy {
  padding-top: 52px;
}

.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: #6b9fff;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(107, 159, 255, 0.15);
}

.copy-button.copied {
  border-color: #4caf50;
  color: #4caf50;
}

/* === Links === */

.blog-post a {
  color: #6b9fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-post a:hover {
  color: #8fb3ff;
  text-decoration: underline;
}

/* === Blockquotes (optional) === */

blockquote {
  border-left: 4px solid var(--border-2);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--muted);
  font-style: italic;
}

/* === Full-screen Image Viewer === */
.iv-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.iv-overlay.is-open {
  display: flex;
}

.iv-surface {
  position: relative;
  width: min(1100px, 96vw);
  height: min(740px, 86vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  transform: scale(0.98);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
  touch-action: none;
  user-select: none;
}

.iv-overlay.is-open .iv-img {
  transform: scale(1);
  opacity: 1;
}

.iv-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 18, 0.65);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.iv-caption {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: min(820px, 92vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 12, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6e6e6;
  font-size: 13px;
  text-align: center;
}

.iv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 18, 18, 0.55);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.iv-prev {
  left: 10px;
}

.iv-next {
  right: 10px;
}

@media (max-width: 480px) {
  .iv-surface {
    width: 96vw;
    height: 86vh;
  }
  .iv-caption {
    font-size: 12px;
  }
}

/* === Responsive Design === */

@media (max-width: 900px) {
  .blog-container {
    margin: 60px auto 0 auto;
    padding: 0 0.5rem;
  }
}

@media (max-width: 768px) {
  .blog-container {
    margin: 32px auto 0 auto;
    padding: 0 0.5rem;
  }
  .blog-card {
    padding: 56px 2vw 12px 2vw;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  }
  .blog-post h1 {
    font-size: 7vw;
    min-font-size: 20px;
    max-font-size: 28px;
    line-height: 1.18;
    word-break: break-word;
    letter-spacing: -0.5px;
    text-align: left;
    margin-bottom: 16px;
  }
  .blog-post h2 {
    font-size: 5vw;
    min-font-size: 17px;
    max-font-size: 22px;
    margin-top: 24px;
    margin-bottom: 10px;
  }
  .blog-post h3 {
    font-size: 4.2vw;
    min-font-size: 15px;
    max-font-size: 18px;
    margin-top: 18px;
    margin-bottom: 8px;
  }
  .blog-post p,
  .blog-post li {
    font-size: 15px;
    line-height: 1.6;
  }
  .blog-post ul,
  .blog-post ol {
    padding-left: 1.2em;
    margin-bottom: 14px;
  }
  .blog-post img,
  .blog-post video,
  .blog-post iframe {
    max-width: 100vw;
    border-radius: 8px;
  }
  .blog-post table {
    font-size: 14px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .blog-container {
    margin: 18px auto 0 auto;
    padding: 0 0.2rem;
  }
  .blog-card {
    padding: 48px 1vw 7px 1vw;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  }
  .blog-post h1 {
    font-size: 8vw;
    min-font-size: 16px;
    max-font-size: 22px;
    line-height: 1.13;
    text-align: left;
    word-break: break-word;
    margin-bottom: 12px;
  }
  .blog-post h2 {
    font-size: 6vw;
    min-font-size: 14px;
    max-font-size: 18px;
    margin-top: 16px;
    margin-bottom: 8px;
  }
  .blog-post h3 {
    font-size: 5vw;
    min-font-size: 12px;
    max-font-size: 15px;
    margin-top: 12px;
    margin-bottom: 6px;
  }
  .blog-post p,
  .blog-post li {
    font-size: 14px;
    line-height: 1.55;
  }
  .blog-post ul,
  .blog-post ol {
    padding-left: 1em;
    margin-bottom: 10px;
  }
  .blog-post img,
  .blog-post video,
  .blog-post iframe {
    max-width: 100vw;
    border-radius: 6px;
  }
  .blog-post table {
    font-size: 13px;
    border-radius: 4px;
  }
}
