/* ==========================================================================
   YURBI GUIDE STYLES
   Extends blog.css — load guide.css as pageCSS; it imports blog.css itself.
   blog.css provides: post-header, breadcrumb, post-article typography,
   post-inline-cta, post-footer, post-category badge.
   ========================================================================== */

@import url('/assets/css/blog.css');


/* --------------------------------------------------------------------------
   Guide Cards Grid  (src/guides/index.njk)
   -------------------------------------------------------------------------- */
.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-lg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.guide-card:hover {
  border-color: var(--blue);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.guide-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.guide-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.guide-card-category {
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-soft2);
  padding: 4px 10px;
  border-radius: var(--r-full);
}

.guide-card-chapters {
  font-size: var(--t-sm);
  color: var(--text-muted);
  font-weight: var(--w-medium);
}

.guide-card h2 {
  font-size: var(--t-card);
  font-weight: var(--w-bold);
  line-height: var(--lh-snug);
  color: var(--text);
  margin-bottom: var(--s-3);
}

.guide-card p {
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  flex: 1;
  margin-bottom: var(--s-5);
}

.guide-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  color: var(--blue);
  margin-top: auto;
}

.guide-card-cta svg {
  width: 16px;
  height: 16px;
  transition: transform .2s;
}

.guide-card:hover .guide-card-cta svg {
  transform: translateX(4px);
}


/* --------------------------------------------------------------------------
   Guide Header  (guides/index.njk — listing page)
   Two-column layout: text left, mascot image right
   -------------------------------------------------------------------------- */
.guide-header {
  padding: calc(var(--header-h) + 48px) var(--s-6) var(--s-12);
  background: linear-gradient(160deg, var(--bg-blue) 0%, var(--bg) 70%);
  overflow: hidden;
}

.guide-header-layout {
  max-width: var(--max-w);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-10);
}

.guide-header-text {
  flex: 1;
  min-width: 0;
}

.guide-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-soft2);
  padding: 5px 14px;
  border-radius: var(--r-full);
  margin-bottom: var(--s-5);
}

.guide-header-eyebrow svg {
  width: 14px;
  height: 14px;
}

.guide-header h1 {
  font-size: var(--t-hero);
  font-weight: var(--w-xbold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text);
  margin-bottom: var(--s-4);
}

.guide-header p {
  font-size: var(--t-lead);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  max-width: 52ch;
}

.guide-header-mascot {
  flex-shrink: 0;
  width: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* Slight upward crop so mascot appears to sit at the bottom edge */
  margin-bottom: calc(var(--s-12) * -1);
}

.guide-header-mascot img {
  width: 260px;
  height: auto;
  display: block;
  /* Preserve transparency on the PNG */
  mix-blend-mode: multiply;
}

@media (max-width: 900px) {
  .guide-header-mascot { width: 180px; }
  .guide-header-mascot img { width: 180px; }
  .guide-header h1 { font-size: var(--t-4xl); }
}

@media (max-width: 640px) {
  .guide-header { padding-top: calc(var(--header-h) + 36px); text-align: center; }
  .guide-header-layout { flex-direction: column-reverse; align-items: center; gap: var(--s-6); }
  .guide-header-mascot { width: 140px; margin-bottom: 0; }
  .guide-header-mascot img { width: 140px; }
  .guide-header p { max-width: none; }
  .guide-header-eyebrow { margin-inline: auto; }
}


/* --------------------------------------------------------------------------
   Guide TOC Page  (guides/[name]/index.njk)
   -------------------------------------------------------------------------- */
.guide-toc-intro {
  font-size: var(--t-lead);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  margin-top: var(--s-4);
  max-width: 65ch;
}

.guide-toc-section {
  padding: var(--s-12) var(--s-6) var(--s-20);
}

.guide-toc-inner {
  max-width: 720px;
  margin: 0 auto;
}

.guide-toc-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--text-muted);
  margin-bottom: var(--s-5);
}

.guide-toc-label svg {
  width: 16px;
  height: 16px;
}

.guide-toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-10);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.guide-toc-list li + li {
  border-top: 1px solid var(--border-sub);
}

.guide-toc-item {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5) var(--s-6);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.guide-toc-item:hover {
  background: var(--bg-subtle);
}

.guide-toc-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.guide-toc-num {
  font-size: var(--t-sm);
  font-weight: var(--w-bold);
  color: var(--text-muted);
  min-width: 28px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.guide-toc-text {
  flex: 1;
}

.guide-toc-text strong {
  display: block;
  font-size: var(--t-base);
  font-weight: var(--w-semibold);
  color: var(--text);
  margin-bottom: 3px;
}

.guide-toc-text span {
  font-size: var(--t-sm);
  color: var(--text-muted);
  line-height: var(--lh-normal);
}

.guide-toc-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s, color .2s;
}

