/* Bookzign V2 — minimal app styles (Phase 1) */
body {
  min-height: 100vh;
}
.navbar .btn {
  font-size: 0.8rem;
}

/* ============================================================
   Public site design system (presentation only)
   One restrained visual language for home, guides, articles,
   and 404. Bootstrap 5 grid/utilities + these overrides.
   ============================================================ */

.public-page {
  display: flex;
  flex-direction: column;
}
.public-page main {
  flex: 1 0 auto;
}

/* --- header & navigation ----------------------------------- */
.public-header {
  background: #fff;
}
.site-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.public-nav-link {
  text-decoration: none;
  color: var(--bs-body-color);
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.public-nav-link:hover,
.public-nav-link:focus {
  color: var(--bs-body-color);
}
.public-nav-link.active {
  border-bottom-color: var(--bs-body-color);
  font-weight: 600;
}
@media (max-width: 575.98px) {
  .public-header .container {
    gap: 0.75rem;
  }
  .site-brand {
    font-size: 1rem;
  }
  .public-nav-link {
    font-size: 0.9rem;
  }
}

/* --- hero ---------------------------------------------------- */
.public-hero {
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}
.hero-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero-lead {
  max-width: 46rem;
  color: var(--bs-body-color);
}

/* --- section titles & layout -------------------------------- */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.page-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-intro {
  max-width: 46rem;
}
.about-text {
  max-width: 46rem;
}

/* --- guide cards --------------------------------------------- */
.page-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  color: var(--bs-body-color);
}
.page-card:hover,
.page-card:focus {
  border-color: var(--bs-body-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: var(--bs-body-color);
}
.page-card .card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.page-card .card-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

/* --- latest list (home) -------------------------------------- */
.latest-list {
  border-top: 1px solid var(--bs-border-color);
}
.latest-list li {
  border-bottom: 1px solid var(--bs-border-color);
}
.latest-date {
  min-width: 6.5rem;
}
@media (max-width: 575.98px) {
  .latest-list li {
    flex-direction: column;
    gap: 0.25rem;
  }
  .latest-date {
    min-width: 0;
  }
}

/* --- empty state --------------------------------------------- */
.empty-state {
  padding: 3rem 1rem;
  border: 1px dashed var(--bs-border-color);
  border-radius: 0.5rem;
}

/* --- breadcrumbs --------------------------------------------- */
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}
.breadcrumbs a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}
.breadcrumbs a:hover,
.breadcrumbs a:focus {
  color: var(--bs-body-color);
  text-decoration: underline;
}
.breadcrumbs li[aria-current] {
  color: var(--bs-body-color);
}

/* --- article page (public editorial layout) --------------------- */
.article-shell {
  max-width: 48rem;
  margin-inline: auto;
}
.article-header {
  margin-bottom: 1rem;
}
.article-title {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
}
.article-meta {
  margin-top: 0.75rem;
}
.meta-sep {
  margin: 0 0.45rem;
  opacity: 0.55;
}

/* Featured media: editorial framing of the existing asset. */
.article-hero-figure {
  margin: 1.5rem 0 1.75rem;
}
.article-hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.6rem;
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.07);
  background: var(--bs-tertiary-bg);
}

/* Key takeaways: derived from the article's own section headings.
   Presented as numbered editorial key points (not form checkboxes). */
.takeaways {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.6rem;
  padding: 1.1rem 1.25rem 1.25rem;
  margin-bottom: 1.75rem;
}
.takeaways-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 0.8rem;
}
.takeaways-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  counter-reset: takeaway;
}
.takeaways-list li {
  position: relative;
  padding-left: 2.35rem;
  font-weight: 500;
  counter-increment: takeaway;
}
.takeaways-list li::before {
  content: counter(takeaway, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bs-secondary-color);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px) {
  .takeaways-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* Body typography: comfortable line length and visual rhythm. */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
}
.article-body p {
  margin-bottom: 1.2rem;
}
.article-body > p:first-child {
  font-size: 1.15rem;
  line-height: 1.65;
  opacity: 0.85;
  margin-bottom: 1.35rem;
}
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 2.75rem 0 0.9rem;
}
.article-body h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.9rem 0 0.6rem;
}
.article-body h4,
.article-body h5,
.article-body h6 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
/* Lists render as restrained checklists (the site's practical-guide
   register); no lists are invented — existing items only. */
