@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

html { 
    margin: 0; padding: 0; 
    background-color: transparent; 
    height: auto;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    margin: 0; padding: 0;
    background-color: transparent;
    color: #2f4f4f;
    min-height: 0;
    height: auto; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#content-wrapper { 
    display: inline-block; 
    width: 100%; 
    box-sizing: border-box; 
    flex: 0 0 auto; 
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid #ccc;
    transition: margin-top 0.3s ease-in-out;
}

#split-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow: hidden; 
    background-color: #fcfcfc;
    position: relative;
    height: 100%;
}

#reading-content {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 160px; 
    box-sizing: border-box;
    font-size: 1em;
    line-height: 1.6;
    display: none; 
}

#gateway-content {
    display: none;
    flex: 1 1 auto; 
    flex-direction: column; 
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
}

#gateway-audio {
    display: none;
    height: 135px; 
    width: 100%;
    background: #ffffff; 
    border-top: 1px solid #ddd;
    flex: 0 0 auto; 
}

#iframe-wrapper {
    flex: 1 1 auto;
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: #fff;
    z-index: 1;
}

/* Ensure the iframe scales from the top-left */
#reading-frame {
    transform-origin: 0 0;
}

.swipe-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 25px;
    z-index: 20;
    background: transparent;
}

#swipe-left {
    left: 0;
}

#swipe-right {
    right: 0;
}

#reading-placeholder {
     display: flex;
     align-items: center;
     justify-content: center;
     height: 100%;
     color: #888;
     font-style: italic;
     font-family: 'Roboto', sans-serif;
}

.reading-toolbar {
    display: flex;
    width: 100%;
    align-items: center;
    position: relative; 
    padding: 4px 10px; /* Added horizontal padding */
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    background-color: transparent; 
    box-sizing: border-box;
}

.reading-toolbar button {
    background: none;
    border: none;
    cursor: pointer;
    color: #888; 
    padding: 4px; 
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;  
}

.reading-toolbar button:first-child {
    margin-left: 0;
}

.reading-toolbar button span {
    font-size: 26px;
}

.reading-toolbar button[title="Decrease Font"] span {
    font-size: 21px;
}

.reading-toolbar button:hover {
    background-color: #eee;
    color: #333;
}

/* --- Added Slider Styles --- */
.font-slider-container {
    display: flex;
    align-items: center;
    margin-right: 5px;
}

.font-slider {
    -webkit-appearance: none; /* Remove default styling */
    width: 100px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    margin: 0 5px;
}

/* Slider Thumb - Webkit (Chrome, Safari, Edge) */
.font-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6e92ac;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.font-slider::-webkit-slider-thumb:hover {
    background: #5a7a90;
}

/* Slider Thumb - Firefox */
.font-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6e92ac;
    cursor: pointer;
    border: none;
}
/* --------------------------- */

#lang-select {
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}
#lang-select:focus {
    outline: none;
}

.reading-nav {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-family: 'Roboto', sans-serif;
}

.nav-btn {
    display: flex;
    align-items: center;
    color: #2f4f4f;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    padding: 10px 15px; 
    border-radius: 4px;
    transition: background 0.2s;
    user-select: none;
}

.nav-btn:hover {
    background-color: #eee;
}

.nav-btn span {
    font-size: 24px;
}

.nav-btn.today-btn {
    color: #2f4f4f;
    opacity: 0.8;
}
.nav-btn.today-btn:hover {
    opacity: 1;
    background-color: #e3f2fd; 
}

#audio-pane {
    display: none; 
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f1f1f1;
    border-top: 1px solid #ccc;
    padding: 2px;
    box-sizing: border-box;
    z-index: 100;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

audio {
    width: 100%;
    max-width: 600px;
    display: block;   
    margin: 0 auto;   
    height: 36px;     
}

.bible-readings {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto', sans-serif;
}
.bible-readings th, .bible-readings td {
    text-align: center;
    vertical-align: top;
    padding: 8px;
    border: 1px solid #ddd;
    background-color: #ffffff;
}
.bible-readings p { line-height: 1.5; margin: 0; }
.bible-readings a { color: inherit; text-decoration: none; cursor: pointer; }
.bible-readings a:hover { text-decoration: underline; }

