/* index.php only. This is everything the homepage/search-results page needs beyond css/base.css
   (fonts, theme variables, plain body) and css/header.css (logo, title, Menu, Settings dialog).
   Covers: the two-column layout (reading column + illustration plates), Word of the Day, the search
   box and result tabs, dictionary/encyclopedia/thesaurus entry formatting, the Bible comparison view,
   auto-linked cross-references, and the cookie banner. */

.layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}
/* The content grows (up to 900px) far faster than the plates column, so on a wide screen it is 900px and
   the plates take all the rest. The flex-basis values (500 + 300) are the same as before, so the point
   at which the plates drop below the content on a phone / narrow window has not moved. */
.content {
    flex: 100 1 500px;
    max-width: 900px;
    min-width: 0;
}
.plates-column {
    flex: 1 1 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.plate-item img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--fg);
}
.plate-item a {
    cursor: zoom-in;
}
/* Word of the Day -- index.php only (not part of the shared header). */
.word-of-day {
    display: inline-block;
    font-size: 0.9em;
    margin: 12px 0 20px 0;
    border: 1px solid var(--fg);
    padding: 3px 8px;
}
.word-of-day a {
    font-weight: bold;
    color: var(--fg);
}
.headword-link {
    color: inherit;
    text-decoration: none;
}
/* Dark mode only: in-text cross-reference links have never had their own color -- always just the
   browser's default link blue, which is fine on white but is the same dark, hard-to-read blue on a
   near-black page. Light mode is untouched (still the plain, unstyled browser default). */
:root[data-theme="dark"] .auto-link,
:root[data-theme="dark"] .auto-link:visited {
    color: #7ab8ff;
}
.subtitle {
    font-size: 0.85em;
    margin-bottom: 20px;
}
.subtitle a {
    color: var(--fg);
}
.notice {
    font-size: 0.95em;
    margin-bottom: 20px;
}
form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.search-wrap {
    position: relative;
    flex: 1;
}
input[type=text] {
    width: 100%;
    font-family: inherit;
    font-size: 1em;
    padding: 8px;
    border: 1px solid var(--fg);
    background: var(--bg);
    color: var(--fg);
}
input[type=text]::placeholder {
    color: var(--fg);
    opacity: 1;
    font-weight: normal;
}
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 2px 0 0 0;
    padding: 0;
    list-style: none;
    background: var(--bg);
    border: 1px solid var(--fg);
    max-height: 260px;
    overflow-y: auto;
    z-index: 10;
}
.autocomplete-list li {
    padding: 6px 8px;
    cursor: pointer;
}
.autocomplete-list li.active,
.autocomplete-list li:hover {
    background: #dcedc8;
    color: #000000;
}
button {
    font-family: inherit;
    font-size: 1em;
    padding: 8px 16px;
    border: 1px solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
}
.entry {
    margin-bottom: 24px;
    border-top: 1px solid var(--fg);
    padding-top: 12px;
}
.headword {
    font-weight: bold;
    font-size: 1.1em;
}
.pos {
    font-style: italic;
    font-weight: normal;
    font-size: 0.8em;
}
.sense {
    margin: 6px 0 6px 16px;
}
.illustration {
    margin: 10px 0 6px 16px;
}
.illustration img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--fg);
}
.illustration-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0 6px 16px;
}
.illustration-group img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--fg);
}
.no-results {
    margin-top: 12px;
}
.fallback-note {
    font-size: 0.85em;
    margin-bottom: 12px;
}
.enc-citation {
    font-size: 0.8em;
    color: var(--muted);
    font-style: italic;
    margin: 4px 0 6px 16px;
}
.enc-toggle {
    margin-left: 4px;
}
.enc-full-link {
    font-size: 0.85em;
    margin: 4px 0 6px 16px;
}
.thesaurus-pos-label {
    font-weight: bold;
    margin-right: 2px;
}
.thesaurus-note {
    font-style: italic;
    color: var(--muted);
}
.print-article-btn {
    font-size: 0.75em;
    margin-left: 8px;
    padding: 0 8px;
    line-height: 1.6;
    vertical-align: middle;
}
.link-tooltip {
    position: fixed;
    max-width: 320px;
    background: #222222;
    color: #ffffff;
    font-size: 0.85em;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
}
/* Bible verse references (see bible_refs.php): dotted underline, and a
   tooltip that -- unlike .link-tooltip -- can be hovered and scrolled,
   because a passage can run to many verses. */
/* One colour per Bible version, used for its badge, its toggle in Settings and its tag on a phone.
   (No other source uses turquoise or pink: 1913 blue, 1828 yellow, Britannica purple, Watson peach.) */
