/* Icons in texts (Bootstrap Icons, assets/bootstrap-icons; inserted with assets/text-icon.js):
   <span class="text-icon bi-NAME text-icon-SIZE">. The icon takes the text color; sizes relative to the text. */
.text-icon { display: inline-block; font-size: 1.3em; font-style: normal; line-height: 1; vertical-align: -.15em; }
.text-icon::before { vertical-align: top !important; }
.text-icon-s { font-size: 1em; vertical-align: -.125em; }
.text-icon-m { font-size: 1.3em; }
.text-icon-l { font-size: 1.8em; vertical-align: -.3em; }
.text-icon-xl { font-size: 2.6em; vertical-align: middle; }
.text-icon-xxl { font-size: 3.6em; vertical-align: middle; }

/* Editors: an icon is chosen with a click. */
[contenteditable="true"] .text-icon { cursor: pointer; border-radius: 4px; }
[contenteditable="true"] .text-icon:hover { outline: 2px dashed rgba(36,92,78,.35); outline-offset: 2px; }
.text-icon.is-selected { outline: 2px solid #245c4e; outline-offset: 2px; }

/* Bar at the selected icon – self-contained, as it also appears in the website's edit mode. */
.text-icon-tools { position: fixed; z-index: 32; display: flex; max-width: min(460px, calc(100vw - 16px)); flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 9px 10px; border: 1px solid #d6e2da; border-radius: 10px; background: #fff; box-shadow: 0 10px 26px rgba(20,50,35,.18); color: #1d312d; font: 11px/1.3 'Aptos', 'Segoe UI', sans-serif; }
.text-icon-tools[hidden] { display: none; }
.text-icon-tools .text-image-group { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.text-icon-tools .text-image-group > span { width: 100%; margin-bottom: 2px; color: #46544e; font-size: 10px; font-weight: 700; }
.text-icon-tools .text-image-actions { display: flex; gap: 4px; }
.text-icon-tools button { padding: 5px 8px; border: 1px solid #dfe6e1; border-radius: 6px; background: #fff; color: #46544e; font: inherit; font-weight: 700; cursor: pointer; }
.text-icon-tools button:hover { background: #f3f8f4; }
.text-icon-tools button.is-active { border-color: #8db59d; background: #e3efe6; color: #245c4e; }
.text-icon-tools .is-danger { color: #a52a1f; }

/* Picker dialog */
.text-icon-dialog { width: min(720px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 24px)); padding: 0; border: 0; border-radius: 14px; background: #fff; color: #1d312d; box-shadow: 0 24px 60px rgba(20,40,30,.3); font: 13px/1.4 'Aptos', 'Segoe UI', sans-serif; }
.text-icon-dialog::backdrop { background: rgba(20,32,28,.45); }
.text-icon-dialog form { display: flex; max-height: inherit; flex-direction: column; gap: 10px; padding: 16px 18px; box-sizing: border-box; }
.text-icon-dialog header { display: flex; align-items: center; justify-content: space-between; }
.text-icon-dialog h2 { margin: 0; font-size: 16px; }
.text-icon-close { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #53635c; font-size: 20px; cursor: pointer; }
.text-icon-close:hover { background: #f0f4f0; }
.text-icon-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.text-icon-search { min-width: 0; flex: 1 1 260px; padding: 9px 11px; border: 1px solid #d6e2da; border-radius: 8px; color: inherit; font: inherit; }
.text-icon-search:focus { border-color: #245c4e; outline: 2px solid rgba(36,92,78,.2); }
.text-icon-sizes { display: flex; gap: 3px; }
.text-icon-sizes[hidden] { display: none; }
.text-icon-sizes button { min-width: 36px; padding: 6px 8px; border: 1px solid #dfe6e1; border-radius: 6px; background: #fff; color: #46544e; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-icon-sizes button.is-active { border-color: #8db59d; background: #e3efe6; color: #245c4e; }
.text-icon-status { margin: 0; color: #6f7c76; font-size: 11px; }
.text-icon-grid { display: grid; min-height: 120px; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; padding: 2px; }
.text-icon-choice { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid #e5ebe6; border-radius: 9px; background: #fff; color: #1d312d; font: inherit; cursor: pointer; }
.text-icon-choice:hover, .text-icon-choice:focus-visible { border-color: #8db59d; background: #f3f8f4; color: #245c4e; }
.text-icon-choice.is-active { border-color: #245c4e; background: #e3efe6; }
.text-icon-choice .text-icon { font-size: 24px; vertical-align: 0; }
.text-icon-choice small { max-width: 100%; overflow: hidden; color: #6f7c76; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.text-icon-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.text-icon-dialog footer small { color: #9aa7a1; font-size: 10px; }
.text-icon-cancel { padding: 8px 14px; border: 0; border-radius: 8px; background: transparent; color: #53635c; font: inherit; font-weight: 700; cursor: pointer; }
.text-icon-cancel:hover { background: #f0f4f0; color: #245c4e; }

/* Icon of a heading (block "Überschrift", template element "Überschrift") */
.heading-icon-before { margin-right: .35em; }
.heading-icon-after { margin-left: .35em; }
:is(h1, h2, h3, h4) > .text-icon { vertical-align: middle; }

/* Icon field in the block settings (CMSTextIcon.chooser) */
.text-icon-chooser { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.text-icon-chooser-preview { display: inline-flex; min-width: 0; flex: 1 1 100%; align-items: center; gap: 8px; color: #245c4e; }
.text-icon-chooser-preview small { overflow: hidden; color: #6f7c76; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