.esv-text {
    display:inline;
    font-family: 'Roboto', sans-serif; 
    color: #333333;
}

.esv-text h2 {
    color: #333333; 
    font-size: 1.15em;
    font-weight: bold;
    margin-bottom: 5px;
    font-style: italic;
}

.esv-text h3 {
    color: #333333;
    font-size: 1.1em;
    font-weight: 300;
    margin-bottom: 0.75em;
    margin-top: 1.25em;
    font-style: italic;
}

.esv-text h3.psalm-book {
    color: #000;
    font-family: 'Roboto', sans-serif;
    font-style: normal;
    letter-spacing: 0.2em;
    padding-left: 4em;
    text-transform: uppercase;
}

.esv-text p {
    margin-bottom: 0;
    font-size: 108%;
    line-height: 130%;
    text-indent: 1.5em;
    color: #333333; 
}
.esv-text h2#top { border:none; padding:0; }

.esv-text h2.book-name {
    color: #333333;
    font-family: 'Roboto', sans-serif; 
    font-size: 2em;
    font-style: normal;
    font-variant: small-caps;
    font-weight: normal;
    padding: 1em 0 0.7em 0;
    border-bottom: 1px solid;
    margin-left: 0;
}

.esv-text p.line { margin: 0; text-indent: -3.5em; padding-left: 5.5em; clear:both; }
.esv-text p.indent { text-indent: -4em; padding-left: 7em; }
.esv-text p.indent-2, .esv-text p.psalm-doxology { text-indent: -5em; padding-left: 9em; }
.esv-text p.declares { text-indent: -2em; padding-left: 11em; }
.esv-text p.extra-space { margin-top: 1em; }
.esv-text p.starts-chapter, .esv-text p.john8 { text-indent:0; }
.esv-text p.same-paragraph { text-indent: 0; }

span.small-caps, span.divine-name { font-variant: small-caps; }
.esv-text h4.speaker, .esv-text h4.psalm-acrostic-title, .esv-text h4.psalm-title {
    font-variant: small-caps;
}

.esv-text a {
    color: #6e92ac;
    text-decoration: none;
}
.esv-text a:hover { text-decoration: underline; }

.esv-text span.footnote, .esv-text a.fn {
    font-size: 0.7em;
    vertical-align: top;
    color: #6e92ac;
    text-decoration: none;
    font-weight: normal; 
}

.esv-text a.cf {
    font-size: 0.7em;
    vertical-align: top;
    color: #6e92ac;
    text-decoration: none;
    font-weight: normal !important; 
    opacity: 0.85; 
}

.esv-text .footnotes p { font-size: 90%; line-height: 120%; text-indent: 0; }

