/* ─────────────────────────────────────────────
   LyttonOS_AI.css — Lytton Studio
   30-Aug-2026
   Loaded via $extra_css by LyttonOS_Input.php

   The page runs the API call in the browser, so
   there are three states on one page: form,
   spinner, result.
────────────────────────────────────────────── */

/* ── Compact hero ── */

.lyttonos-hero {
  margin-bottom: 0.5rem;
}

.lyttonos-hero .hero-eyebrow {
  margin-bottom: 0.25rem;
}

.lyttonos-hero .hero-title {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  line-height: 1.15;
}

/* ── State switching ── */

[hidden] {
  display: none !important;
}

/* ── Form grid ── */

.lyttonos-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 0.75rem;
  align-items: start;
}

.lyttonos-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lyttonos-form label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.lyttonos-form textarea,
.lyttonos-form input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border: 1px solid #c9c9c4;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}

.lyttonos-form textarea {
  resize: vertical;
  height: clamp(140px, 34vh, 400px);
}

.lyttonos-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.lyttonos-key {
  flex: 1 1 22rem;
  min-width: 0;
}

.lyttonos-form button[type="submit"],
.lyttonos-restart {
  flex: 0 0 auto;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.lyttonos-notes {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
  line-height: 1.5;
}

/* ── Text-style button, for Clear saved text ── */

.lyttonos-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.lyttonos-linkbtn:hover,
.lyttonos-linkbtn:focus {
  text-decoration: none;
}

/* ── Spinner — the compass logo, turning ── */

.lyttonos-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 40vh;
  text-align: center;
}

.lyttonos-spinner {
  width: 72px;
  height: 72px;
  animation: lyttonos-turn 2.4s linear infinite;
}