.article-body ul {
  list-style: none;
  padding-left: 0.2rem;
  margin: 0 0 1.3rem;
}
.article-body ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.article-body ul li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.34em;
  width: 0.72em;
  height: 0.72em;
  border: 1.5px solid var(--bs-secondary-color);
  border-radius: 0.22em;
}
.article-body blockquote {
  border-left: 3px solid var(--bs-border-color);
  padding-left: 1rem;
  margin: 0 0 1.3rem;
  color: var(--bs-secondary-color);
}
.article-body pre {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin: 0 0 1.3rem;
  font-size: 0.875rem;
  overflow-x: auto;
}
.article-body code {
  font-size: 0.9em;
}
.article-body hr {
  border-color: var(--bs-border-color);
  opacity: 0.6;
  margin: 2.5rem 0;
}
.article-body a {
  text-underline-offset: 0.15em;
}

/* --- affiliate box (restrained) ---------------------------------- */
.affiliate-box {
  border: 1px solid var(--bs-border-color);
  border-left: 3px solid var(--bs-secondary-color);
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg);
  padding: 1rem 1.25rem;
}
.affiliate-disclosure {
  color: var(--bs-secondary-color);
}
/* Contextual-recommendation framing (not an ad block). */
.affiliate-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}

/* --- article footer (continue reading) ---------------------------- */
.article-footer {
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
  margin-top: 3rem;
  padding: 2.25rem 0 2.5rem;
}
.article-footer-block + .article-footer-block {
  margin-top: 2rem;
}
.article-footer-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.related-list {
  border-top: 1px solid var(--bs-border-color);
}
.related-list li {
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.65rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
}
.related-list a {
  text-decoration: none;
  color: var(--bs-body-color);
}
.related-list a::after {
  content: "\2192";
  margin-left: 0.45rem;
  opacity: 0.4;
}
.related-list a:hover,
.related-list a:focus {
  text-decoration: underline;
}
.related-date {
  white-space: nowrap;
}
.article-footer-cta {
  margin-top: 2rem;
}

/* --- article page: mobile refinements ------------------------------ */
@media (max-width: 575.98px) {
  .article-title {
    font-size: 1.7rem;
  }
  .article-hero-figure {
    margin: 1.25rem 0 1.5rem;
  }
  .article-hero-figure img {
    border-radius: 0.5rem;
  }
  .takeaways {
    padding: 1rem 1rem 1.1rem;
  }
  .article-body {
    font-size: 1rem;
    line-height: 1.7;
  }
  .article-body > p:first-child {
    font-size: 1.0625rem;
  }
  .article-body h2 {
    font-size: 1.35rem;
    margin-top: 2.25rem;
  }
  .article-footer {
    margin-top: 2.25rem;
    padding: 1.75rem 0 2rem;
  }
  .related-list li {
    padding: 0.75rem 0; /* comfortable tap rows */
  }
  .article-footer-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- footer ----------------------------------------------------- */
.public-footer {
  background: var(--bs-tertiary-bg);
  flex-shrink: 0;
}
.footer-brand {
  font-size: 1rem;
}
.footer-link {
  color: var(--bs-secondary-color);
  text-decoration: none;
}
.footer-link:hover,
.footer-link:focus {
  color: var(--bs-body-color);
  text-decoration: underline;
}
.footer-disclosure {
  color: var(--bs-secondary-color);
  max-width: 46rem;
}

/* ============================================================
   Admin — Project Workspace (operating console)
   Compact, information-dense, responsive (sidebar collapses
   to a wrapping strip below the content on small screens).
   ============================================================ */

.workspace-main {
  min-width: 0; /* allow tables/cards to shrink inside the grid */
}

/* --- sidebar ------------------------------------------------ */
.workspace-nav {
  position: sticky;
  top: 1rem;
}
.workspace-nav-card {
  border-top: 3px solid var(--bs-primary);
}
.workspace-project-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bs-body-color);
  text-decoration: none;
  line-height: 1.2;
}
.workspace-project-name:hover,
.workspace-project-name:focus {
  color: var(--bs-primary);
}
.nav-workspace {
  flex-direction: column; /* single column on desktop */
}
.nav-workspace .nav-link {
  color: var(--bs-body-color);
  font-size: 0.875rem;
  border-radius: 0.375rem;
  gap: 0.5rem;
}
.nav-workspace .nav-link:hover,
.nav-workspace .nav-link:focus {
  background: var(--bs-tertiary-bg);
}
.nav-workspace .nav-link.active {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  font-weight: 600;
}
.count-pill {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}
.nav-workspace .nav-link.active .count-pill {
  color: var(--bs-primary);
  border-color: var(--bs-primary-border-subtle);
  background: #fff;
}

