/* ==========================================================================
   COMPONENTS – Accordion, Modals, FAQ, Statutes, Newsletter, Shared Buttons
   ========================================================================== */

/* --- Custom Accordion (Design-Optimiert) --- */
.custom-accordion-wrapper {
    width: 100%;
    margin: 0;
}

.custom-accordion-wrapper .accordion-item {
    margin-bottom: 1rem;
    border-radius: 12px; /* Etwas sanfterer Radius */
    box-shadow: 0 4px 20px rgb(47 47 47 / 0.05); /* Weicherer Schatten */
    overflow: hidden;
    border: 1px solid var(--border-light);
    background-color: #fff;
}

.custom-accordion-wrapper .accordion-item:last-child {
    margin-bottom: 0;
}

/* Header Styling */
.custom-accordion-wrapper .accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.2rem 1.5rem;
    /* WAR: var(--bg-warm) -> JETZT: Neutrales Grau/Weiß */
    background-color: #f9f9f9; 
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.custom-accordion-wrapper .accordion-header:hover {
    background-color: #fff; /* Hover-Effekt */
}

.custom-accordion-wrapper .accordion-header[aria-expanded="true"] {
    background-color: #fff;
    border-bottom: 1px solid var(--border-soft); /* Trennlinie wenn offen */
}

/* Titel Typografie (Wichtig für dein Design!) */
.custom-accordion-wrapper .accordion-title {
    font-family: "Playfair Display", serif; /* Brand-Font */
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text-dark);
    line-height: 1.3;
}

.custom-accordion-wrapper .accordion-header:hover .accordion-title,
.custom-accordion-wrapper .accordion-header[aria-expanded="true"] .accordion-title {
    color: var(--color-primary); /* Wird primärfarben bei Aktivität */
}

/* Icon Animation (Plus/Minus) */
.custom-accordion-wrapper .accordion-icon {
    width: 1.5em;
    height: 1.5em;
    position: relative;
    flex-shrink: 0;
    margin-left: 1rem;
}

.custom-accordion-wrapper .accordion-icon::before,
.custom-accordion-wrapper .accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background-color: var(--color-primary); /* Deine Primärfarbe */
    border-radius: 1px;
    transition: transform 0.3s ease;
    transform: translate(-50%, -50%);
}

.custom-accordion-wrapper .accordion-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.custom-accordion-wrapper .accordion-header[aria-expanded="true"] .accordion-icon::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Panel & Content */
.custom-accordion-wrapper .accordion-panel {
    background-color: #fff;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-out;
}

.custom-accordion-wrapper .accordion-content {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    line-height: 1.7;
    color: var(--color-text);
    font-family: "Lato", sans-serif; /* Fließtext Font */
}

/* Überschriften im Content anpassen */
.custom-accordion-wrapper .accordion-content h1,
.custom-accordion-wrapper .accordion-content h2,
.custom-accordion-wrapper .accordion-content h3,
.custom-accordion-wrapper .accordion-content h4,
.custom-accordion-wrapper .accordion-content h5,
.custom-accordion-wrapper .accordion-content h6 {
    font-family: "Playfair Display", serif;
    color: var(--color-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.custom-accordion-wrapper .accordion-content p,
.custom-accordion-wrapper .accordion-content ul,
.custom-accordion-wrapper .accordion-content ol {
    max-width: 75ch; /* Lesbare Zeilenlänge */
    margin-bottom: 1.25rem;
}

.custom-accordion-wrapper .accordion-content ul,
.custom-accordion-wrapper .accordion-content ol {
    padding-left: 1.5rem;
}

.custom-accordion-wrapper .accordion-content li {
    margin-bottom: 0.5rem;
}

.custom-accordion-wrapper .accordion-content strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* --- Close-Trigger (Einklappen Link) --- */
.close-trigger-wrapper {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 1rem;
    border-top: 1px dashed var(--border-light); /* Visuelle Trennung */
}

.accordion-close-trigger {
    background: none;
    border: none;
    color: var(--color-primary);
    font-family: "Lato", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.accordion-close-trigger:hover {
    background-color: var(--bg-warm);
}

.close-icon-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid var(--color-primary);
}

/* --- Social Modal --- */
.social-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgb(47 47 47 / 0.6);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0s 0.3s;
}
.social-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}
.social-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgb(0 0 0 / 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.social-modal-overlay.active .social-modal-content {
    transform: scale(1);
}
.social-modal-content h3 {
    font-family: "Georgia", serif;
    font-size: 1.5rem;
    color: var(--color-primary);
    margin: 0 0 1rem 0;
}
.social-modal-content p {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.social-modal-content p a {
    color: var(--color-primary);
    font-weight: 400;
}
.social-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}
.social-modal-close:hover {
    color: var(--color-primary);
}
.social-modal-confirm-btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff !important;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    transition: background-color 0.3s ease;
}
.social-modal-confirm-btn:hover {
    background-color: var(--color-primary-dark);
}