@keyframes lyttonos-turn {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.lyttonos-loading-text {
  margin: 0;
  font-weight: 600;
}

.lyttonos-loading-sub {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.lyttonos-elapsed {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .lyttonos-spinner {
    animation-duration: 8s;
  }
}

/* ── Result ── */

.result-cv {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 1rem;
  background: #f7f7f5;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-error {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid #b03030;
  background: #fdf3f3;
}

.result-error h3 {
  margin-top: 0;
}

.result-error pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

.result-changes li,
.result-gaps li {
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.result-note {
  font-style: italic;
  opacity: 0.8;
  font-size: 0.9rem;
}

.result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── Short screens ── */

@media (max-height: 800px) {
  .lyttonos-form textarea {
    height: clamp(120px, 28vh, 260px);
  }
  .lyttonos-hero .hero-title {
    font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  }
}

/* ── Mobile ── */

@media (max-width: 760px) {
  .lyttonos-form {
    grid-template-columns: 1fr;
  }
  .lyttonos-form textarea {
    height: 9rem;
  }
  .lyttonos-form button[type="submit"] {
    width: 100%;
  }
  .result-cv {
    font-size: 0.9rem;
    padding: 0.75rem;
  }
}

/* ─────────────────────────────────────────────
   Result layout — added 06-Sep-2026
   The result mirrors the form: inputs on the left,
   targeted CV on the right, analysis underneath.
────────────────────────────────────────────── */

.lyttonos-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5rem;
  row-gap: 1rem;
  align-items: start;
}

.lyttonos-result-grid h3 {
  margin-top: 0;
}

/* ── Left column: the inputs, as pasted ── */

.lyttonos-echo summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0;
}

.lyttonos-echo-pre {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-y: auto;
  max-height: 22rem;
  margin: 0.35rem 0 0.75rem;
  padding: 0.75rem;
  background: #f2f2ef;
  border: 1px solid #dcdcd6;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.5;
}

.lyttonos-echo-note {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ── Analysis block, full width under the two columns ── */

.lyttonos-analysis {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #dcdcd6;
}

.lyttonos-usage {
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ── Buttons ── */

.lyttonos-btn {
  flex: 0 0 auto;
  padding: 0.65rem 1.5rem;
  min-height: 44px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Visible keyboard focus, WCAG 2.2 AA ── */

.lyttonos-btn:focus-visible,
.lyttonos-linkbtn:focus-visible,
.lyttonos-echo summary:focus-visible,
.result-cv:focus-visible,
.lyttonos-form textarea:focus-visible,
.lyttonos-form input:focus-visible {
  outline: 3px solid #1a1a1a;
  outline-offset: 2px;
}

#lyttonos-result:focus {
  outline: none;
}

/* ── Mobile ── */

@media (max-width: 760px) {
  .lyttonos-result-grid {
    grid-template-columns: 1fr;
  }
  .lyttonos-echo-pre {
    max-height: 14rem;
  }
  .lyttonos-btn {
    width: 100%;
  }
}

/* ── Print, and Save as PDF ──
   Leave the targeted CV on the page and nothing else. ── */

@media print {
  header, nav, footer,
  .hero-section,
  .lyttonos-form,
  .lyttonos-loading,
  .lyttonos-echo,
  .result-actions,
  .lyttonos-summary,
  .lyttonos-analysis,
  .lyttonos-notes {
    display: none !important;
  }
  .lyttonos-result-grid {
    display: block;
  }
  .result-cv {
    background: none;
    padding: 0;
    font-size: 11pt;
    line-height: 1.4;
    border: none;
  }
}

/* ── Summary card — sits above the targeted CV in the right column ── */

.lyttonos-summary {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  background: #f2f4f0;
  border: 1px solid #d8ddd3;
  border-left: 4px solid #3d5a3d;
  border-radius: 4px;
}

.lyttonos-fit {
  margin: 0;
  font-size: 1.05rem;
}

.lyttonos-fit-reason {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.lyttonos-summary h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lyttonos-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.lyttonos-summary li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.lyttonos-summary .result-note {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
}

/* ── Three columns on desktop: inputs · targeted CV · summary ──
   The summary column is sticky, so the changes stay on screen while a long
   CV scrolls past. Below 1100px it collapses to one column, summary first. */

@media (min-width: 1100px) {
  .lyttonos-result-grid-3 {
    grid-template-columns: 1fr 1.5fr 1fr;
  }
  /* Not sticky: the summary can be taller than the screen, and a pinned
     column taller than the viewport cannot be scrolled to read. */
}

@media (max-width: 1099px) {
  .lyttonos-result-grid-3 {
    grid-template-columns: 1fr;
  }
  .lyttonos-result-grid-3 .lyttonos-summary-col { order: 1; }
  .lyttonos-result-grid-3 .lyttonos-cv-col      { order: 2; }
  .lyttonos-result-grid-3 .lyttonos-echo        { order: 3; }
}

/* ── Second score, and the job-description phrases behind it ── */

.lyttonos-fit-second {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid #d8ddd3;
}

.lyttonos-signals {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  list-style: none;
}

.lyttonos-signals li {
  margin-bottom: 0.3rem;
  padding-left: 0.6rem;
  border-left: 2px solid #b9c4b3;
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.45;
  opacity: 0.85;
}

/* ─────────────────────────────────────────────
   Page width — this page only
   The shared .about-grid reserves a 1fr sidebar column that this page
   never fills, so a third of a wide monitor sat empty. Dropping the grid
   here gives the content the full column, and the caps below let it use
   a large screen instead of stopping at the site default.
────────────────────────────────────────────── */

.lyttonos-page {
  display: block;
}

@media (min-width: 80rem) {
  .main-content:has(.lyttonos-page) { max-width: 92rem; }
}

@media (min-width: 100rem) {
  .main-content:has(.lyttonos-page) { max-width: 108rem; }
}

@media (min-width: 120rem) {
  .main-content:has(.lyttonos-page) { max-width: 124rem; }
}

/* ── Which level the match fit was scored against ── */

.lyttonos-level {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
}

/* ── Unfinished CV warning — sits above the score ── */

.lyttonos-placeholders,
.lyttonos-inconsistencies {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #fdf6e8;
  border: 1px solid #e2d3ad;
  border-left: 4px solid #b58900;
  border-radius: 4px;
}

.lyttonos-placeholders h4,
.lyttonos-inconsistencies h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.lyttonos-placeholders p,
.lyttonos-inconsistencies p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.lyttonos-placeholders ul,
.lyttonos-inconsistencies ul {
  margin: 0;
  padding-left: 1.2rem;
}

.lyttonos-placeholders li,
.lyttonos-inconsistencies li {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1.45;
}

/* Contradictions read differently from unfinished text — blue, not amber */
.lyttonos-inconsistencies {
  background: #eef3f8;
  border-color: #c3d4e4;
  border-left-color: #35618f;
}