.guide-toc-item:hover .guide-toc-arrow {
  transform: translateX(3px);
  color: var(--blue);
}

.guide-toc-cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}


/* --------------------------------------------------------------------------
   Chapter Label  (above h1 on chapter pages)
   -------------------------------------------------------------------------- */
.guide-chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  color: var(--text-muted);
  margin-bottom: var(--s-4);
}

.guide-chapter-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   Prev / Next Chapter Navigation
   -------------------------------------------------------------------------- */
.guide-chapter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-15);
  padding-top: var(--s-8);
  border-top: 1px solid var(--border-sub);
}

.guide-chapter-nav-prev,
.guide-chapter-nav-next {
  flex: 1;
}

.guide-chapter-nav-next {
  display: flex;
  justify-content: flex-end;
}

.guide-nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  background: var(--bg);
  border: 1px solid var(--border-sub);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  max-width: 260px;
}

.guide-nav-link:hover {
  border-color: var(--blue);
  box-shadow: var(--sh-sm);
}

.guide-nav-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.guide-nav-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.guide-nav-label {
  display: block;
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
  margin-bottom: 3px;
}

.guide-nav-title {
  display: block;
  font-size: var(--t-sm);
  font-weight: var(--w-semibold);
  color: var(--text);
  line-height: var(--lh-snug);
}

.guide-nav-next { text-align: right; }

.guide-toc-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: var(--t-label);
  font-weight: var(--w-semibold);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  transition: color .2s, background .2s;
  flex-shrink: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

.guide-toc-link:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.guide-toc-link svg {
  width: 18px;
  height: 18px;
}


/* --------------------------------------------------------------------------
   Guide CTA Block  (mid-chapter)
   -------------------------------------------------------------------------- */
.guide-cta-block {
  background: var(--bg-subtle);
  border: 1px solid var(--border-sub);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: var(--s-6) 28px;
  margin: var(--s-10) 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.guide-cta-block p {
  font-size: var(--t-body);
  font-weight: var(--w-medium);
  color: var(--text);
  margin: 0;
  line-height: var(--lh-relaxed);
  max-width: 60ch;
}

.guide-cta-block-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  align-items: center;
}

/* Reset link styles that bleed from .post-article */
.guide-cta-block .btn {
  text-decoration: none;
  font-size: var(--t-base);
  font-weight: var(--w-semibold);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .2s;
  min-height: 44px;
}

.guide-cta-block .btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
}

.guide-cta-block .btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--sh-blue);
}

.guide-cta-block .btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
}

.guide-cta-block .btn-secondary:hover {
  background: var(--bg-muted);
  color: var(--text);
  border-color: var(--blue);
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   Guide Callout Box
   -------------------------------------------------------------------------- */
.guide-callout {
  background: var(--bg-blue);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--s-5) var(--s-6);
  margin: var(--s-8) 0;
}

.guide-callout strong {
  display: block;
  font-size: var(--t-label);
  font-weight: var(--w-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--blue);
  margin-bottom: var(--s-2);
}

.guide-callout p {
  font-size: var(--t-base);
  color: var(--text-sec);
  line-height: var(--lh-relaxed);
  margin: 0;
}


/* --------------------------------------------------------------------------
   Responsive Table
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--s-8) 0;
  border: 1px solid var(--border-sub);
  border-radius: var(--r-md);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-base);
  line-height: var(--lh-normal);
}

.table-wrap th,
.table-wrap td {
  padding: 12px var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--border-sub);
  vertical-align: top;
}

.table-wrap th {
  font-weight: var(--w-bold);
  color: var(--text);
  background: var(--bg-subtle);
  font-size: var(--t-sm);
}

.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap td b,
.table-wrap td strong { color: var(--text); }


/* --------------------------------------------------------------------------
   Ensure block images in articles
   -------------------------------------------------------------------------- */
.post-article img { display: block; }

.post-article ul,
.post-article ol { margin-top: var(--s-5); }


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .guide-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .guide-cards-grid { grid-template-columns: 1fr; }

  .guide-chapter-nav {
    flex-wrap: wrap;
  }

  .guide-nav-link {
    max-width: 100%;
    width: 100%;
  }

  .guide-chapter-nav-next {
    justify-content: flex-start;
  }
}
