/* Luage — Compendium guide enhancements
   Purpose: elegant, editorial layout for guides/standards/procedures.
   Note: research articles use compendium-shared.css (separate template).
*/

.guide-header{
  background: rgba(255,255,255,.92);
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 0.55rem 1.4rem rgba(15, 23, 42, 0.06);
}

.guide-header h1{
  margin: 0 0 .4rem 0;
  font-weight: 800;
  letter-spacing: .01em;
}

.guide-header .lead{
  margin-bottom: .75rem;
  max-width: 72ch;
}

.guide-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .6rem;
}

.guide-meta .pill{
  font-size: .83rem;
  padding: .22rem .58rem;
}

.guide-aside{
  position: sticky;
  top: 6.2rem;
}

.toc-list{
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.toc-list li{
  margin: .35rem 0;
}

.toc-list a{
  text-decoration: none;
  color: rgba(27,36,51,.92);
}

.toc-list a:hover{
  text-decoration: underline;
}

.guide-content h2,
.guide-content h3{
  scroll-margin-top: 6.8rem; /* fixed navbar offset */
}

.callout{
  border: 1px solid var(--luage-border);
  border-left-width: 6px;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0.35rem 1.0rem rgba(15, 23, 42, 0.05);
}

.callout strong{
  font-weight: 800;
}

.callout--info{ border-left-color: var(--luage-a2); }
.callout--ok{ border-left-color: var(--luage-a1); }
.callout--warn{ border-left-color: #f59e0b; }

.figure-card{
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  background: rgba(255,255,255,.95);
  padding: 1rem;
  box-shadow: 0 0.5rem 1.4rem rgba(15, 23, 42, 0.06);
}

.figure-card figcaption{
  margin-top: .6rem;
  font-size: .92rem;
  color: var(--luage-muted);
}

.key-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.key-card{
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  background: rgba(255,255,255,.92);
  padding: 1rem 1.05rem;
}

.key-card .k{
  font-weight: 800;
  margin-bottom: .35rem;
}

pre.code{
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 1rem;
  overflow: auto;
}


/* --- Dynamic navigation (auto ToC / related / prev-next) --- */

.toc-list a.is-active{
  font-weight: 800;
}

.luage-nextprev .np-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
}

.np-link{
  display: block;
  text-decoration: none;
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  padding: .85rem .95rem;
  background: rgba(255,255,255,.92);
  box-shadow: 0 0.35rem 1.0rem rgba(15, 23, 42, 0.05);
}

.np-link:hover{
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 0.6rem 1.35rem rgba(15, 23, 42, 0.08);
}

.np-text{
  color: rgba(27,36,51,.92);
  font-weight: 750;
  line-height: 1.25;
}

.np-meta{
  margin-top: .45rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.np-chip{
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(153,94,255,.22);
  background: linear-gradient(135deg, rgba(70,220,212,.12), rgba(153,94,255,.10));
  color: rgba(27,36,51,.90);
  font-size: .76rem;
  font-weight: 650;
}

.np-chip--soft{
  border-color: var(--luage-border);
  background: rgba(255,255,255,.72);
  color: rgba(27,36,51,.76);
}

.related-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: .75rem;
}

.related-card{
  display: block;
  text-decoration: none;
  border: 1px solid var(--luage-border);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  background: rgba(255,255,255,.92);
  box-shadow: 0 0.35rem 1.0rem rgba(15, 23, 42, 0.05);
}

.related-card:hover{
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 0.6rem 1.35rem rgba(15, 23, 42, 0.08);
}

.related-title{
  font-weight: 820;
  color: rgba(27,36,51,.94);
  margin-bottom: .35rem;
}

.related-meta{
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.related-chip{
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(153,94,255,.22);
  background: linear-gradient(135deg, rgba(70,220,212,.10), rgba(153,94,255,.08));
  color: rgba(27,36,51,.88);
  font-size: .76rem;
  font-weight: 650;
}

.related-chip--soft{
  border-color: var(--luage-border);
  background: rgba(255,255,255,.72);
  color: rgba(27,36,51,.76);
}
/* --- Reading mode (guides / standards / patterns) --- */
.guide-page.reading-mode .guide-content{
  font-size: 1.05rem;
  line-height: 1.75;
}

.guide-page.reading-mode .guide-content p,
.guide-page.reading-mode .guide-content li{
  line-height: 1.78;
}

@media (min-width: 992px){
  .guide-page.reading-mode .row.g-4.align-items-start > .col-lg-8{
    width: 74%;
  }
  .guide-page.reading-mode .row.g-4.align-items-start > .col-lg-4{
    width: 26%;
  }
}

/* --- Print / PDF (clean export) --- */
@media print{
  nav.navbar,
  .guide-aside,
  footer,
  .library-toolbar{
    display: none !important;
  }

  body{
    background: #fff !important;
  }

  .card-soft,
  .guide-header{
    box-shadow: none !important;
  }

  .container{
    max-width: 100% !important;
  }

  .col-lg-8{
    width: 100% !important;
  }

  a{
    color: #000 !important;
    text-decoration: none !important;
  }

  .guide-content h2,
  .guide-content h3{
    page-break-after: avoid;
  }
}