/* --- FAQ Accordion (Kurzform) --- */
.faq-accordion .faq-item {
    border-bottom: 1px solid var(--border-light);
}
.faq-accordion .faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-dark);
}
.faq-accordion .faq-question:hover {
    color: var(--color-primary);
}
.faq-accordion .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}
.faq-accordion .faq-item.active .faq-answer {
    padding-bottom: 1.5rem;
}

/* --- FAQ Accordion (Vollform) --- */
.faq-accordion {
    margin-top: 3rem;
}
.faq-item {
    border-bottom: 1px solid var(--border-soft);
}
.faq-item:first-child {
    border-top: 1px solid var(--border-soft);
}
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0.5rem;
    cursor: pointer;
}
.faq-question h4 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--color-text-dark);
    font-weight: 700;
    transition: color 0.3s ease;
}
.faq-icon {
    font-size: 1.1rem;
    color: var(--color-primary);
    transition: transform 0.4s ease;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition:
        max-height 0.5s ease,
        padding 0.5s ease;
}
.faq-answer p {
    font-size: 1rem;
    line-height: 1.7;
    padding: 0 0.5rem;
    text-align: justify;
    color: var(--color-text);
}
.faq-question:hover h4,
.faq-item.active .faq-question h4 {
    color: var(--color-primary);
}
.faq-item.active .faq-icon {
    transform: rotate(180deg);
}
.faq-item.active .faq-answer {
    padding-bottom: 2rem;
}

/* --- Statutes Accordion --- */
.interactive-statutes .statutes-accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem;
    background-color: var(--bg-warm);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background-color 0.3s ease;
}
.interactive-statutes .statutes-accordion-trigger:hover,
.interactive-statutes .statutes-accordion-trigger.active {
    background-color: var(--border-light);
}
.interactive-statutes .statutes-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    padding: 0 1.25rem;
}

/* --- Newsletter-Formular --- */
#manual-newsletter-form-wrapper {
    border: 1px solid var(--border-light);
}
#manual-newsletter-form .newsletter-form-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}
.newsletter-consent-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 600px;
    margin: 1.5rem auto 0;
    text-align: left;
}
.newsletter-consent-row input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 3px;
    flex-shrink: 0;
}
.newsletter-consent-row label {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.6;
    font-weight: 400;
}
.newsletter-consent-row label a {
    color: var(--color-primary);
    text-decoration: underline;
}
#manual-newsletter-form input[type="email"] {
    flex-grow: 1;
    max-width: 350px;
    border: 1px solid var(--border-soft);
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 1rem;
}

/* --- Shared Action Buttons (DSGVO, Load Feed) --- */
.dsgvo-confirm-button,
.load-feed-button {
    background: var(--color-primary); /* Bleibt Weinrot */
    color: #fff !important;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    /* WAR: rgb(141 45 72 / 0.25) -> JETZT: Neutraler schwarzer Schatten */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s;
}

.dsgvo-confirm-button:hover,
.load-feed-button:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* Neutraler Hover-Schatten */
    transform: translateY(-1px);
}
