/*
 * Procurement Champions – Beitrags-Bausteine
 * Gilt im Frontend (.brxe-post-content) und im Block-Editor (.editor-styles-wrapper).
 * Werte in px, weil Website (1rem = 10px) und Editor (1rem = 16px) unterschiedliche Grundgrößen haben.
 * Gruppen haben in diesem Theme (Frontend und Editor) einen inneren Container (.wp-block-group__inner-container),
 * Raster und Flex-Layouts hängen deshalb an diesem Element.
 * Josefin Sans sitzt hoch in der Zeile: Boxen und Buttons haben oben etwas mehr Innenabstand als unten.
 */

:is(.brxe-post-content, .editor-styles-wrapper) {
	--pc-teal: #007e9b;
	--pc-teal-dark: #00657d;
	--pc-teal-wash: rgba(0, 126, 155, 0.08);
	--pc-teal-line: #e6f4f7;
	--pc-dark: #282828;
	--pc-gray: #6c757d;
	--pc-accent: #ffd650;
	--pc-accent-hover: #ffca1f;
}

/* Überschriften und Einleitung */
:is(.brxe-post-content, .editor-styles-wrapper) h2 { font-size: 30px; line-height: 1.15; color: var(--pc-teal); margin: 44px 0 12px; }
:is(.brxe-post-content, .editor-styles-wrapper) h3 { font-size: 28px; line-height: 1.15; margin: 0 0 10px; }
:is(.brxe-post-content, .editor-styles-wrapper) :is(.lede, .is-style-pc-einleitung) { font-size: 20px; }

/* Innenleben aller Bausteine: Abstände zurücksetzen (überschreibt auch die Block-Abstände des Editors) */
:is(.brxe-post-content, .editor-styles-wrapper) :is(.icon-box-row, .icon-box, .journey-container, .journey-item, .journey-content, .final-cta, .author-box) > .wp-block-group__inner-container > * { margin: 0; max-width: none; }
.editor-styles-wrapper :is(.icon-box-row, .journey-container) > .wp-block-group__inner-container > .block-list-appender { grid-column: 1 / -1; }

/* Karten-Reihe */
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box-row { margin: 20px 0; }
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box-row > .wp-block-group__inner-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box-row.is-2-col > .wp-block-group__inner-container { grid-template-columns: 1fr 1fr; }
@media (max-width: 680px) {
	.brxe-post-content .icon-box-row > .wp-block-group__inner-container,
	.brxe-post-content .icon-box-row.is-2-col > .wp-block-group__inner-container { grid-template-columns: 1fr; }
}
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box { background: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); padding: 26px 20px 22px; text-align: center; }
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box h3.wp-block-heading { font-size: 20px; line-height: 1.3; margin-bottom: 6px; color: var(--pc-dark); }
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box p { font-size: 16px; line-height: 1.6; color: var(--pc-gray); }
:is(.brxe-post-content, .editor-styles-wrapper) .icon-box p.icon-badge { width: 48px; height: 48px; padding-top: 3px; box-sizing: border-box; background: var(--pc-teal); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px; line-height: 1; margin: 0 auto 14px; }

