/* laptop.css - the laptop-and-up layout (JOB 6, LAPTOP.md, night of 23 Nov 2026).
   Inese: the pages were built for a phone and sat in one third of a laptop
   screen; from 900px up the content must use the width well.
   EVERY rule here sits inside one @media (min-width: 900px) block, so the
   approved phone look (under 900px) is byte-for-byte what it was.
   Colours come only from the pages' own tokens (STYLE.md), so all four colour
   sets (Bright, Midnight, Forest, Sunset) and dark mode keep working. */

@media (min-width: 900px) {

  /* ---- the frame: one width for the top bar, the menu and the content ----
     about 1180px at 1366, about 890px at 1024, capped at 1400 on wide screens */
  :root { --lap: min(1400px, 87vw); }
  .bar-in, .vibes, .sm-in, .wrap { max-width: var(--lap); margin-inline: auto; }

  /* the site menu under the top bar: the three groups sit in one row, each
     taking its share, the account block on the right - same width as the bar */
  .sm-in { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 22px; padding: 14px 16px 16px; }
  .sm-g { flex: 1 1 200px; }
  .sm-acct { border-top: 0; padding-top: 0; margin-left: auto; flex: 0 1 260px; }

  /* ---- the tool pages: cards in two equal columns, reading order kept -----
     heroes, group titles, dark talk boxes, footers, wide parts and the long
     comparison blocks span both columns; everything else flows two a row */
  body[data-page]:not([data-page="quick-look"]):not([data-page="stages"]):not([data-page="landing"]):not([data-page="privacy"]) .wrap {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  }
  .wrap > .hero, .wrap > .section-title, .wrap > .talk, .wrap > .foot,
  .wrap > .job, .wrap > .hubSets, .wrap > [id="sections"],
  .wrap > [id="moneyCards"] { grid-column: 1 / -1; }

  /* a card that holds something long - a table, a step path of money tiles,
     the subject columns, a side-by-side compare - uses the full width */
  .wrap > .card:has(table), .wrap > .card:has(.faPay),
  .wrap > .card:has(#colBox), .wrap > .card:has(.cmp2),
  .wrap > .card:has(.routes4), .wrap > .card:has(.cmpGrid) { grid-column: 1 / -1; }
  .wrap table { width: 100%; }
  .st-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* a card alone between two full-width rows fills its row (no empty half) */
  .wrap > :is(.hero, .section-title, .talk, .job, .hubSets) + .card:has(+ :is(.section-title, .talk, .job, .foot, .hubSets, #sections, #moneyCards)),
  .wrap > .card:has(#colBox) + .card:has(+ :is(.section-title, .talk, .foot)),
  .wrap > .section-title + .card + .card + .card:has(+ :is(.section-title, .talk, .foot)) { grid-column: 1 / -1; }
  #mfpTold > .section-title { grid-column: 1 / -1; }
  #mfpTold > .st-full { grid-column: 1 / -1; }
  #mfpTold > .card:nth-child(even):last-child { grid-column: 1 / -1; }
  .wrap > .hero:first-child { padding-top: 18px; }
  .hero:has(> .fox-av) { min-height: 172px; padding-right: 190px; }
  .hero > .fox-av { position: absolute; right: 16px; bottom: -8px; max-width: 160px; max-height: 172px; margin: 0; }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-screen { padding-top: 18px; }

  /* the JS-filled stacks: CV parts, apprenticeship kinds, personal-statement
     questions and the interview practice sets go two a row (their own inline
     flex is overridden here only at this width) */
  [id="flow"], [id="parts"], [id="questions"], .hubSets {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px; align-items: start; flex-direction: row !important;
  }
  /* the cover letter is one running piece of writing (advert, notes, the
   letter itself) - it stays one full-width column */
  body[data-page="cover-letter"] [id="parts"] {
    grid-template-columns: minmax(0, 1fr); display: block !important;
  }

  /* long text blocks keep a readable line (about 70 characters) */
  .wrap .card p, .wrap .card .sub, .talk p, .wrap > .card li {
    max-width: 70ch;
  }

  /* small cards go three a row: job cards and job grids */
  .jobs { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* ---- headings and buttons sized for a laptop ---- */
  .hero h1 { font-size: clamp(2.4rem, 3vw, 3.1rem); }
  .hero p { font-size: 1.06rem; max-width: 62ch; }
  .wrap .btn { font-size: 1rem; padding: 9px 20px; }
  .wrap .ql-big { font-size: 1.08rem; padding: 13px 26px; }

  /* keyboard: the house focus ring stays, hover states get a little firmer */
  .wrap .btn:hover { border-color: var(--pop, var(--mfp-pop)); }
  .wrap .card button:focus-visible, .wrap .btn:focus-visible { outline-offset: 2px; }

  /* ---- panels: wider on the right ---- */
  .panel { width: min(30rem, 100%); }
  .mfp-spanel { width: min(26rem, 100vw); }

  /* ---- the Quick look: one question at a time, centred, fox alongside ---- */
  body:is([data-page="quick-look"],[data-page="stages"]) .wrap { display: flex; flex-direction: column; }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-screen:not([hidden]) {
    width: 100%; max-width: 44rem; margin-inline: auto;
  }
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-spark:not([hidden]),
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-change:not([hidden]) { max-width: 68rem; }
  /* bigger answer buttons, side by side in a row */
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-answers {
    flex-direction: row; flex-wrap: wrap; gap: 12px;
  }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-opt {
    flex: 1 1 0; min-width: 138px; min-height: 72px; padding: 14px 18px;
  }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-opt b { font-size: 1.18rem; }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-opt span { font-size: 1rem; }
  body:is([data-page="quick-look"],[data-page="stages"]) .ql-qtext { font-size: 1.7rem; }
  /* the fox sits beside the question, inside the centred card, never on text */
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-q .ql-qtext,
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-subs .ql-qtext {
    position: relative; padding-right: 200px; min-height: 168px;
    display: flex; align-items: center;
  }
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-q .ql-qtext::after,
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-subs .ql-qtext::after {
    content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 180px; height: 168px;
    background: var(--qfox, url(/fox/fox3d-checks.webp)) center / contain no-repeat; animation: foxbob 4.5s ease-in-out infinite;
  }
  /* the results screens use the width: three job cards a row */
  body:is([data-page="quick-look"],[data-page="stages"]) #ql-jobs-body .jobs { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* ---- the landing: hero beside its text, three part cards in one row ---- */
  body[data-page="landing"] .top-in, body[data-page="landing"] .vibes,
  body[data-page="landing"] .hero, body[data-page="landing"] .wrap,
  body[data-page="landing"] .band-in, body[data-page="landing"] footer {
    max-width: var(--lap); margin-inline: auto;
  }
  body[data-page="landing"] .hero {
    display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 20px; align-items: center; padding-block: 20px 0;
  }
  body[data-page="landing"] .hero-pic { height: 100%; }
  body[data-page="landing"] .hero-pic img {
    aspect-ratio: auto; height: 100%; min-height: 420px; object-position: 50% 45%;
  }
  body[data-page="landing"] .welcome {
    margin-top: 0; max-width: none; grid-template-columns: minmax(0, 1fr) 160px;
  }
  body[data-page="landing"] .welcome h1 { font-size: clamp(2.5rem, 3.4vw, 3.4rem); }
  body[data-page="landing"] .hello { max-width: 170px; }
  body[data-page="landing"] .age { width: min(30rem, calc(100vw - 32px)); }

  /* the three part cards in one row: the two .parts stacks open out into the
     main grid, so parts 1, 2 and 3 land side by side in reading order */
  body[data-page="landing"] main {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
    max-width: var(--lap); margin-inline: auto; padding-inline: 16px;
  }
  body[data-page="landing"] main > .hero { width: calc(100% + 32px); max-width: none; margin-inline: -16px; padding-inline: 16px; }
  body[data-page="landing"] main > * { grid-column: 1 / -1; min-width: 0; }
  body[data-page="landing"] main > .wrap.parts { display: contents; }
  /* the "Three parts" heading line: auto margins would shrink it to its text,
     so it stretches like the rows below it */
  body[data-page="landing"] main > .wrap:not(.parts) {
    margin-inline: 0; justify-self: stretch; padding-inline: 0;
  }
  body[data-page="landing"] main > .wrap.parts > .part { margin: 0; }
  body[data-page="landing"] .part, body[data-page="landing"] .part.flip {
    grid-template-columns: minmax(0, 1fr); align-items: start;
  }
  body[data-page="landing"] .part h2 { font-size: 1.7rem; }
  body[data-page="landing"] .gap-top { margin-top: 0; }
  body[data-page="landing"] .band {
    margin-top: 26px; width: 100%; max-width: none; border: 2px solid var(--line); border-radius: 26px;
  }
  body[data-page="landing"] .band-in {
    grid-template-columns: minmax(0, 1fr); text-align: center;
  }

  /* ---- the privacy page: a reading page in two 70-character columns ---- */
  body[data-page="privacy"] main {
    max-width: var(--lap); display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px;
  }
  body[data-page="privacy"] main > :not(section) { grid-column: 1 / -1; }
  body[data-page="privacy"] main section p,
  body[data-page="privacy"] main section li { max-width: 70ch; }

}
