/* =========================================================
   Azguards Single Post v3
   ========================================================= */

/* ── Smooth scroll + heading offset (CSS-native, no JS) ─── */
html { scroll-behavior: smooth; }

.azguards-post__content h2,
.azguards-post__content h3,
.azguards-post__content h4 {
  scroll-margin-top: 110px;
}

/* ── Page ────────────────────────────────────────────────── */
.azguards-post-page { background: #f7f8f5; }
.azguards-post      { max-width: 1160px; margin: 0 auto; }

/* ── Boxed hero ──────────────────────────────────────────── */
.azguards-post__hero-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 28px 0;
}

.azguards-post__hero {
  border-radius: 12px;
  overflow: hidden;
  background: #dde0d8;
  max-height: 420px;
}

.azguards-post__hero-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}

/* ── Two-column grid ──────────────────────────────────────
   align-items: start is CRITICAL — without it the sidebar
   column stretches full row height and position:sticky
   has no room to move.
──────────────────────────────────────────────────────── */
.azguards-post__layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 52px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 28px 96px;
  align-items: start; /* ← the key fix */
}

/* ── Sticky sidebar ──────────────────────────────────────
   The sidebar itself is sticky; its inner is scrollable.
   height + overflow-y lets it scroll independently.
──────────────────────────────────────────────────────── */
.azguards-post__sidebar {
  position: sticky;
  top: 88px;
  height: calc(100vh - 108px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* thin scrollbar so overflow is visible but not ugly */
  scrollbar-width: thin;
  scrollbar-color: #d4d8cd transparent;
}

.azguards-post__sidebar::-webkit-scrollbar       { width: 4px; }
.azguards-post__sidebar::-webkit-scrollbar-thumb {
  background: #d4d8cd; border-radius: 2px;
}

/* ── Post header ─────────────────────────────────────────── */
.azguards-post__header {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e2e5db;
}

.azguards-post__cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}

