/* Editor.js host + custom tool styling — uses panel theme vars only. */

.bce-host {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px 20px;
    min-height: 360px;
    color: var(--text-1);
    line-height: 1.55;
    box-sizing: border-box;
    min-width: 0;
}

.bce-host .codex-editor__redactor {
    padding-bottom: 80px !important;
}

.bce-host .ce-block__content,
.bce-host .ce-toolbar__content {
    max-width: min(920px, calc(100% - 64px));
}

.bce-host .cdx-block { color: var(--text-1); }

.bce-host h1, .bce-host h2, .bce-host h3, .bce-host h4 {
    color: var(--text-1);
    margin: 0.6em 0 0.3em;
}

.bce-host a { color: var(--cyan); }

.bce-host .cdx-marker {
    background: rgba(255, 170, 0, 0.22);
    padding: 1px 2px;
    border-radius: 3px;
}

.bce-host .cdx-warning__title,
.bce-host .cdx-warning__message,
.bce-host .cdx-quote__text,
.bce-host .cdx-quote__caption,
.bce-host .ce-paragraph[data-placeholder]:empty::before {
    color: var(--text-2);
}

.bce-host .ce-toolbar__plus,
.bce-host .ce-toolbar__settings-btn {
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.bce-host .ce-toolbar__plus:hover,
.bce-host .ce-toolbar__settings-btn:hover {
    background: rgba(255, 170, 0, 0.12);
    color: var(--gold);
}

.bce-host .ce-popover {
    background: var(--bg-elev-1);
    color: var(--text-1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.bce-host .ce-popover-item:hover {
    background: rgba(255, 170, 0, 0.10);
    color: var(--gold);
}

/* ────────────────────────────────────────────────────────────────────────
 * Gallery Tool
 * ──────────────────────────────────────────────────────────────────────── */
.bce-gallery {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
}

/* Toolbar */
.bce-gallery-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.bce-gallery-toolbar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--gold);
    flex: 1;
}

.bce-gallery-toolbar-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

/* Layout toggle buttons */
.bce-gallery-layout-btn {
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.bce-gallery-layout-btn.active {
    background: rgba(255, 170, 0, 0.15);
    color: var(--gold);
    border-color: rgba(255, 170, 0, 0.32);
}
.bce-gallery-layout-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-1);
}

/* Upload + URL buttons */
.bce-gallery-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 170, 0, 0.13);
    color: var(--gold);
    border: 1px solid rgba(255, 170, 0, 0.28);
    border-radius: 6px;
    padding: 5px 11px 5px 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    margin-left: 4px;
}
.bce-gallery-upload-btn:hover {
    background: rgba(255, 170, 0, 0.22);
    border-color: rgba(255, 170, 0, 0.5);
}

.bce-gallery-url-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bce-gallery-url-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-1);
}

/* Drop zone (empty state) */
.bce-gallery-drop-zone {
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.bce-gallery-drop-zone:hover {
    background: rgba(255, 170, 0, 0.04);
}
.bce-gallery-drop-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 170, 0, 0.07);
    border: 1.5px dashed rgba(255, 170, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    opacity: 0.75;
    transition: opacity 0.15s, background 0.15s;
}
.bce-gallery-drop-zone:hover .bce-gallery-drop-icon {
    opacity: 1;
    background: rgba(255, 170, 0, 0.12);
}
.bce-gallery-drop-label {
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
}
.bce-gallery-drop-sub {
    color: var(--text-3);
    font-size: 11px;
}

/* Grid / Carousel */
.bce-gallery-grid {
    display: grid;
    gap: 6px;
    padding: 12px;
}
.bce-gallery-grid.layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.bce-gallery-grid.layout-carousel {
    grid-auto-flow: column;
    grid-auto-columns: 200px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
}
.bce-gallery-grid.layout-carousel::-webkit-scrollbar { height: 3px; }
.bce-gallery-grid.layout-carousel::-webkit-scrollbar-track { background: transparent; }
.bce-gallery-grid.layout-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
}

/* Image tile */
.bce-gallery-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    scroll-snap-align: start;
    flex-shrink: 0;
}
.bce-gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover overlay */
.bce-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.50) 0%,
        transparent 35%,
        transparent 55%,
        rgba(0, 0, 0, 0.68) 100%
    );
    opacity: 0;
    transition: opacity 0.18s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 7px;
}
.bce-gallery-tile:hover .bce-tile-overlay { opacity: 1; }

