/* nue.io demo landing  -  extends styles.css. Light mode default (theme.js). */

.site-main {
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-dim) 100%);
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3.5rem;
}
.hero__eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.hero__title {
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero__lede {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 2rem;
  max-width: 720px;
}

.block {
  border-bottom: 1px solid var(--border);
}
.block--alt {
  background: var(--surface-dim);
}
.block__inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.block__heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.block__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.block__body {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}
.block__body--lead {
  font-size: 1.1rem;
  color: var(--text);
}
.block__note {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  border-left: 3px solid var(--border);
  padding-left: 0.9rem;
  margin-top: 0.4rem;
}
.block__cite {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.block__quote-inline {
  font-style: italic;
  color: var(--text);
  margin-top: 0.6rem;
}

.quote {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.25rem;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.55;
}
.quote--criterion {
  border-left-color: #16a34a;
  font-size: 1.1rem;
}
.quote__attribution {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: normal;
}

.numbered {
  margin: 0 0 0.5rem 1.25rem;
  padding: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}
.numbered li {
  margin-bottom: 0.5rem;
}

.bullets {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
  color: var(--text-secondary);
  line-height: 1.65;
}
.bullets li {
  margin-bottom: 0.4rem;
}

.cta {
  background: var(--surface);
}
.cta__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}
.cta__heading {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.cta__body {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: #ffffff;
}
.btn--primary:hover { background: var(--accent-hover); }

.video-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  /* Top, sides, bottom: scale fluidly with viewport but always keep breathing room. */
  padding-top:    clamp(1.25rem, 4vw, 2.5rem);
  padding-right:  clamp(1rem,    3vw, 2rem);
  padding-bottom: clamp(1.75rem, 5vw, 3rem);
  padding-left:   clamp(1rem,    3vw, 2rem);
  text-align: center;
}
.video-wrap video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}
.video-wrap__caption {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* ---------- Header action layout ---------- */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}
.header-print-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.header-print-btn:hover { background: var(--surface-dim); color: var(--text); }
.header-signout {
  margin-left: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12.5px;
  text-decoration: none;
  color: var(--text-secondary);
}
.header-signout:hover {
  background: var(--surface-dim);
  color: var(--text);
  border-color: var(--text-muted);
}

/* ---------- Footer extensions ---------- */
.site-footer__confidential {
  display: inline-block;
  margin-left: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}
.site-footer__right {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Kill nav animations ---------- */
.site-main,
.site-nav,
.site-nav-overlay,
.wpp__item {
  transition: none !important;
  animation: none !important;
}

/* ===========================================================
   Standard CODITECT WPP sidebar
   =========================================================== */
.site-nav.wpp {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
  font-size: 13px;
  padding: 0.75rem 0 2rem;
  transform: translateX(-100%);
}
.site-nav.wpp.open { transform: translateX(0); }

.wpp__docs-header { padding: 0.5rem 1.25rem 1rem; }
.wpp__docs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1e3a8a;
  text-transform: uppercase;
}
.wpp__docs-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.wpp__section { padding: 0; margin: 0; }
.wpp__section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.25rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
}
.wpp__section-head:hover { color: var(--text); }
.wpp__chev, .wpp__folder { display: inline-flex; align-items: center; }
.wpp__chev { width: 14px; }
.wpp__folder { width: 16px; opacity: 0.85; }
.wpp__section-name { flex: 1; }
.wpp__section-count {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
}

.wpp__items { display: block; padding: 0.1rem 0 0.4rem; }
.wpp__section[data-collapsed="true"] .wpp__items { display: none; }

.wpp__item {
  display: block;
  padding: 0.35rem 1.25rem 0.35rem 2.6rem;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  line-height: 1.35;
}
.wpp__item:hover { background: var(--surface-dim); color: var(--text); }
.wpp__item.active {
  background: rgba(30, 58, 138, 0.06);
  color: #1e3a8a;
  border-left-color: #1e3a8a;
  font-weight: 600;
}
/* Highlight the top "WATCH FIRST" section so the demo is unmistakable */
.wpp__section[data-key="demo"] {
  background: rgba(22, 163, 74, 0.06);
  border-left: 3px solid #16a34a;
  margin-bottom: 0.75rem;
}
.wpp__section[data-key="demo"] .wpp__section-head {
  color: #15803d;
}
.wpp__section[data-key="demo"] .wpp__item {
  color: #166534;
  font-weight: 600;
  font-size: 13px;
}
.wpp__section[data-key="demo"] .wpp__item:hover {
  background: rgba(22, 163, 74, 0.1);
  color: #14532d;
}
.wpp__file-ico { display: none; }
.wpp__item-text { display: inline; }

/* Desktop sidebar offset */
@media (min-width: 769px) {
  body.nav-open .site-main { margin-left: 260px; }
}

.site-nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 80; display: none;
}
.site-nav-overlay.visible { display: block; }

/* ===========================================================
   Standard CODITECT WPP header
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-icon-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.header-icon-btn:hover { background: var(--surface-dim); color: var(--text); }
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  margin-left: 0.4rem;
  flex: 1;
  min-width: 0;
}
.site-header__logo { width: 36px; height: 36px; flex-shrink: 0; }
.site-header__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.25;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.site-header__actions > a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 5px;
}
.site-header__actions > a:hover { background: var(--surface-dim); color: var(--text); }
@media (max-width: 720px) {
  .site-header__subtitle { display: none; }
  .site-header__actions > a:not(.header-signout) { display: none; }
}

/* ---------- Mermaid: fill the main panel ---------- */
.diagram-wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.diagram-wrap__title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}
.mermaid {
  width: 100%;
  display: block;
  text-align: center;
}
.mermaid svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

