/* Additions for the local edition. style.css is copied from MitSpor
   and kept as close to the original as possible. */

/* A little space between the file buttons and the editing buttons. */
#toolbar .tool-group + .tool-group {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-strong);
}

/* Notch/rounded corners on phones (and in the app). */
#toolbar {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-top: max(9px, env(safe-area-inset-top));
}

#drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.18);
  border: 4px dashed var(--primary);
  pointer-events: none;
}
#drop-overlay[hidden] { display: none; }
#drop-overlay > div {
  padding: 16px 24px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Link without a thumbnail in the links dialog: host name/file name. */
.image-row-foreign {
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  font-size: 11px;
}

@media (max-width: 560px) {
  #toolbar .tool-group + .tool-group {
    margin-left: 4px;
    padding-left: 4px;
  }
}

/* Narrow phones (iPhone SE/mini at 375px, many Androids at 360px): less air
   between and inside the buttons, so all of them stay on one line. */
@media (max-width: 430px) {
  #toolbar {
    gap: 4px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  #toolbar .toolbar-group { gap: 4px; }
  #toolbar .tool-group button,
  #toolbar #btn-menu { padding: 0 8px; }
}
@media (max-width: 350px) {
  #toolbar .tool-group button,
  #toolbar #btn-menu { padding: 0 5px; }
  .lang-picker { padding: 0 5px; }
}

/* Language picker: button with a globe and the language code. The invisible <select>
   lies on top and opens the device's own list of languages. */
.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.lang-picker:hover { background: var(--surface-hover); }
.lang-picker:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.lang-picker .tb-icon { width: 18px; height: 18px; color: var(--link); }
#toolbar .lang-picker select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px; /* avoids zoom on iOS */
}
@media (max-width: 560px) {
  .lang-picker { padding: 0 7px; }
  .lang-picker .tb-icon { display: none; }
}

/* The selection and split bars: on narrow screens and in languages with long
   button texts (e.g. French) the buttons wrap onto more lines instead of
   running off the screen. The bar takes the width of its content, at most the
   screen's width (otherwise left: 50% only leaves it half the screen). */
.selection-bar {
  width: max-content;
}
.selection-buttons {
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}
.selection-buttons button {
  white-space: normal;
}
@media (max-width: 480px) {
  .selection-bar {
    padding: 8px;
  }
  .selection-buttons button {
    padding: 6px 9px;
  }
  .selection-buttons .selection-clear {
    min-width: 36px;
  }
}

/* The version under the text in About the editor. */
.about-version {
  margin: -8px 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
