/* ============================================================
   File: assets/css/guides.css
   Purpose: Guides hub, single-guide e-reader, and sources page for
            columbusconstructioncost.com. Reads the --ccc-* tokens
            declared in assets/css/site.css :root; loaded per-view by
            guides/index.php, guides/show.php, guides/sources.php, and
            (for the .guide-router-tag pill only) public/landing.php.
            Mechanism ported from columbusremodelcost.com's guides.css
            2026-09-26 and re-themed to this site's palette and section
            conventions — the page hero reuses the existing
            .dark-band/.blog-hero photo band from assets/css/blog.css
            rather than introducing a second hero pattern.
   Brand:   iSpec LLC teal #57c1b6 / ink #1a1a1a (tokens in site.css)
   Author:  iSpec LLC
   Created: 2026-09-26
   Last Modified: 2026-09-26 — created (guides library port from CRC)
   ============================================================ */

/* ── HUB — CATEGORY GROUPS + GUIDE LIST ──────────────────── */
.guide-empty { color: var(--ccc-muted); }
.guide-empty a { color: var(--ccc-teal-dark); font-weight: 600; }

.guide-cat-group { margin-bottom: 40px; }
.guide-cat-heading {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ccc-teal-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-cat-heading::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ccc-teal);
}
.guide-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 700px) {
  .guide-list { grid-template-columns: 1fr 1fr; }
}
.guide-list-item {
  display: block;
  padding: 20px;
  border: 1px solid var(--ccc-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ccc-body-soft);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.guide-list-item:hover {
  border-color: var(--ccc-teal);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  color: var(--ccc-body-soft);
  text-decoration: none;
}
.guide-list-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ccc-ink);
  margin: 0 0 6px;
}
.guide-list-summary {
  font-size: 14px;
  color: var(--ccc-muted);
  margin: 0 0 8px;
}
.guide-list-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--ccc-teal-dark);
}

/* ── LANDING "WHERE TO START" ROUTER ─────────────────────── */
/* The router cards themselves reuse .page-nav-card / .page-nav-icon /
   .page-nav-title / .page-nav-note from site.css so the section reads
   as part of the landing page; only the category pill is new here. */
.guide-router-tag {
  display: inline-block;
  background: var(--ccc-callout-tint);
  color: var(--ccc-teal-dark);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.guide-router-foot { margin-top: 24px; font-size: 15px; }
.guide-router-foot a { color: var(--ccc-teal-dark); font-weight: 600; }

/* ── SINGLE GUIDE — ARTICLE HEADER + BODY ────────────────── */
.guide-article-header { margin-bottom: 28px; }
.guide-article-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ccc-teal-dark);
  margin-bottom: 10px;
}
.guide-article-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 10px;
}
.guide-article-sub {
  font-size: 1.05rem;
  color: var(--ccc-muted);
  max-width: 640px;
}
.guide-prose {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.75;
}
.guide-prose p { margin-bottom: 1rem; }
.guide-prose h2 { font-size: 1.5rem; margin: 32px 0 12px; }
.guide-prose h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.guide-prose > h2:first-child,
.guide-prose > h3:first-child { margin-top: 0; }
.guide-prose ul,
.guide-prose ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.guide-prose li { margin-bottom: 0.5rem; }
.guide-prose li::marker { color: var(--ccc-teal); }
.guide-prose table {
  width: 100%;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
  font-size: 15px;
}
.guide-prose th {
  background: var(--ccc-ink);
  color: var(--ccc-on-dark);
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.guide-prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ccc-border);
  vertical-align: top;
}
.guide-prose tr:last-child td { border-bottom: none; }

/* First-use glossary deep links (App\Helpers\GlossaryDeepLinker).
   Marked with a dotted underline so it reads as a definition lookup
   rather than a navigation link. */
.glossary-deep-link {
  color: inherit;
  border-bottom: 1px dotted var(--ccc-teal);
  text-decoration: none;
}
.glossary-deep-link:hover {
  color: var(--ccc-teal-dark);
  border-bottom-style: solid;
  text-decoration: none;
}

/* ── SINGLE GUIDE — SOURCES / RELATED / BACK ─────────────── */
.guide-sources {
  margin: 40px 0 24px;
  padding-top: 24px;
  border-top: 2px solid var(--ccc-border);
}
.guide-sources-title { font-size: 1.3rem; margin-bottom: 12px; }
.guide-sources-title a { color: var(--ccc-ink); }
.guide-sources-title a:hover { color: var(--ccc-teal-dark); text-decoration: none; }
.guide-sources h2 { font-size: 1.3rem; margin-bottom: 12px; }
.guide-sources ul { margin: 0 0 1rem 1.1rem; padding-left: 1rem; }
.guide-sources li {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ccc-body-soft);
}
.guide-related { margin: 32px 0 24px; }
.guide-related ul { margin: 8px 0 0 1.1rem; padding-left: 1rem; list-style: none; }
.guide-related li { margin-bottom: 6px; }
.guide-related a { color: var(--ccc-teal-dark); }
.guide-sources-foot,
.guide-hub-foot,
.guide-back { margin-top: 20px; font-size: 15px; }
.guide-sources-foot a,
.guide-hub-foot a,
.guide-back a { color: var(--ccc-teal-dark); font-weight: 600; }
.guide-article-foot { margin-top: 32px; }
.guide-article-foot .section-note {
  font-size: 13px;
  color: var(--ccc-muted);
  margin-top: 12px;
}

