/* Quelora — internal-page styles.
   Relies on tokens.css and shares atoms with landing.css. */

/* Page hero (lighter than landing hero) */
.qp-hero {
  padding: var(--gap-8) 0 var(--gap-7);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.qp-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(800px 300px at 20% 0%, var(--brand-soft), transparent 60%);
}
.qp-hero__inner { position: relative; max-width: 800px; }
.qp-hero h1 {
  /* −20% vs the previous clamp(32, 5vw, 56) for visual consistency with .q-h1 */
  font-size: clamp(26px, 4vw, 45px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: var(--gap-4) 0 0;
  font-weight: 600;
}
.qp-hero p {
  font-size: var(--fs-18);
  color: var(--muted);
  max-width: 62ch;
  margin: var(--gap-5) 0 0;
  line-height: 1.55;
}
.qp-crumbs {
  font-size: var(--fs-13);
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.qp-crumbs a:hover { color: var(--ink); }
.qp-crumbs span.qp-crumbs__sep { color: var(--muted-2); }
.qp-crumbs span.qp-crumbs__here { color: var(--ink); font-weight: 500; }

/* Section block */
.qp-section {
  padding: var(--gap-8) 0;
  border-top: 1px solid var(--line);
}
.qp-section:first-of-type { border-top: 0; }
.qp-section__head { max-width: 720px; margin-bottom: var(--gap-6); }
.qp-section__head h2 {
  font-size: var(--fs-32);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: var(--gap-2) 0 0;
  line-height: 1.1;
}
.qp-section__head p {
  margin: var(--gap-3) 0 0;
  color: var(--muted);
  font-size: var(--fs-16);
  line-height: 1.55;
}

/* Two-column block */
.qp-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-7);
  align-items: flex-start;
}
@media (max-width: 920px) { .qp-2col { grid-template-columns: 1fr; } }
.qp-2col--media-right { grid-template-columns: 0.95fr 1.05fr; }

/* Body text */
.qp-prose p {
  font-size: var(--fs-16);
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 var(--gap-4);
}
.qp-prose p:last-child { margin-bottom: 0; }
.qp-prose strong { color: var(--ink); font-weight: 600; }
.qp-prose a { color: var(--brand); }
.qp-prose a:hover { text-decoration: underline; }
.qp-prose ul { padding-left: 18px; margin: 0 0 var(--gap-4); }
.qp-prose ul li { margin-bottom: 6px; color: var(--ink-2); font-size: var(--fs-15); line-height: 1.55; }

/* TOC sidebar (for long pages like Features) */
.qp-toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--gap-4));
  align-self: flex-start;
  font-size: var(--fs-13);
}
.qp-toc h6 {
  margin: 0 0 var(--gap-3);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.qp-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qp-toc a {
  color: var(--muted);
  display: block;
  padding: 2px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -14px;
}
.qp-toc a:hover { color: var(--ink); }
.qp-toc a.is-active { color: var(--brand); border-color: var(--brand); }

/* Layout for content + TOC */
.qp-doc {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--gap-7);
}
@media (max-width: 960px) {
  .qp-doc { grid-template-columns: 1fr; }
  .qp-toc { position: static; }
}

/* Box / callout */
.qp-box {
  padding: var(--gap-5);
  border-radius: var(--r-4);
  border: 1px solid var(--line);
  background: var(--surface);
}
.qp-box--brand {
  background: linear-gradient(180deg, var(--brand-soft), transparent 80%);
  border-color: var(--brand-line);
}
.qp-box__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand);
  margin: 0 0 var(--gap-3);
  text-transform: uppercase;
}

/* Spec table */
.qp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-14);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  table-layout: auto;
  word-break: break-word;
}
.qp-table th, .qp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.qp-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: var(--fs-13);
  color: var(--ink);
  letter-spacing: -0.005em;
}
.qp-table tr:last-child td { border-bottom: 0; }
.qp-table tbody tr:hover { background: var(--surface-2); }
.qp-table td .q-mono { color: var(--brand); word-break: break-all; }
.qp-table .qp-cell-muted { color: var(--muted); }
.qp-table .qp-yes { color: var(--ok); font-weight: 600; }
.qp-table .qp-no { color: var(--danger); font-weight: 600; }
.qp-table .qp-partial { color: var(--warn); font-weight: 600; }
@media (max-width: 720px) {
  .qp-table { font-size: var(--fs-13); display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qp-table th, .qp-table td { padding: 10px 10px; }
}

/* Architecture SVG containers scroll horizontally on small screens */
.qp-arch { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.qp-arch svg { min-width: 720px; }
@media (max-width: 720px) {
  .qp-arch { padding: var(--gap-3); }
}

/* Mobile padding for page hero + sections */
@media (max-width: 720px) {
  .qp-hero { padding: var(--gap-7) 0 var(--gap-6); }
  .qp-hero h1 { font-size: clamp(22px, 6.4vw, 32px); }
  .qp-section { padding: var(--gap-7) 0; }
  .qp-section__head h2 { font-size: var(--fs-28); }
  .qp-doc { gap: var(--gap-5); }
  .qp-toc { position: static; }
}
@media (max-width: 480px) {
  .qp-hero { padding: var(--gap-6) 0 var(--gap-5); }
  .qp-section { padding: var(--gap-6) 0; }
  .qp-feature-deep { padding: var(--gap-4); }
}

/* Architecture diagram — boxes & lines (SVG-friendly) */
.qp-arch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  padding: var(--gap-5);
  overflow: auto;
}
.qp-arch svg { width: 100%; height: auto; }

/* Repo card row (reuse from landing) */
.qp-repos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-3);
  margin-top: var(--gap-5);
}
@media (max-width: 720px) { .qp-repos { grid-template-columns: 1fr; } }

