/* ============================================================
   content.css — изображения, видео, цитаты, заголовки в постах
   ============================================================ */

/* --- Изображения: не выходят за пределы контейнера --- */
.md img,
.post-text img,
.news-body img,
.announcement-body img,
.review-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

/* Если изображение-ссылка — обёртка тоже ограничена */
.md a img { display: inline-block; }

/* --- Видео-встраивание (YouTube, Rutube) --- */
.md .video-embed,
.post-text .video-embed {
    position: relative;
    width: 100%;
    max-width: 720px;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin: 16px 0;
    border-radius: 8px;
    background: #000;
    box-shadow: var(--shadow);
}

.md .video-embed iframe,
.post-text .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.md .video-error,
.post-text .video-error {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,100,103,.1);
    border: 1px solid rgba(255,100,103,.3);
    border-radius: 4px;
    color: #ff6467;
    font-size: 13px;
}

/* --- Заголовки [h]...[/h] --- */
.md h3.post-heading,
.post-text h3.post-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 20px 0 10px;
    color: var(--text);
    line-height: 1.3;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* --- Цитата с автором [quote=Author]...[/quote] --- */
.md blockquote.quote-with-author,
.post-text blockquote.quote-with-author {
    margin: 14px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--accent);
    background: var(--accent-10);
    border-radius: 0 6px 6px 0;
    font-style: normal;
}

.md blockquote.quote-with-author .quote-author,
.post-text blockquote.quote-with-author .quote-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
}

.md blockquote.quote-with-author .quote-body,
.post-text blockquote.quote-with-author .quote-body {
    font-style: italic;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Обычная цитата [quote]...[/quote] — уже оформлена в editor.css */

/* --- Email-ссылки --- */
.md a[href^="mailto:"],
.post-text a[href^="mailto:"] {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-style: dotted;
}

/* --- Мобильные: компактнее --- */
@media (max-width: 640px) {
    .md img,
    .post-text img {
        margin: 8px 0;
        border-radius: 4px;
    }
    .md .video-embed,
    .post-text .video-embed {
        margin: 10px 0;
        border-radius: 6px;
    }
    .md h3.post-heading,
    .post-text h3.post-heading {
        font-size: 16px;
        margin: 14px 0 8px;
    }
    .md blockquote.quote-with-author,
    .post-text blockquote.quote-with-author {
        padding: 10px 12px;
        margin: 10px 0;
    }
}
/* Нативные опции — во всех формах сайта */
select option {
    background: var(--panel-deep);
    color: var(--text);
}
html[data-theme='light'] select option {
    background: #fff;
    color: #101828;
}
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--accent);
}

/* ============================================================
   Нативные select на основном сайте (installer38d)
   ============================================================ */
html[data-theme='dark'] select,
html[data-theme='dark'] .field select {
    background-color: #1a2232;
    color: var(--text);
}
html[data-theme='dark'] select option {
    background-color: #1a2232;
    color: var(--text);
}
html[data-theme='dark'] select:focus {
    background-color: #1f2a3d;
    border-color: var(--accent-30);
}

html[data-theme='light'] select,
html[data-theme='light'] .field select {
    background-color: #f3f4f6;
    color: #101828;
}
html[data-theme='light'] select option {
    background-color: #fff;
    color: #101828;
}
html[data-theme='light'] select:focus {
    background-color: #eff6ff;
    border-color: var(--accent-30);
}
