/*     BLOG SECTION (INDEX)  */
.blog-section__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.blog-section__empty {
  margin: 0;
  color: rgba(232, 232, 232, 0.78);
}

.blog-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex: 1 1 100%;
  content-visibility: auto;
  contain-intrinsic-size: 330px;
}

.blog-card__link {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 100%;
  background: var(--color-surface);
  border: 4px solid rgba(255, 255, 255, 0.12);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px),
    calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: var(--shadow-ghost);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-default),
    box-shadow var(--transition-default);
}

.blog-card__link:hover {
  transform: translate(-4px, -4px);
  box-shadow: var(--shadow-cyan);
}

.blog-card__image {
  flex: 0 0 320px;
  min-width: 250px;
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  transition: transform 0.3s ease;
}

.blog-card__link:hover .blog-card__image img {
  transform: scale(1.05);
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: var(--space-sm);
  gap: 0.75rem;
}

.blog-card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(0, 217, 255, 0.85);
}

.blog-card__title {
  margin: 0;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blog-card__excerpt {
  margin: 0;
  color: rgba(232, 232, 232, 0.78);
}

.blog-card .button {
  margin-top: auto;
}

@media (max-width: 767px) {
  .blog-card__link {
    flex-direction: column;
  }
  .blog-card__image {
    flex-basis: 220px;
  }
}

/* =========================================================
   BLOG POST LAYOUT
   ========================================================= */
.blog-post {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.blog-post__meta {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.blog-post__layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.blog-post__sidebar {
  order: 0;
  width: 100%;
}

.blog-post__content {
  order: 1;
  flex: 1 1 auto;
  min-width: 320px;
}

/* --- Desktop layout: sidebar on right --- */
@media (min-width: 1025px) {
  .blog-post__layout {
    flex-wrap: nowrap;
  }

  .blog-post__content {
    order: 0;
    flex: 1 1 70%;
  }

  .blog-post__sidebar {
    order: 1;
    flex: 0 0 320px;
    min-width: 260px;
    max-width: 420px;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    width: auto;
  }
}

/* =========================================================
   AUTHOR BIO
   ========================================================= */
.author-bio {
  background: var(--surface-2, #0f172a);
}

.author-bio__container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.author-bio__media {
  flex: 0 0 180px;
  max-width: 220px;
}

.author-bio__media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-ghost);
}

.author-bio__body {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.author-bio__eyebrow {
  color: rgba(0, 217, 255, 0.85);
}

.author-bio__summary {
  margin: 0;
  color: rgba(232, 232, 232, 0.85);
}

.author-bio .button {
  width: fit-content;
}

@media (max-width: 599px) {
  .author-bio__container {
    text-align: center;
    justify-content: center;
  }

  .author-bio__body {
    align-items: center;
  }

  .author-bio .button {
    width: 100%;
  }
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar-details {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}

.sidebar-details__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: var(--surface-2, #0f172a);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .18);
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: .75rem;
  border: solid 2px #4DB760;
}

.sidebar-details__summary::-webkit-details-marker {
  display: none;
}

.sidebar-details__summary::after {
  content: "▼";
  font-size: .9rem;
  opacity: .8;
  transition: transform .2s ease;
}

.sidebar-details[open] > .sidebar-details__summary::after {
  transform: rotate(-180deg);
}

.sidebar-details__label {
  font-weight: 600;
  letter-spacing: .2px;
}

.sidebar-details__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: .75rem;
}

.card--sidebar {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: .75rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.sidebar-details__content > .card--sidebar + .card--sidebar {
  margin-top: 1.25rem;
}

.blog-toc__title {
  font-size: .95rem;
  color: #9fb8ff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 .6rem;
}

.blog-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-height: 60vh;
  overflow: auto;
}

.blog-toc__item a {
  display: block;
  padding: .5rem .6rem;
  color: #4DB760;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-weight: 600;
  font-size: .96rem;
  line-height: 1.45;
  transition: color .18s ease, border-left-color .18s ease, padding-left .18s ease;
}

.blog-toc__item a:hover {
  color: #fff;
  border-left-color: #4DB760;
}

/* --- Featured Posts --- */
.blog-featured-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.imgz-alert {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: .75rem;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(77, 183, 96, .08);
  color: #d2f5d9;
  font-size: .95rem;
  line-height: 1.5;
}

.imgz-alert--error {
  background: rgba(220, 38, 38, .12);
  border-color: rgba(220, 38, 38, .4);
  color: #fecaca;
}

.imgz-feat-img__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .75rem;
}

.blog-featured-list a {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .95rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.01));
  border-radius: .6rem;
  color: #fff;
  text-decoration: none;
  border-left: 4px solid rgba(255, 255, 255, 0.02);
  transition: background .14s ease, transform .08s ease;
  min-height: 64px;
}

.blog-featured-list a:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03));
  transform: translateY(-3px);
  border-left-color: #FF8C00;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.blog-featured-list .eyebrow {
  font-size: .68rem;
  text-transform: uppercase;
  color: #FF8C00;
  font-weight: 800;
  letter-spacing: .06em;
  padding: .08rem .5rem;
  background: rgba(255, 140, 0, 0.06);
  border-radius: 999px;
  margin-bottom: .25rem;
  width: fit-content;
}

.blog-featured-list .title {
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.25;
}

/* --- Desktop Sidebar Locked --- */
@media (min-width: 1025px) {
  summary.sidebar-details__summary {
    position: absolute;
    left: -9999px;
  }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: var(--space-lg) 0;
}

.hero__container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.hero__text {
  flex: 1 1 520px;
  min-width: 300px;
  z-index: 2;
}

.hero__image {
  flex: 0 0 420px;
  min-width: 260px;
  max-width: 46%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card--image {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  border-radius: .75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .25));
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

.card--image img {
  border-radius: .25rem;
  filter: contrast(.95) saturate(.9);
}

/* --- Responsive hero adjustments --- */
@media (max-width: 1024px) {
  .hero__image {
    order: 2;
    width: 100%;
    max-width: 100%;
  }
  .hero__text {
    order: 1;
    width: 100%;
  }
  .blog-post__sidebar {
    order: 0;
    width: 100%;
  }
  .blog-post__content {
    order: 1;
    width: 100%;
  }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .06;
  background: linear-gradient(90deg, rgba(81, 45, 168, .02), rgba(0, 0, 0, 0));
  z-index: 1;
}


