/**
 * Stafflancer Company & Landing Page V8 RC1.6
 * Tablet-only composition. 768px and 1024px are INCLUDED.
 * No desktop or mobile layout selectors are changed here.
 * Works with light/dark palette provided by frontend.css + contrast.css.
 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  /* Editorial headings: a full-width heading followed by its description.
     Avoid the former narrow first column and unintended mid-word wraps. */
  .stlcv8 .section-heading,
  .stlcv8 .lp-section-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    margin-bottom: 30px;
  }
  .stlcv8 .section-heading > div,
  .stlcv8 .section-heading > p,
  .stlcv8 .lp-section-intro > div,
  .stlcv8 .lp-section-intro > p {
    min-width: 0;
    width: 100%;
  }
  .stlcv8 .section-heading h2,
  .stlcv8 .lp-section-intro h2 {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
  }
  .stlcv8 .section-heading > p,
  .stlcv8 .lp-section-intro > p {
    max-width: 780px;
    margin: 0;
  }

  /* Three-up grids become two-up, with an odd final card filling row two.
     This also remains sensible when an editor adds/removes cards. */
  .stlcv8 .values-grid,
  .stlcv8 .impact-grid,
  .stlcv8 .work-grid,
  .stlcv8 .career-principles,
  .stlcv8 .lp-foundation-grid,
  .stlcv8 .lp-deliver-grid,
  .stlcv8 .lp-highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
  .stlcv8 .values-grid > :last-child:nth-child(odd),
  .stlcv8 .impact-grid > :last-child:nth-child(odd),
  .stlcv8 .work-grid > :last-child:nth-child(odd),
  .stlcv8 .career-principles > :last-child:nth-child(odd),
  .stlcv8 .lp-foundation-grid > :last-child:nth-child(odd),
  .stlcv8 .lp-deliver-grid > :last-child:nth-child(odd),
  .stlcv8 .lp-highlights-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .stlcv8 .values-grid > :last-child:nth-child(odd),
  .stlcv8 .lp-foundation-grid > :last-child:nth-child(odd),
  .stlcv8 .lp-deliver-grid > :last-child:nth-child(odd),
  .stlcv8 .lp-highlights-grid > :last-child:nth-child(odd) {
    min-height: 0;
  }
  .stlcv8 .lp-foundation-grid > :last-child:nth-child(odd) h3,
  .stlcv8 .lp-highlights-grid > :last-child:nth-child(odd) h3 {
    margin-top: 20px;
  }
  .stlcv8 .lp-foundation-grid > :last-child:nth-child(odd) .lp-card-bullets,
  .stlcv8 .lp-deliver-grid > :last-child:nth-child(odd) .lp-card-bullets,
  .stlcv8 .lp-highlights-grid > :last-child:nth-child(odd) .lp-card-bullets {
    max-width: 680px;
  }

  /* Four-step delivery processes use a balanced 2 × 2 tablet composition. */
  .stlcv8 .lp-process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stlcv8 .lp-process-grid::before { display: none; }

  /* Other split editorial sections were also too compressed on tablets. */
  .stlcv8 .story-grid,
  .stlcv8 .faq-layout,
  .stlcv8 .lp-faq-grid,
  .stlcv8 .lp-quality-grid,
  .stlcv8 .inquiry-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
  .stlcv8 .inquiry-section .inquiry-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }
  .stlcv8 .inquiry-section .inquiry-header > div { min-width: 0; }

  /* RC1.6: The two desktop sticky sidebars became stacked, but retained
     position:sticky from frontend.css. This kept the story heading fixed over
     scrolling paragraphs (and likewise risked FAQ overlap). Release them back
     to normal document flow ONLY while the tablet layouts are single-column. */
  .stlcv8 .editorial-story .story-intro,
  .stlcv8 .faq-layout .faq-side {
    position: static;
    top: auto;
    align-self: stretch;
  }
  .stlcv8 .editorial-story .story-grid > *,
  .stlcv8 .faq-layout > * {
    min-width: 0;
  }
  .stlcv8 .editorial-story .story-content {
    min-width: 0;
    position: relative;
  }
  .stlcv8 .editorial-story .story-index {
    margin-top: 26px;
  }
  .stlcv8 .editorial-story .story-first {
    margin-top: 22px;
    margin-bottom: 20px;
  }

  /* Team leadership: photo above biography, only in tablet range.
     Keep existing two leadership cards across and desktop/mobile rules intact. */
  .stlcv8 .leaders-grid-rich .person-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .stlcv8 .leaders-grid-rich .portrait {
    height: 245px;
    min-height: 0;
  }
  .stlcv8 .leaders-grid-rich .person-body { min-width: 0; }

  /* Balanced spacing inside the wider two-column layouts. */
  .stlcv8 .section-heading + :is(.values-grid,.impact-grid,.work-grid,.career-principles),
  .stlcv8 .lp-section-intro + :is(.lp-foundation-grid,.lp-deliver-grid,.lp-highlights-grid) {
    margin-top: 0;
  }
}
