/* bbcode.css: Rendered BBCode: quote, spoiler, columns, headings, YouTube facade, code blocks. */
/* ===== BBCODE QUOTE BLOCK ===== */
.bbcode-quote {
    margin: 10px 0;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    overflow: hidden;
}

.bbcode-quote-author {
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
}

.bbcode-quote-body {
    margin: 0;
    padding: 8px 12px;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: none;
    quotes: none;
    word-break: break-word;
}

/* ===== BBCODE SPOILER BLOCK ===== */
.bbcode-spoiler {
    margin: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.bbcode-spoiler-title {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.bbcode-spoiler-title::-webkit-details-marker {
    display: none;
}

.bbcode-spoiler-title::before {
    content: '▶ ';
    font-size: 0.7em;
}

details.bbcode-spoiler[open] .bbcode-spoiler-title::before {
    content: '▼ ';
}

.bbcode-spoiler-content {
    padding: 8px 12px;
    background: var(--bg-surface);
    word-break: break-word;
}

.bbcode-columns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.bbcode-col {
    flex: 1;
    min-width: 150px;
}

.bbcode-h1 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.75em 0 0.25em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.25em;
}
.bbcode-h2 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.6em 0 0.2em;
}
.bbcode-h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0.5em 0 0.15em;
}

.bbcode-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1em 0;
}

.bbcode-highlight {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    padding: 0 3px;
    border-radius: var(--radius-sm);
}

.bbcode-yt {
    max-width: 480px;
    margin: 0.75em 0;
}
.bbcode-yt-facade {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-subtle);
    cursor: pointer;
    font: inherit;
}
.bbcode-yt-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bbcode-yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    border-radius: 50%;
    font-size: 1.1rem;
}
.bbcode-yt-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 0.82rem;
    text-align: left;
}
.bbcode-yt-facade:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
@media (pointer: coarse) {
    .bbcode-yt-play { width: 64px; height: 64px; }
}
.bbcode-yt-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-md);
}

.bbcode-code {
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: var(--radius-md);
    margin: 0.75em 0;
    overflow: hidden;
}
.bbcode-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    background: #181825;
    border-bottom: 1px solid #313244;
    min-height: 30px;
}
.bbcode-code-lang {
    font-size: 0.75rem;
    color: #a6adc8;
    font-family: monospace;
    text-transform: lowercase;
}
.bbcode-code-copy {
    background: none;
    border: 1px solid #45475a;
    border-radius: var(--radius-sm);
    color: #a6adc8;
    font-size: 0.72rem;
    padding: 1px 8px;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.15s, color 0.15s;
}
@media (hover: hover) {
    .bbcode-code-copy:hover {
        background: #313244;
        color: #cdd6f4;
    }
}
.bbcode-code pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    color: #cdd6f4;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre;
}
.bbcode-code pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