/* Remove button */
.bce-tile-remove {
    align-self: flex-start;
    margin-left: auto;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.bce-tile-remove:hover { background: rgba(200, 30, 30, 0.82); }

/* Caption input (visible inside overlay at bottom) */
.bce-tile-caption {
    width: 100%;
    background: transparent;
    color: #fff;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.32);
    padding: 3px 2px;
    font-size: 11px;
    outline: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.bce-tile-caption::placeholder { color: rgba(255, 255, 255, 0.42); }
.bce-tile-caption:focus { border-bottom-color: rgba(255, 170, 0, 0.72); }

/* Loading tile */
.bce-gallery-tile.loading {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}
.bce-tile-spinner {
    width: 26px;
    height: 26px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: bce-spin 0.75s linear infinite;
}
@keyframes bce-spin { to { transform: rotate(360deg); } }

/* "Add more" tile */
.bce-gallery-tile-add {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px dashed rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--text-3);
    font-size: 11px;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    scroll-snap-align: start;
}
.bce-gallery-tile-add:hover {
    background: rgba(255, 170, 0, 0.07);
    border-color: rgba(255, 170, 0, 0.32);
    color: var(--gold);
}

/* Video tool */
.bce-video {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.bce-video-url {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
}

.bce-video-flags {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--text-2);
    font-size: 12px;
}

.bce-video-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.bce-video-preview { margin-top: 6px; }

/* Hero tool */
.bce-hero,
.bce-two-column {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.bce-hero-header,
.bce-two-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bce-hero-label,
.bce-two-column-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
    flex: 1;
}

.bce-hero-title-input,
.bce-hero-subtitle-input {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.bce-hero-title-input { font-weight: 700; font-size: 15px; }
.bce-hero-subtitle-input { color: var(--text-2); font-size: 12px; }

.bce-hero-focal {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    max-width: 220px;
}

.bce-hero-preview-shell {
    position: relative;
    min-height: 160px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.bce-hero-preview-shell img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.bce-hero-preview-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    color: var(--text-3);
    font-size: 12px;
}

.bce-hero-preview-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px 18px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.bce-hero-preview-title {
    margin: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1.2;
}

.bce-hero-preview-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

/* Two-column tool */
.bce-two-column-text {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.bce-two-column-preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.bce-two-column-preview-image,
.bce-two-column-preview-text {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    min-height: 120px;
}

.bce-two-column-preview-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.bce-two-column-preview-image.empty,
.bce-two-column-preview-text.placeholder {
    display: grid;
    place-items: center;
    color: var(--text-3);
    font-size: 12px;
    padding: 12px;
}

.bce-two-column-preview-text {
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-1);
    white-space: pre-wrap;
}

.bce-two-column-preview-caption {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-3);
}

@media (max-width: 640px) {
    .bce-two-column-preview-row {
        grid-template-columns: 1fr;
    }
}

/* ────────────────────────────────────────────────────────────────────────
 * UI-L3 Smart-Crop Modal (mediaCropper.open)
 * Overlay + Modal + Toolbar. Theme-konform (var-only).
 * ──────────────────────────────────────────────────────────────────────── */
.mcrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.mcrop-modal {
    background: var(--bg-card);
    color: var(--text-1);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    width: min(960px, 100%);
    max-height: 90vh;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    overflow: hidden;
}

.mcrop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mcrop-header strong { color: var(--text-1); font-size: 14px; letter-spacing: 0.3px; }
.mcrop-close {
    background: transparent;
    color: var(--text-2);
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.mcrop-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-1); }

/* Definite Container-Höhe: Cropper.js fittet das Bild hinein und zentriert es.
   KEIN min/max-height-Mix und KEIN width:100% — sonst entsteht bei breiten Bildern
   Leerraum unter dem Bild, und der Zoom-/Dreh-Anker liegt in diesem Leerraum
   ("Zoom kommt von unten" / gedrehtes Bild teils abgeschnitten). */
.mcrop-canvas-wrap {
    position: relative;
    height: 60vh;
    background: var(--bg-void);
    overflow: hidden;
}
.mcrop-img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.mcrop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.mcrop-aspects, .mcrop-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mcrop-aspects button, .mcrop-controls button {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    min-width: 34px;
}
.mcrop-aspects button:hover, .mcrop-controls button:hover {
    background: rgba(255, 170, 0, 0.10);
    color: var(--gold);
}
.mcrop-aspects button.active {
    background: rgba(255, 170, 0, 0.18);
    color: var(--gold);
    border-color: rgba(255, 170, 0, 0.4);
}
.mcrop-controls button {
    font-size: 16px;
    line-height: 1;
}

