/* ============================================================
   Documentation hub — extends styles.css
   ============================================================ */

body { background: var(--surface); }

/* ---------- Docs hero ---------- */
.docs-hero {
  background:
    radial-gradient(ellipse 760px 360px at 50% -20%, rgba(101, 46, 186, 0.14), transparent 62%),
    radial-gradient(ellipse 500px 260px at 85% 120%, rgba(255, 75, 147, 0.08), transparent 60%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
  text-align: center;
  position: relative;
}
.docs-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center, #000, transparent 72%);
  opacity: 0.3;
  pointer-events: none;
}
.docs-hero > .container { position: relative; z-index: 1; }
.docs-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 16px 0 12px;
}
.docs-hero .lede {
  font-size: 18px;
  color: var(--ink-3);
  max-width: 560px;
  margin: 0 auto 28px;
}

/* ---------- Search box ---------- */
.docs-search {
  max-width: 600px;
  margin: 0 auto;
}
.docs-search-control { position: relative; z-index: 2; }
.docs-search .field {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding-block: 4px;
  padding-inline: 18px 4px;
  box-shadow: var(--shadow-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.docs-search .field:focus-within {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(101, 46, 186, 0.12), var(--shadow-md);
}
.docs-search .field svg { width: 20px; height: 20px; color: var(--ink-4); flex: none; }
.docs-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 16px var(--bs-body-font-family);
  color: var(--ink-1);
  padding: 14px 14px;
}
.docs-search input::placeholder { color: var(--ink-4); }
.docs-search .field .go {
  background: var(--brand-gradient);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font: 600 14px var(--bs-body-font-family);
  cursor: pointer;
  flex: none;
}
.docs-search .field .go:hover { filter: brightness(1.06); }

.docs-search .hints {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-4);
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  align-items: center;
}
.docs-search .hints a {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.docs-search .hints a:hover { border-color: var(--brand-purple); color: var(--brand-purple); }

/* Live search suggestions — scoped to Docs so it cannot affect the
   WordPress search-results page. */
.docs-search-results {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 50;
  text-align: start;
  max-height: 380px;
  overflow-y: auto;
}
.docs-search-results[hidden] { display: none; }
.docs-search-results .sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink-2);
  text-decoration: none;
}
.docs-search-results .sr-item:hover,
.docs-search-results .sr-item.is-active { background: var(--surface-2); }
.docs-search-results .sr-item:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: -2px; }
.docs-search-results .sr-item .ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--brand-purple);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.docs-search-results .sr-item .ic svg { width: 16px; height: 16px; }
.docs-search-results .sr-item .t { font-size: 14px; font-weight: 600; color: var(--ink-1); }
.docs-search-results .sr-item .c { font-size: 12px; color: var(--ink-4); }
.docs-search-results .sr-empty { padding: 22px; text-align: center; font-size: 14px; color: var(--ink-4); }
.docs-search-results .sr-empty a { color: var(--brand-purple); font-weight: 600; }
.docs-search-results mark { background: rgba(101, 46, 186, 0.18); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Quick start strip ---------- */
.quickstart {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 0;
}
.qs-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.qs-card:hover { border-color: var(--brand-purple); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.qs-card .n {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--brand-gradient);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  flex: none;
}
.qs-card h3 { font-size: 15px; font-weight: 600; color: var(--ink-1); margin: 0 0 2px; font-family: var(--font-display); }
.qs-card p { font-size: 12.5px; color: var(--ink-4); margin: 0; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  height: 100%;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.cat-card:hover { border-color: color-mix(in oklab, var(--brand-purple) 32%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cat-card .ic {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--brand-purple);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.cat-card .ic svg { width: 24px; height: 24px; }
.cat-card h3 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.cat-card .meta { font-size: 12px; color: var(--ink-4); margin: 0 0 14px; }
.cat-card ul { list-style: none; padding: 0; margin: 0; }
.cat-card li { margin-bottom: 9px; }
.cat-card li:last-child { margin-bottom: 0; }
.cat-card li a {
  font-size: 14px;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.cat-card li a::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-4);
  flex: none;
}
.cat-card li a:hover { color: var(--brand-purple); }
.cat-card li a:hover::before { background: var(--brand-purple); }
.cat-card .more {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--brand-purple);
  margin-top: 14px;
}

/* ---------- Popular articles ---------- */
.popular {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}
.pop-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.pop-item:hover { border-color: var(--brand-purple); background: var(--surface-2); }
.pop-item .rank {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--ink-4);
  width: 26px; text-align: center; flex: none;
}
.pop-item .body { flex: 1; }
.pop-item h4 { font-size: 14.5px; font-weight: 600; color: var(--ink-1); margin: 0 0 1px; }
.pop-item .c { font-size: 12px; color: var(--ink-4); }
.pop-item .arr { color: var(--ink-4); flex: none; }
.pop-item:hover .arr { color: var(--brand-purple); }
.pop-item .arr svg { width: 16px; height: 16px; }

/* ---------- Video tutorials ---------- */
.tut-yt-all { display: inline-flex; align-items: center; margin-top: 20px; }
.tut-yt-all .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.tut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tut-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.tut-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tut-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2a1860, #1a0e3a);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
/* YouTube poster (lazy-loaded thumbnail) fills the 16:9 box behind the play button. */
.tut-thumb .tut-poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border: 0;
}
/* Scrim keeps the white play button legible on any poster. */
.tut-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,28,0.12), rgba(10,14,28,0.42));
  pointer-events: none;
}
.tut-thumb .play,
.tut-thumb .dur { position: relative; z-index: 1; }
.tut-thumb .play {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: var(--brand-purple);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform .2s ease;
}
.tut-card:hover .play { transform: scale(1.08); }
.tut-thumb .play svg { width: 24px; height: 24px; margin-inline-start: 3px; }
.tut-thumb .dur {
  position: absolute; inset-inline-end: 10px; bottom: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 5px;
}
.tut-body { padding: 16px 18px; }
.tut-body h4 { font-size: 15px; font-weight: 600; margin: 0 0 3px; }
.tut-body p { font-size: 12.5px; color: var(--ink-4); margin: 0; }
/* Only cards with a configured YouTube link are interactive. */
.tut-card:not(.is-playable) { cursor: default; }
.tut-card:not(.is-playable):hover { transform: none; box-shadow: none; }
.tut-card:not(.is-playable) .play { opacity: 0.55; }
.tut-card.is-playable:focus-visible { outline: 2px solid var(--brand-purple); outline-offset: 2px; }

