/* WeSearch Press — mobile newspaper, not a squeezed desktop.
   Changes: reorder lockup (lead → stacks → briefs); 5-col dock with Menu visible;
   compact flag + 40px section rail; 28–34px lead / 160px plate; briefs 16px;
   scrollable skyline; 2-col across tiles, hide .tc-mark; 1-col wire; ink/red
   contrast; 64px dock clearance; keep #side-nav / .mobile-bottom-nav dead;
   44px tap targets. */

@media (max-width: 959px) {
  /* --- Page: dock clearance, no pale type on paper --- */
  html[data-layout="press"] body {
    padding-bottom: 64px !important;
    color: var(--press-ink);
  }

  html[data-layout="press"] #frontpage,
  html[data-layout="press"] #frontpage.press-sheet-wrap,
  html[data-layout="press"] .press-sheet,
  html[data-layout="press"] .broadsheet-form,
  html[data-layout="press"] .latest-section {
    color: var(--press-ink);
    overflow-x: hidden;
  }

  html[data-layout="press"] .press-sheet {
    padding: 0 12px 24px;
  }

  /* --- Compact flag: 36px seal, 20px word, one-row search, no deck/folio --- */
  html[data-layout="press"] header.press-mast,
  html[data-layout="press"] header.ws-header.press-mast {
    position: sticky !important;
    top: 0;
    z-index: 44;
  }

  html[data-layout="press"] .press-flag {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "mark search tools";
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--press-paper);
    position: sticky;
    top: 0;
    z-index: 43;
  }

  html[data-layout="press"] .press-mark {
    grid-area: mark;
    gap: 8px;
  }

  html[data-layout="press"] .press-mark img,
  html[data-layout="press"] .ws-brand img {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
    flex: 0 0 36px !important;
  }

  html[data-layout="press"] .press-word-we,
  html[data-layout="press"] .ws-brand-name.press-word-we {
    font-size: 20px !important;
    line-height: 1 !important;
    color: var(--press-ink) !important;
  }

  html[data-layout="press"] .press-word-deck,
  html[data-layout="press"] .press-flag-folio {
    display: none !important;
  }

  html[data-layout="press"] .press-search,
  html[data-layout="press"] #search-form.press-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
  }

  html[data-layout="press"] .press-search .search-input,
  html[data-layout="press"] #search-form #search-input,
  html[data-layout="press"] #search-input {
    min-height: 44px;
    height: 44px;
    font-size: 16px;
    color: var(--press-ink) !important;
  }

  html[data-layout="press"] .press-tools {
    grid-area: tools;
    flex-wrap: nowrap;
    gap: 0;
  }

  html[data-layout="press"] .press-tools > a,
  html[data-layout="press"] .press-tools > button {
    min-width: 44px;
    min-height: 44px;
    color: var(--press-ink) !important;
  }

  /* --- Section rail: scroll topics; Pixel Canvas stays pinned --- */
  html[data-layout="press"] #press-sections {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    overflow: hidden;
    padding-right: 0;
  }

  html[data-layout="press"] .press-sec-scroll {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  html[data-layout="press"] .press-sec-scroll::-webkit-scrollbar {
    display: none;
  }

  html[data-layout="press"] #press-sections a,
  html[data-layout="press"] #press-sections button {
    flex: 0 0 auto;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 40px;
    white-space: nowrap;
    color: var(--press-paper) !important;
  }

  html[data-layout="press"] #press-sections a.press-sec-canvas {
    padding: 0 12px;
    font-size: 13px;
    background: #1A1612;
  }

  /* --- Dock: five equal columns, 13px, Menu unclipped --- */
  html[data-layout="press"] #press-dock {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    background: var(--press-paper);
    color: var(--press-ink);
    border-top: 2px solid var(--press-ink);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: visible;
  }

  html[data-layout="press"] #press-dock a,
  html[data-layout="press"] #press-dock button,
  html[data-layout="press"] #press-dock #press-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: auto;
    min-height: 48px;
    height: 48px;
    padding: 0 2px;
    margin: 0;
    border: 0;
    background: var(--press-paper);
    color: var(--press-ink);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    text-decoration: none;
    box-sizing: border-box;
    flex: none;
  }

  html[data-layout="press"] #press-dock .is-on {
    box-shadow: inset 0 -3px 0 var(--press-kicker);
  }

  /* --- Lockup: visual order lead → stacks → desk briefs --- */
  html[data-layout="press"] .lockup {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "lead"
      "second"
      "briefs";
    gap: 0;
    min-width: 0;
    max-width: 100%;
  }

  html[data-layout="press"] .col-lead {
    grid-area: lead;
    min-width: 0;
    max-width: 100%;
    padding: 0 0 14px;
    border: 0;
    border-bottom: 2px solid var(--press-ink);
  }

  html[data-layout="press"] .col-second {
    grid-area: second;
    min-width: 0;
    max-width: 100%;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--press-ink);
  }

  html[data-layout="press"] .col-briefs {
    grid-area: briefs;
    min-width: 0;
    max-width: 100%;
    padding: 12px 0 0;
    border: 0;
  }

  /* --- Lead: 28–34px hed, 160px plate/cut --- */
  html[data-layout="press"] .col-lead .lead-hed,
  html[data-layout="press"] .col-lead .lead-hed:link,
  html[data-layout="press"] .col-lead .lead-hed:visited {
    font-size: clamp(28px, 7.6vw, 34px) !important;
    line-height: 1.05;
    color: var(--press-ink) !important;
    overflow-wrap: break-word;
    word-break: break-word;
    min-height: 44px;
  }

  html[data-layout="press"] .lead-deck {
    font-size: 16px;
    line-height: 1.35;
    color: var(--press-ink);
    margin: 8px 0 12px;
  }

  html[data-layout="press"] .lead-cut,
  html[data-layout="press"] .lead-cut .cut-link {
    display: block;
    max-height: 160px;
    overflow: hidden;
  }

  html[data-layout="press"] .lead-cut img.lead-img,
  html[data-layout="press"] img.lead-img,
  html[data-layout="press"] .col-lead .lead-img {
    height: 160px !important;
    max-height: 160px !important;
    width: 100%;
    object-fit: cover;
  }

  html[data-layout="press"] .lead-cut .ws-plate,
  html[data-layout="press"] .col-lead .ws-plate,
  html[data-layout="press"] .lead-plate {
    height: 160px !important;
    max-height: 160px !important;
    width: 100%;
  }

  /* --- Briefs: 16px type, 12px pad, no right-edge overflow --- */
  html[data-layout="press"] .briefs-flag {
    color: var(--press-kicker);
    padding: 6px 12px;
    margin: 0 0 4px;
  }

  html[data-layout="press"] .brief {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  html[data-layout="press"] .brief-num {
    font-size: 16px;
    line-height: 1.2;
    color: var(--press-kicker);
  }

  html[data-layout="press"] .brief-body {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  html[data-layout="press"] .brief-src {
    color: var(--press-kicker);
  }

  html[data-layout="press"] .brief-hed {
    font-size: 16px;
    line-height: 1.2;
    color: var(--press-ink);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  html[data-layout="press"] .stack {
    min-height: 44px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  html[data-layout="press"] .stack-hed {
    font-size: 20px;
    color: var(--press-ink);
    overflow-wrap: break-word;
  }

  html[data-layout="press"] .stack-dek {
    color: var(--press-ink);
  }

  /* --- Skyline: horizontal scroll, readable type --- */
  html[data-layout="press"] .skyline {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px 12px;
    scrollbar-width: thin;
  }

  html[data-layout="press"] .sky-item,
  html[data-layout="press"] .broadsheet-form a.sky-item,
  html[data-layout="press"] .broadsheet-form a.sky-item:link,
  html[data-layout="press"] .broadsheet-form a.sky-item:visited {
    flex: 0 0 auto;
    min-width: 168px;
    max-width: 220px;
    min-height: 44px;
    font-size: 13px;
    line-height: 1.25;
    padding: 8px 12px;
    color: var(--press-paper) !important;
  }

  html[data-layout="press"] .sky-item b {
    font-size: 9px;
    color: var(--press-kicker);
  }

  /* --- Across tiles: 2-col, 80px plates, no monograms --- */
  html[data-layout="press"] .under {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
  }

  html[data-layout="press"] .under-col {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--press-ink);
    box-sizing: border-box;
  }

  html[data-layout="press"] .under-col img,
  html[data-layout="press"] .under-img,
  html[data-layout="press"] .under-col .ws-plate {
    height: 80px !important;
    max-height: 80px !important;
    aspect-ratio: auto;
    margin-bottom: 8px;
  }

  html[data-layout="press"] .under-hed {
    font-size: 16px;
    line-height: 1.15;
    color: var(--press-ink);
    overflow-wrap: break-word;
  }

  html[data-layout="press"] .under-col .tc-mark,
  html[data-layout="press"] .lead-cut .tc-mark,
  html[data-layout="press"] .ws-plate .tc-mark,
  html[data-layout="press"] .tc-mark {
    display: none !important;
  }

  /* --- Wire: single column, source / hed / time --- */
  html[data-layout="press"] .late-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 44px;
    padding: 10px 0;
    box-sizing: border-box;
  }

  html[data-layout="press"] .late-row .kicker {
    order: 1;
    color: var(--press-kicker);
  }

  html[data-layout="press"] .late-hed {
    order: 2;
    font-size: 16px;
    line-height: 1.2;
    color: var(--press-ink);
    overflow-wrap: break-word;
  }

  html[data-layout="press"] .late-time {
    order: 3;
    text-align: left;
    color: var(--press-kicker);
  }

  /* --- Contrast on paper: ink or red only --- */
  html[data-layout="press"] .kicker,
  html[data-layout="press"] .section-flag,
  html[data-layout="press"] .section-flag span,
  html[data-layout="press"] .briefs-flag,
  html[data-layout="press"] .brief-src,
  html[data-layout="press"] .brief-num,
  html[data-layout="press"] .ws-plate-brand {
    color: var(--press-kicker);
  }

  html[data-layout="press"] .lead-hed,
  html[data-layout="press"] .lead-deck,
  html[data-layout="press"] p.lead-deck,
  html[data-layout="press"] .col-lead .lead-deck,
  html[data-layout="press"] .stack-hed,
  html[data-layout="press"] .stack-dek,
  html[data-layout="press"] .under-hed,
  html[data-layout="press"] .brief-hed,
  html[data-layout="press"] .late-hed,
  html[data-layout="press"] .ws-plate,
  html[data-layout="press"] .ws-plate-folio,
  html[data-layout="press"] .latest-section .ed-section-kicker,
  html[data-layout="press"] .latest-section .ed-section-meta,
  html[data-layout="press"] #feed-status,
  html[data-layout="press"] .press-sheet .text-mute,
  html[data-layout="press"] .broadsheet-form .text-mute,
  html[data-layout="press"] .latest-section .text-mute {
    color: var(--press-ink) !important;
  }

  html[data-layout="press"] .section-flag i {
    background: var(--press-ink);
    box-shadow: 0 2px 0 var(--press-ink);
  }

  /* --- Legacy chrome stays dead --- */
  html[data-layout="press"] #side-nav,
  html[data-layout="press"] aside#side-nav,
  html[data-layout="press"] .mobile-bottom-nav,
  html[data-layout="press"] nav.mobile-bottom-nav,
  html[data-layout="press"] .mobile-tab-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
}
