/* ─────────────────────────────────────────────────────────────
   Projekt Nest — Blog
   ───────────────────────────────────────────────────────────── */


/* ─── BLOG OVERVIEW ─────────────────────────────────────────── */

.blog-page-header {
  min-height: auto;
  padding: 8rem 0 4rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}


/* ─── BLOG CARD ─────────────────────────────────────────────── */

.blog-card {
  display: flex;
  flex-direction: column;
  padding: 2rem 2rem 2rem 0;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.blog-card:last-child          { border-right: none; padding-right: 0; }
.blog-card:not(:first-child)   { padding-left: 2rem; }
.blog-card:hover               { opacity: 0.72; }

.blog-card__category {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.blog-card__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.85rem;
}

.blog-card__excerpt {
  font-size: 0.76rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0.62;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1.5rem;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0.38;
  text-transform: uppercase;
}

.blog-card__meta span + span::before {
  content: '·';
  margin-right: 1rem;
}


/* ─── BLOG POST ─────────────────────────────────────────────── */

.blog-post-header {
  min-height: auto;
  padding: 8rem 0 0;
}

.blog-post-header .blog-card__category { margin-bottom: 1.25rem; }

.blog-post-header .heading-xl {
  margin-bottom: 1.5rem;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.38;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.blog-post-meta span + span::before {
  content: '·';
  margin-right: 1rem;
}


/* ─── BLOG POST COVER IMAGE ─────────────────────────────────── */

.blog-post-cover {
  overflow: hidden;
  aspect-ratio: 21 / 7;
  position: relative;
  margin-top: 4rem;
}

.blog-post-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}

.blog-post-cover__img {
  width: 100%;
  /* Extra height gives parallax room to travel without revealing edges */
  height: calc(100% + 120px);
  object-fit: cover;
  display: block;
  margin-top: -60px;
}


/* ─── BLOG ARTICLE BODY ─────────────────────────────────────── */

.blog-article {
  min-height: auto;
  padding: 5rem 0 7rem;
  justify-content: flex-start;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0 5rem;
  align-items: start;
}

/* Right column: stacks TOC then sidebar blocks, sticky as a unit */
.blog-sidebar-col {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 6rem;
}

.blog-content {
  grid-column: 1;
  grid-row: 1;
  max-width: 680px;
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Rich text content inside the article */
.blog-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 400;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.blog-content p {
  font-size: 0.84rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0.78;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.blog-content p strong {
  font-weight: 500;
  opacity: 1;
  color: var(--ink);
}

.blog-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.blog-content ul li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0.72;
  line-height: 1.6;
}

.blog-content ul li::before {
  content: '→';
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.72rem;
  margin-top: 0.08em;
}

.blog-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.75rem;
  border-left: 2px solid var(--accent);
  background: var(--muted);
}

.blog-content blockquote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  opacity: 0.82;
  margin-bottom: 0;
  line-height: 1.6;
}


/* ─── BLOG SIDEBAR ───────────────────────────────────────────── */

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-sidebar__block {
  padding: 1.5rem;
  background: var(--muted);
  border: 1px solid var(--border);
}

/* Table of contents variant — no fill, accent top border */
.blog-sidebar__toc {
  background: transparent;
  border: none;
  border-top: 2px solid var(--accent);
  padding: 1.25rem 0 0;
}

.blog-sidebar__toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.blog-sidebar__toc-list li {
  border-bottom: 1px solid var(--border);
}

.blog-sidebar__toc-list li:last-child {
  border-bottom: none;
}

.blog-sidebar__toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.6rem 0;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0.55;
  text-decoration: none;
  line-height: 1.4;
  transition: opacity 0.2s ease;
}

.blog-sidebar__toc-link:hover { opacity: 1; }

.blog-sidebar__toc-num {
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 1.4rem;
}

.blog-sidebar__label {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.blog-sidebar__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.blog-sidebar__list a {
  font-size: 0.74rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0.65;
  text-decoration: none;
  line-height: 1.4;
  transition: opacity 0.2s ease;
}

.blog-sidebar__list a:hover { opacity: 1; }

.blog-sidebar__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.blog-sidebar__cta:hover { color: var(--accent); }


/* ─── BACK LINK ─────────────────────────────────────────────── */

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.blog-back svg        { transform: rotate(180deg); transition: transform 0.2s ease; }
.blog-back:hover      { opacity: 1; }
.blog-back:hover svg  { transform: rotate(180deg) translateX(3px); }


/* ─── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .blog-page-header  { padding: 7rem 0 3rem; }
  .blog-post-header  { padding: 7rem 0 0; }
  .blog-post-cover   { aspect-ratio: 16 / 7; margin-top: 3rem; }
  .blog-article      { padding: 4rem 0 5rem; }

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

  .blog-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.75rem 0;
  }

  .blog-card:not(:first-child) { padding-left: 0; }
  .blog-card:last-child        { border-bottom: none; }

  .blog-layout {
    grid-template-columns: 1fr;
    gap: 3rem 0;
  }

  /* Dissolve the wrapper so TOC and sidebar become individual grid children */
  .blog-sidebar-col {
    display: contents;
    position: static;
  }

  /* Reset explicit row placement so order takes effect */
  .blog-content { grid-row: auto; max-width: none; }

  /* TOC first, article second, sidebar last */
  .blog-sidebar__toc { order: 1; }
  .blog-content      { order: 2; }
  .blog-sidebar      { order: 3; }
}