/* Feature deep cards */
.qp-feature-deep {
  padding: var(--gap-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  margin-bottom: var(--gap-4);
}
.qp-feature-deep__head {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  margin-bottom: var(--gap-4);
}
.qp-feature-deep__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.qp-feature-deep__icon svg { width: 22px; height: 22px; }
.qp-feature-deep h3 {
  margin: 0;
  font-size: var(--fs-20);
  font-weight: 600;
  letter-spacing: -0.018em;
}
.qp-feature-deep p {
  margin: 0 0 var(--gap-4);
  color: var(--muted);
  font-size: var(--fs-15);
  line-height: 1.55;
  max-width: 64ch;
}
.qp-feature-deep__detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-5);
}
@media (max-width: 820px) { .qp-feature-deep__detail { grid-template-columns: 1fr; } }
.qp-feature-deep__chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Roadmap timeline */
.qp-timeline { position: relative; padding-left: 28px; }
.qp-timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line-strong);
}
.qp-mile {
  position: relative;
  padding-bottom: var(--gap-6);
}
.qp-mile::before {
  content: "";
  position: absolute;
  left: -24px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
}
.qp-mile--done::before { background: var(--brand); border-color: var(--brand); }
.qp-mile--now::before { background: var(--bg); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.qp-mile__date {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.qp-mile h4 {
  margin: 4px 0 6px;
  font-size: var(--fs-16);
  font-weight: 600;
}
.qp-mile p {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--muted);
  line-height: 1.55;
  max-width: 64ch;
}

/* Author card */
.qp-author {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--gap-5);
  padding: var(--gap-6);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  background: var(--surface);
}
.qp-author__avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.qp-author h3 { margin: 0 0 4px; font-size: var(--fs-20); font-weight: 600; }
.qp-author p { margin: 0; color: var(--muted); }
.qp-author__links {
  display: flex; gap: var(--gap-3);
  margin-top: var(--gap-3);
  font-size: var(--fs-14);
}
.qp-author__links a { color: var(--brand); }

/* ── Screenshot slots ───────────────────────────────────
   Static placeholder for product screenshots the author will drop in.
   Replace the inner content with <img src="..."> when the file exists. */
.qp-shot {
  position: relative;
  width: 100%;
  border-radius: var(--r-4);
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      45deg,
      var(--surface) 0px, var(--surface) 12px,
      var(--surface-2) 12px, var(--surface-2) 24px
    );
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.qp-shot--16x9 { aspect-ratio: 16 / 9; }
.qp-shot--16x10 { aspect-ratio: 16 / 10; }
.qp-shot--4x3 { aspect-ratio: 4 / 3; }
.qp-shot--3x4 { aspect-ratio: 3 / 4; }
.qp-shot--1x1 { aspect-ratio: 1 / 1; }
.qp-shot--phone { aspect-ratio: 9 / 19; max-width: 360px; margin-left: auto; margin-right: auto; }

.qp-shot__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gap-5);
  text-align: center;
  gap: var(--gap-2);
}
.qp-shot__label {
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
}
.qp-shot__title {
  font-size: var(--fs-15);
  color: var(--ink-2);
  font-weight: 600;
  max-width: 32ch;
  line-height: 1.4;
}
.qp-shot__path {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--muted);
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  user-select: all;
}
.qp-shot__icon {
  width: 32px; height: 32px;
  color: var(--brand);
  opacity: 0.6;
}
.qp-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qp-shot--browser .qp-shot__chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  z-index: 2;
}
.qp-shot--browser .qp-shot__chrome::before,
.qp-shot--browser .qp-shot__chrome::after,
.qp-shot--browser .qp-shot__chrome span {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}
.qp-shot--browser .qp-shot__inner { top: 28px; }
.qp-shot--browser img { top: 28px; height: calc(100% - 28px); }

/* Showcase grid for screens */
.qp-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-5);
}
.qp-gallery--3 { grid-template-columns: repeat(3, 1fr); }
.qp-gallery--asym {
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 820px) {
  .qp-gallery,
  .qp-gallery--3,
  .qp-gallery--asym { grid-template-columns: 1fr; }
}
.qp-shot-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-3);
}
.qp-shot-card h4 {
  margin: 0;
  font-size: var(--fs-15);
  font-weight: 600;
}
.qp-shot-card p {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--muted);
  line-height: 1.5;
}