:root {
    --kjv-color: #8fe0d0;
    --bsb-color: #f2a5d6;
}
/* Verse references inside definitions/articles: grey box with a dotted underline, the same
   grey whether or not the pointer is over it. Links to the verse (/bible/...). */
.bible-ref,
.bible-ref:link,
.bible-ref:visited {
    color: inherit;
    background: var(--panel);
    text-decoration: none;
    border-bottom: 1px dotted var(--fg);
    cursor: pointer;
}
.bible-ref:hover,
.bible-ref:active,
.bible-ref:focus {
    background: var(--panel);
    outline: none;
}
.bible-ref:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 1px;
}
.bible-tooltip {
    position: fixed;
    width: 380px;
    max-width: calc(100vw - 16px);
    max-height: 360px;
    overflow-y: auto;
    background: #222222;
    color: #ffffff;
    font-size: 0.85em;
    line-height: 1.45;
    padding: 10px 14px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}
.bible-tooltip .bt-passage + .bt-passage {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #555555;
}
.bible-tooltip .bt-ref {
    font-weight: bold;
    margin-bottom: 3px;
}
.bible-tooltip sup {
    font-size: 0.7em;
    color: #bbbbbb;
    margin-right: 2px;
}
.bible-tooltip .bt-gap {
    color: #bbbbbb;
    margin: 0 4px;
}
.bible-tooltip .bt-note,
.bible-tooltip .bt-error {
    color: #cccccc;
    font-style: italic;
}
/* King James Bible results */
.edition-label.edition-bsb {
    background: var(--bsb-color);
    padding: 1px 5px;
    border-radius: 3px;
    color: #000000;
}
.edition-label.edition-kjv {
    background: var(--kjv-color);
    padding: 1px 5px;
    border-radius: 3px;
    color: #000000;
}
/* "Both" Bible versions, verse by verse: "Book Ch:V" on its own line, the KJV text under it on the left and
   the BSB text on the right (blank where a version has none); the version names at the top of the columns.
   On a phone the two texts stack under the reference, each tagged KJV / BSB. */
.bible-head,
.bible-cells {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    margin-left: 16px;
}
.bible-head {
    margin-bottom: 8px;
}
.bible-cell {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    min-width: 0;
}
.bible-cell + .bible-cell {
    margin-left: 24px;
}
.bible-row {
    margin: 0 0 12px 0;
}
.bible-title {
    color: var(--muted);
}
@media (max-width: 640px) {
    .bible-head {
        display: none;
    }
    .bible-cells {
        display: block;
    }
    .bible-cell + .bible-cell {
        margin-left: 0;
        margin-top: 4px;
    }
    .bible-cell:empty {
        display: none;
    }
    .bible-cell[data-v]::before {            /* the version tag in front of each text: KJV / BSB in its colour */
        content: attr(data-label);
        display: inline-block;
        font-size: 0.8em;
        font-weight: bold;
        color: var(--fg);
        padding: 0 5px;
        margin-right: 6px;
        border-radius: 3px;
        line-height: 1.4;
    }
    .bible-cell[data-v="kjv"]::before {
        background: var(--kjv-color);
    }
    .bible-cell[data-v="bsb"]::before {
        background: var(--bsb-color);
    }
}
/* "< Psalms 22        Psalms 24 >" under a whole chapter */
.bible-nav {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    margin-top: 14px;
}
.bible-note {
    font-size: 0.85em;
    color: var(--muted);
}
.bible-verse-ref {
    font-weight: bold;
    color: var(--fg);
}
.bible-results mark {
    background: #fff3a3;
    color: inherit;
    padding: 0 1px;
}
.bible-vnum {
    font-size: 0.7em;
    color: var(--muted);
    margin-right: 2px;
}
.bible-gap {
    color: var(--muted);
}
/* The two boxes under the search input: "Search: n results" | "Bible Verses: n results" */
.result-tabs {
    display: flex;
    margin: 14px 0 16px 0;
}
.result-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    text-align: center;
    cursor: pointer;
}
.result-tab + .result-tab {
    margin-left: -1px;
}
.result-tab:hover {
    background: var(--panel2);
}
.result-tab.active,
.result-tab.active:hover {
    background: #dcedc8;
    color: #000000;
    font-weight: bold;
}
.result-tab:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: -4px;
}
.search-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.results-count {
    font-size: 0.85em;
    color: var(--muted);
    margin: 0;
}
.random-label {
    margin-top: 4px;
    font-size: 0.95em;
}
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--fg);
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    z-index: 100;
    font-size: 0.9em;
}
.cookie-banner a {
    color: var(--fg);
}
.cookie-banner button {
    font-family: inherit;
    font-size: 1em;
    padding: 6px 14px;
    border: 1px solid var(--fg);
    background: #dcedc8;
    color: #000000;
    cursor: pointer;
    flex-shrink: 0;
}
