/* 
 * Haupt-Styling für den Details-Block.
*/
details.harsch-accordion {
    padding: 2rem 0;
    /* margin-bottom: 1rem; */
}

/* 
 * Der Summary-Titel.
*/
details.harsch-accordion > summary {
    cursor: pointer;
    position: relative;
    padding: 0.5rem 0.5rem 0.5rem 52px; /* Platz für das 40px Icon + 12px Abstand */
    list-style: none; /* Entfernt den Standard-Pfeil in Firefox */
}

/* 
 * Überschrift im Accordion
*/
details.harsch-accordion .accordion-title {
    font-weight: bold;
    font-size: 1.5em;
    margin: 0;
    margin-left: 2rem;
}

/* 
 * Beschreibung im Accordion
*/
details.harsch-accordion .accordion-description {
    font-weight: normal;
    margin: 0;
}

/* 
 * Flexbox-Styling für die Summary, wenn Inhalte per JavaScript verschoben wurden.
*/
details.harsch-accordion > summary.accordion-summary-flex {
    display: flex;
    justify-content: space-between;
    align-items: start; /* Geändert von center zu start */
    gap: 4rem;
    flex-wrap: wrap;
    padding: 0; /* Entfernt das Padding auf mobilen Geräten */
}

/* 
 * Spezielles Styling für die Überschrift im Flex-Layout auf mobilen Geräten
*/
details.harsch-accordion > summary.accordion-summary-flex .accordion-title {
    margin-left: 4rem;
}
details.harsch-accordion > summary.accordion-summary-flex:hover .accordion-title {
    text-decoration: underline;
}

/* 
 * 1/3 zu 2/3 Aufteilung innerhalb der Summary.
 * Das erste Kind (h2) erhält 1/3, das zweite Kind (wp-block-group) erhält 2/3.
*/
details.harsch-accordion > summary.accordion-summary-flex > *:first-child {
    flex: 1 1 0; /* 1/3 des verfügbaren Platzes */
}

details.harsch-accordion > summary.accordion-summary-flex > *:nth-child(2) {
    flex: 2 1 0; /* 2/3 des verfügbaren Platzes */
}

/* 
 * Die ERSTE Gruppe (der Vorschau-Text).
 * Sie wird per JavaScript in die Summary verschoben.
*/
details.harsch-accordion > summary + .wp-block-group {
    margin-top: 0; /* Standard-Margin entfernen */
}

/* 
 * Die ZWEITE Gruppe (der aufklappbare Inhalt).
*/
details.harsch-accordion > .wp-block-group:last-of-type {
    padding-top: 1rem;
    margin-top: 1rem;
}

/* --- Styling für den Toggle-Button --- */

/* Standard-Pfeil des Browsers entfernen */
details.harsch-accordion > summary::-webkit-details-marker {
    display: none; /* Für Chrome, Safari, Edge */
}

/* Container für das Toggle-Icon */
details.harsch-accordion > summary::before {
    content: "\F282"; /* Icon für geschlossenes Akkordeon */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    top: -5px;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border-radius: 50%;
    border: 2px solid var(--color-secondary-100);
    box-shadow: 0px 2px 4px -2px #0000000F, 0px 4px 8px -2px #0000001A;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-secondary-900);
}

/* Icon wechseln, wenn das Akkordeon geöffnet ist */
details.harsch-accordion[open] > summary::before {
    content: "\F286"; /* Icon für geöffnetes Akkordeon */
}

/* Layout */

details.harsch-accordion > .wp-block-group>div>div{
    margin-top: 2rem;
}

@media(max-width: 768px){
    details.harsch-accordion {
        margin-bottom: 2rem;

        > .wp-block-group>div{
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        } 
    }
    
    details.harsch-accordion > summary.accordion-summary-flex {
        align-items: start; /* Geändert von center zu start */
        gap: 1rem;
    }

    details.harsch-accordion figure{
        padding: 2rem 0 1rem;
    }
}
