/* IW content callouts – blog, CMS, edytor CKEditor */
.iw-callout,
.ck-content .iw-callout {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.6;
    border: none;
}

.iw-callout > :first-child,
.iw-callout-title {
    margin-top: 0;
}

.iw-callout > :last-child {
    margin-bottom: 0;
}

.iw-callout p,
.iw-callout-title {
    margin-bottom: 0.5em;
}

.iw-callout p:last-child {
    margin-bottom: 0;
}

.iw-callout strong,
.iw-callout-title strong {
    font-weight: 700;
}

/* Wspólny układ jak panel Info – delikatne tło wg typu, bez lewego paska */
.iw-callout--info,
.iw-callout--success,
.iw-callout--warning,
.iw-callout--error,
.ck-content .iw-callout--info,
.ck-content .iw-callout--success,
.ck-content .iw-callout--warning,
.ck-content .iw-callout--error {
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.iw-callout--info,
.ck-content .iw-callout--info {
    background: #edf4fc;
}

.iw-callout--success,
.ck-content .iw-callout--success {
    background: #edf7f1;
}

.iw-callout--warning,
.ck-content .iw-callout--warning {
    background: #fff8e6;
}

.iw-callout--error,
.ck-content .iw-callout--error {
    background: #fef2f2;
}

.iw-callout--info .iw-callout-title strong,
.iw-callout--info > p:first-child strong,
.ck-content .iw-callout--info .iw-callout-title strong,
.ck-content .iw-callout--info > p:first-child strong {
    color: #1a5fb4;
}

.iw-callout--success .iw-callout-title strong,
.iw-callout--success > p:first-child strong,
.ck-content .iw-callout--success .iw-callout-title strong,
.ck-content .iw-callout--success > p:first-child strong {
    color: #0d7a4e;
}

.iw-callout--warning .iw-callout-title strong,
.iw-callout--warning > p:first-child strong,
.ck-content .iw-callout--warning .iw-callout-title strong,
.ck-content .iw-callout--warning > p:first-child strong {
    color: #b45309;
}

.iw-callout--error .iw-callout-title strong,
.iw-callout--error > p:first-child strong,
.ck-content .iw-callout--error .iw-callout-title strong,
.ck-content .iw-callout--error > p:first-child strong {
    color: #b91c1c;
}

/* Placeholder w edytorze */
.ck-content blockquote.iw-callout-placeholder,
.iw-callout-placeholder {
    border: none;
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-style: normal;
}

.ck-content blockquote.iw-callout-placeholder .iw-callout-marker,
.iw-callout-placeholder .iw-callout-marker {
    display: none !important;
}

.ck-content blockquote.iw-callout-placeholder .iw-callout-title,
.iw-callout-placeholder .iw-callout-title {
    margin-top: 0;
    margin-bottom: 0.45em;
}

.ck-content blockquote.iw-callout-placeholder--info,
.iw-callout-placeholder--info { background: #edf4fc; }

.ck-content blockquote.iw-callout-placeholder--success,
.iw-callout-placeholder--success { background: #edf7f1; }

.ck-content blockquote.iw-callout-placeholder--warning,
.iw-callout-placeholder--warning { background: #fff8e6; }

.ck-content blockquote.iw-callout-placeholder--error,
.iw-callout-placeholder--error { background: #fef2f2; }

.ck-content blockquote.iw-callout-placeholder--info .iw-callout-title strong,
.iw-callout-placeholder--info .iw-callout-title strong { color: #1a5fb4; }

.ck-content blockquote.iw-callout-placeholder--success .iw-callout-title strong,
.iw-callout-placeholder--success .iw-callout-title strong { color: #0d7a4e; }

.ck-content blockquote.iw-callout-placeholder--warning .iw-callout-title strong,
.iw-callout-placeholder--warning .iw-callout-title strong { color: #b45309; }

.ck-content blockquote.iw-callout-placeholder--error .iw-callout-title strong,
.iw-callout-placeholder--error .iw-callout-title strong { color: #b91c1c; }

/* Przycisk paneli w pasku CKEditor */
.iw-ck-macro {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.iw-ck-macro-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.iw-ck-macro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: var(--ck-ui-component-min-height, 2.35em);
    height: var(--ck-ui-component-min-height, 2.35em);
    padding: 0 0.35rem;
    border: 0;
    border-radius: var(--ck-border-radius, 2px);
    background: transparent;
    color: var(--ck-color-text, #475569);
    cursor: pointer;
    flex-shrink: 0;
}

.iw-ck-macro-btn:hover,
.iw-ck-macro-wrap.open .iw-ck-macro-btn,
.iw-ck-toc-btn:hover {
    background-color: var(--ck-color-button-on-background, #eef1f4);
}

.iw-ck-macro-caret {
    opacity: 0.55;
    flex-shrink: 0;
}

.iw-ck-macro-menu--portal {
    display: none;
    position: fixed;
    z-index: 20000;
    min-width: 9rem;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.iw-ck-macro-menu--portal.is-open {
    display: block;
}

.iw-ck-macro-menu-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.iw-ck-macro-menu-item:last-child {
    border-bottom: 0;
}

.iw-ck-macro-menu-item:hover {
    background: #f8fafc;
}

.iw-ck-macro-menu-item--info { color: #1a5fb4; }
.iw-ck-macro-menu-item--success { color: #0d7a4e; }
.iw-ck-macro-menu-item--warning { color: #b45309; }
.iw-ck-macro-menu-item--error { color: #b91c1c; }

.iw-ck-toc-btn {
    margin-left: 0;
}

.iw-ck-qa-btn:hover,
.iw-ck-macro-wrap.open .iw-ck-qa-btn {
    background-color: var(--ck-color-button-on-background, #eef1f4);
}

.iw-ck-macro-menu-item--qa {
    color: #256cb0;
}

/* Sekcja Q&A – frontend */
.iw-qa-section {
    margin: 2.75rem 0;
    padding: 1.75rem 1.5rem;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid var(--iw-border, #e8edf3);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.iw-qa-section-title {
    margin: 0 0 1.35rem;
    padding-left: 0.85rem;
    border-left: 4px solid var(--iw-blue, #2563eb);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--iw-blue-text, #16233a);
}

.iw-qa-section-title strong {
    font-weight: 700;
}

.iw-qa-accordion.iw-qa-flat {
    border: none;
}

.iw-qa-accordion.iw-qa-flat .accordion-item,
.iw-qa-flat .iw-qa-item {
    border: 1px solid var(--iw-border, #e8edf3);
    border-radius: 12px !important;
    margin-bottom: 0.65rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.iw-qa-accordion.iw-qa-flat .accordion-item:hover,
.iw-qa-flat .iw-qa-item:hover {
    border-color: #cfe0f7;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.iw-qa-accordion.iw-qa-flat .accordion-item:last-child,
.iw-qa-flat .iw-qa-item:last-child {
    margin-bottom: 0;
}

.iw-qa-accordion.iw-qa-flat .accordion-button,
.iw-qa-flat .iw-qa-question {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
    background: #fff;
    padding: 1.15rem 3rem 1.15rem 1.35rem;
    border-radius: 12px;
    box-shadow: none !important;
    line-height: 1.45;
    text-align: left;
    width: 100%;
}

.iw-qa-accordion.iw-qa-flat .accordion-button p,
.iw-qa-flat .iw-qa-question p {
    margin: 0;
    display: inline;
}

.iw-qa-accordion.iw-qa-flat .accordion-button:not(.collapsed),
.iw-qa-flat .iw-qa-question:not(.collapsed) {
    color: var(--iw-blue, #2563eb);
    background: #f0f7ff;
}

.iw-qa-accordion.iw-qa-flat .accordion-button::after {
    filter: none;
    opacity: 0.7;
}

.iw-qa-accordion.iw-qa-flat .accordion-body,
.iw-qa-flat .iw-qa-answer {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 0.85rem 1.35rem 1.35rem;
    background: #f9fafb;
    border-top: 1px solid #eef2f7;
}

.iw-qa-answer p:last-child {
    margin-bottom: 0;
}

/* Sekcja Q&A – placeholder w edytorze */
.ck-content blockquote.iw-qa-section-placeholder,
.iw-qa-section-placeholder {
    border: none;
    margin: 1.75rem 0;
    padding: 1.35rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid #dbe4ef;
    font-style: normal;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.ck-content blockquote.iw-qa-section-placeholder .iw-qa-marker,
.iw-qa-section-placeholder .iw-qa-marker {
    display: none !important;
}

.iw-qa-section-placeholder .iw-qa-section-title {
    margin: 0 0 1.1rem;
    padding: 0 0 0.85rem 0.85rem;
    border-bottom: 1px solid #dbe4ef;
    border-left: 4px solid var(--iw-blue, #2563eb);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--iw-blue-text, #16233a);
}

.ck-content blockquote.iw-qa-pair-placeholder,
.iw-qa-section-placeholder blockquote.iw-qa-pair-placeholder,
.iw-qa-pair-placeholder {
    margin: 0.85rem 0 0;
    padding: 0.85rem 1rem;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #fff;
    font-style: normal;
}

.ck-content blockquote.iw-qa-pair-placeholder .iw-qa-pair-marker,
.iw-qa-pair-placeholder .iw-qa-pair-marker,
.ck-content blockquote.iw-qa-pair-placeholder .iw-qa-q-marker,
.iw-qa-pair-placeholder .iw-qa-q-marker,
.ck-content blockquote.iw-qa-pair-placeholder .iw-qa-a-marker,
.iw-qa-pair-placeholder .iw-qa-a-marker {
    display: none !important;
}

.iw-qa-section-placeholder .iw-qa-pair-sep {
    border: 0;
    border-top: 1px dashed #cbd5e1;
    margin: 1.1rem 0;
}

.iw-qa-section-placeholder .iw-qa-pair {
    padding: 0.9rem 0;
    border-top: 1px solid #e2e8f0;
}

.iw-qa-section-placeholder .iw-qa-pair:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.iw-qa-section-placeholder .iw-qa-question {
    margin: 0 0 0.55em;
    font-weight: 700;
    font-size: 0.98rem;
    color: #111827;
}

.iw-qa-section-placeholder .iw-qa-question + p,
.iw-qa-section-placeholder p.iw-qa-answer,
.iw-qa-section-placeholder .iw-qa-answer {
    margin: 0;
    color: #4b5563;
    line-height: 1.65;
}

/* Spis treści – frontend i edytor */
.iw-toc,
.ck-content .iw-toc-placeholder {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.iw-toc-title,
.ck-content .iw-toc-placeholder .iw-toc-title {
    margin: 0 0 0.65em;
    font-weight: 700;
    color: #334155;
}

.iw-toc-list,
.ck-content .iw-toc-placeholder .iw-toc-list {
    margin: 0;
    padding-left: 1.25em;
    list-style: disc;
}

.iw-toc-list .iw-toc-level-3,
.ck-content .iw-toc-placeholder .iw-toc-level-3 {
    margin-left: 1em;
    list-style: circle;
}

.iw-toc-list .iw-toc-level-4,
.ck-content .iw-toc-placeholder .iw-toc-level-4 {
    margin-left: 2em;
    list-style: square;
}

.iw-toc-list a,
.ck-content .iw-toc-placeholder .iw-toc-list a {
    color: #256cb0;
    text-decoration: underline;
}

.iw-toc-empty,
.ck-content .iw-toc-placeholder .iw-toc-empty {
    margin: 0;
    color: #64748b;
    font-size: 0.9375rem;
    font-style: italic;
}

.ck-content blockquote.iw-toc-placeholder,
.iw-toc-placeholder {
    border: none;
    font-style: normal;
}

.ck-content blockquote.iw-toc-placeholder .iw-toc-marker,
.iw-toc-placeholder .iw-toc-marker {
    display: none !important;
}

body.iw-admin .ck.ck-editor__main > .ck-editor__editable {
    min-height: 280px;
}

body.iw-admin .ck.ck-toolbar {
    flex-wrap: wrap;
}
