/* e4-picker.css: LANE C passage picker (section 110, PK1; BAM14 LANE-C-PICKER.md; CA7 picker ruling; Bob 12:31 AM MT:
   "BOOKS ON LEFT ... TWO ROWS OF CHAPTER AND THEN VERSE NUMBERS ON RIGHT"). Applies only while js/e4/e4_picker.js has marked the dialog
   (.modal-content.e4pk, desktop >= 768 px): phones keep STEP's own picker. STEP's own elements are only restyled, never moved or removed:
   its 'Summary +' button, the type-in line and its words, the Current / New / Append switch and the X are left as they are (lane A owns
   the first three). Window width unchanged: STEP's .modal-content width is not touched. */
@media (min-width: 768px) {
  #passageSelectionModal .modal-content.e4pk {
    display: grid; grid-template-columns: 40% minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    height: calc(100vh - 56px); max-height: calc(100vh - 56px); overflow: hidden;
  }
  /* top to bottom (CA7; phone 0.4 handoff: type-in box at the top): X, the type-in line, the Current / New / Append switch, then books | chapters + verses.
     STEP's .modal-header only holds the X and the switch: its box is dissolved (display: contents) so each part gets its own row. */
  #passageSelectionModal .modal-content.e4pk > .modal-header { display: contents; }
  #passageSelectionModal .modal-content.e4pk > .modal-header > span.pull-right { grid-column: 1 / -1; grid-row: 1; justify-self: end; padding: 6px 14px 0 0; }
  #passageSelectionModal .modal-content.e4pk > .modal-header > br { display: none; }
  #passageSelectionModal .modal-content.e4pk > #enterYourPassage { grid-column: 1 / -1; grid-row: 2; }
  /* R3 MERGE: lane A's top bar (e4_topbar.js) wraps the type-in box with its label "Type ref:" in div.e4-typeref-line; the wrapper takes the box's place. */
  #passageSelectionModal .modal-content.e4pk > .e4-typeref-line { grid-column: 1 / -1; grid-row: 2; }
  #passageSelectionModal .modal-content.e4pk > #e4PhoneSelects { grid-column: 1 / -1; grid-row: 2; }
  #passageSelectionModal .modal-content.e4pk > .modal-header > #displayLocForm { grid-column: 1 / -1; grid-row: 3; float: none !important; clear: none !important; justify-self: end; margin: 2px 16px 4px 0; }
  #passageSelectionModal .modal-content.e4pk > .footer { grid-column: 1 / -1; grid-row: 5; }
  #passageSelectionModal .e4pk #pssgModalBackButton { display: none !important; }
  /* the 'Pick a verse too' tick box GOES (Bob 12:31 AM MT): hidden here, kept in STEP's DOM because STEP's own chapter click reads it */
  #passageSelectionModal .e4pk #modalonoffswitch { display: none !important; }
  /* while Done clicks STEP's own links, the dialog is not shown */
  #passageSelectionModal.e4pk-working .modal-content { visibility: hidden; }

  /* LEFT: STEP's own book tables, as a narrow grid */
  #passageSelectionModal .e4pk-books { grid-column: 1; grid-row: 4; min-height: 0; overflow-y: auto; padding: 0 6px 8px 14px; }
  #passageSelectionModal .e4pk-books #ot_header, #passageSelectionModal .e4pk-books #nt_header { display: block; margin: 10px 0 4px; font: 700 15px var(--e4r-sans, 'Source Sans 3', sans-serif); color: var(--e4r-mut, #7a7368); }
  #passageSelectionModal .e4pk-books #ot_table table, #passageSelectionModal .e4pk-books #nt_table table { display: block; width: 100%; }
  #passageSelectionModal .e4pk-books table colgroup { display: none; }
  #passageSelectionModal .e4pk-books table tbody { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  #passageSelectionModal .e4pk-books table tr { display: contents; }
  #passageSelectionModal .e4pk-books table td { display: block; padding: 0; min-width: 0; background: transparent !important; text-align: center; }
  #passageSelectionModal .e4pk-books table td a {
    display: block; padding: 5px 1px; border-radius: 6px; font: 600 13px/1.25 var(--e4r-sans, 'Source Sans 3', sans-serif);
    color: var(--e4r-acc, #8a4f1d); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  #passageSelectionModal .e4pk-books table td a:hover { background: var(--e4r-accs, #f3dfc6); }
  #passageSelectionModal .e4pk-books table td a.e4pk-on { background: var(--e4r-acc, #8a4f1d); color: #ffffff; }

  /* RIGHT: chapter numbers, then below them the verse numbers of the clicked chapter, then Done */
  #passageSelectionModal .e4pk-right { grid-column: 2; grid-row: 4; min-height: 0; display: flex; flex-direction: column; padding: 0 16px 8px 8px; border-left: 1px solid var(--e4r-line, #e4ded2); }
  #passageSelectionModal .e4pk-head { flex: 0 0 auto; margin: 10px 0 6px 6px; font: 700 15px var(--e4r-sans, 'Source Sans 3', sans-serif); color: var(--e4r-mut, #7a7368); min-height: 20px; }
  #passageSelectionModal .e4pk-chapters, #passageSelectionModal .e4pk-verses {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; align-content: start; overflow-y: auto;
  }
  #passageSelectionModal .e4pk-chapters { flex: 0 1 auto; max-height: 42%; }
  #passageSelectionModal .e4pk-verses { flex: 1 1 auto; min-height: 0; }
  #passageSelectionModal .e4pk-right a[data-n] {
    display: block; text-align: center; padding: 6px 0; border-radius: 6px; text-decoration: none;
    font: 600 14px/1.2 var(--e4r-sans, 'Source Sans 3', sans-serif); color: var(--e4r-acc, #8a4f1d); background: var(--e4r-paper, #fbf9f4); border: 1px solid var(--e4r-tan-line, #dccfae);
  }
  #passageSelectionModal .e4pk-right a[data-n]:hover { background: var(--e4r-accs, #f3dfc6); }
  #passageSelectionModal .e4pk-right a[data-n].e4pk-on { background: var(--e4r-acc, #8a4f1d); border-color: var(--e4r-acc, #8a4f1d); color: #ffffff; }
  #passageSelectionModal .e4pk a:focus-visible, #passageSelectionModal .e4pk-done:focus-visible { outline: 2px solid var(--e4r-acc, #8a4f1d); outline-offset: 2px; }
  #passageSelectionModal .e4pk-bar { flex: 0 0 auto; display: flex; justify-content: flex-end; padding-top: 8px; }
  #passageSelectionModal .e4pk-done.btn {
    font: 700 15px var(--e4r-sans, 'Source Sans 3', sans-serif); padding: 7px 28px; border-radius: 999px;
    background: var(--e4r-acc, #8a4f1d); border: 0; color: #ffffff; box-shadow: none;
  }
  #passageSelectionModal .e4pk-done.btn.e4pk-disabled { opacity: .45; cursor: default; }
}