/* ── Contact form ─────────────────────────────────────── */
.qp-form {
  display: grid;
  gap: var(--gap-4);
  padding: var(--gap-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
}
.qp-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-4);
}
@media (max-width: 720px) { .qp-form__row { grid-template-columns: 1fr; } }
.qp-field { display: flex; flex-direction: column; gap: 6px; }
.qp-field label {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--ink-2);
}
.qp-field label .qp-req { color: var(--brand); margin-left: 2px; }
.qp-field input,
.qp-field select,
.qp-field textarea {
  font: inherit;
  font-size: var(--fs-14);
  padding: 10px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}
.qp-field input:focus,
.qp-field select:focus,
.qp-field textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.qp-field textarea { min-height: 140px; resize: vertical; }
.qp-field__hint {
  font-size: var(--fs-12);
  color: var(--muted);
}
.qp-form__actions {
  display: flex;
  gap: var(--gap-3);
  align-items: center;
  flex-wrap: wrap;
}
.qp-form__status {
  font-size: var(--fs-13);
  color: var(--muted);
}
.qp-form__status.is-ok { color: var(--ok); }
.qp-form__status.is-err { color: var(--danger); }

/* Direct-link cards beside the form */
.qp-contact-direct {
  display: grid;
  gap: var(--gap-3);
}
.qp-contact-direct__item {
  display: flex;
  gap: var(--gap-3);
  align-items: flex-start;
  padding: var(--gap-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  transition: border-color 0.15s ease;
}
.qp-contact-direct__item:hover { border-color: var(--brand-line); }
.qp-contact-direct__icon {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qp-contact-direct__icon svg { width: 16px; height: 16px; }
.qp-contact-direct__body h4 { margin: 0; font-size: var(--fs-14); font-weight: 600; }
.qp-contact-direct__body p { margin: 2px 0 0; font-size: var(--fs-13); color: var(--muted); }
.qp-contact-direct__body a { color: var(--brand); font-weight: 500; }

/* ── Lightbox ──────────────────────────────────────────
   Activates on click on any <img> inside a .qp-shot. */
.ql-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 7, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 32px;
}
html.ql-lb-open .ql-lightbox { display: flex; }
html.ql-lb-open { overflow: hidden; }
.ql-lightbox__fig {
  margin: 0;
  max-width: min(1400px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.ql-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: #111;
}
.ql-lightbox__cap {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  max-width: 60ch;
  line-height: 1.5;
}
.ql-lightbox__close,
.ql-lightbox__nav {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.ql-lightbox__close:hover,
.ql-lightbox__nav:hover { background: rgba(255, 255, 255, 0.18); }
.ql-lightbox__close:active,
.ql-lightbox__nav:active { transform: scale(0.95); }
.ql-lightbox__close {
  top: 16px;
  right: 16px;
}
.ql-lightbox__nav--prev { left: 16px; top: 50%; transform: translateY(-50%); }
.ql-lightbox__nav--next { right: 16px; top: 50%; transform: translateY(-50%); }
.ql-lightbox__nav--prev:active { transform: translateY(-50%) scale(0.95); }
.ql-lightbox__nav--next:active { transform: translateY(-50%) scale(0.95); }
.ql-lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.05em;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
@media (max-width: 720px) {
  .ql-lightbox { padding: 12px; }
  .ql-lightbox__nav { width: 38px; height: 38px; }
  .ql-lightbox__close { top: 12px; right: 12px; }
  .ql-lightbox__nav--prev { left: 8px; }
  .ql-lightbox__nav--next { right: 8px; }
}

/* ------------------------------------------------------------------------
 * Toast — used by the contact form for submit feedback.
 * Pure CSS + tiny JS helper (see contact.html). No deps.
 * ------------------------------------------------------------------------ */
.qp-toast-host {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.qp-toast {
  pointer-events: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--surface-3);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.25);
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.25s ease;
}
.qp-toast.is-show { transform: translateX(0); opacity: 1; }
.qp-toast--ok  { border-left-color: var(--ok); }
.qp-toast--err { border-left-color: var(--danger); }
.qp-toast__icon {
  flex: 0 0 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.qp-toast--ok  .qp-toast__icon { color: var(--ok); }
.qp-toast--err .qp-toast__icon { color: var(--danger); }
.qp-toast__body { flex: 1; min-width: 0; }
.qp-toast__title { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.qp-toast__msg { color: var(--muted); }
.qp-toast__close {
  background: none; border: 0; cursor: pointer;
  color: var(--muted); padding: 2px 6px; margin: -2px -6px -2px 4px;
  font-size: 18px; line-height: 1; border-radius: 6px;
}
.qp-toast__close:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 640px) {
  .qp-toast-host { top: 16px; right: 16px; left: 16px; max-width: none; }
}

/* Editions card — extra note clarifying the Enterprise name */
.ql-edition__note {
  margin: var(--gap-3) 0 0;
  padding: var(--gap-3) var(--gap-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  font-size: var(--fs-13);
  line-height: 1.55;
  color: var(--muted);
}
.ql-edition__note strong { color: var(--ink); }
.ql-edition__note em { font-style: italic; color: var(--ink); }
