/* ============================================================
   PLAY-ALL TITLE
   ============================================================ */
.play-all-title-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 8px;
}
.play-all-title {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0 8px;
    background: #fff;
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-color);
    line-height: 1.3;
    max-width: 100%;
    text-align: center;
    word-break: break-word;
}
.play-all-title-main {
    display: inline;
}
.play-all-title-sub {
    display: inline;
}
.play-all-title-sub:empty {
    display: none;
}

/* ============================================================
   PLAY-ALL STICKY WRAP (buitenste kader transparant)
   ============================================================ */
.play-all-sticky-wrap {
    text-align: center;
    margin: 0 auto 16px;
}
.play-all-sticky-wrap.playing {
    position: sticky;
    top: 180px;
    z-index: 500;
    padding: 6px 0;
}

/* ============================================================
   PLAY-ALL WRAPPER (met achtergrond — knoppen leesbaar houden)
   ============================================================ */
.play-all-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    max-width: 100%;
}
.play-all-toggle-wrapper {
    justify-content: center;
    flex-wrap: wrap;
    width: fit-content;
    margin: 0 auto 16px;
}
.play-all-toggle-wrapper.playing {
    position: sticky;
    top: 180px;
    z-index: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border-color: #f59e0b;
    background-color: #fef9c3;
}
.play-all-sticky-wrap .play-all-toggle-wrapper {
    margin: 0 auto;
}
.play-all-sticky-wrap .play-all-toggle-wrapper.playing {
    position: static;
    top: auto;
    border-color: #f59e0b;
    background-color: #fef9c3;
}

.play-all-wrapper .play-icon { height: 28px; }
.play-all-wrapper .ctrl-icon { height: 22px; }
.play-all-wrapper .stop-btn .ctrl-icon { height: 22px; }

.play-all-toggle-wrapper .switch-container { gap: 4px; }
.play-all-toggle-wrapper .switch-track { width: 32px; height: 18px; }
.play-all-toggle-wrapper .switch-thumb { width: 14px; height: 14px; }
.play-all-toggle-wrapper .switch-container[data-mode="ar"] .switch-thumb { transform: translateX(14px); }
.play-all-toggle-wrapper .no-switch-label { font-size: 0.7rem; }

.switch-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 0 4px;
    margin: 0 4px;
}
.switch-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.2s;
}
.switch-label.active { color: #1e293b; }
.switch-track {
    position: relative;
    width: 32px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 12px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    transform: translateX(0);
}
.switch-container[data-mode="ar"] .switch-track {
    background: var(--primary-color);
}
.switch-container[data-mode="ar"] .switch-thumb {
    transform: translateX(14px);
}
.no-switch-label {
    font-weight: 600;
    font-size: 0.7rem;
    color: #475569;
    margin: 0 4px;
}

.play-all-wrapper .play-btn,
.play-all-wrapper .prev-btn,
.play-all-wrapper .next-btn,
.play-all-wrapper .stop-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.play-all-wrapper .play-btn:hover,
.play-all-wrapper .prev-btn:hover,
.play-all-wrapper .next-btn:hover,
.play-all-wrapper .stop-btn:hover {
    transform: scale(1.1);
}

.speaker-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.55;
}
.speaker-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}
.single-play-icon { height: 20px; width: auto; }

/* ============================================================
   LOADING-INDICATOR OP PLAY-BUTTONS
   ============================================================ */
.play-btn,
.speaker-icon {
    position: relative;
}

.play-btn.loading .play-icon,
.speaker-icon.loading .single-play-icon {
    visibility: hidden;
}

.play-btn.loading::after,
.speaker-icon.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    box-sizing: border-box;
    animation: btn-spin 0.7s linear infinite;
}

.play-btn.loading::after {
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border-width: 2px;
}

.speaker-icon.loading::after {
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border-width: 1.5px;
}

.speaker-icon.loading {
    opacity: 1;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   RESUME-BUTTON (Verder luisteren vanaf vers X)
   ============================================================ */
.play-all-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
    margin: 0 4px;
    line-height: 1.2;
}
.play-all-resume-btn:hover {
    background: #fde68a;
    transform: scale(1.04);
}

.play-all-resume-btn .resume-icon {
    width: 12px;
    height: 12px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}
.play-all-resume-btn .resume-num {
    font-weight: 700;
}

@media (max-width: 768px) {
    .play-all-resume-btn .resume-icon {
        width: 14px;
        height: 14px;
    }
}

/* ============================================================
   HOOFDSTUK PLAY-ALL ACHTER MORE-KNOP
   ============================================================ */
