/* Chilly Proxy blog — article + index */

.blog-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #10b981, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.55);
  transition: width 0.08s linear;
  pointer-events: none;
}

.blog-article-page main {
  background:
    radial-gradient(1100px 380px at 8% -5%, rgba(99, 102, 241, 0.14), transparent 58%),
    radial-gradient(900px 320px at 92% 12%, rgba(16, 185, 129, 0.1), transparent 55%);
}

.blog-article-card {
  border-radius: 1.25rem;
  border: 1px solid #1e2028;
  background: linear-gradient(165deg, rgba(22, 24, 29, 0.98), rgba(17, 19, 24, 0.96));
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 64px rgba(0, 0, 0, 0.45);
}

.blog-hero {
  position: relative;
  min-height: 280px;
  max-height: 420px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .blog-hero {
    min-height: 340px;
  }
}

.blog-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 8s ease-out;
}

.blog-article-card:hover .blog-hero-img {
  transform: scale(1.06);
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 15, 0.15) 0%, rgba(10, 11, 15, 0.55) 45%, rgba(10, 11, 15, 0.97) 100%),
    linear-gradient(105deg, rgba(99, 102, 241, 0.22) 0%, transparent 42%),
    linear-gradient(285deg, rgba(16, 185, 129, 0.18) 0%, transparent 38%);
}

.blog-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 280px;
  padding: 1.75rem 1.5rem 2rem;
}

@media (min-width: 768px) {
  .blog-hero-content {
    min-height: 340px;
    padding: 2.5rem 2.5rem 2.75rem;
  }
}

.blog-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(8px);
}

.blog-hero-meta {
  margin: 0;
  opacity: 0.95;
}

.blog-hero h1 {
  margin-top: 0.85rem;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.blog-hero-sub {
  margin-top: 0.65rem;
  max-width: 42rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.blog-article-body {
  padding: 1.5rem 1.25rem 2rem;
}

@media (min-width: 768px) {
  .blog-article-body {
    padding: 2rem 2rem 2.5rem;
  }
}

.blog-callout {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem 1.2rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.06));
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.08) inset;
}

.blog-callout-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6ee7b7;
  margin-bottom: 0.5rem;
}

.blog-callout-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.blog-callout p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #d1fae5;
  font-weight: 500;
}

.blog-intro {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #9ca3af;
  margin-bottom: 1.75rem;
}

.blog-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .blog-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 2.5rem;
  }
}

.blog-sidebar {
  order: 2;
}

@media (min-width: 1024px) {
  .blog-sidebar {
    order: 0;
  }
}

.blog-toc-sticky {
  border-radius: 1rem;
  border: 1px solid #1e2028;
  background: linear-gradient(180deg, rgba(17, 19, 24, 0.95), rgba(10, 11, 15, 0.88));
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
  .blog-toc-sticky {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.4) transparent;
  }
}

.blog-toc-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #818cf8;
  margin-bottom: 0.75rem;
}

.blog-toc-sticky ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.blog-toc-sticky li a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #9ca3af;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.blog-toc-sticky li a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.blog-toc-sticky li a.is-active {
  color: #fff;
  background: rgba(16, 185, 129, 0.1);
  border-left-color: #10b981;
}

.blog-content h2.blog-section-title,
.blog-content > h2 {
  margin-top: 2.75rem;
  padding-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  scroll-margin-top: 5.5rem;
}

.blog-content h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-bottom: 0.65rem;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #10b981);
}

.blog-content h3 {
  margin-top: 1.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f3f4f6;
}

.blog-figure {
  margin: 2rem 0;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #1e2028;
  background: #111318;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.blog-figure img,
.blog-hero-img {
  background: linear-gradient(135deg, #111318 0%, #1e2028 50%, #111318 100%);
}

.blog-figure img {
  width: 100%;
  height: auto;
  max-height: 340px;
  min-height: 160px;
  object-fit: cover;
  display: block;
}

.blog-figure img.blog-img-failed,
.blog-hero-img.blog-img-failed {
  min-height: 200px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.12));
}

.blog-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #9ca3af;
  border-top: 1px solid #1e2028;
  background: rgba(10, 11, 15, 0.6);
}

.blog-figure--wide img {
  max-height: 380px;
  object-position: center 35%;
}

.blog-figure--accent {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(99, 102, 241, 0.12) inset;
}

.blog-figure--accent figcaption {
  border-top-color: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}

.blog-content .blog-figure:nth-of-type(odd) img {
  object-position: center 40%;
}

.blog-content .blog-figure:nth-of-type(even) img {
  object-position: center 55%;
}

.blog-tip {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, 0.08);
}

.blog-tip strong {
  display: block;
  color: #c7d2fe;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.blog-tip p {
  margin: 0;
  font-size: 0.92rem;
  color: #d1d5db;
  line-height: 1.6;
}

.blog-content table {
  border-collapse: separate;
  border-spacing: 0;
}

.blog-content .overflow-x-auto {
  margin: 1.25rem 0;
  border-radius: 1rem;
  border: 1px solid #1e2028;
  overflow: hidden;
}