/* ---------- Screenshot/dashboard image figure ---------- */
.screenshot {
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
  max-width: 1100px;
  text-align: center;
}
.screenshot img {
  width: 100%;
  max-width: 1000px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  display: block;
  margin: 0 auto;
}
.screenshot figcaption {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===========================================================
   Responsive: mobile + tablet - center everything in main panel
   =========================================================== */
@media (max-width: 768px) {
  /* Header: hide subtitle, hide all actions except sign out */
  .site-header { padding: 0 0.6rem; gap: 0.3rem; }
  .site-header__title { font-size: 14px; }
  .site-header__subtitle { display: none; }
  .site-header__brand { gap: 0.45rem; }
  .site-header__logo { width: 30px; height: 30px; }
  .site-header__actions > a:not(.header-signout),
  .site-header__actions .header-print-btn { display: none; }
  .header-signout { padding: 0.3rem 0.6rem; font-size: 12px; }

  /* Sidebar slides over content (already fixed). Body never offsets on mobile. */
  body.nav-open .site-main { margin-left: 0; }
  .site-nav.wpp { width: 88vw; max-width: 320px; }

  /* Hero: tighter, centered */
  .hero__inner { padding: 2.25rem 1.1rem 1.75rem; }
  .hero__title { font-size: 1.55rem; line-height: 1.25; }
  .hero__lede { font-size: 0.98rem; }

  /* Block sections: tighter, readable line length */
  .block__inner { padding: 1.75rem 1.1rem; }
  .block__heading { font-size: 1.25rem; }

  /* Video: smaller corner radius on mobile (padding handled by clamp() above) */
  .video-wrap video { border-radius: 8px; }

  /* Screenshot images: full-width, centered */
  .screenshot { padding: 0.75rem 0.75rem 0; }
  .screenshot img { border-radius: 8px; }

  /* Diagrams: scrollable horizontally if needed */
  .diagram-wrap { padding: 1rem 0.5rem; }
  .mermaid svg { max-width: 100%; }

  /* Footer: stack vertically, centered */
  .site-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
  }
  .site-footer__confidential {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    display: block;
    margin-top: 0.2rem;
  }
}

/* Centering and overflow control that apply at all sizes */
html, body { max-width: 100%; overflow-x: hidden; }
body { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

.site-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
}
.site-main > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.video-wrap, .screenshot, .diagram-wrap, .hero, .block, .cta {
  margin-left: auto;
  margin-right: auto;
}

/* Hard right-side guard: every section container has box-sizing + max-width 100% */
.hero, .block, .cta, .video-wrap, .screenshot, .diagram-wrap,
.hero__inner, .block__inner, .cta__inner {
  box-sizing: border-box;
  max-width: 100%;
}

/* Section containers always carry a horizontal padding floor so content never touches the viewport edge */
.hero, .block, .cta {
  padding-left: clamp(1rem, 2.5vw, 1.5rem);
  padding-right: clamp(1rem, 2.5vw, 1.5rem);
}
/* The inner wrappers handle their own max-width centering; reset their inline padding so it doesn't double up */
.hero__inner, .block__inner, .cta__inner {
  padding-left: 0;
  padding-right: 0;
}

/* Long unbreakable strings (code paths, URLs) must wrap inside their container instead of pushing it wider */
.block__body,
.block__note,
.block__quote-inline,
.hero__lede,
.hero__title,
.cta__heading,
.cta__body,
.bullets,
.bullets li,
.numbered,
.numbered li,
p, li, code, pre {
  overflow-wrap: anywhere;
  word-break: break-word;
}
pre, code { white-space: pre-wrap; }

/* Images never exceed their container */
img { max-width: 100%; height: auto; }

/* ===========================================================
   Header search
   =========================================================== */
.site-search {
  position: relative;
  margin-right: 0.4rem;
}
.site-search__input {
  width: 14rem;
  max-width: 28vw;
  padding: 0.4rem 0.7rem;
  font-size: 13px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  outline: none;
}
.site-search__input:focus {
  border-color: var(--accent);
  background: var(--surface);
}
.site-search__results {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  width: 28rem;
  max-width: 88vw;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 110;
}
.site-search__results.open { display: block; }
.site-search__hit {
  display: block;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.site-search__hit:last-child { border-bottom: 0; }
.site-search__hit:hover { background: var(--surface-dim); }
.site-search__hit-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.site-search__hit-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.site-search__empty {
  padding: 0.85rem 1rem;
  font-size: 12.5px;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .site-search__input { width: 9rem; max-width: 36vw; }
}

/* ---------- Print stylesheet ---------- */
@media print {
  .site-header__actions,
  .site-nav,
  .site-nav-overlay,
  .nav-toggle-btn,
  .header-print-btn,
  .header-signout,
  .theme-toggle {
    display: none !important;
  }
  body, .site-main { background: #fff !important; color: #000 !important; }
  .block, .block--alt { background: #fff !important; }
  .site-header { border-bottom: 1px solid #000; }
}