.chapter-play-wrapper-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 8px;
    gap: 8px;
    min-height: 32px;
}
.chapter-play-wrapper-container .play-all-toggle-wrapper.is-hidden {
    display: none;
}
.chapter-play-wrapper-container .play-all-toggle-wrapper {
    margin: 0 auto;
    width: auto;
}
.chapter-more-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.chapter-more-btn:hover {
    transform: translateY(-50%) scale(1.1);
    opacity: 0.85;
}
.chapter-more-btn img {
    height: 12px;
    width: auto;
    object-fit: contain;
}
.chapter-more-btn.active {
    background: #f1f5f9;
    border-radius: 50%;
}
html[dir="rtl"] .chapter-play-wrapper-container {
    justify-content: center;
}
html[dir="rtl"] .chapter-more-btn {
    right: auto;
    left: 0;
}

/* ============================================================
   SHORTCODES & BRONWEERGAVE
   ============================================================ */
.shortcode-container {
    background: transparent;
    border: none;
    padding: 0;
    margin: 28px 0;
    border-radius: 0;
}
html[dir="rtl"] .shortcode-container {
    border: none;
    border-radius: 0;
}
.chapter-header {
    margin: 0 0 18px;
    color: #1a1a1a;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.chapter-header .chapter-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: #000000;
    color: #ffffff;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.chapter-header .chapter-title-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
}
.chapter-header .chapter-title-link:hover,
.chapter-header .chapter-title-link:hover .chapter-title-name {
    color: #1a1a1a;
    text-decoration: none;
}
.chapter-header .chapter-title-name {
    color: #1a1a1a;
    line-height: 1.2;
}

.article-items { margin: 0; }

.article-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 0 4px 8px;
    border-bottom: none;
    line-height: 1.4;
    transition: background 0.2s, border-left 0.2s;
    position: relative;
    border-left: 3px solid transparent;
}
.article-item:hover { border-left-color: #e5e7eb; }

.article-number {
    flex: 0 0 28px;
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-decoration: none;
    line-height: inherit;
    transition: color 0.15s, transform 0.15s;
}
.article-number-link:hover {
    color: var(--primary-color);
    filter: brightness(0.85);
}
html[dir="rtl"] .article-number,
html[dir="rtl"] .article-number-link { text-align: left; }

.article-text {
    flex: 1;
    min-width: 0;
    color: #333;
    line-height: inherit;
}

.article-item.source-item {
    margin: 0 0 4px 30px;
    padding: 2px 0 2px 12px;
    background: transparent;
    border-left: 3px solid #f59e0b;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.4;
    gap: 0;
}
.article-item.source-item .article-text { color: #4b5563; }
.source-text {
    color: #4b5563;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
}
html[dir="rtl"] .article-item.source-item {
    margin: 0 30px 4px 0;
    padding: 2px 12px 2px 0;
    border-left: none;
    border-right: 3px solid #f59e0b;
}
html[dir="rtl"] .source-text {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left !important;
}
.article-item.transliteration-item {
    margin: 0 0 4px 30px;
    padding: 2px 0 2px 12px;
    background: transparent;
    border-left: 3px solid #8b5cf6;
    color: #5b21b6;
    font-size: 0.95rem;
    line-height: 1.4;
    gap: 0;
}
.transliteration-text {
    color: #5b21b6;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
    font-style: italic;
}
html[dir="rtl"] .article-item.transliteration-item {
    margin: 0 30px 4px 0;
    padding: 2px 12px 2px 0;
    border-left: none;
    border-right: 3px solid #8b5cf6;
}

.secde-icon { margin-right: 4px; }
.secde-icon img {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.highlight-audio {
    background-color: #fef9c3 !important;
    border-left: 4px solid #f59e0b !important;
}
html[dir="rtl"] .highlight-audio {
    border-left: none !important;
    border-right: 4px solid #f59e0b !important;
}
.highlight-single {
    background-color: #fef9c3 !important;
    border-left: 4px solid #f59e0b !important;
}
html[dir="rtl"] .highlight-single {
    border-left: none !important;
    border-right: 4px solid #f59e0b !important;
}

/* ============================================================
   CHAPTER-SOURCE ITEMS — container
   ============================================================ */
.chapter-source-items {
    margin: 10px 0;
    background: #fdfdfe;
    padding: 10px 12px;
    border-radius: 6px;
}

/* ============================================================
   VOETNOTEN
   ============================================================ */
.footnote-ref {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    vertical-align: super;
    margin: 0 2px;
    text-decoration: none;
}
.footnote-ref:hover { text-decoration: underline; }
.footnote-container {
    margin-top: 8px;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: footnoteReveal 0.25s ease-out;
}
@keyframes footnoteReveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.footnote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}
.footnote-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0 4px;
}
.footnote-close:hover { color: #111827; }
.footnote-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footnote-entry {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
}
.footnote-number {
    font-weight: 600;
    color: #4b5563;
    min-width: 24px;
}
.footnote-text { flex: 1; }

/* ============================================================
   MICRO-ANIMATIONS
   ============================================================ */
@keyframes playPulse {
    0%   { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}
.play-btn.pulse,
.speaker-icon.pulse {
    border-radius: 50%;
    animation: playPulse 0.6s ease-out;
}
.article-number.note-clickable:hover {
    transform: scale(1.08);
}