/* --- stat strip (overview pipeline cards) -------------------- */
.stat-card {
  border-top: 3px solid var(--bs-border-color);
  height: 100%;
}
.stat-card a.stat-label,
.stat-card .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  text-decoration: none;
}
.stat-card a.stat-label:hover {
  color: var(--bs-primary);
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-sub {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
}

/* --- engine console grid (overview) -------------------------- */
.engine-card {
  height: 100%;
  transition: border-color 0.15s ease;
}
.engine-card:hover {
  border-color: var(--bs-primary);
}
.engine-card .engine-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.engine-card .engine-desc {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  min-height: 2.4em;
}
.engine-card .engine-open {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

/* --- compact tables ------------------------------------------ */
.workspace-main .table {
  font-size: 0.875rem;
}
.workspace-main .table td,
.workspace-main .table th {
  vertical-align: middle;
}

/* Admin top bar wraps on narrow screens (no horizontal overflow) */
@media (max-width: 575.98px) {
  .navbar > .container.d-flex {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .navbar > .container.d-flex .ms-auto {
    flex-wrap: wrap;
    justify-content: flex-end;
    column-gap: 0.5rem;
    row-gap: 0.25rem;
  }
}

/* --- responsive: sidebar becomes a wrapping strip ------------- */
@media (max-width: 991.98px) {
  .workspace-nav {
    position: static;
  }
  .workspace-nav-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  .workspace-nav-list .nav-item {
    display: inline-flex;
  }
  .nav-workspace .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  .stat-value {
    font-size: 1.25rem;
  }
}

/* --- Resource Engine V1 (public) ---------------------------------- */
/* Resource cards on the /resources hub (reuse guide-card rhythm). */
.resource-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1.25rem 1.25rem 1.15rem;
  text-decoration: none;
  color: var(--bs-body-color);
  transition: border-color 0.15s ease;
}
.resource-card:hover {
  border-color: var(--bs-primary);
  color: var(--bs-body-color);
}
.resource-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.resource-type-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.resource-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.resource-card-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.resource-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2em 0.55em;
  border-radius: 0.35rem;
  white-space: nowrap;
}
.resource-badge-free {
  background: var(--bs-success-subtle);
  color: var(--bs-success-text-emphasis);
  border: 1px solid var(--bs-success-subtle);
}
.resource-badge-paid {
  background: var(--bs-warning-subtle);
  color: var(--bs-warning-text-emphasis);
  border: 1px solid var(--bs-warning-subtle);
}

/* Resource detail: access box (capture / download / paid note). */
.resource-access-box {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg);
  padding: 1.25rem 1.25rem 1.35rem;
  margin-top: 1.5rem;
  max-width: 34rem;
}
.resource-get-text {
  margin-bottom: 1rem;
}
.resource-success {
  font-weight: 600;
  margin-bottom: 1rem;
}
.resource-download-btn {
  display: inline-block;
}
.resource-submit-btn {
  min-width: 10.5rem;
}
.resource-paid-note {
  color: var(--bs-secondary-color);
}
.resource-back-link {
  font-size: 0.92rem;
}

/* Article CTA (contextual, restrained — utility before commerce). */
.resource-cta {
  border: 1px solid var(--bs-border-color);
  border-left: 3px solid var(--bs-primary);
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg);
  padding: 1rem 1.25rem;
}
.resource-cta-overline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.resource-cta-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.resource-cta-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
