/*
 * V9 PROVENANCE (WRITER-V9, merge of version 9; documentation only, no logic changed)
 * New file, patches V8C3 P1b (the rules) and P8 (text-align removed). Used by: js/f2513/form/selectbox.js, loaded
 *   by hooks/assets.php after states.css. Serves: owner answers 2026-12-01 12:16 and 12:30. Output: look only.
 */
/*
 * selectbox.css - the styled list component of form 2513/2 (task 3.1 of PLAN4; js/f2513/form/selectbox.js).
 * What it does: draws the field, the list, the logo box, and the yellow bold active row and field of the lists that
 * selectbox.js builds over a plain select.
 * Input: the elements div.f2513-sb (field and list) and the class f2513-sb-native on the hidden select.
 * Output: look only. Business purpose: owner decisions of 2026-12-01 (12:16, 11:41, 12:21, 12:30).
 * The yellow is the variable --f2513-editing-bg of states.css (#fffe7a); no second constant is made here.
 * Loaded after states.css (manifest of assets.php).
 */

:root {
  /* What: width and height of the logo box of a bank row and of the closed bank field; type: length; source: PLAN2
     B2 (a fixed square, the picture fits it by object-fit: contain); used by .f2513-sb-logo; purpose: the logos of
     36 and of 307 pixels look the same size and "other" has an empty box of the same size.
     Pending owner approval: the size 24px is a proposal. */
  --f2513-sb-logo: 24px;
  /* What: highest the open list grows before it scrolls; type: length; source: the style rule of the country list
     (200px, countries.js header); used by .f2513-sb-list. */
  --f2513-sb-list-h: 240px;
}

/* The plain select stays in the page as the value holder but takes no room and cannot be seen or clicked. */
.f2513-form select.f2513-sb-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  pointer-events: none;
}

/* The wrapper div.f2513-sb that selectbox.js puts around the field and the list; it is the positioning parent of the open list.
   Input: the element built by selectbox.js. Output: look only (V8C3 P1b). */
.f2513-form .f2513-sb {
  position: relative;
  display: block;
}

/* The box that holds the shown value (the input), the logo and the chevron; the chevron and the logo are positioned against it.
   Input: the element div.f2513-sb-field. Output: look only. */
.f2513-form .f2513-sb-field {
  position: relative;
  display: block;
}

/* The chevron of the list, on the left like the arrow of the plain list (base.css), drawn with the same variable. */
.f2513-form .f2513-sb-field::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 8px;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  background: var(--f2513-select-arrow) no-repeat center / 12px 8px;
  pointer-events: none;
}

/* The field: same box as the other controls (height 30, gray, light border). The width is the width of the column,
   never the width of the text, with an ellipsis, so a bold text can never widen or move the field (PLAN2 B4). */