.blog-content details {
  border-radius: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.blog-content details[open] {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.04);
}

.blog-content details summary {
  color: #f9fafb;
}

.blog-cta-panel {
  margin-top: 2.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: 1.15rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(99, 102, 241, 0.15), transparent 60%),
    linear-gradient(160deg, rgba(16, 185, 129, 0.12), rgba(17, 19, 24, 0.95));
  text-align: center;
}

@media (min-width: 640px) {
  .blog-cta-panel {
    text-align: left;
  }
}

.blog-cta-panel h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
}

.blog-cta-panel p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #9ca3af;
  max-width: 36rem;
}

.blog-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .blog-cta-actions {
    justify-content: flex-start;
  }
}

.blog-cta-actions a {
  text-decoration: none;
}

.blog-cta-actions .rounded-full.border {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  text-decoration: none;
}

.blog-cta-actions .rounded-full.border:hover {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

/* Blog index */
.blog-index-hero {
  background:
    radial-gradient(900px 280px at 20% 0%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(700px 240px at 85% 20%, rgba(16, 185, 129, 0.12), transparent 50%);
}

.blog-card {
  border-radius: 1rem;
  border: 1px solid #1e2028;
  background: linear-gradient(165deg, rgba(22, 24, 29, 0.95), rgba(17, 19, 24, 0.9));
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.12);
}

.blog-card-featured {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.blog-card-img-wrap {
  position: relative;
  overflow: hidden;
  height: 11rem;
}

.blog-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-img-wrap img {
  transform: scale(1.06);
}

.blog-card-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 11, 15, 0.85) 100%);
  pointer-events: none;
}

.blog-card-tag {
  position: absolute;
  bottom: 0.75rem;
  left: 0.85rem;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.blog-card-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.blog-card-body > p.text-xs.uppercase:first-of-type {
  display: none;
}

.blog-card h2 {
  transition: color 0.2s;
}

.blog-card:hover h2 {
  color: #6ee7b7;
}

.blog-mobile-toc-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #1e2028;
  background: #111318;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .blog-mobile-toc-toggle {
    display: none;
  }
}

.blog-sidebar.is-collapsed .blog-toc-sticky {
  display: none;
}

@media (min-width: 1024px) {
  .blog-sidebar.is-collapsed .blog-toc-sticky {
    display: block;
  }
}

/* Mobile / tablet only — desktop (1024px+) unchanged */
@media (max-width: 1023px) {
  .blog-article-page {
    overflow-x: clip;
  }

  .blog-article-page section.pt-12 > div,
  .blog-article-wrap {
    width: min(1140px, calc(100% - 1.25rem)) !important;
    max-width: 100%;
  }

  .blog-article-card {
    border-radius: 0.85rem;
    margin-left: auto;
    margin-right: auto;
  }

  .blog-hero {
    min-height: 200px;
    max-height: 300px;
  }

  .blog-hero-content {
    min-height: 200px;
    padding: 1.15rem 1rem 1.35rem;
  }

  .blog-hero h1 {
    font-size: clamp(1.35rem, 5.5vw, 1.85rem);
  }

  .blog-hero-sub {
    font-size: 0.875rem;
  }

  .blog-article-body {
    padding: 1rem 0.85rem 1.35rem;
  }

  .blog-intro {
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
  }

  .blog-layout {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .blog-content {
    order: 3;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .blog-sidebar {
    order: 2;
    width: 100%;
  }

  .blog-mobile-toc-toggle {
    order: 1;
    margin-bottom: 0;
  }

  .blog-content h2.blog-section-title,
  .blog-content > h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
    scroll-margin-top: 4.5rem;
  }

  .blog-content h3 {
    font-size: 1rem;
  }

  .blog-content p,
  .blog-content li {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .blog-content .overflow-x-auto {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .blog-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    font-size: 0.8rem;
  }

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

  .blog-content pre {
    overflow-x: auto;
    font-size: 0.72rem;
    -webkit-overflow-scrolling: touch;
  }

  .blog-figure {
    margin: 1.35rem 0;
  }

  .blog-figure img {
    max-height: 220px;
    min-height: 120px;
  }

  .blog-figure figcaption {
    font-size: 0.75rem;
    padding: 0.55rem 0.75rem;
  }

  .blog-callout {
    padding: 0.9rem 1rem;
    margin-bottom: 1.15rem;
  }

  .blog-callout p {
    font-size: 0.85rem;
  }

  .blog-tip {
    padding: 0.85rem 1rem;
  }

  .blog-cta-panel {
    padding: 1.25rem 1rem;
    text-align: center;
  }

  .blog-cta-actions {
    justify-content: center;
  }

  .blog-cta-actions a {
    flex: 1 1 auto;
    min-width: min(100%, 10rem);
    justify-content: center;
  }

  .blog-index-hero {
    padding: 1.25rem 1rem !important;
  }

  .blog-index-hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }

  .blog-card-body {
    padding: 1rem 1rem 1.15rem;
  }

  .blog-card-img-wrap {
    height: 9.5rem;
  }

  .blog-toc-sticky {
    max-height: min(50vh, 320px);
    overflow-y: auto;
  }
}