/* Zeitleiste */
:is(.brxe-post-content, .editor-styles-wrapper) .journey-container { padding: 20px 0; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-container > .wp-block-group__inner-container { display: flex; flex-direction: column; gap: 20px; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-item { position: relative; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-item > .wp-block-group__inner-container { display: flex; gap: 16px; align-items: flex-start; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-content { flex: 1; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-item::before { content: ''; position: absolute; left: 20px; top: 52px; bottom: -32px; width: 2px; background: var(--pc-teal-line); }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-item:last-child::before,
.editor-styles-wrapper .journey-item:nth-last-child(1 of .journey-item)::before { display: none; }
:is(.brxe-post-content, .editor-styles-wrapper) p.journey-icon { width: 40px; height: 40px; min-width: 40px; padding-top: 3px; box-sizing: border-box; background: var(--pc-teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; line-height: 1; position: relative; z-index: 1; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-content h3.wp-block-heading { color: var(--pc-teal); margin: 6px 0 4px; font-size: 20px; line-height: 1.3; }
:is(.brxe-post-content, .editor-styles-wrapper) .journey-content p { color: var(--pc-gray); }

/* Hinweisbox und Warnbox */
:is(.brxe-post-content, .editor-styles-wrapper) :is(.source-note, .is-style-pc-hinweis) { background: var(--pc-teal-wash); border-radius: 12px; padding: 22px 24px 18px; margin: 24px 0; }
:is(.brxe-post-content, .editor-styles-wrapper) :is(.warn, .is-style-pc-warnung) { background: #fff8e1; border-left: 4px solid var(--pc-accent); border-radius: 4px; padding: 18px 20px 14px; margin: 20px 0; font-size: 16px; }

/* FAQ als Akkordeon (Frontend-Ausgabe des Rank-Math-FAQ-Blocks) */
.brxe-post-content .pc-faq { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 8px; }
.brxe-post-content .pc-faq-item { background: #fff; border: 1px solid #e1eef1; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05); overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.brxe-post-content .pc-faq-item[open] { border-color: rgba(0, 126, 155, 0.35); box-shadow: 0 6px 20px rgba(0, 126, 155, 0.1); }
.brxe-post-content .pc-faq-question { display: block; list-style: none; cursor: pointer; position: relative; padding: 19px 60px 15px 22px; }
.brxe-post-content .pc-faq-question::-webkit-details-marker { display: none; }
.brxe-post-content .pc-faq-question::marker { content: ''; }
.brxe-post-content .pc-faq-question h3 { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 700; color: var(--pc-teal); }
.brxe-post-content .pc-faq-question::after { content: ''; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--pc-teal); border-bottom: 2px solid var(--pc-teal); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s ease; }
.brxe-post-content .pc-faq-item[open] .pc-faq-question::after { transform: translateY(-25%) rotate(-135deg); }
.brxe-post-content .pc-faq-question:hover h3 { color: var(--pc-teal-dark); }
.brxe-post-content .pc-faq-question:focus-visible { outline: 3px solid var(--pc-accent); outline-offset: -3px; border-radius: 12px; }
.brxe-post-content .pc-faq-answer { padding: 0 22px 18px; color: var(--pc-gray); }
.brxe-post-content .pc-faq-answer p { margin: 0; }

/* Call-to-Action */
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta { background: var(--pc-dark); color: #fff; border-radius: 20px; padding: 38px 36px 34px; margin-top: 40px; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta p { color: #fff; font-size: 18px; line-height: 1.6; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 26px; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .cta-row > * { margin: 0; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .wp-block-button__link { display: inline-flex; align-items: center; gap: 12px; padding: 16px 30px 12px; border: 2px solid transparent; border-radius: 200px; font-size: 16px; font-weight: 600; line-height: 1.2; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .wp-block-button__link:focus-visible { outline: 3px solid var(--pc-accent); outline-offset: 3px; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-primary .wp-block-button__link { background: var(--pc-accent); color: var(--pc-dark); }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-primary .wp-block-button__link::after { content: ''; width: 7px; height: 7px; margin-top: -3px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.2s ease; }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-primary .wp-block-button__link:hover { background: var(--pc-accent-hover); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255, 214, 80, 0.25); }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-primary .wp-block-button__link:hover::after { transform: translateX(3px) rotate(45deg); }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-outline .wp-block-button__link { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.85); }
:is(.brxe-post-content, .editor-styles-wrapper) .final-cta .pc-btn-outline .wp-block-button__link:hover { background: #fff; color: var(--pc-dark); border-color: #fff; }

/* Autorenbox mit Foto */
:is(.brxe-post-content, .editor-styles-wrapper) .author-box { background: var(--pc-teal-wash); border-radius: 12px; padding: 22px 24px 20px; margin-top: 28px; font-size: 16px; line-height: 1.6; }
:is(.brxe-post-content, .editor-styles-wrapper) .author-box > .wp-block-group__inner-container { display: flex; align-items: center; gap: 20px; }
:is(.brxe-post-content, .editor-styles-wrapper) .author-box > .wp-block-group__inner-container > :not(.author-box-photo) { flex: 1; }
:is(.brxe-post-content, .editor-styles-wrapper) .author-box strong { color: var(--pc-teal); }
:is(.brxe-post-content, .editor-styles-wrapper) .author-box-photo { flex: 0 0 88px; margin: 0; }
:is(.brxe-post-content, .editor-styles-wrapper) .author-box-photo img { display: block; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
@media (max-width: 480px) {
	.brxe-post-content .author-box-photo { flex-basis: 64px; }
	.brxe-post-content .author-box-photo img { width: 64px; height: 64px; }
}

/* ===== Blöcke „Karten-Reihe“ (pc/karten) und „Zeitleiste“ (pc/zeitleiste) ===== */

/* Karten-Reihe: Raster mit automatischer Nummer */
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: pc-karte; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karten.is-2-col { grid-template-columns: repeat(2, 1fr); }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karten.is-4-col { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 680px) { .brxe-post-content .pc-karten.pc-karten { grid-template-columns: 1fr; } }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karten > .pc-karte { margin: 0; max-width: none; counter-increment: pc-karte; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karte > * { margin: 0; max-width: none; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-karten.is-nummeriert > .pc-karte::before { content: counter(pc-karte); width: 48px; height: 48px; padding-top: 3px; box-sizing: border-box; background: var(--pc-teal); border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px; line-height: 1; margin: 0 auto 14px; }

/* Zeitleiste: Schritte mit Kreis-Nummer und Verbindungslinie */
:is(.brxe-post-content, .editor-styles-wrapper) .pc-zeitleiste { display: flex; flex-direction: column; gap: 20px; padding: 20px 0; margin: 0; counter-reset: pc-schritt; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-zeitleiste > .pc-schritt { position: relative; min-height: 40px; padding-left: 56px; margin: 0; max-width: none; counter-increment: pc-schritt; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-schritt::before { content: counter(pc-schritt); position: absolute; left: 0; top: 0; width: 40px; height: 40px; padding-top: 3px; box-sizing: border-box; border-radius: 50%; background: var(--pc-teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; line-height: 1; z-index: 1; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-schritt::after { content: ''; position: absolute; left: 20px; top: 52px; bottom: -32px; width: 2px; background: var(--pc-teal-line); }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-zeitleiste > .pc-schritt:nth-last-child(1 of .pc-schritt)::after { display: none; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-schritt > * { margin: 0; max-width: none; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-schritt h3.wp-block-heading { color: var(--pc-teal); margin: 6px 0 4px; font-size: 20px; line-height: 1.3; }
:is(.brxe-post-content, .editor-styles-wrapper) .pc-schritt p { color: var(--pc-gray); }

/* Editor: Button „hinzufügen“ unter Karten und Schritten */
.editor-styles-wrapper .pc-karten > .block-list-appender { grid-column: 1 / -1; margin: 0; }
.editor-styles-wrapper .pc-zeitleiste > .block-list-appender { margin: 0 0 0 56px; }
.editor-styles-wrapper .pc-appender.components-button { font-family: inherit; font-size: 14px; border-radius: 200px; }
