/* intake-editorial.css — PRESS-EDITORIAL-002
   Full-viewport editorial experience for /generate
   Three steps as full-viewport screens. No scroll between steps.
   Loaded after base.css and intake.css.
   ─────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   §0  BODY / APP-LAYOUT OVERRIDES
   When the editorial intake is active, suppress the split-panel app-layout
   and let the intake fill the viewport below the topbar.
   ═══════════════════════════════════════════════════════════════════════════ */

body.app-generate .app-layout {
  display: block;
  position: relative;
}

body.app-generate .right-panel {
  display: none !important;
}

body.app-generate .left-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-right: none;
  overflow: visible;
  height: auto;
  padding: 0;
}

body.app-generate .generate-sticky {
  display: none !important;
}

body.app-generate .my-decks-panel,
body.app-generate .my-archived-panel,
body.app-generate .my-sessions-panel,
body.app-generate .deck-library-section,
body.app-generate .history-section,
body.app-generate .intake-advanced-link {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §1  INTAKE EDITORIAL WRAPPER
   ═══════════════════════════════════════════════════════════════════════════ */

.intake-editorial {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 56px); /* subtract topbar */
}

/* ═══════════════════════════════════════════════════════════════════════════
   §2  SCREEN SYSTEM
   Each screen occupies the full viewport. Only one active at a time.
   ═══════════════════════════════════════════════════════════════════════════ */

.intake-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: var(--bg, #0D0D14);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.intake-screen--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  z-index: 0;
}

.intake-screen--active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
  z-index: 1;
}

.intake-screen__inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 52px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Brief screen gets wider inner */
.intake-screen__inner--brief {
  max-width: 960px;
}

/* ── Screen head ──────────────────────────────────────────────────────────── */

.intake-screen__head {
  margin-bottom: 40px;
}

.intake-screen__question {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0;
}

.intake-screen__title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 0 0 4px;
}

/* ── Back button ──────────────────────────────────────────────────────────── */

.intake-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim, #6B7280);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}

.intake-back:hover {
  color: var(--text-muted, #9CA3AF);
}

/* ═══════════════════════════════════════════════════════════════════════════
   §3  SCREEN 1 — ARTIFACT PICKER
   Editorial single-column list. No grid. No cards. No background fills.
   Restaurant menu / premium table of contents energy.
   ═══════════════════════════════════════════════════════════════════════════ */

.artifact-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.artifact-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 20px;
  padding: 20px 0 20px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: border-left-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
  outline: none;
}

.artifact-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.artifact-item:hover {
  border-left-color: rgba(26, 110, 245, 0.35);
}

