/*
 * Gestaltung von Textseiten und Editor-Blöcken (Impressum, Datenschutz, AGB, FAQ ...).
 * Gilt im Frontend für .entry-content und wird im Block-Editor auf den Editor-Body übertragen.
 */

/* Seitenhintergrund bis zum Footer durchziehen, auch wenn der Inhalt kurz ist */
body:has(.text-page) {
    background: var(--top);
}

.text-page {
    background: var(--top);
    min-height: 60vh;
    padding: 24px 24px 96px;
}

.text-page__inner {
    max-width: 760px;
    margin: 0 auto;
}

.text-page__title {
    margin: 0 0 40px;
    font-size: 48px;
    line-height: 1.08;
    letter-spacing: -1.8px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Text */
.entry-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--white);
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content figure,
.entry-content table,
.entry-content pre,
.entry-content .wp-block-buttons {
    margin: 0 0 1.25em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 2em 0 0.6em;
    line-height: 1.2;
    color: var(--white);
}
.entry-content h2 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.76px;
}
/* Abschnitte auf Textseiten (Impressum, Datenschutz, AGB ...): halbtransparente Trennlinie vor jeder Überschrift */
.text-page .entry-content > h2:not(:first-child) {
    margin-top: 1.6em;
    padding-top: 1.6em;
    border-top: 1px solid rgba(247, 247, 248, 0.18);
}
.entry-content h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
}
.entry-content h4 {
    font-size: 17.6px;
    font-weight: 600;
    letter-spacing: -0.26px;
}
.entry-content > :first-child {
    margin-top: 0;
}

.entry-content a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: #9899a6;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.entry-content a:hover {
    color: var(--lime);
    text-decoration-color: var(--lime);
}

.entry-content strong {
    font-weight: 700;
}

.entry-content small,
.entry-content .has-small-font-size,
.entry-content figcaption {
    font-size: 14px;
    color: #9899a6;
}

/* Listen */
.entry-content ul,
.entry-content ol {
    padding-left: 1.4em;
}
.entry-content li {
    margin-bottom: 0.4em;
}
.entry-content li::marker {
    color: #9899a6;
}

/* Zitat */
.entry-content blockquote {
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--purple);
    color: #d6d5da;
}
.entry-content blockquote p {
    margin-bottom: 0.6em;
}
.entry-content blockquote cite {
    font-size: 14px;
    font-style: normal;
    color: #9899a6;
}

/* Trenner */
.entry-content hr,
.entry-content .wp-block-separator {
    height: 1px;
    margin: 2.5em 0;
    border: 0;
    background: #24222a;
    opacity: 1;
}

/* Tabelle */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.entry-content th,
.entry-content td {
    padding: 10px 12px;
    border-bottom: 1px solid #24222a;
    text-align: left;
    vertical-align: top;
}
.entry-content th {
    font-weight: 600;
    color: var(--white);
    border-bottom-color: #49434f;
}
.entry-content figure.wp-block-table {
    overflow-x: auto;
}

/* Code */
.entry-content code,
.entry-content pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
}
.entry-content code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #211e26;
}
.entry-content pre {
    padding: 16px;
    overflow-x: auto;
    border: 1px solid #6a6375;
    border-radius: 12px;
    background: #211e26;
}
.entry-content pre code {
    padding: 0;
    background: none;
}

/* Bilder */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Buttons (Block "Button") wie die Seiten-Buttons */
.entry-content .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.entry-content .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 99px;
    background: var(--lime);
    color: #0d0b12;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.25s cubic-bezier(.2, .8, .2, 1);
}
.entry-content .wp-block-button__link:hover {
    color: #0d0b12;
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.entry-content .is-style-outline .wp-block-button__link {
    background: transparent;
    border-color: #ddd;
    color: var(--white);
    font-weight: 400;
}
.entry-content .is-style-outline .wp-block-button__link:hover {
    color: var(--white);
}

/* Details-Block (FAQ) */
.entry-content details {
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid #24222a;
}
.entry-content details:first-of-type {
    border-top: 1px solid #24222a;
}
.entry-content summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.entry-content summary::-webkit-details-marker {
    display: none;
}
.entry-content summary::after {
    content: "+";
    color: #9899a6;
}
.entry-content details[open] summary::after {
    content: "\2212";
}
.entry-content details:last-of-type {
    margin-bottom: 1.75em;
}
.entry-content details > :not(summary) {
    margin-top: 0.8em;
    color: #d6d5da;
}

/* Kontaktseite: Box "Direkt erreichen" (gear_dock_contact_box in functions.php) */
.text-page {
    position: relative;
}
.contact-box {
    margin: 2.5em 0 0;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--card);
}
.entry-content .contact-box h2 {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    font-size: 18px;
    letter-spacing: 0;
}
.entry-content .contact-box p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}
@media (min-width: 1000px) {
    /* oben rechts, bündig mit dem Seitentitel; an der Spalte, solange rechts daneben kein Platz ist */
    .text-page__inner {
        position: relative;
    }
    .contact-box {
        position: absolute;
        top: 0;
        right: 0;
        width: 260px;
        margin: 0;
    }
    .text-page__inner:has(.contact-box) .entry-content > p:first-child {
        max-width: calc(100% - 300px);
    }
}
@media (min-width: 1400px) {
    /* genug Platz: Box am rechten Seitenrand unter dem Header */
    .text-page__inner {
        position: static;
    }
    .contact-box {
        top: 24px;
        right: 24px;
    }
    .text-page__inner:has(.contact-box) .entry-content > p:first-child {
        max-width: none;
    }
}

@media (max-width: 900px) {
    .text-page {
        padding: 8px 24px 72px;
    }
    .text-page__title {
        font-size: 36px;
        letter-spacing: -1.35px;
        margin-bottom: 28px;
    }
    .entry-content h2 {
        font-size: 26px;
    }
}
