/* Separate archive stylesheet: existing main.css is not changed. */

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    background: #d1ebed;
    color: #203937;
    font: 17px/1.6 system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: #155a49;
    text-underline-offset: 3px;
}

a:hover {
    color: #0c392f;
}

button,
input,
select {
    font: inherit;
}

button,
.button {
    min-height: 44px;
    border-radius: 7px;
    padding: 10px 17px;
    border: 1px solid #205f4b;
    background: #205f4b;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: #174737;
    color: white;
}

button:disabled {
    background: #e5ebe8;
    color: #52665f;
    border-color: #c0ccc6;
    cursor: default;
}

.secondary {
    background: white;
    color: #205f4b;
}

input,
select {
    border: 1px solid #91aaa5;
    border-radius: 6px;
    padding: 10px 12px;
    min-height: 44px;
    background: white;
    color: #203937;
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
}

input {
    width: 100%;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid #976311;
    outline-offset: 3px;
}

.page {
    width: min(100% - 32px, 1000px);
    margin: auto;
}

/* Match menu (magnifying glass) and language picker (globe) share a layout. */
.match-switch,
.language-switch {
    display: flex;
    align-items: center;
    gap: 8px 10px;
}

/* Language picker: lives in the "Match" row, right after the Match menu. */
.language-switch {
    margin-inline-start: 16px;
}

.language-switch select {
    min-width: 140px;
}

.match-switch .magnifier,
.language-switch .globe {
    color: #205f4b;
    flex: none;
}

header {
    text-align: center;
    padding: 28px 0 16px;
}

.portrait {
    max-width: 297px;
    max-height: 324px;
    width: auto;
    height: auto;
    object-fit: contain;
}

h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    line-height: 1.2;
    margin: 16px 0 8px;
}

h2 {
    font-size: 1.6rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-top: 0;
}

header p {
    margin: 8px 0;
}

.search-panel {
    background: white;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 5px 18px #16382e12;
}

label {
    font-weight: 600;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.search-row input {
    flex: 1;
    min-width: 0;
}

.options {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 14px 0;
}

.hint {
    font-size: 0.9rem;
    color: #4e625e;
}

/* In normal document flow: these links cannot float over Search. */
.main-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    border-top: 1px solid #dce6e1;
    padding-top: 18px;
}

main {
    margin: 28px 0;
    overflow-wrap: anywhere;
}

.home-note {
    text-align: center;
    padding: 15px;
}

.home-note img {
    vertical-align: middle;
}

.home-note a {
    font-size: 1.2rem;
}

.result,
.reader {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin: 18px 0;
    border: 1px solid #c6dad4;
}

.passage {
    border-left: 3px solid #c9dfd5;
    padding-left: 14px;
    margin: 16px 0;
}

.passage p {
    margin: 4px 0;
    white-space: pre-wrap;
}

.timestamp {
    font-size: 0.85rem;
    color: #546862;
    font-variant-numeric: tabular-nums;
}

mark {
    background: #fff0a2;
    color: #1b3025;
    padding: 0;
}

.current {
    background: #f6b653;
    outline: 2px solid #865817;
}

summary {
    cursor: pointer;
    color: #155a49;
    padding: 10px 0;
    min-height: 44px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 18px;
}

.links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.unavailable {
    color: #596762;
}

.downloads {
    justify-content: center;
}

.reader h2 {
    text-align: center;
}

.reader-tools {
    background: #f1f6f3;
    border: 1px solid #c8d9ce;
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0;
}

/* Preserve paragraph spacing without inserting HTML <br> tags. */
.transcript {
    white-space: pre-wrap;
    font: 19px/1.8 Georgia, "Times New Roman", serif;
    overflow-wrap: anywhere;
    max-width: 75ch;
    margin: 24px auto;
}

.transcript-list {
    list-style: none;
    padding: 0;
    background: #fff;
    border-radius: 10px;
}

.transcript-list li {
    border-bottom: 1px solid #e0e9e3;
    padding: 3px 18px;
}

.transcript-list a {
    display: block;
    padding: 10px 0;
    min-height: 44px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 28px 0;
}

.notice {
    background: #fff3dc;
    border-left: 4px solid #976311;
    padding: 16px;
}

.skip {
    position: absolute;
    top: -100px;
    left: 12px;
    background: #fff;
    padding: 10px;
    z-index: 10;
}

.skip:focus {
    top: 12px;
}

footer {
    text-align: center;
    padding: 24px 0;
    font-size: 0.9rem;
    color: #4e625e;
}

[hidden] {
    display: none !important;
}

code {
    font-size: 0.9em;
}

/* Right-to-left languages (set text_direction to "rtl" in strings.json). */
[dir="rtl"] .passage {
    border-left: 0;
    border-right: 3px solid #c9dfd5;
    padding-left: 0;
    padding-right: 14px;
}

[dir="rtl"] .notice {
    border-left: 0;
    border-right: 4px solid #976311;
}

@media (max-width: 480px) {
    .language-switch {
        margin-inline-start: 0;
    }

    .page {
        width: calc(100% - 20px);
    }

    header {
        padding-top: 20px;
    }

    .portrait {
        max-width: 203px;
        max-height: 243px;
    }

    .search-panel,
    .result,
    .reader {
        padding: 16px;
    }

    .main-nav {
        flex-direction: column;
    }

    .search-row {
        gap: 7px;
    }

    .search-row button {
        padding: 10px 12px;
    }

    .reader-tools {
        padding: 12px;
    }

    .reader-tools .search-row {
        flex-wrap: wrap;
    }

    .reader-tools .search-row input {
        flex-basis: 100%;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    .search-panel,
    .language-switch,
    .reader-tools,
    footer,
    .downloads,
    .skip,
    header {
        display: none;
    }

    .page {
        width: 100%;
    }

    .reader {
        border: 0;
        padding: 0;
    }

    .transcript {
        font-size: 12pt !important;
    }

    mark {
        background: none;
    }
}
