/* Страници със съдържание от Confluence (terms.php и др.) — визуализира форматирането 1:1 */

.cf-section { padding-top: clamp(36px, 5vw, 64px); }
.cf-layout { display: block; }
.cf-layout--side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }

/* --- Подстраници отстрани --- */
.cf-side { position: sticky; top: 96px; font-size: .95rem; }
.cf-side ul { list-style: none; margin: 0; padding: 0; }
.cf-side ul ul { padding-left: 14px; border-left: 1px solid var(--line); margin: 4px 0 4px 10px; }
.cf-side a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--ink-soft); text-decoration: none; line-height: 1.35; }
.cf-side a:hover { background: var(--bg-soft); color: var(--brand-700); }
.cf-side a.is-active { background: var(--brand-50); color: var(--brand-800); font-weight: 600; }
.cf-side > nav > ul > li > a { font-weight: 700; color: var(--ink); }

@media (max-width: 900px) {
    .cf-layout--side { grid-template-columns: 1fr; }
    .cf-side { position: static; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
}

/* --- Съдържание --- */
.cf-content { color: var(--ink); line-height: 1.65; font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.cf-content > :first-child { margin-top: 0; }
.cf-content p { margin: 0 0 .8em; }
.cf-content h1, .cf-content h2, .cf-content h3, .cf-content h4, .cf-content h5, .cf-content h6 {
    font-family: var(--font-head); color: var(--ink); line-height: 1.3; margin: 1.6em 0 .6em;
}
.cf-content h1 { font-size: 1.9rem; }
.cf-content h2 { font-size: 1.5rem; }
.cf-content h3 { font-size: 1.25rem; }
.cf-content h4 { font-size: 1.1rem; }
.cf-content h5, .cf-content h6 { font-size: 1rem; }
.cf-content a { color: var(--brand-600); }
.cf-content ul, .cf-content ol { margin: 0 0 .9em; padding-left: 1.6em; }
.cf-content li > p { margin: 0 0 .3em; }
.cf-content u { text-decoration: underline; }
.cf-content s, .cf-content del { text-decoration: line-through; }
.cf-content blockquote { margin: 0 0 1em; padding: .4em 1em; border-left: 3px solid var(--line-2); color: var(--ink-soft); }
.cf-content hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.cf-content code { background: var(--bg-soft); padding: .1em .35em; border-radius: 4px; font-size: .92em; }
.cf-content pre { background: var(--bg-soft); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; }

/* Таблици */
.cf-content .table-wrap { overflow-x: auto; margin: 0 0 1em; }
.cf-content table { border-collapse: collapse; width: auto; max-width: 100%; margin: 0 0 1em; }
.cf-content table[data-layout="full-width"], .cf-content table[data-layout="wide"] { width: 100%; }
.cf-content th, .cf-content td { border: 1px solid var(--line-2); padding: 8px 10px; vertical-align: top; text-align: left; }
.cf-content th, .cf-content .confluenceTh { background: var(--bg-soft); font-weight: 600; }
.cf-content td > p:last-child, .cf-content th > p:last-child { margin-bottom: 0; }

/* Изображения — подравняване и размери както в Confluence */
.cf-content img { max-width: 100%; height: auto; }
.cf-content .confluence-embedded-file-wrapper { display: inline-block; max-width: 100%; }
.cf-content .image-center-wrapper, .cf-content .confluence-embedded-file-wrapper.image-center-wrapper { display: block; text-align: center; }
.cf-content img.image-center { display: block; margin-left: auto; margin-right: auto; }
.cf-content .image-right-wrapper, .cf-content img.image-right { float: right; margin: 0 0 12px 18px; }
.cf-content .image-left-wrapper, .cf-content img.image-left { float: left; margin: 0 18px 12px 0; }
.cf-content img.confluence-thumbnail { max-width: 300px; }
.cf-content img.emoticon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.cf-content::after { content: ""; display: block; clear: both; }

/* Информационни панели (info / note / warning / tip / panel) */
.cf-content .confluence-information-macro { position: relative; margin: 0 0 1em; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; }
.cf-content .confluence-information-macro .title { font-weight: 700; margin: 0 0 .4em; }
.cf-content .confluence-information-macro-icon { display: none; }
.cf-content .confluence-information-macro-body > :last-child { margin-bottom: 0; }
.cf-content .confluence-information-macro-information { background: #e9f2ff; border-color: #cce0ff; }
.cf-content .confluence-information-macro-note { background: #fff7d6; border-color: #f8e6a0; }
.cf-content .confluence-information-macro-warning { background: #ffeceb; border-color: #ffd5d2; }
.cf-content .confluence-information-macro-tip { background: #dcfff1; border-color: #baf3db; }
.cf-content .panel { border: 1px solid var(--line-2); border-radius: var(--radius-sm); margin: 0 0 1em; }
.cf-content .panelHeader { padding: 8px 14px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.cf-content .panelContent { padding: 12px 14px; }

/* Статуси (lozenge) */
.cf-content .status-macro { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: .72rem; font-weight: 700; text-transform: uppercase; line-height: 1.6; vertical-align: middle; background: #dfe1e6; color: #42526e; }
.cf-content .aui-lozenge-success { background: #dcfff1; color: #216e4e; }
.cf-content .aui-lozenge-complete { background: #e9f2ff; color: #0055cc; }
.cf-content .aui-lozenge-current { background: #fff7d6; color: #7f5f01; }
.cf-content .aui-lozenge-error { background: #ffeceb; color: #ae2e24; }
.cf-content .aui-lozenge-progress { background: #f3f0ff; color: #5e4db2; }

/* Колони (page layouts) */
.cf-content .contentLayout2 .columnLayout { display: grid; gap: 24px; margin: 0 0 1em; }
.cf-content .columnLayout.two-equal { grid-template-columns: 1fr 1fr; }
.cf-content .columnLayout.two-left-sidebar { grid-template-columns: 1fr 2fr; }
.cf-content .columnLayout.two-right-sidebar { grid-template-columns: 2fr 1fr; }
.cf-content .columnLayout.three-equal { grid-template-columns: 1fr 1fr 1fr; }
.cf-content .columnLayout.three-with-sidebars { grid-template-columns: 1fr 2fr 1fr; }
.cf-content .columnLayout.single { grid-template-columns: 1fr; }
@media (max-width: 700px) { .cf-content .contentLayout2 .columnLayout { grid-template-columns: 1fr; } }

/* Разгъващи се секции — на сайта са отворени */
.cf-content .expand-control { font-weight: 600; margin-bottom: .4em; }
.cf-content .expand-control-icon { display: none; }
.cf-content .expand-content { display: block !important; opacity: 1 !important; height: auto !important; }

/* Списък със задачи */
.cf-content ul.inline-task-list { list-style: none; padding-left: 0; }
.cf-content ul.inline-task-list > li { padding-left: 1.6em; position: relative; }
.cf-content ul.inline-task-list > li::before { content: "☐"; position: absolute; left: 0; }
.cf-content ul.inline-task-list > li.checked::before { content: "☑"; }