/* ---------- Video lightbox ---------- */
.ws-video-modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ws-video-modal[hidden] { display: none; }
.ws-video-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 14, 28, 0.72);
  backdrop-filter: blur(6px);
}
.ws-video-frame {
  position: relative;
  width: 100%; max-width: 900px;
  animation: ws-video-pop .25s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes ws-video-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.ws-video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 100px rgba(10, 14, 28, 0.6);
}
.ws-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ws-video-close {
  position: absolute; top: -14px; inset-inline-end: -14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-1);
  border: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.ws-video-close:hover { background: var(--surface-2); }
.ws-video-close svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .ws-video-close { top: 8px; inset-inline-end: 8px; }
}

/* ---------- Help CTA ---------- */
.help-cta {
  background: var(--ink-1);
  border-radius: var(--radius-xl);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.help-cta::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 12% 120%, rgba(101,46,186,0.6), transparent 55%),
              radial-gradient(circle at 90% -20%, rgba(255,75,147,0.3), transparent 55%);
}
.help-cta > * { position: relative; }
.help-cta h2 { color: #fff; font-size: 28px; margin: 0 0 6px; }
.help-cta p { color: #c8ceda; font-size: 15px; margin: 0; max-width: 460px; }
.help-cta .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.help-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.3); }
.help-cta .btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .quickstart, .cat-grid, .tut-grid { grid-template-columns: 1fr 1fr; }
  .popular { grid-template-columns: 1fr; }
  .help-cta { grid-template-columns: 1fr; text-align: center; padding: 36px 24px; }
  .help-cta .actions { justify-content: center; }
}
@media (max-width: 600px) {
  .quickstart, .cat-grid, .tut-grid { grid-template-columns: 1fr; }
  .docs-search .field .go { padding: 11px 14px; }
}
