/* ── Global ── */

li a {
    color: var(--ink, #1a1f2b);
    list-style-position: inside;
}

body {
    background: var(--surface, #f8fafc);
}

/* ── Top menu layout ── */
nav.top-menu, div.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 32px;
    border-bottom: 1px solid var(--stone, #e2e8f0);
}

/* Collapsible wrapper that holds search + login. Desktop: behaves like the
   old direct-child layout (search left, login right). Mobile: hidden behind
   the hamburger toggle. */
.nav-collapsible {
    display: flex;
    flex: 1;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* Hamburger checkbox sentinel + label (CSS-only toggle, no JS). */
.nav-toggle {
    /* Visually hidden but keyboard-focusable */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nav-toggle-label {
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-md, 8px);
    border: 1.5px solid var(--pebble-light, #94a3b8);
    color: var(--pebble, #4a5568);
    background: transparent;
    min-height: 36px;
}

.nav-toggle-label .material-symbols-outlined {
    font-size: 24px;
}

.nav-toggle:focus-visible + .nav-toggle-label {
    box-shadow: var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #3b82f6);
    outline: none;
}

div.search-top {
    display: flex;
    align-items: center;
}

div.login-top {
    display: flex;
    align-items: center;
}

form.search-top {
    display: inline-block;
}

form.login-top {
    display: inline-block;
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-row-sub {
    margin-top: 6px;
}

a.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ink, #1a1f2b);
}

a.nav-link:hover {
    text-decoration: none;
    background: var(--wash, #f1f5f9);
    border-color: var(--pebble-light, #94a3b8);
}

/* ── Nav buttons (lighter than action buttons) ── */
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md, 8px);
    border: 1.5px solid var(--pebble-light, #94a3b8);
    padding: 4px 12px;
    height: 30px;
    font-size: 13px;
    font-family: var(--font-stack, sans-serif);
    color: var(--pebble, #4a5568);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.nav-btn:hover {
    background: var(--wash, #f1f5f9);
    border-color: var(--pebble-light, #94a3b8);
    color: var(--ink, #1a1f2b);
    text-decoration: none;
}

.nav-btn:focus-visible {
    box-shadow: var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #3b82f6);
    outline: none;
}

/* ── Main page search input (hero area) ── */
input.search-main-input {
    border-radius: var(--radius-md, 8px);
    border: 2px solid var(--stone, #e2e8f0);
    padding: 10px 18px;
    height: 52px;
    width: 400px;
    font-size: 18px;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
    background: white;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.08);
    transition: border-color 0.15s, box-shadow 0.15s;
}

input.search-main-input:hover {
    border-color: var(--pebble-light, #94a3b8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}

input.search-main-input:focus {
    border-color: var(--creek, #3b82f6);
    box-shadow: 0 4px 12px rgba(59,130,246,0.15), 0 2px 4px rgba(0,0,0,0.08);
}

input.search-main-button {
    border-radius: var(--radius-md, 8px);
    border: 2px solid var(--stone, #e2e8f0);
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
    background: white;
    cursor: pointer;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

input.search-main-button:hover {
    background: var(--wash, #f1f5f9);
    border-color: var(--pebble-light, #94a3b8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}

input.search-main-button:active {
    background: var(--stone, #e2e8f0);
}

input.advanced-search-main-button {
    border-radius: var(--radius-md, 8px);
    border: 2px solid var(--stone, #e2e8f0);
    height: 52px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
    background: white;
    cursor: pointer;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.08);
    transition: background 0.15s, box-shadow 0.15s;
}

input.advanced-search-main-button:hover {
    background: var(--wash, #f1f5f9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.08);
}

input.advanced-search-main-button:active {
    background: var(--stone, #e2e8f0);
}

/* ── Top bar search (small) ── */
input.search-top {
    border-radius: var(--radius-md, 8px);
    border: 1.5px solid var(--pebble-light, #94a3b8);
    padding: 4px 10px;
    height: 30px;
    font-size: 14px;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
    background: white;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: border-color 0.15s;
}

input.search-top:focus {
    border-color: var(--creek, #3b82f6);
}

/* ── Buttons ── */
.input-button {
    border-radius: var(--radius-md, 8px);
    border: 1.5px solid var(--pebble-light, #94a3b8);
    padding: 6px 16px;
    height: 36px;
    min-width: 70px;
    font-size: 14px;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
    background: var(--btn-bg, #e2e7ef);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: background 0.15s, border-color 0.15s;
}

.input-button:hover {
    background: var(--btn-bg-hover, #d5dbe5);
    border-color: var(--pebble, #4a5568);
}

.input-button:active {
    background: var(--btn-bg-active, #c8cfdb);
}

.input-button:focus-visible {
    box-shadow: var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #3b82f6);
}

/* ── Text links ── */
.text-link {
    min-width: 70px;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 4px);
    transition: background 0.15s;
}

.text-link:hover {
    background-color: var(--wash, #f1f5f9);
}

.text-link:active {
    background-color: var(--stone, #e2e8f0);
}

.text-link:focus-visible {
    outline: 2px solid var(--creek, #3b82f6);
    outline-offset: 2px;
}

/* ── Info panels ── */
div.info-panel {
    margin-bottom: 20px;
    padding: 16px 20px;
    background-color: white;
    border: 1px solid var(--stone, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    font-family: var(--font-stack, sans-serif);
}

div.info-header {
    font-family: var(--font-stack, sans-serif);
    padding: 12px 16px;
    background-color: var(--wash, #f1f5f9);
    border-bottom: 1px solid var(--stone, #e2e8f0);
    border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink, #1a1f2b);
    position: relative;
    cursor: pointer;
}

div.info-body {
    padding: 20px;
    font-family: var(--font-stack, sans-serif);
    color: var(--ink, #1a1f2b);
}

/* ── Centered ── */
.centered {
    text-align: center;
}

.centered-inside {
    display: inline-block;
}

/* ── Error / message sections ── */
.main-error-section {
    color: var(--ink, #1a1f2b);
    font-weight: bold;
    border-radius: var(--radius-md, 8px);
    background-color: rgba(255, 255, 255, 0.8);
}

.main-error-text {
    color: #dc2626;
    font-weight: bold;
    list-style-position: inside;
}

.main-message-section {
    color: var(--ink, #1a1f2b);
    font-weight: bold;
    border-radius: var(--radius-md, 8px);
    background-color: rgba(255, 255, 255, 0.8);
}

.main-message-text {
    color: var(--ink, #1a1f2b);
    font-weight: bold;
    list-style-position: inside;
}

.default_text {
    font-family: var(--font-stack, sans-serif);
}

.small_text {
    font-size: 14px;
}

.error {
    color: #dc2626;
    font-weight: bold;
    list-style-position: inside;
}

.success {
    color: var(--ink, #1a1f2b);
    font-weight: bold;
    list-style-position: inside;
}

/* ── Section header ── */
.section-header {
    font-family: var(--font-stack, sans-serif);
    border-bottom: 1px solid var(--stone, #e2e8f0);
    font-size: 26px;
    font-weight: 700;
    color: var(--ink, #1a1f2b);
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ── Tools ── */
ul.tool-list {
    padding: 5px;
    font-size: 18px;
    list-style-type: none;
}

li.tool-list {
    padding: 5px;
    font-size: 18px;
}

/* ── Passaging plot table ── */
.passaging-plot {
    font-family: var(--font-stack, sans-serif);
    border-collapse: collapse;
    text-align: left;
    font-size: 18px;
    margin: auto;
}

.passaging-plot th {
    padding: 5px;
    border: 1px solid var(--stone, #e2e8f0);
}

.passaging-plot td {
    padding: 5px;
    border: 1px solid var(--stone, #e2e8f0);
}

/* ── Link button ── */
.link {
    background: none;
    border: 0 none;
    cursor: pointer;
    color: var(--creek-deep, #1e40af);
    text-decoration: underline;
    font-size: 18px;
}

/* ── Dashboard Cards ── */
.home-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}
.home-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.home-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
}

.home-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
}
.home-card-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    flex: 1;
}
.home-card-icon {
    font-size: 22px;
    color: #555;
}
.home-card-arrow {
    font-size: 20px;
    color: #999;
    transition: transform 0.25s;
}
.home-card--collapsed .home-card-arrow {
    transform: rotate(-90deg);
}

.home-card-body {
    padding: 0;
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.home-card--collapsed .home-card-body {
    max-height: 0;
}
.home-card-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.home-card-link:last-child {
    border-bottom: none;
}
.home-card-link:hover {
    background: #f5f8ff;
}
.home-card-link > .material-symbols-outlined {
    font-size: 20px;
    color: #666;
    margin-top: 2px;
    flex-shrink: 0;
}
.home-card-link div {
    min-width: 0;
}
.home-card-link strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
}
.home-card-link span {
    display: block;
    font-size: 12.5px;
    color: #777;
    line-height: 1.4;
    margin-top: 1px;
}

/* ── Wide card (spans both grid columns) ── */
.home-card--wide {
    grid-column: 1 / -1;
}
.home-card-columns {
    display: flex;
}
.home-card-section {
    flex: 1;
    min-width: 0;
}
.home-card-section + .home-card-section {
    border-left: 1px solid #e8e8e8;
}
.home-card-section-label {
    padding: 10px 18px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #999;
}
/* ── Two-column auto-flow grid for card body ── */
.home-card-body--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: none;
}
.home-card-body--grid .home-card-link {
    border-bottom: 1px solid #f0f0f0;
}
.home-card-body--grid .home-card-link:nth-child(odd) {
    border-right: 1px solid #f0f0f0;
}

.home-card-link--footer {
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}
.home-card-link--footer:hover {
    background: #f0f4ff;
}

@media (max-width: 720px) {
    .home-card-columns {
        flex-direction: column;
    }
    .home-card-section + .home-card-section {
        border-left: none;
        border-top: 1px solid #e8e8e8;
    }
    .home-card-body--grid {
        grid-template-columns: 1fr;
    }
    .home-card-body--grid .home-card-link:nth-child(odd) {
        border-right: none;
    }
}

/* ── Detail dashboard (larger, e.g. /data/ page) ── */
.home-dashboard--detail {
    max-width: 1060px;
    gap: 24px;
}
.home-dashboard--detail .home-card-header {
    padding: 16px 22px;
}
.home-dashboard--detail .home-card-header h3 {
    font-size: 19px;
}
.home-dashboard--detail .home-card-icon {
    font-size: 26px;
}
.home-dashboard--detail .home-card-link {
    padding: 14px 22px;
    gap: 14px;
}
.home-dashboard--detail .home-card-link > .material-symbols-outlined {
    font-size: 24px;
    margin-top: 1px;
}
.home-dashboard--detail .home-card-link strong {
    font-size: 16px;
}
.home-dashboard--detail .home-card-link span {
    font-size: 14px;
    margin-top: 2px;
    color: #666;
}

@media (max-width: 720px) {
    .home-dashboard {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile responsive nav (≤768px) ── */
@media (max-width: 768px) {
    nav.top-menu, div.top-menu {
        flex-wrap: wrap;
        padding: 8px 16px;
    }
    /* Hamburger label visible only on small screens; pushed to far right */
    .nav-toggle-label {
        display: inline-flex;
        margin-left: auto;
    }
    /* Collapsed nav takes a full new wrapped row, and stays hidden until checked */
    .nav-collapsible {
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 8px;
        display: none;
    }
    .nav-toggle:checked ~ .nav-collapsible {
        display: flex;
    }
    /* Search + login rows go full width and stack their internal nav-rows */
    div.search-top, div.login-top,
    form.search-top, form.login-top {
        width: 100%;
        align-items: stretch;
    }
    .nav-row {
        flex-wrap: wrap;
    }
    /* Search input fills the row instead of fixed 31-char width */
    input.search-top {
        flex: 1 1 60%;
        min-width: 0;
    }
    /* Touch-friendlier nav buttons on mobile */
    .nav-btn {
        min-height: 36px;
        padding: 6px 14px;
    }
}
