/* ============================================
   Assyrian4all / Chaldean4all Holy Bible
   Light Blue Theme  (matches Arabic Cartoon build)
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #cfe9ff 0%, #a8d8f0 50%, #7fc2e8 100%);
    color: #0a3a5c;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

a { color: #0a3a5c; text-decoration: none; }

/* ===== Header band ===== */
.top-band {
    width: 100%;
    background: linear-gradient(180deg, #b5dcf3, #8fc3e3);
    border-bottom: 4px double #1a5680;
    text-align: center;
    padding: 10px 0;
    position: relative;
}
.top-band .title-pill {
    display: inline-block;
    padding: 6px 26px;
    background: #fff;
    border: 2px solid #1a5680;
    border-radius: 18px;
    font-weight: 700;
    color: #0a3a5c;
    font-size: 1.05rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 6px rgba(10,58,92,0.18);
}
.top-band .title-pill span { margin: 0 24px; }

/* ===== Main outer frame (red border) ===== */
.outer-frame {
    margin: 14px auto;
    width: 96%;
    max-width: 1400px;
    border: 3px solid #d33;
    border-radius: 12px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(2px);
    padding: 12px;
    box-shadow: 0 10px 30px rgba(10,58,92,0.18);
}

/* Layout: NEW TESTAMENT column + OLD TESTAMENT column + right player pane.
   Matches the classic Assyrian4all side-by-side index look (see image 2222). */
.layout {
    display: grid;
    grid-template-columns: 170px 170px 1fr;
    gap: 12px;
    align-items: start;
}

/* ===== Language selector bar ===== */
.lang-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 12px;
}
.lang-btn {
    background: #fff;
    border: 2px solid #1a5680;
    border-radius: 18px;
    color: #0a3a5c;
    padding: 7px 22px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(10,58,92,0.15);
}
.lang-btn:hover {
    background: #eaf3fc;
    transform: translateY(-2px);
}
.lang-btn.active {
    background: linear-gradient(180deg, #1a5680, #0d3556);
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 8px rgba(26,86,128,0.6);
}
.lang-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== LEFT INDEX (green box) ===== */
.book-index {
    border: 3px solid #2e8b3a;
    border-radius: 10px;
    background: #f5fbff;
    padding: 10px;
    max-height: 760px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a5680 #cfe9ff;
}
.book-index::-webkit-scrollbar { width: 10px; }
.book-index::-webkit-scrollbar-track { background: #cfe9ff; border-radius: 6px; }
.book-index::-webkit-scrollbar-thumb { background: #1a5680; border-radius: 6px; }

.book-index h3 {
    text-align: center;
    background: #1a5680;
    color: #fff;
    padding: 6px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* The two side-by-side index boxes (NT on the left, OT next to it). */
.nt-index .testament-label,
.ot-index .testament-label {
    margin-top: 2px;
}

/* ===== Holy Bible banner image (above the audio player) =====
   Show the WHOLE picture — no cropping. Image keeps its natural
   aspect ratio and scales with the container width. */
.bible-banner {
    width: 100%;
    border: 3px solid #1a5680;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 6px 18px rgba(10,58,92,0.25);
    /* Sit flush against the player below for that "one unit" look. */
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    /* Cancel the .right-pane flex gap so banner + player touch. */
    margin-bottom: -10px;
}
.bible-banner img {
    display: block;
    width: 100%;
    height: auto;        /* show FULL image, no crop */
    object-fit: contain;
}

/* Player sits flush under the banner so banner + player read as one box. */
.bible-banner + .player-host {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}
.testament-label {
    text-align: center;
    background: #2e8b3a;
    color: #fff;
    padding: 4px;
    border-radius: 5px;
    margin: 12px 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.testament-label:first-of-type { margin-top: 2px; }

.book-card {
    display: block;
    background: #fff;
    border: 1px solid #9ec9e3;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 9px 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.book-card:hover {
    transform: translateY(-2px);
    border-color: #1a5680;
    box-shadow: 0 4px 10px rgba(26,86,128,0.25);
}
.book-card.active {
    border-color: #d33;
    background: #fff5f5;
}
.book-card .card-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #0a3a5c;
    line-height: 1.2;
}
.book-card .card-sub {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    color: #1a5680;
    opacity: 0.75;
}

/* ===== RIGHT SIDE: player + chapter grid ===== */
.right-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;       /* FIX: prevents CSS grid column blowout so image fits */
    overflow: hidden;
}

.now-playing {
    background: #1a5680;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
}

/* Audio player host */
.player-host {
    background: #3a2a45;
    border: 3px solid #180a1f;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* ===== Chapter grid (blue box) ===== */
.chapter-grid-wrap {
    border: 3px solid #1f4dbb;
    border-radius: 10px;
    background: #eaf3fc;
    padding: 10px;
}
.chapter-grid-wrap h3 {
    text-align: center;
    color: #1f4dbb;
    margin-bottom: 8px;
    font-size: 1rem;
}
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #1f4dbb #cfe9ff;
}
.chapter-grid::-webkit-scrollbar { width: 10px; }
.chapter-grid::-webkit-scrollbar-track { background: #cfe9ff; border-radius: 6px; }
.chapter-grid::-webkit-scrollbar-thumb { background: #1f4dbb; border-radius: 6px; }

.ch-btn {
    background: linear-gradient(180deg, #3a3a55, #1f1f33);
    color: #fff;
    border: 2px solid #1f4dbb;
    border-radius: 6px;
    padding: 10px 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.15;
}
.ch-btn:hover {
    background: linear-gradient(180deg, #1f4dbb, #0d2c70);
    transform: scale(1.04);
}
.ch-btn.active {
    background: linear-gradient(180deg, #d33, #8b1a1a);
    border-color: #fff;
    box-shadow: 0 0 8px rgba(211,51,51,0.7);
}

/* Single combined recording (e.g. Assyrian "Old Testament (Full)") -
   one wide button instead of a numbered grid. */
.chapter-grid.single-track {
    grid-template-columns: 1fr;
    max-height: none;
}
.chapter-grid.single-track .ch-btn {
    padding: 16px 10px;
    font-size: 0.95rem;
}

/* Intro block on landing page */
.intro {
    text-align: center;
    padding: 14px;
    color: #0a3a5c;
}
.intro h1 {
    color: #1a5680;
    margin-bottom: 8px;
    font-size: 1.6rem;
}
.intro p { color: #1a5680; font-size: 0.95rem; }

/* Landing page book gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 14px;
}
.gallery .book-card { margin-bottom: 0; }

/* ============================================
   Landing page: 4-language "Choose Book" grid
   (classic Assyrian4all table layout)
   ============================================ */
.bible-head {
    text-align: center;
    padding: 8px 10px 14px;
}
.bible-head h1 {
    color: #1a5680;
    font-size: 1.5rem;
    margin-bottom: 6px;
}
.bible-head h2 {
    color: #0a3a5c;
    font-size: 1.05rem;
    font-weight: 600;
}
.bible-head .ar {
    font-family: "Segoe UI", Tahoma, "Traditional Arabic", serif;
    font-weight: 700;
    margin-right: 6px;
}

.lang-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto 10px;
    background: rgba(255,255,255,0.85);
}
.lang-table td {
    border: 1px solid #1a5680;
    padding: 0;
    vertical-align: top;
    width: 50%;
}
.lang-table .lang-name {
    text-align: center;
    background: linear-gradient(180deg, #1a5680, #0d3556);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 6px;
}
.lang-table .lang-cell {
    padding: 0;
}

.testament-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.testament-block {
    text-align: center;
    padding: 12px 10px 16px;
    border-right: 1px solid #9ec9e3;
}
.testament-block:last-child { border-right: none; }

.testament-head {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0a3a5c;
    margin-bottom: 10px;
    line-height: 1.35;
}
.testament-head .ar {
    font-weight: 700;
    color: #1a5680;
    font-size: 0.9rem;
}

.book-select {
    width: 90%;
    max-width: 240px;
    padding: 5px 6px;
    font-size: 0.85rem;
    border: 1px solid #1a5680;
    border-radius: 4px;
    background: #fff;
    color: #0a3a5c;
    cursor: pointer;
}
.book-select:disabled {
    background: #eee;
    color: #999;
    cursor: not-allowed;
}

.go-btn {
    display: inline-block;
    margin-top: 8px;
    background: linear-gradient(180deg, #1a5680, #0d3556);
    color: #fff;
    border: 1px solid #0d3556;
    border-radius: 5px;
    padding: 6px 22px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.go-btn:hover {
    background: linear-gradient(180deg, #2570a8, #14497a);
    transform: translateY(-1px);
}
.go-btn:disabled {
    background: #bbb;
    border-color: #bbb;
    cursor: not-allowed;
    transform: none;
}
.no-audio-note {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #d33;
    font-style: italic;
}

/* Footer */
.foot {
    text-align: center;
    margin: 14px 0 22px;
    color: #0a3a5c;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr 1fr;
    }
    .right-pane { grid-column: 1 / -1; }
    .book-index { max-height: 360px; }
    .chapter-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 560px) {
    .layout { grid-template-columns: 1fr; }
    .book-index { max-height: 280px; }
    .chapter-grid { grid-template-columns: repeat(4, 1fr); }
    .top-band .title-pill span { margin: 0 12px; }
    .lang-table, .lang-table tbody, .lang-table tr, .lang-table td {
        display: block;
        width: 100%;
    }
    .lang-table td { border-width: 1px 0; }
    .testament-row { grid-template-columns: 1fr; }
    .testament-block { border-right: none; border-bottom: 1px solid #9ec9e3; }
    .bible-head h1 { font-size: 1.2rem; }
    .bible-head h2 { font-size: 0.9rem; }
}

a, .book-card, .ch-btn, .lang-btn { -webkit-touch-callout: none; }