.artifact-item:focus-visible {
  border-left-color: var(--accent, #C9A84C);
  outline: none;
}

.artifact-item--selected {
  border-left-color: var(--accent, #C9A84C);
}

.artifact-item__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.02em;
  line-height: 1.3;
  flex-shrink: 0;
  min-width: 160px;
}

.artifact-item--selected .artifact-item__name {
  color: var(--accent, #C9A84C);
}

.artifact-item__desc {
  font-size: 0.85rem;
  color: var(--text-dim, #6B7280);
  line-height: 1.45;
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §4  SCREEN 2 — VOICE PICKER
   Same single-column editorial list. Suggested = inline label.
   Hidden/blocked items disappear entirely.
   ═══════════════════════════════════════════════════════════════════════════ */

.voice-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 36px;
}

.voice-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0 20px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-left-color 0.15s ease;
  outline: none;
}

.voice-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-item:hover {
  border-left-color: rgba(26, 110, 245, 0.35);
}

.voice-item:focus-visible {
  border-left-color: var(--accent, #C9A84C);
  outline: none;
}

.voice-item--selected {
  border-left-color: var(--accent, #C9A84C);
}

.voice-item--selected .voice-item__name {
  color: var(--accent, #C9A84C);
}

/* Hidden — incompatible voices simply disappear */
.voice-item--hidden {
  display: none !important;
}

.voice-item__name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* "→ Suggested" inline label — appears when voice-item--suggested is set */
.voice-item--suggested .voice-item__name::after {
  content: '→ Suggested';
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent, #C9A84C);
  opacity: 0.75;
  text-transform: none;
  font-style: normal;
}

.voice-item__desc {
  font-size: 0.85rem;
  color: var(--text-dim, #6B7280);
  line-height: 1.5;
}

/* ── Medium zone ──────────────────────────────────────────────────────────── */

.medium-zone {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.medium-zone--visible {
  max-height: 600px;
  opacity: 1;
}

.medium-zone__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #6B7280);
  margin: 0 0 12px 16px;
}

/* Medium list — same editorial single-column treatment, slightly tighter */
.medium-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 12px;
}

.medium-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0 14px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-left-color 0.15s ease;
  outline: none;
}

.medium-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.medium-item:hover:not(.medium-item--blocked) {
  border-left-color: rgba(26, 110, 245, 0.35);
}

.medium-item:focus-visible {
  border-left-color: var(--accent, #C9A84C);
  outline: none;
}

.medium-item--selected {
  border-left-color: var(--accent, #C9A84C);
}

.medium-item--selected .medium-item__label {
  color: var(--accent, #C9A84C);
}

/* Blocked mediums are completely hidden — don't show them */
.medium-item--blocked {
  display: none !important;
}

.medium-item--warn {
  /* Warn items remain visible but get a subtle amber left accent */
  border-left-color: rgba(245, 158, 11, 0.4);
}

.medium-item__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  min-width: 120px;
}

.medium-item__desc {
  font-size: 0.8rem;
  color: var(--text-dim, #6B7280);
  line-height: 1.4;
  flex: 1;
}

.medium-compat-note {
  font-size: 0.8rem;
  line-height: 1.5;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 4px;
}

.medium-compat-note:empty {
  display: none;
}

.medium-compat-note--warn {
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-muted, #9CA3AF);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.medium-compat-note--block {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger, #EF4444);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

/* ═══════════════════════════════════════════════════════════════════════════
   §5  SCREEN 3 — THE BRIEFING
   Textarea as writing surface. Minimal border, no form-field feel.
   Ambient progress: quiet single line, right-aligned below the textarea.
   ═══════════════════════════════════════════════════════════════════════════ */

.brief-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .brief-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Main brief column ────────────────────────────────────────────────────── */

.brief-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Writing surface — minimal, document-like */
.brief-textarea-editorial {
  width: 100%;
  box-sizing: border-box;
  min-height: 320px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  color: var(--text, #F9FAFB);
  font-size: 1.05rem;
  font-family: inherit;
  line-height: 1.7;
  padding: 4px 0 16px;
  resize: none;
  outline: none;
  transition: border-bottom-color 0.18s ease;
}

.brief-textarea-editorial::placeholder {
  color: rgba(156, 163, 175, 0.5);
  font-style: italic;
}

.brief-textarea-editorial:focus {
  border-bottom-color: rgba(26, 110, 245, 0.5);
}

/* Ambient: quiet single-line, right-aligned, below the textarea */
.brief-ambient-inline {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-dim, #6B7280);
  letter-spacing: 0.01em;
  padding: 4px 0;
  min-height: 1.2em;
}

.brief-ambient-inline--complete {
  color: var(--accent, #C9A84C);
}

/* ── File upload zone ─────────────────────────────────────────────────────── */

.brief-upload-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.brief-upload-btn {
  background: none;
  border: 1px dashed var(--border-idle, rgba(255,255,255,0.12));
  border-radius: 6px;
  color: var(--text-dim, #6B7280);
  font-size: 0.85rem;
  font-family: inherit;
  padding: 10px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.brief-upload-btn:hover {
  border-color: rgba(26, 110, 245, 0.4);
  color: var(--text-muted, #9CA3AF);
}

.brief-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brief-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(26, 110, 245, 0.06);
  border: 1px solid rgba(26, 110, 245, 0.15);
  border-radius: 5px;
  gap: 8px;
}

.brief-file-name {
  font-size: 0.8rem;
  color: var(--text-muted, #9CA3AF);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brief-file-remove {
  background: none;
  border: none;
  color: var(--text-dim, #6B7280);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}

.brief-file-remove:hover { color: var(--danger, #EF4444); }

.brief-source-confirm {
  font-size: 0.75rem;
  color: var(--text-dim, #6B7280);
  display: none;
}

.brief-source-confirm--visible {
  display: block;
}

/* ── Sidebar: CTA only (ambient moved inline below textarea) ──────────────── */

.brief-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
}

/* Legacy brief-ambient kept for JS compatibility — hidden in new layout */
.brief-ambient {
  display: none;
}

.brief-ambient__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim, #6B7280);
  margin-bottom: 8px;
}

.brief-ambient__progress {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted, #9CA3AF);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brief-ambient__progress--complete {
  color: var(--accent, #C9A84C);
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */

.intake-cta-wrap {
  display: flex;
  flex-direction: column;
}

.intake-cta-editorial {
  width: 100%;
  padding: 14px 20px;
  background: rgba(26, 110, 245, 0.12);
  border: 1.5px solid rgba(26, 110, 245, 0.25);
  border-radius: 10px;
  color: var(--text-muted, #9CA3AF);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
  outline: none;
}

.intake-cta-editorial:hover {
  background: rgba(26, 110, 245, 0.2);
  border-color: rgba(26, 110, 245, 0.45);
  color: var(--text, #F9FAFB);
}

.intake-cta-editorial--ready {
  background: var(--accent, #C9A84C);
  border-color: var(--accent, #C9A84C);
  color: #fff;
  box-shadow: 0 4px 20px rgba(26, 110, 245, 0.35);
}

.intake-cta-editorial--ready:hover {
  background: var(--accent-dim, #A88A3A);
  border-color: var(--accent-dim, #A88A3A);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26, 110, 245, 0.45);
}

/* ═══════════════════════════════════════════════════════════════════════════
   §6  BRIEFING CONVERSATION
   AI conversation zone that reveals below the brief layout.
   ═══════════════════════════════════════════════════════════════════════════ */

.briefing-conversation {
  margin-top: 40px;
  border-top: 1px solid var(--border-idle, rgba(255,255,255,0.08));
  padding-top: 28px;
  display: none;
}

.briefing-conversation--active {
  display: block;
}

.briefing-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.briefing-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 86%;
}

.briefing-msg--press {
  background: var(--bg-card, #1A1A2E);
  border: 1px solid var(--border-idle, rgba(255,255,255,0.08));
  color: var(--text-muted, #9CA3AF);
  align-self: flex-start;
}

.briefing-msg--user {
  background: rgba(26, 110, 245, 0.1);
  border: 1px solid rgba(26, 110, 245, 0.2);
  color: var(--text, #F9FAFB);
  align-self: flex-end;
}

/* Fix 5: sign-back-in link style */
.briefing-signin-link {
  color: var(--accent, #C9A84C);
  text-decoration: underline;
}

.briefing-signin-link:hover {
  color: #fff;
}

.briefing-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.briefing-input {
  flex: 1;
  background: var(--bg-card, #1A1A2E);
  border: 1.5px solid var(--border-idle, rgba(255,255,255,0.08));
  border-radius: 8px;
  color: var(--text, #F9FAFB);
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.5;
  padding: 10px 14px;
  resize: none;
  outline: none;
  transition: border-color 0.15s ease;
}

.briefing-input:focus {
  border-color: var(--accent, #C9A84C);
}

.briefing-send {
  padding: 0 18px;
  background: var(--accent, #C9A84C);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.briefing-send:hover { background: var(--accent-dim, #A88A3A); }
.briefing-send:disabled { opacity: 0.45; cursor: not-allowed; }

.briefing-skip-row {
  text-align: center;
}

.briefing-skip {
  background: none;
  border: none;
  color: var(--text-dim, #6B7280);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.briefing-skip:hover {
  color: var(--text-muted, #9CA3AF);
}

.briefing-ready-row {
  margin-top: 16px;
  text-align: center;
}

.briefing-ready-generate {
  display: inline-block;
  width: auto;
  min-width: 200px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §7  LEFT-SCROLL RESET (intake mount container)
   ═══════════════════════════════════════════════════════════════════════════ */

.left-scroll#intakeMount {
  overflow: visible !important;
  height: auto !important;
  padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §8  MOBILE GUARD
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  .intake-screen__inner {
    padding: 36px 20px 60px;
  }

  .brief-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .brief-sidebar {
    position: static;
  }

  .artifact-item {
    flex-direction: column;
    gap: 4px;
  }

  .artifact-item__name {
    min-width: unset;
  }

  .medium-item {
    flex-direction: column;
    gap: 3px;
  }

  .medium-item__label {
    min-width: unset;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   §9  SCREEN 0 — EDITORIAL LANDING (once-only intro)
   Full-viewport dark screen. Spacious, typographic, no chrome.
   Same design language as the generation overlay.
   ═══════════════════════════════════════════════════════════════════════════ */

.intake-screen--0 {
  align-items: center;
  justify-content: center;
  background: #0A0A12;
}

.intake-screen__inner--s0 {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding: 0 32px;
}

.intake-s0__headline {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  color: var(--text, #F9FAFB);
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 0;
  /* Subtle editorial gradient — same as gen-cover-title */
  background: linear-gradient(135deg, #F9FAFB 55%, #9CA3AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intake-s0__sub {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-dim, #6B7280);
  line-height: 1.65;
  margin: 0;
  max-width: 480px;
  letter-spacing: 0.005em;
}

.intake-s0__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--accent, #C9A84C);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  outline: none;
  margin-top: 8px;
}

.intake-s0__cta:hover {
  background: var(--accent-dim, #A88A3A);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(26, 110, 245, 0.45);
}

.intake-s0__cta:active {
  transform: translateY(0);
}

.intake-s0__cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(26, 110, 245, 0.35);
}

@media (max-width: 767px) {
  .intake-screen__inner--s0 {
    padding: 0 24px;
    gap: 22px;
  }

  .intake-s0__cta {
    width: 100%;
    justify-content: center;
  }
}
