/**
 * Q&A Accordion Styles
 * Placer denne fil i dit child theme under /spørgsmål-accordion/qa-accordion-style.css
 */

/* Import Korolev font hvis ikke allerede importeret */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* Container */
.qa-accordion-container {
    max-width: 800px;
    margin: 2rem auto;
    font-family: 'Korolev', sans-serif !important;
}

/* Title */
.qa-accordion-title {
    font-family: 'Korolev', sans-serif !important;
    font-size: 2.5rem;
    font-weight: 600;
    color: #8C7131;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.qa-accordion-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #54765d, transparent);
    border-radius: 2px;
}

/* Accordion */
.qa-accordion {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(140, 113, 49, 0.1);
    overflow: hidden;
    border: 1px solid rgba(140, 113, 49, 0.1);
}

/* Q&A Items */
.qa-item {
    border-bottom: 1px solid rgba(140, 113, 49, 0.1);
    transition: all 0.3s ease;
}

.qa-item:last-child {
    border-bottom: none;
}

.qa-item:hover {
    background-color: rgba(140, 113, 49, 0.02);
}

/* Questions (buttons) */
.qa-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 2rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Korolev', sans-serif !important;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    /* Bedre touch support */
    -webkit-tap-highlight-color: rgba(140, 113, 49, 0.1);
    touch-action: manipulation;
}

.qa-question:hover {
    color: #54765d;
    background-color: rgba(140, 113, 49, 0.05);
}

/* FIXED: Forbedret focus styling i stedet for at skjule elementet */
.qa-question:focus {
    outline: 2px solid #54765d;
    outline-offset: -2px;
    background-color: rgba(140, 113, 49, 0.05);
    color: #54765d;
}

.qa-question[aria-expanded="true"] {
    color: #54765d;
    background-color: rgba(140, 113, 49, 0.08);
}

.qa-question[aria-expanded="true"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #54765d;
}

/* Question Text */
.qa-question-text {
    flex: 1;
    margin-right: 1rem;
    line-height: 1.4;
}

/* Toggle Icon */
.qa-toggle-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: #8C7131;
    transition: transform 0.3s ease;
}

.qa-question[aria-expanded="true"] .qa-toggle-icon {
    transform: rotate(180deg);
}

.qa-toggle-icon svg {
    width: 100%;
    height: 100%;
}

/* Answers */
.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(140, 113, 49, 0.02);
}

.qa-answer.active {
    max-height: 500px; /* Adjust based on content */
}

.qa-answer-content {
    padding: 1rem 2rem 1.5rem 2rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.qa-answer.active .qa-answer-content {
    opacity: 1;
    transform: translateY(0);
}

/* Answer Text Styling */
.qa-answer-content p {
    font-family: 'Korolev', sans-serif !important;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    margin: 0 0 1rem 0;
}

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

.qa-answer-content ul {
    font-family: 'Korolev', sans-serif !important;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
    padding-left: 1.5rem;
}

.qa-answer-content li {
    margin-bottom: 0.5rem;
    position: relative;
}

.qa-answer-content li::marker {
    color: #8C7131;
}

/* Responsive Design */
@media (max-width: 768px) {
    .qa-accordion-container {
        margin: 1rem;
    }
    
    .qa-accordion-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .qa-question {
        padding: 1.5rem 1.5rem;
        font-size: 1.1rem;
        min-height: 60px; /* Større klik-område på mobil */
    }
    
    /* Bedre touch feedback på mobil */
    .qa-question:active {
        background-color: rgba(140, 113, 49, 0.1);
        transform: scale(0.98);
    }
    
    .qa-answer-content {
        padding: 1rem 1.5rem 1.25rem 1.5rem;
    }
    
    .qa-answer-content p,
    .qa-answer-content ul {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .qa-question {
        padding: 1.25rem 1rem;
        font-size: 1.1rem;
        min-height: 56px; /* Tilpas til mindre skærme */
    }
    
    .qa-answer-content {
        padding: 1rem 1rem 1rem 1rem;
    }
    
    .qa-accordion-title {
        font-size: 1.8rem;
    }
    
    /* Større toggle icon på små skærme */
    .qa-toggle-icon {
        width: 28px;
        height: 28px;
    }
}

/* Animation for smooth accordion opening */
@keyframes accordionOpen {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

@keyframes accordionClose {
    from {
        max-height: 500px;
        opacity: 1;
    }
    to {
        max-height: 0;
        opacity: 0;
    }
}

/* Loading animation for better UX */
.qa-accordion-container.loading .qa-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.qa-accordion-container.loading .qa-item:nth-child(1) { animation-delay: 0.1s; }
.qa-accordion-container.loading .qa-item:nth-child(2) { animation-delay: 0.2s; }
.qa-accordion-container.loading .qa-item:nth-child(3) { animation-delay: 0.3s; }
.qa-accordion-container.loading .qa-item:nth-child(4) { animation-delay: 0.4s; }
.qa-accordion-container.loading .qa-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}