/* ── SINGLE GUIDE — E-READER TOOLBAR ────────────────────── */
/* The toolbar is the last child of the article column, so it spans the
   article width and can never overlap the footer. position: sticky keeps
   it floating at the bottom of the viewport while there is guide left to
   read, then it comes to rest above the footer. */
body.guide-nav-open { overflow: hidden; }

.guide-toolbar {
  position: sticky;
  bottom: 0;
  z-index: 1030;
  margin-top: 32px;
  padding: 3px 10px 0;   /* top padding leaves room for the progress strip */
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  background: #ffffff;
  border-top: 1px solid var(--ccc-border);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.1);
}
.guide-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ccc-body-soft);
  cursor: pointer;
}
.guide-toolbar-btn:hover { color: var(--ccc-teal-dark); text-decoration: none; }
.guide-toolbar-prev { flex: 1 1 0; justify-content: flex-start; }
.guide-toolbar-next { flex: 1 1 0; justify-content: flex-end; text-align: right; }
.guide-toolbar-prev .guide-toolbar-txt { align-items: flex-start; }
.guide-toolbar-next .guide-toolbar-txt { align-items: flex-end; }
.guide-toolbar-ico {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  color: var(--ccc-teal-dark);
}
.guide-toolbar-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
}
.guide-toolbar-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ccc-muted);
}
.guide-toolbar-lbl {
  max-width: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-toolbar-sections {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 4px;
  padding: 8px 16px;
  border: 1.5px solid var(--ccc-teal);
  border-radius: 999px;
  background: var(--ccc-callout-tint);
  color: var(--ccc-teal-dark);
  font-weight: 600;
}
.guide-toolbar-sections:hover { background: var(--ccc-callout-tint); color: var(--ccc-teal-dark); }
.guide-toolbar-sections .guide-toolbar-ico { color: var(--ccc-teal-dark); }
.guide-toolbar-sections .guide-toolbar-lbl { white-space: nowrap; }
.guide-toolbar-sections .guide-toolbar-txt { align-items: center; line-height: 1.15; }
.guide-toolbar-sections .guide-toolbar-kicker { color: var(--ccc-teal-dark); opacity: 0.85; }
@media (max-width: 560px) {
  .guide-toolbar-prev .guide-toolbar-lbl,
  .guide-toolbar-next .guide-toolbar-lbl { display: none; }
  .guide-toolbar-sections { padding: 8px 13px; }
}
/* Tablet/desktop: rounded + lifted off the viewport edge so it reads as a
   floating pill rather than a bar welded to the bottom of the screen. */
@media (min-width: 768px) {
  .guide-toolbar {
    bottom: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--ccc-border);
    border-radius: 14px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.14);
    overflow: hidden;
  }
}
.guide-toolbar-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ccc-border);
}
/* The fill width is a runtime value. public/js/guide-reader.js sets the
   --guide-progress custom property on .guide-toolbar (the parent) — never
   an inline style on the element itself. */
.guide-toolbar-progress-fill {
  display: block;
  height: 100%;
  width: var(--guide-progress, 0%);
  background: var(--ccc-teal);
  transition: width 0.2s ease;
}

/* ── SINGLE GUIDE — OFF-CANVAS SECTION DRAWER ───────────── */
/* Opened by the toolbar "Sections" button; slides in from the right. */
.guide-section-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.guide-section-nav-backdrop.is-open { opacity: 1; }

.guide-section-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  width: min(360px, 86vw);
  background: #ffffff;
  box-shadow: -4px 0 22px rgba(0, 0, 0, 0.16);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
.guide-section-nav.is-open { transform: translateX(0); }
.guide-section-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ccc-border);
}
.guide-section-nav-title { font-weight: 600; color: var(--ccc-ink); }
.guide-section-nav-close {
  border: none;
  background: none;
  padding: 2px 6px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ccc-muted);
  cursor: pointer;
}
.guide-section-nav-close:hover { color: var(--ccc-ink); }
.guide-section-nav-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 10px 24px;
}
.guide-section-link {
  display: block;
  padding: 8px 11px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--ccc-body-soft);
}
.guide-section-link:hover { background: var(--ccc-surface); color: var(--ccc-body-soft); text-decoration: none; }
.guide-section-link.is-current {
  background: var(--ccc-callout-tint);
  border-left-color: var(--ccc-teal);
  color: var(--ccc-teal-dark);
  font-weight: 600;
}
.guide-section-link--top { font-weight: 600; color: var(--ccc-ink); margin-bottom: 4px; }

/* ── SINGLE GUIDE — PAGINATED READER MODE ───────────────── */
/* One <h2> section per page once guide-reader.js has run. With no JS the
   body stays in normal document flow — these rules never hide anything
   that the script has not already split into .guide-page blocks. */
.guide-page { margin-bottom: 8px; }
.guide-page[hidden],
.guide-section-nav[hidden],
.guide-section-nav-backdrop[hidden] { display: none !important; }
@media (min-width: 700px) {
  .guide-page { min-height: 42vh; }   /* keeps short sections from looking sparse */
}
.guide-page--wrapup { min-height: 0; }