.f2513-form .input-row .f2513-sb-input.f2513-sb-input {
  box-sizing: border-box;
  width: 100%;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  background-color: var(--f2513-field-bg);
  border: 1px solid var(--f2513-field-border);
  border-radius: 0;
  padding-left: 28px;
  padding-right: var(--f2513-icon-pad) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.f2513-form .input-row .f2513-sb-bank .f2513-sb-input.f2513-sb-input {
  padding-right: calc(var(--f2513-icon-pad) + var(--f2513-sb-logo) + 6px) !important;
  cursor: text;
}

/* The logo box of the closed bank field: inside the field on the right, left of the state icon. */
.f2513-form .f2513-sb-field > .f2513-sb-logo {
  position: absolute;
  top: 50%;
  right: var(--f2513-icon-pad);
  margin-top: calc(var(--f2513-sb-logo) / -2);
}

/* The fixed square of a bank logo (the size is the variable --f2513-sb-logo, pending owner approval). Input: span.f2513-sb-logo in a row or in the
   closed bank field. Output: look only; the same box is empty for "other", so the rows keep one height. */
.f2513-form .f2513-sb-logo {
  box-sizing: border-box;
  flex: 0 0 var(--f2513-sb-logo);
  width: var(--f2513-sb-logo);
  height: var(--f2513-sb-logo);
  overflow: hidden;
}

/* The logo picture (a bank file banks/<code>.png, P5) fits the square without changing its proportions. Input: the img that selectbox.js creates
   with the address built from F2513_DATA.bankLogoBase. Output: look only. */
.f2513-form .f2513-sb-logo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The field in use: yellow and bold. The state class of states.css (is-editing) and the focus itself both give it,
   so the field is yellow also when the states module did not run. */
.f2513-form .input-row.is-editing .f2513-sb-input.f2513-sb-input,
.f2513-form .f2513-sb-field:focus-within .f2513-sb-input.f2513-sb-input:not([aria-invalid="true"]) {
  background-color: var(--f2513-editing-bg) !important;
  font-weight: 700;
}

/* The open list. */
.f2513-form .f2513-sb-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  left: 0;
  box-sizing: border-box;
  max-height: var(--f2513-sb-list-h);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  background: var(--f2513-white, #fff);
  border: 1px solid var(--f2513-field-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* A closed list takes no room. Input: the hidden attribute that selectbox.js sets and removes. Output: look only. */
.f2513-form .f2513-sb-list[hidden] {
  display: none;
}

/* One row of the open list: the logo box and the text side by side. Input: li.f2513-sb-row. Output: look only; the click and the keys are handled in
   selectbox.js, which writes the chosen value to the original select. */
.f2513-form .f2513-sb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 8px;
  cursor: pointer;
}

/* The two layers of the text in one grid cell: the cell is as wide and as high as the bold text, so the bold of the
   active row changes neither the width nor the height of any row (PLAN2 B4). */
.f2513-form .f2513-sb-text {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.f2513-form .f2513-sb-t,
.f2513-form .f2513-sb-ghost {
  grid-area: 1 / 1;
  overflow-wrap: anywhere;
}

.f2513-form .f2513-sb-ghost {
  font-weight: 700;
  visibility: hidden;
  /* v42: the hidden bold copy keeps the width only. Its height is 0, so when it breaks into more lines than the shown text (the real cause of the
     empty last line of a row, measured on the branch list of Bank Poalim: the bold text is wider than the regular text and wraps while the
     regular one fits) the row is not made taller. */
  height: 0;
  overflow: hidden;
}

/* The row under the pointer or the arrow keys: yellow and bold (owner decision of 12:30; one class for both). */
.f2513-form .f2513-sb-row.is-active {
  background-color: var(--f2513-editing-bg) !important;
}

/* The visible layer of the text of the active row is bold; the invisible bold layer (.f2513-sb-ghost) keeps the width, so nothing moves. */
.f2513-form .f2513-sb-row.is-active .f2513-sb-t {
  font-weight: 700;
}

/* v41: the blank row of the day and month lists (text: "ריק כשלא ידוע"), and the same text as the placeholder of the closed field, are grey. */
.f2513-form .f2513-sb-row.is-blank .f2513-sb-t,
.f2513-form .f2513-sb-input::placeholder {
  color: #6b7280;
  opacity: 1;
}

/* V9B item 4 (owner answer 18:20): a bank row, right to left: the logo, the bank code (two digits, its own column),
   the bank name; all aligned right. */
.f2513-form .f2513-sb-bank .f2513-sb-row {
  justify-content: flex-start;
  text-align: right;
}

.f2513-form .f2513-sb-bank .f2513-sb-code {
  flex: 0 0 2.5em;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* V10B_01 (owner request V10B): rows of the branch list. What: right aligned rows of one even look; a long name
   breaks only between words and its next line starts under the start of the text. Input: the list ul made by
   selectbox.js for the select f08_payer_branch_no (id f08_payer_branch_no-sb-list). Output: look only. Purpose: the
   branch number is first on the right, and no row is cut, widened or broken in the middle of a word. */
.f2513-form #f08_payer_branch_no-sb-list .f2513-sb-row {
  align-items: flex-start;
  min-height: 32px;
  padding: 6px 8px;
  line-height: 20px;
  text-align: right;
}

.f2513-form #f08_payer_branch_no-sb-list :is(.f2513-sb-t, .f2513-sb-ghost) {
  overflow-wrap: normal;
  word-break: normal;
}

/* V11B_06 (owner answer 6, 2026-12-02 15:56): one type scale for every step of the form.
   What: the regular text of the form is 18px: field labels, group legends, the text typed in fields and lists, the rows
   of the open lists (selectbox.js lists and the msDropdown country lists, whose site rules gave 13px and 16px), the
   option text of radio and checkbox items, the help and hint lines and the message of a field. The step headings
   (h2.form-title and h3.f2513-subtitle) are 20px. Not changed: the form title h1.f2513-page-title (owner: as today),
   the step buttons, the draft buttons and the progress strip. Why this file: selectbox.css is the last file of the
   manifest (assets.php), so equal or higher specificity wins over base.css, states.css and errors.css; the site rules
   that set these sizes are not !important, except the site h2 rule (35px !important), answered with !important. Input: the markup of the templates S1 to S7 and of the list widgets.
   Output: look only. Line height is not set here, so each element keeps its line height. */
.f2513-page .f2513-form .input-row :is(label, legend, input, select, textarea),
.f2513-page .f2513-form :is(fieldset legend, .wpcf7-list-item-label, .f2513-help, .f2513-hint, .f2513-msg),
.f2513-page .f2513-form .input-row :is(.f2513-sb-input, .f2513-sb-list li, .ddTitleText, .ddChild li, .ddChild li .ddlabel, .ddlabel),
.f2513-page .f2513-form fieldset.f2513-switch .wpcf7-list-item [type="radio"] + .wpcf7-list-item-label {
  font-size: 18px;
}
.f2513-page .f2513-form :is(h2.form-title, h3.f2513-subtitle) {
  font-size: 20px !important; /* the site rule h2:not(...) of style-main.css line 1220 is 35px !important */
}

/* V20 (owner order 2026-12-03): the value shown in a Latin list (select with class f2513-ltr, for example the country of the receiver
   address in step 5) is aligned to the LEFT, as English text normally is; the page default is right. The padding keeps the room of
   the chevron on the left. Input: div.f2513-sb with dir="ltr" (selectbox.js). Output: look only. */
.f2513-form .f2513-sb[dir="ltr"] .f2513-sb-input.f2513-sb-input {
  direction: ltr;
  text-align: left !important; /* errors.css sets text-align: right on every input with a long :not() selector */
  text-align-last: left !important; /* errors.css line 243 sets text-align-last: right, which wins over text-align in a one-line input (V23: the real cause of the right-aligned country) */
}

/* V30: a day that does not exist in the chosen month is a grey row that cannot be chosen. Input: class is-disabled on a row. */
.f2513-form .f2513-sb-row.is-disabled,
.f2513-form .f2513-sb-row.is-disabled.is-active {
  color: #aaa;
  background: transparent;
  cursor: not-allowed;
  font-weight: normal;
}

/* v42 (owner order): in a branch row the gap each side of the dash is 2px narrower (the two spaces of "NNN - name" are replaced by a 3px
   margin on each side of the dash; a space of 18px text is about 5px), so even the bold of the active row does not add a line. */
.f2513-form .f2513-sb-dash {
  margin-inline: 3px;
}