.esv-text small.audio {
    font-size: 0 !important;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    vertical-align: baseline;
    position: relative;
    top: 0px;
}
.esv-text small.audio::before {
    content: "\1F50A"; 
    font-size: 16px;
    color: #284f57;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}

.esv-text .chapter-num, .esv-text b.chapter-num, .esv-text span.chapter-num {
    font-weight: normal !important;
    font-size: 0.7em !important;
    vertical-align: super !important;
    line-height: 0;
    color: #333333 !important; 
    float: none !important;
    display: inline !important;
    margin: 0 !important;
    padding-right: 4px;
}

.esv-text .verse-num, .esv-text b.verse-num, .esv-text span.verse-num {
    font-weight: normal !important;
    font-size: 0.7em !important;
    vertical-align: super !important;
    line-height: 0;
    color: #333333 !important;
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #f0f0f0 4%, #e0e0e0 25%, #f0f0f0 36%);
  background-size: 1000px 100%;
  height: 20px;
  margin-bottom: 10px;
  border-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  .skeleton {
     background: linear-gradient(to right, #333 4%, #444 25%, #333 36%);
  }
}

.share-tooltip {
    display: none;
    position: fixed;
    z-index: 1000;
    background-color: transparent; 
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    user-select: none;
    margin-top: 10px;
    gap: 10px; 
}

.tooltip-btn {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #222;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    white-space: nowrap; 
}

.tooltip-btn:hover {
    background-color: #000;
}

.tooltip-btn span {
    font-size: 16px;
    margin-right: 6px;
}

.share-tooltip.flash-message-mode {
    gap: 0;
}
.share-tooltip.flash-message-mode .tooltip-btn {
    background-color: #222; 
    cursor: default;
    width: 100%;
    justify-content: center;
}

.ref-tooltip-box {
    flex-direction: column;
    background-color: #f0f0f0; 
    color: #222; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.7);
    text-align: center;
    align-items: center;
    gap: 8px;
}

.ref-content {
    font-size: 0.9em;
    line-height: 1.4;
}

.ref-footer {
    border-top-color: #ccc; 
    color: #666; 
}

@media (orientation: landscape) {
    #split-container {
        flex-direction: row;
    }
    #gateway-content {
        height: 100%;
        flex: 3;
    }
    #gateway-audio {
        height: 100%;
        flex: 1;
        border-top: none;
        border-left: 1px solid #ccc;
    }
}

@media (prefers-color-scheme: dark) {
    body { background-color: transparent; color: #e0e0e0; }
    
    #content-wrapper { background-color: #1a1a1a; border-bottom-color: #444; }
    #split-container { background-color: #1a1a1a; }
    #reading-content { background: #2a2a2a; color: #e0e0e0; }
    #audio-pane { background-color: #222; border-top-color: #444; }
    #gateway-content { background: #2a2a2a; }
    #gateway-audio { background: #1a1a1a; border-top-color: #444; border-left-color: #444; }
    #iframe-wrapper { background-color: #2a2a2a; }

    .reading-toolbar { border-bottom-color: #444; }
    .reading-toolbar button { color: #aaa; }
    .reading-toolbar button:hover { background-color: #444; color: #fff; }
    #lang-select { color: #aaa !important; background-color: #1a1a1a; }
    
    /* --- Dark Mode Slider --- */
    .font-slider { background: #555; }
    .font-slider::-webkit-slider-thumb { background: #a0c4d0; }
    .font-slider::-moz-range-thumb { background: #a0c4d0; }
    /* ------------------------ */

    .reading-nav { border-top-color: #444; }
    .nav-btn { color: #e0e0e0; }
    .nav-btn:hover { background-color: #444; }
    .nav-btn.today-btn { color: #e0e0e0; }
    .nav-btn.today-btn:hover { background-color: #444; }
    
    .bible-readings th, .bible-readings td { background-color: #2a2a2a; border-color: #444; }
    .bible-readings a { color: #e0e0e0; }

    .esv-text { color: #e0e0e0; }
    .esv-text h2, .esv-text h3 { color: #ffffff; }
    .esv-text h2.book-name { color: #ffffff; }
    .esv-text h3.psalm-book { color: #e0e0e0; }
    .esv-text p { color: #e0e0e0; }
    
    .esv-text .chapter-num, .esv-text b.chapter-num, .esv-text span.chapter-num { color: #e0e0e0 !important; }
    .esv-text .verse-num, .esv-text b.verse-num, .esv-text span.verse-num { color: #e0e0e0 !important; }
    
    .esv-text small.audio::before { color: #a0c4d0; }

    .esv-text a, 
    .esv-text span.footnote, 
    .esv-text a.cf, 
    .esv-text a.fn { 
        color: #90c4d0 !important; 
    }

    .tooltip-btn { 
        background-color: #eee; 
        color: #222; 
    }
    .tooltip-btn:hover { 
        background-color: #fff; 
    }
    
    .share-tooltip.flash-message-mode .tooltip-btn { 
        background-color: #eee; 
    }

    .ref-tooltip-box {
        background-color: #f0f0f0; 
        color: #222; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.7);
    }
    
    .ref-footer {
        border-top-color: #ccc; 
        color: #666; 
    }
}