.mcrop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.mcrop-cancel, .mcrop-confirm {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.mcrop-cancel {
    background: transparent;
    color: var(--text-2);
}
.mcrop-cancel:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-1);
}
.mcrop-confirm {
    background: var(--gold);
    color: var(--bg-void);
    border-color: var(--gold);
    font-weight: 600;
}
.mcrop-confirm:hover { filter: brightness(1.08); }

@media (max-width: 720px) {
    .mcrop-toolbar { flex-direction: column; align-items: stretch; }
    .mcrop-aspects, .mcrop-controls { justify-content: center; }
}

/* ────────────────────────────────────────────────────────────────────────
 * UI-L8 Spell-Check Theming
 * Browser-native Spell-Error-Markierung an das Panel-Theme angleichen.
 * Funktioniert vor allem in Chromium-basierten Browsern. Safari/Firefox
 * fallen auf ihre Default-Markierung (rote Welle) zurueck — kein Bruch.
 * ──────────────────────────────────────────────────────────────────────── */
.bce-host [contenteditable="true"] {
    /* Lange Worte ohne ausreichend Whitespace nicht abschneiden, aber umbrechen */
    word-break: break-word;
}

.bce-host [contenteditable="true"]::spelling-error {
    text-decoration: underline wavy color-mix(in oklab, var(--red) 75%, transparent);
    text-decoration-skip-ink: none;
    text-underline-offset: 3px;
}

.bce-host [contenteditable="true"]::grammar-error {
    text-decoration: underline wavy color-mix(in oklab, var(--gold) 60%, transparent);
    text-decoration-skip-ink: none;
    text-underline-offset: 3px;
}

/* ────────────────────────────────────────────────────────────────────────
 * Article Render Standard (bhr-*) — Panel preview + reader parity with MAUI
 * Token mapping: MediaText → --text-1, MediaStroke → --border-2, etc.
 * ──────────────────────────────────────────────────────────────────────── */
.cc-article-body.bhr-article,
.ue-preview-body .cc-article-body {
    --bhr-gap: 18px;
    --bhr-line: 1.6;
    --bhr-text: var(--text-1);
    --bhr-text-muted: var(--text-2);
    --bhr-text-subtle: var(--text-3);
    --bhr-accent: var(--gold);
    --bhr-stroke: var(--border-2);
    --bhr-surface: rgba(255, 255, 255, 0.04);
    --bhr-surface-subtle: rgba(255, 255, 255, 0.025);
    --bhr-warning-fill: color-mix(in oklab, var(--amber) 14%, transparent);
    --bhr-warning-stroke: color-mix(in oklab, var(--amber) 38%, transparent);
    --bhr-radius-media: 14px;
    --bhr-radius-card: 12px;
    --bhr-radius-code: 10px;
    color: var(--bhr-text);
    font-family: var(--sans, inherit);
    font-size: 15px;
    line-height: var(--bhr-line);
    max-width: min(720px, 100%);
}

.cc-article-body.bhr-article > * + *,
.ue-preview-body .cc-article-body > * + * {
    margin-top: var(--bhr-gap);
}

.cc-article-body.bhr-article > :first-child,
.ue-preview-body .cc-article-body > :first-child {
    margin-top: 0;
}

.bhr-paragraph,
.cc-article-body.bhr-article p {
    margin: 0;
    color: var(--bhr-text);
    line-height: var(--bhr-line);
}

.bhr-heading,
.cc-article-body.bhr-article :is(h1, h2, h3, h4) {
    margin: 0;
    color: var(--bhr-text);
    font-weight: 700;
    line-height: 1.25;
}

.bhr-h1, .cc-article-body.bhr-article h1 { font-size: 1.625rem; line-height: 1.2; }
.bhr-h2, .cc-article-body.bhr-article h2 { font-size: 1.375rem; line-height: 1.2; }
.bhr-h3, .cc-article-body.bhr-article h3 { font-size: 1.125rem; }
.bhr-h4, .cc-article-body.bhr-article h4 { font-size: 1rem; }

.cc-article-body.bhr-article a,
.bhr-embed-link,
.bhr-attach {
    color: var(--bhr-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-article-body.bhr-article :is(ul, ol) {
    margin: 0;
    padding-left: 1.25rem;
}

.cc-article-body.bhr-article li + li {
    margin-top: 6px;
}

.bhr-checklist {
    list-style: none;
    padding-left: 0;
}

.bhr-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bhr-checklist input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--bhr-accent);
    width: auto;
}

