@font-face {
    font-family: 'Gentium';
    src: url('./Gentium/GentiumPlus-Regular.ttf') format('truetype');
}

/* Biblical-Hebrew serifs with full niqqud coverage (incl. the rare U+05BA
   holam-haser-for-vav, paseq, upper dot) that Gentium and the system fallback
   lack. Noto Serif Hebrew is the primary face (a variable font, so the weight
   is dialable); Ezra SIL is the fallback. Applied via .hebrew-text. */
@font-face {
    font-family: 'Noto Serif Hebrew';
    src: url('./Noto_Serif_Hebrew/NotoSerifHebrew-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
}

@font-face {
    font-family: 'Ezra SIL';
    src: url('./Ezra/SILEOT.ttf') format('truetype');
}

/* .hebrew-font: apply the Hebrew face/weight only (for inline Hebrew or cells
   with their own sizing, e.g. the notes page). .hebrew-text adds the reader's
   verse-cell sizing on top. */
.hebrew-font,
.hebrew-text {
    font-family: 'Noto Serif Hebrew', 'Ezra SIL', serif;
    font-weight: 350;
}

.hebrew-text {
    font-size: 1.2em;
    line-height: 1.9;
}

body {
    font-family: Gentium, serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

table {
    table-layout: fixed;
    width: 100%;
    border-spacing: 0px;
    align-items: center;
}

tbody {
    overflow-y: scroll;
}

.scrollingGrids {
    position: sticky;
    top: 0;
    z-index: 10;
}

.navGrid {
    display: grid;
    grid-template-columns: 20% 30% 30% 20%;
    gap: 10px;
    grid-auto-rows: minmax(50px, auto);
}

.navButton button {
    font-size: 30px;
    height: 50px;
    vertical-align: top;
}

.editionHeaderGrid {
    display: grid;
    width: 100%;
}

.firstColumnHeader {
    text-align: center;
    width: 100%;
    height: 100%;
    background-color: #FFF;
}

.columnHeader {
    text-align: center;
    width: 100%;
    height: 100%;
    border-left:2px solid rgba(255, 0, 0, 0.4);
    background-color: #FFF;
}

.textColumns {
    display: grid;
    z-index: 500;
    top: 1000;
    background-color: #FFF;
    grid-auto-rows: minmax(50px, auto);
}

.verseRow {
    display: grid;
}

.verseColumn {
    border-left: 2px solid #FF0000;
    padding-bottom:20px;
    padding-left:5px;
    padding-right:5px;
    padding-top:5px;
    padding-bottom:20px;
    vertical-align:top;
    text-align:left;
    position: sticky;
    top: 10;
    z-index: 1;
}

.firstVerseColumn {
    padding-bottom:20px;
    padding-left:5px;
    padding-right:5px;
    padding-top:5px;
    padding-bottom:20px;
    vertical-align:top;
    text-align:left;
    position: sticky;
    top: 10;
    z-index: 1;
}

.verseColumn, .firstVerseColumn {
    word-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.verseNumberColumn {
    text-align: center;
    font-weight: bold;
    padding: 5px;
    border-left: 2px solid #FF0000;
    border-right: 2px solid #FF0000;
}

.verseNumberHeader {
    text-align: center;
    font-weight: bold;
    background-color: #FFF;
}


#stickyButtonBar {
    position: sticky;
    top: 0px;
    z-index: 10;
    background-color: #FFF;
}


.t th {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0px 4px 2px rgba(0, 0, 0, 0.4);
    text-align:center;
    font-size:30px;
    position: sticky;
    top: 15;
    border: 0px white;
    z-index: 500;
    padding-top: 0px;
    vertical-align: bottom;
    width: auto;
}

.t .prevChapter {
    width: 50%;
}

.verseNumCell {
    font-size: 25px;
    text-align: center;
    vertical-align: top;
    width: 16%;
}

.verseNumHeader {
    font-size: 30px;
    align-items: center;
    text-align: center;
    position: sticky;
    top: 15;
    width: 16%;
    z-index: 500;
    vertical-align: bottom;
}

.t th + th {
    border-left:2px solid rgba(255, 0, 0, 0.4); 
}

.t td + td { 
    border-left:2px solid red; 
}

.t td {
    padding-bottom:20px;
    padding-left:5px;
    padding-right:5px;
    padding-top:5px;
    vertical-align:top;
    text-align:left;
    position: sticky;
    top: 10;
    z-index: 1;
}

.tab {
    padding-left: 40px;
}

.textTab {
    display: inline-block;
    margin-left: 2em;
}

.textTab2 {
    display: inline-block;
    margin-left: 4em;
}

li {
    text-align: center;
}

ul.normal li {
    text-align: left;
    padding-bottom: 5px;
}

input[type="text"] {
    font-family: Gentium, serif;
    font-style: italic;
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    font-size: 16px;
}

button {
    font-family: Gentium, serif;
    font-style: bold;
    width: 100%;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.leftColumn {
    float: left;
    width: 40%;
}

.rightColumn {
    float: right;
    width: 60%;
}

.hover-tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted;
    border-color: black; 
    color: blue;
    cursor: help; /* Changes the cursor to a question mark */
}

.cite-span {
    position: relative;
    display: inline-block;
    cursor: pointer;
    text-decoration-style: dotted;
}

/* Modify the existing .display-box rule to exclude tables in verse-box-column */
.display-box {
    position: fixed;
    background-color: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 5px;
    z-index: 9999;
    width: fit-content;
}

.display-box td, .display-box th {
    padding: 8px 12px;
    vertical-align: top;
    border-bottom: 1px solid #ddd;
    position: relative;
    min-width: 90px;
    line-height: 1.4;
}

.display-box th {
    text-align: center;
    background-color: #f8f8f8;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

.column-resizer {
    position: absolute;
    right: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 10000;
}

.column-resizer:hover {
    background-color: #0066ff33;
}

.display-box table {
    border-collapse: collapse;
    margin: 0;
    min-width: 80%;
    table-layout: fixed;
}

.show-verse.active {
    visibility: visible;
    opacity: 1;
    outline: 2px solid #000;
}


/*
.cite-span:hover .show-verse {
    visibility: visible;
    opacity: 1;
}
*/

.tooltip-content:focus {
    outline: none;
}
/*
.tooltip-content:not(:focus) {
    visibility: hidden;
    opacity: 0;
}
*/


/* Qere/Ketiv display.
   Markup comes from python/hebrewmanager.py (KQTagging + bare-qere handling):
     ketiv + qere -> <span class="ketiv">KETIV<span class="qere">QERE</span></span>
     silent ketiv -> <span class="silentKetiv">KETIV</span>
     bare qere    -> <span class="qereVeloKetiv">QERE</span>
   The ketiv (written form) is always visible; hovering reveals the qere. */
:root {
    /* Shared grey for qere text — the qere tooltip and (later) orphaned qeres. */
    --qere-grey: #666;
}

.ketiv {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted #b00;
    cursor: help;
}

/* The qere sits inside the ketiv span and is shown only on hover, as a
   floating tooltip that takes no layout space until revealed. */
.ketiv .qere {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.1s ease-in;

    position: absolute;
    z-index: 10;
    top: 130%;
    left: 50%;
    transform: translateX(-50%);

    direction: rtl;
    white-space: nowrap;
    background-color: #fff;
    color: var(--qere-grey);
    border: 1px solid #000;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.9em;
}

.ketiv:hover .qere,
.ketiv:focus .qere {
    visibility: visible;
    opacity: 1;
}

/* Ketiv written but not read: distinct dotted underline, no qere to reveal. */
.silentKetiv {
    border-bottom: 1px dotted #888;
}

/* Qere read but never written (qere velo ketiv): show the read word in the
   same grey as the qere tooltip to signal it has no consonantal form. */
.qereVeloKetiv {
    color: var(--qere-grey);
}

body {
    counter-reset: footnote;
}

/* Style for footnote references in text */
.footnote-ref {
    counter-increment: footnote;
    text-decoration: none;
    color: blue;
    font-size: 0.8em;
    vertical-align: super;
}

.footnote-ref::before {
    content: counter(footnote);
}

/* Style for footnote definitions */
.footnote {
    font-size: 0.9em;
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
}

.footnote::before {
    content: counter(footnote) ". ";
    counter-increment: footnote;
    position: absolute;
    left: 130px;
    font-weight: bold;
}

/* Reset counter for footnote definitions section */
.footnotes {
    counter-reset: footnote;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

/* Hover effect */
.footnote-ref:hover {
    background-color: #ffffcc;
}

ul.normal li {
    text-align: left;
    padding-bottom: 5px;
}

/* Optional: If you want the table to be even wider, you can also adjust the grid layout */
#results-container {
    display: grid;
    grid-template-columns: 30% 70%; /* Changed from 1fr 1fr to give more space to verse box */
    gap: 20px;
    padding-right: 25px;
}

.results-column {
    min-height: 100px;
}
/* Override for tables specifically in the verse-box-column */
#verse-box-column .display-box {
    position: sticky;
    top: 20px; /* Distance from top when it becomes sticky */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 10px 0;
    background-color: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 5px;
    z-index: 100; /* Lower than tooltips but above normal content */
}

#verse-box-column .display-box table {
    width: 100%;
    max-width: 100%;
    table-layout: auto; /* Changed from 'fixed' to 'auto' */
    min-width: 600px; /* Add minimum width to prevent over-compression */
}

#verse-box-column .display-box th,
#verse-box-column .display-box td {
    width: auto;
    /* Remove max-width: 0 - this was the main problem */
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 8px 12px; /* Increased padding for better readability */
    white-space: normal;
    line-height: 1.4;
    min-width: 120px; /* Set a reasonable minimum width for each column */
}