/* ========================================================================
   com_bibbia - Stili specifici view Read
   ======================================================================== */

.com-bibbia-read .bibbia-read-form {
    margin-bottom: 18px;
}

.com-bibbia-read .bibbia-read-versions,
.com-bibbia-read .bibbia-read-testaments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.com-bibbia-read .bibbia-read-version-option,
.com-bibbia-read .bibbia-read-testaments label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.com-bibbia-read .bibbia-read-version-option:hover,
.com-bibbia-read .bibbia-read-testaments label:hover {
    border-color: #1c99ba;
    background: #f7fcfd;
}

.com-bibbia-read .bibbia-read-version-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #24323a;
}

.com-bibbia-read select {
    background: #fff;
    min-width: 220px;
}

.com-bibbia-read select:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.com-bibbia-read .bibbia-read-output {
    margin-top: 18px;
}

.com-bibbia-read .bibbia-read-meta {
    margin-bottom: 14px;
}

.com-bibbia-read .bibbia-read-meta-info {
    padding: 10px 12px;
    border: 1px solid #dbe8ec;
    border-radius: 4px;
    background: #f8fcfd;
    color: #24404d;
}

.com-bibbia-read .bibbia-read-meta-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.35;
    color: #24323a;
}

.com-bibbia-read .bibbia-read-meta-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 8px;
    font-size: 0.92rem;
    color: #4d616c;
}

.com-bibbia-read .bibbia-read-audio {
    margin: 0 0 14px 0;
}

.com-bibbia-read .bibbia-read-audio audio {
    width: 100%;
    max-width: 640px;
    display: block;
}

.com-bibbia-read .bibbia-read-chapter-block {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-left: 3px solid #1c99ba;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.com-bibbia-read .bibbia-read-chapter-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    line-height: 1.35;
    color: #24323a;
}

.com-bibbia-read .bibbia-read-verse {
    margin: 0 0 7px 0;
    line-height: 1.55;
    color: #333;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.com-bibbia-read .bibbia-read-verse:last-child {
    margin-bottom: 0;
}

.com-bibbia-read .bibbia-read-verse-number {
    font-weight: 700;
    margin-right: 6px;
    color: #24323a;
}

.com-bibbia-read .bibbia-read-verse-text {
    color: #333;
}

.com-bibbia-read .bibbia-read-empty {
    margin: 0;
    color: #666;
    font-style: italic;
}

/* Popup/fullscreen Read */

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-meta-info {
    margin-bottom: 14px;
}

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-audio {
    margin-bottom: 16px;
}

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-audio audio {
    width: 100%;
    max-width: 640px;
}

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-chapter-block {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #1c99ba;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-verse {
    margin: 0 0 6px 0;
    line-height: 1.38;
    font-size: 1em;
}

.bc-modal-content .bibbia-read-fullscreen .bibbia-read-verse-number,
.bc-modal-content .bibbia-read-fullscreen .bibbia-read-verse-text {
    font-size: inherit;
    line-height: inherit;
}

/* Responsive */

@media (max-width: 600px) {
    .com-bibbia-read .bibbia-read-versions,
    .com-bibbia-read .bibbia-read-testaments {
        flex-direction: column;
        align-items: stretch;
    }

    .com-bibbia-read .bibbia-read-version-option,
    .com-bibbia-read .bibbia-read-testaments label {
        width: 100%;
    }

    .com-bibbia-read select {
        width: 100%;
        min-width: 0;
    }

    .com-bibbia-read .bibbia-read-meta-subtitle {
        flex-direction: column;
        gap: 6px;
    }

    .com-bibbia-read .bibbia-read-chapter-block {
        padding: 12px;
    }

    .bc-modal-title {
        display: none !important;
    }

    .bc-modal-toolbar {
        padding: 10px 12px;
        gap: 8px;
        align-items: flex-start;
    }

    .bc-modal-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .bc-modal-inner {
        max-width: 100%;
        padding: 10px 10px 18px;
    }
}

@media (max-width: 480px) {
    .bc-modal .plg-font-resizer-container .btn-size-down,
    .bc-modal .plg-font-resizer-container .btn-size-reset,
    .bc-modal .plg-font-resizer-container .btn-size-up {
        min-width: 38px;
        height: 36px;
    }

    .bc-modal-toolbar .bc-modal-bold-toggle,
    .bc-modal-toolbar .bc-modal-fs-toggle,
    .bc-modal-toolbar .bc-modal-close {
        min-width: 44px;
        text-align: center;
        padding: 8px 10px;
    }
}

/* ========================================================================
   OVERRIDE UI per allineamento a Search / Compare
   ======================================================================== */

/* Label NON bold */
.com-bibbia-read .bibbia-read-version-label {
    font-weight: 400;
}

/* Select come Search */
.com-bibbia-read select {
    width: 100%;
    min-width: 0;
}

/* Pulsanti: altezza uniforme */
.com-bibbia-read .bibbia-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Reset rosso (usa classe core già presente) */
.com-bibbia-read .bibbia-btn.btn-reset {
    background-color: #a41e39;
}

.com-bibbia-read .bibbia-btn.btn-reset:hover {
    background-color: #7c001f;
}

/* Fullscreen disabilitato stile coerente */
.com-bibbia-read .bibbia-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    color: #fff;
    cursor: not-allowed;
}

/* Miglior allineamento form actions */
.com-bibbia-read .form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Select spacing coerente */
.com-bibbia-read .form-group label {
    display: inline-block;
    margin-bottom: 6px;
    font-weight: 400;
}

/* ========================================================================
   Navigazione capitoli (Read)
   ======================================================================== */

.com-bibbia-read .bibbia-read-chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* Pulsante precedente (sinistra) */
.com-bibbia-read .bibbia-read-prev-chapter {
    margin-right: auto;
}

/* Pulsante successivo (destra) */
.com-bibbia-read .bibbia-read-next-chapter {
    margin-left: auto;
}

/* Se esiste un solo bottone → posizionamento corretto */
.com-bibbia-read .bibbia-read-chapter-nav:has(.bibbia-read-next-chapter):not(:has(.bibbia-read-prev-chapter)) {
    justify-content: flex-end;
}

.com-bibbia-read .bibbia-read-chapter-nav:has(.bibbia-read-prev-chapter):not(:has(.bibbia-read-next-chapter)) {
    justify-content: flex-start;
}

/* ========================================================================
   NAVIGAZIONE CAPITOLI - FIX POPUP
   ======================================================================== */

/* layout base (vale anche per popup) */
.bibbia-read-chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

/* precedente a sinistra */
.bibbia-read-prev-chapter {
    margin-right: auto;
}

/* successivo a destra */
.bibbia-read-next-chapter {
    margin-left: auto;
}

/* fallback: un solo pulsante */
.bibbia-read-chapter-nav:has(.bibbia-read-next-chapter):not(:has(.bibbia-read-prev-chapter)) {
    justify-content: flex-end;
}

.bibbia-read-chapter-nav:has(.bibbia-read-prev-chapter):not(:has(.bibbia-read-next-chapter)) {
    justify-content: flex-start;
}