.azguards-post__cat {
  display: inline-block;
  padding: 3px 10px;
  background: #eaf2da; color: #5f8c22;
  border-radius: 4px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background 0.15s;
}
.azguards-post__cat:hover { background: #d4e8b4; }

.azguards-post__title {
  font-size: clamp(24px, 3.5vw, 38px);
  font-weight: 800; line-height: 1.2;
  color: #1a1d16; margin: 0 0 18px;
  letter-spacing: -0.025em;
}

.azguards-post__meta {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: #5c6257;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.azguards-post__meta-item  { display: inline-flex; align-items: center; gap: 4px; }
.azguards-post__meta-sep   { color: #c8ccc2; }

/* ── Mobile ToC ──────────────────────────────────────────── */
.azguards-mobile-toc {
  display: none;
  background: #fff;
  border: 1px solid #e2e5db;
  border-radius: 9px;
  margin-bottom: 28px;
  overflow: hidden;
}

.azguards-mobile-toc__toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 12px 16px;
  background: none; border: none; text-align: left;
  font-size: 13.5px; font-weight: 600; color: #1a1d16;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.azguards-mobile-toc__icon { color: #87BB3F; flex-shrink: 0; }

.azguards-chevron {
  transition: transform 0.2s ease;
  color: #5c6257;
}

/* pushes chevron to right on mobile toggle */
.azguards-mobile-toc__toggle .azguards-chevron { margin-left: auto; }

.azguards-mobile-toc__panel {
  border-top: 1px solid #e2e5db;
  padding: 10px 14px 14px;
}

/* ── Post content typography ─────────────────────────────── */
.azguards-post__content {
  font-size: 17px; line-height: 1.85;
  color: #252820; max-width: 72ch;
}

.azguards-post__content h2 {
  font-size: 22px; font-weight: 750; color: #1a1d16;
  margin: 2.4em 0 0.65em;
  padding-bottom: 10px; border-bottom: 2px solid #eaf2da;
  letter-spacing: -0.015em; line-height: 1.25;
}

.azguards-post__content h3 {
  font-size: 18px; font-weight: 700; color: #1a1d16;
  margin: 2em 0 0.55em;
  letter-spacing: -0.01em; line-height: 1.3;
}

.azguards-post__content h4 {
  font-size: 16px; font-weight: 700;
  margin: 1.6em 0 0.45em;
}

.azguards-post__content p { margin: 0 0 1.5em; }

.azguards-post__content a {
  color: #5f8c22;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(95,140,34,0.35);
  transition: text-decoration-color 0.15s;
}
.azguards-post__content a:hover { text-decoration-color: #5f8c22; }

.azguards-post__content ul,
.azguards-post__content ol { padding-left: 1.6em; margin: 0 0 1.5em; }
.azguards-post__content li  { margin-bottom: 0.5em; }
.azguards-post__content strong { font-weight: 700; color: #1a1d16; }

.azguards-post__content blockquote {
  margin: 2em 0; padding: 16px 22px;
  border-left: 3.5px solid #87BB3F;
  background: #f2f7ea; border-radius: 0 8px 8px 0;
  color: #3d4238; font-style: italic;
}
.azguards-post__content blockquote p { margin: 0; }

.azguards-post__content img {
  max-width: 100%; border-radius: 10px;
  height: auto; display: block; margin: 1.5em 0;
}

.azguards-post__content pre {
  border-radius: 10px; overflow-x: auto;
  margin: 1.8em 0; font-size: 14px;
}

.azguards-post__content code:not(pre code) {
  background: #edf0e8; padding: 2px 6px;
  border-radius: 4px; font-size: 0.875em; color: #3d4238;
  font-family: 'Fira Code', 'Consolas', monospace;
}

/* ── Tags ────────────────────────────────────────────────── */
.azguards-post__tags {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 7px; margin-top: 44px;
  padding-top: 24px; border-top: 1px solid #e2e5db;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.azguards-post__tags-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #5c6257; margin-right: 4px;
}

.azguards-post__tag {
  display: inline-block; padding: 4px 12px;
  background: #f7f8f5; border: 1px solid #e2e5db;
  border-radius: 999px; font-size: 12.5px; color: #5c6257;
  text-decoration: none; transition: all 0.15s;
}
.azguards-post__tag:hover {
  border-color: #87BB3F; color: #5f8c22; background: #eaf2da;
}

/* =========================================================
   SIDEBAR WIDGETS
   ========================================================= */
.azguards-sidebar-widget {
  background: #fff;
  border: 1px solid #e2e5db;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Widget header */
.azguards-sidebar-widget__head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: #fafbf8;
  border-bottom: 1px solid #e2e5db;
}

.azguards-sidebar-widget__title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #5c6257;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.azguards-sidebar-widget__collapse {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid #e2e5db; border-radius: 5px;
  background: #fff; cursor: pointer; color: #5c6257;
  transition: all 0.15s; flex-shrink: 0; padding: 0;
}
.azguards-sidebar-widget__collapse:hover {
  background: #eaf2da; border-color: #87BB3F; color: #5f8c22;
}

/* ── ToC list ────────────────────────────────────────────── */
#azguards-toc-desktop-panel { padding: 8px 6px 10px; }

.azguards-toc__list,
.azguards-toc__sublist {
  list-style: none; padding: 0; margin: 0;
}
.azguards-toc__sublist { padding-left: 10px; }

.azguards-toc__link {
  display: block;
  padding: 5px 8px;
  font-size: 12.5px; color: #5c6257;
  text-decoration: none;
  border-radius: 5px;
  border-left: 2px solid transparent;
  line-height: 1.45;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.azguards-toc__link:hover {
  color: #5f8c22; background: #f0f7e6;
}
.azguards-toc__link.is-active {
  color: #5f8c22; background: #eaf2da;
  border-left-color: #87BB3F; font-weight: 600;
}
.azguards-toc__item--h3 .azguards-toc__link {
  font-size: 12px; padding-left: 10px;
}

/* ── CTA ─────────────────────────────────────────────────── */
.azguards-sidebar-cta {
  border-radius: 10px; overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
  border: none !important; /* override widget border */
}
.azguards-sidebar-cta:hover {
  box-shadow: 0 6px 24px rgba(135,187,63,0.2);
  transform: translateY(-2px);
}
.azguards-sidebar-cta a { display: block; line-height: 0; }
.azguards-sidebar-cta__img {
  width: 100%; aspect-ratio: 1/1;
  object-fit: cover; display: block;
}

/* ── Recent posts ────────────────────────────────────────── */
#azguards-recent-panel { padding: 4px 0; }

.azguards-recent-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  border-bottom: 1px solid #f0f2ec;
  transition: background 0.15s;
}
.azguards-recent-item:last-child { border-bottom: none; }
.azguards-recent-item:hover      { background: #f7f8f5; }

.azguards-recent-item__thumb {
  width: 46px; height: 46px;
  object-fit: cover; border-radius: 6px; flex-shrink: 0;
}
.azguards-recent-item__thumb--empty { background: #eaf2da; }

.azguards-recent-item__body {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.azguards-recent-item__title {
  font-size: 12.5px; font-weight: 600; color: #1a1d16;
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.azguards-recent-item__date {
  font-size: 11px; color: #5c6257;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .azguards-post__layout {
    grid-template-columns: 1fr;
    gap: 0; padding: 28px 20px 60px;
  }
  .azguards-post__sidebar    { display: none; }
  .azguards-mobile-toc       { display: block; }
  .azguards-post__hero-wrap  { padding: 20px 20px 0; }
  .azguards-post__hero-img   { height: 220px; }
  .azguards-post__content    { font-size: 16px; max-width: 100%; }
}

@media (max-width: 480px) {
  .azguards-post__title    { font-size: 22px; }
  .azguards-post__hero-img { height: 160px; }
}