.bhr-quote {
    margin: 0;
    padding: 12px 14px 12px 16px;
    border: 1px solid var(--bhr-stroke);
    border-left: 3px solid var(--bhr-accent);
    border-radius: var(--bhr-radius-card);
    background: var(--bhr-surface-subtle);
}

.bhr-quote p {
    margin: 0;
    font-style: italic;
}

.bhr-quote cite {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-style: normal;
    color: var(--bhr-text-subtle);
}

.bhr-warning {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--bhr-warning-stroke);
    border-radius: var(--bhr-radius-card);
    background: var(--bhr-warning-fill);
}

.bhr-warning h4 {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
}

.bhr-warning p {
    margin: 0;
}

.bhr-image,
.bhr-embed,
.bhr-hero {
    margin: 0;
}

.bhr-image img,
.bhr-two-column-image img,
.bhr-gallery img,
.bhr-video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: var(--bhr-radius-media);
    border: 1px solid var(--bhr-stroke);
    background: var(--bhr-surface);
}

.bhr-image figcaption,
.bhr-embed figcaption,
.bhr-two-column-image figcaption {
    margin-top: 6px;
    font-size: 11px;
    text-align: center;
    color: var(--bhr-text-subtle);
}

.bhr-hero {
    position: relative;
    border-radius: var(--bhr-radius-media);
    overflow: hidden;
    border: 1px solid var(--bhr-stroke);
}

.bhr-hero-cover {
    min-height: 220px;
    background-size: cover;
    background-position: center;
}

.bhr-hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    margin: 0;
    padding: 16px 18px;
    background: linear-gradient(transparent, color-mix(in oklab, #000 78%, transparent));
}

.bhr-hero-title {
    margin: 0;
    color: #fff;
    font-size: 1.375rem;
    line-height: 1.2;
}

.bhr-hero-subtitle {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    line-height: 1.35;
}

.bhr-hero-foot {
    margin: 6px 0 0;
    font-size: 11px;
    text-align: center;
    color: var(--bhr-text-subtle);
}

.bhr-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.bhr-two-column-reverse {
    direction: rtl;
}

.bhr-two-column-reverse > * {
    direction: ltr;
}

.bhr-two-column-text {
    padding: 10px 12px;
    border: 1px solid var(--bhr-stroke);
    border-radius: var(--bhr-radius-card);
    background: var(--bhr-surface-subtle);
    line-height: var(--bhr-line);
}

.bhr-gallery {
    display: grid;
    gap: 8px;
}

.bhr-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.bhr-gallery-carousel {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 70%);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 4px;
}

.bhr-gallery img {
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.bhr-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--bhr-stroke);
    border-radius: var(--bhr-radius-media);
    background: var(--bhr-surface);
}

.bhr-embed-link,
.bhr-attach {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--bhr-stroke);
    border-radius: var(--bhr-radius-card);
    background: var(--bhr-surface-subtle);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.bhr-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--bhr-stroke);
    border-radius: var(--bhr-radius-card);
    overflow: hidden;
    font-size: 12px;
}

.bhr-table th,
.bhr-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--bhr-stroke);
    text-align: left;
    vertical-align: top;
}

.bhr-table thead th {
    background: var(--bhr-surface-subtle);
    font-weight: 700;
    color: var(--bhr-text);
}

.bhr-table tbody tr:last-child td {
    border-bottom: none;
}

.bhr-code {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--bhr-stroke);
    border-radius: var(--bhr-radius-code);
    background: var(--bhr-surface-subtle);
    overflow-x: auto;
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 12px;
    line-height: 1.45;
}

.bhr-code code {
    font-family: inherit;
}

.bhr-delimiter {
    margin: 8px auto;
    width: min(280px, 60%);
    border: 0;
    border-top: 1px solid var(--bhr-stroke);
}

.bhr-empty {
    margin: 0;
    color: var(--bhr-text-subtle);
    font-style: italic;
}

.bhr-raw {
    line-height: var(--bhr-line);
}

.cc-article-body.bhr-article mark,
.bhr-raw mark {
    background: var(--bhr-warning-fill);
    padding: 1px 3px;
    border-radius: 3px;
}

.cc-article-body.bhr-article code,
.bhr-raw code {
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 0.92em;
    background: var(--bhr-surface-subtle);
    padding: 1px 4px;
    border-radius: 4px;
}

@media (max-width: 640px) {
    .bhr-two-column {
        grid-template-columns: 1fr;
    }

    .bhr-two-column-reverse {
        direction: ltr;
    }
}
