/* ============================================================================
   JG-DATABASES.CSS  -  JewishGen /databases/ collection pages stylesheet
   Project Shorashim / JG40-Build
   ----------------------------------------------------------------------------
   Loaded ONLY on the regional/topical collection pages
   (/databases/<Region>/index.php) and the databases landing page.
   Load order:
       1. Bootstrap CDN
       2. /jg-global.css
       3. /databases/jg-databases.css   <-- this file
   NOT loaded on dataset description pages (those use jg-dataset.css).
   ----------------------------------------------------------------------------
   MIRROR RULE: The dataset-card block (section 3) mirrors jg-catalog.css
   section 6, which in turn mirrors jg-rd.css section 5. Any change to card
   styling must now be made in ALL THREE files.
   ----------------------------------------------------------------------------
   Metadata tag color system (canonical):
       Sage = Record Type      Navy = Geography
       Cream/navy border = Topic    Charcoal = Years
   ----------------------------------------------------------------------------
   CHW
============================================================================ */


/* ============================================================================
   1. SEARCH FORM ADDITIONS
   Shared search infrastructure (hero, card, tips, form rows, locked
   overlay, btn-search) lives in jg-global.css. These are the pieces the
   collection search form adds on top.
============================================================================ */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.gs-tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.region-block { margin-top: 14px; }

/* Sub-region "refine" container - shown/hidden by legacy setRegions() */
#SubRegionsDiv {
    display: none;
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--light-blue);
    border: 1px solid #c4d0d6;
    border-radius: 6px;
    animation: dbSubFadeIn 0.25s ease-in;
}
@keyframes dbSubFadeIn { from { opacity: 0; } to { opacity: 1; } }

.sub-region-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 6px;
}
#GeoRegion { background: var(--white) !important; }

body.dark-mode #SubRegionsDiv { background: #1a2533; border-color: #333; }
body.dark-mode .sub-region-label { color: #c8c0b0; }
body.dark-mode #GeoRegion { background: #1e1e1e !important; }

/* Fixed-collection note (region is locked on a collection page) */
.region-fixed-note {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
}
body.dark-mode .region-fixed-note { color: #c8d3df; }

.search-submit-wrap {
    text-align: center;
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--cream);
}
body.dark-mode .search-submit-wrap { border-top-color: #333; }


/* ============================================================================
   1b. COLLECTION-PAGE TIGHTENING
   Scoped to main.db-collection-page so global band styles are untouched
   elsewhere. Reduces vertical air across the title band, search band,
   crossover, and listing chrome.
============================================================================ */

.db-collection-page .page-title-band { padding: 26px 50px 24px; }
.db-collection-page .jg-band-content { padding: 1.75rem 2rem 1.25rem; }
.db-collection-page .rd-crossover { padding: 10px 20px 6px; }
.db-collection-page .db-listing-head { padding: 14px 20px 0; }
.db-collection-page .db-filters { padding: 14px 20px; }
.db-collection-page .results-header { padding: 10px 20px; }
.db-collection-page .catalog-list { padding: 12px 20px 50px; }

/* ============================================================================
   1c. COMPACT CARD MODIFIER (.db-compact on .catalog-list)
   Density pass for long collection listings. Overrides ONLY - the
   canonical card block (section 3) stays identical to its mirrors in
   jg-catalog.css / jg-rd.css.
============================================================================ */

.db-compact .ds-card { margin-bottom: 0.55rem; }
.db-compact .ds-summary { padding: 0.8rem 1.1rem; gap: 0.75rem; }
.db-compact .ds-title-row { margin-bottom: 5px; gap: 8px; }
.db-compact .ds-card-name { font-size: 1rem; }
.db-compact .ds-meta-row { margin-bottom: 6px; gap: 0.5rem 1.1rem; font-size: 0.78rem; }
.db-compact .ds-meta-icon { width: 13px; height: 13px; }
.db-compact .ds-chips { gap: 5px; }
.db-compact .ds-chip { font-size: 0.7rem; padding: 2px 9px; }
.db-compact .chevron-toggle { width: 30px; height: 30px; font-size: 0.75rem; }
.db-compact .ds-expand { padding: 0 1.1rem 1.1rem; }
.db-compact .ds-expand-inner { padding: 1.1rem 1.25rem; gap: 1.25rem; }

/* Show-more reveal button (injected by jg-collection.js) */
.db-show-more-wrap {
    text-align: center;
    padding: 6px 0 4px;
}
.db-show-more {
    display: inline-block;
    padding: 10px 26px;
    background: transparent;
    border: 1.5px solid var(--navy);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
}
.db-show-more:hover { background: #09497a; border-color: #09497a; color: #ffffff; }
body.dark-mode .db-show-more { border-color: #5a7a95; color: #8ab0c9; }
body.dark-mode .db-show-more:hover { background: #5a7a95; color: #ffffff; }

/* ============================================================================
   2. RD CROSSOVER + LISTING HEADER + RESULTS HEADER
============================================================================ */

.db-inner {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Reciprocal link band to a Research Division (omitted on collections
   with no RD) */
.rd-crossover {
    max-width: 1100px; margin: 0 auto; width: 100%;
    padding: 14px 20px;
    box-sizing: border-box;
}
.rd-crossover__inner {
    background: var(--light-blue);
    border: 1px solid #c4d0d6;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 0.9rem;
    color: var(--charcoal);
}
.rd-crossover__inner a { color: var(--navy); font-weight: bold; }
body.dark-mode .rd-crossover__inner {
    background: #1a2533; border-color: #333; color: #c8c8c8;
}
body.dark-mode .rd-crossover__inner a { color: #8ab0c9; }

/* Collection description prose (rendered above the search card). Mirrors
   .db-landing-intro: centered serif italic, framed by sage rules, so it reads
   as headline information rather than a floating paragraph. Links use
   .db-textlink. */
.db-collection-intro {
    max-width: 820px;
    margin: 0.5rem auto 1.75rem;
    padding: 1rem 0;
    border-top: 1px solid #8b8f72;
    border-bottom: 1px solid #8b8f72;
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: normal;
    font-size: 1.08rem;
    line-height: 1.7;
    color: var(--charcoal);
    box-sizing: border-box;
}
.db-collection-intro p { margin: 0 0 0.75rem; }
.db-collection-intro p:last-child { margin-bottom: 0; }
body.dark-mode .db-collection-intro { color: #cfcfcf; border-color: #4a4f3f; }

/* Logo inside the collection intro (e.g. JCR-UK, above the search card) */
.db-intro-logo {
    display: block;
    max-width: 240px;
    height: auto;
    margin: 0 auto 1rem;
}

/* Partner-attribution footer (e.g. UK: JCR-UK + JGSGB). Sits below the
   listing on partner-project collection pages. */
.db-partner-footer {
    max-width: 1100px;
    margin: 8px auto 0;
    width: 100%;
    padding: 22px 20px 44px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--charcoal);
    border-top: 1px solid var(--cream);
}
.db-partner-footer a { color: var(--navy); font-weight: bold; }
.db-partner-footer img { width: 50px; height: auto; }
body.dark-mode .db-partner-footer { color: #cfcfcf; border-top-color: #333; }
body.dark-mode .db-partner-footer a { color: #8ab0c9; }

/* Listing section headings (Featured Databases / All Databases), rendered
   inside the card list. */
.db-section-head {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--navy);
    margin: 18px 0 10px;
}
.catalog-list > .db-section-head:first-child { margin-top: 0; }
body.dark-mode .db-section-head { color: #c8d3df; }

/* Listing section title */
.db-listing-head {
    max-width: 1100px; margin: 0 auto; width: 100%;
    padding: 26px 20px 0;
    box-sizing: border-box;
}
.db-listing-head h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: normal;
    color: var(--navy);
    margin: 0;
}
body.dark-mode .db-listing-head h2 { color: #c8d3df; }

/* Listing filter/sort bar - injected by jg-collection.js into
   #collectionFilters. Ecru band, mirrors the catalog filter styling
   (jg-catalog.css section 3) in trimmed form. */
.db-filters {
    background-color: var(--ecru);
    padding: 18px 20px;
    border-bottom: 1px solid #e3ddd0;
}
body.dark-mode .db-filters { background-color: #1a1a1a; border-bottom-color: #2a2a2a; }

.db-filter-line {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    width: 100%;
}
.db-filter-group { display: flex; flex-direction: column; gap: 6px; }
.db-filter-group label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--navy);
}
body.dark-mode .db-filter-group label { color: #c8d3df; }
.db-filter-group input,
.db-filter-group select {
    padding: 10px 12px;
    border: 1px solid #cfc7b6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    color: var(--charcoal);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.db-filter-group input:focus,
.db-filter-group select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(9,73,122,0.12);
}
body.dark-mode .db-filter-group input,
body.dark-mode .db-filter-group select { background: #1e1e1e; color: #e0e0e0; border-color: #333; }

/* Text filter: primary, grows, leading magnifier */
.db-filter-group.db-search-group { flex: 1; min-width: 240px; }
.db-filter-group.db-search-group input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    cursor: text;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2309497a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 13px center;
}
body.dark-mode .db-filter-group.db-search-group input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238ab0c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.db-btn-reset {
    padding: 9px 18px;
    background: transparent;
    border: 1.5px solid var(--charcoal);
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: var(--charcoal);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    align-self: flex-end;
}
.db-btn-reset:hover { background: var(--charcoal); color: var(--white); }
body.dark-mode .db-btn-reset { border-color: #888; color: #c0c0c0; }
body.dark-mode .db-btn-reset:hover { background: #888; color: #121212; }

/* Results count line (mirrors jg-catalog.css section 5, trimmed) */
.results-header {
    padding: 16px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--cream);
}
body.dark-mode .results-header { border-bottom-color: #333; }
.results-header .db-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.results-count { font-size: 15px; color: var(--charcoal); }
.results-count strong { color: var(--navy); font-size: 17px; }
body.dark-mode .results-count { color: #c0c0c0; }
body.dark-mode .results-count strong { color: #c8d3df; }


/* ============================================================================
   3. DATASET CARD BLOCK
   MIRROR of jg-catalog.css section 6 (which mirrors jg-rd.css section 5).
   Changes here must be made in ALL THREE files.
============================================================================ */

.catalog-list {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    width: 100%;
}

.ds-card {
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 0.875rem;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.ds-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.ds-card[aria-expanded="true"] { box-shadow: 0 4px 18px rgba(0,0,0,0.10); }

.ds-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    align-items: center;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
}
.ds-summary:focus-visible { outline: 2px solid var(--sage); outline-offset: -2px; }

.ds-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}
.ds-card-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.0625rem;
    font-weight: bold;
    color: var(--navy);
    line-height: 1.3;
    margin: 0;
}
body.dark-mode .ds-card-name { color: #b0c8de; }

/* Badges */
.ds-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.ds-badge-new     { background: var(--sage); color: #ffffff; }
.ds-badge-updated { background: #09497a; color: #ffffff; }
body.dark-mode .ds-badge-new     { background: #6e7945; color: #fff; }
body.dark-mode .ds-badge-updated { background: #5a7a95; color: #fff; }

/* Meta row */
.ds-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 1.5rem;
    margin-bottom: 11px;
    font-size: 0.8125rem;
}
.ds-meta-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ds-meta-icon { width: 15px; height: 15px; flex-shrink: 0; color: #09497a; display: inline-block; vertical-align: middle; }
.ds-meta-label { font-weight: 600; color: var(--charcoal); }
.ds-meta-value { color: var(--charcoal); opacity: 0.9; }
body.dark-mode .ds-meta-icon { color: #8ab0c9; }
body.dark-mode .ds-meta-label { color: #999; }
body.dark-mode .ds-meta-value { color: #c8c8c8; }

/* Tag/chip row -- Sage = record type, Navy = geography */
.ds-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-chip {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 11px;
    border-radius: 12px;
    font-weight: 500;
    line-height: 1.5;
    cursor: default;
    transition: filter 0.15s;
}
.chip-record { background-color: var(--sage); color: #ffffff; cursor: pointer; }
.chip-record:hover { filter: brightness(0.92); }
.chip-geo    { background-color: transparent; border: 1px solid var(--navy); color: var(--navy); }
.chip-topic  { background-color: var(--cream); color: var(--charcoal); border: 1px solid var(--navy); }
.chip-years  { background-color: transparent; border: 1px solid var(--charcoal); color: var(--charcoal); }
body.dark-mode .chip-record { background-color: #6e7945; color: #fff; }
body.dark-mode .chip-geo    { border-color: #5a7a95; color: #8ab0c9; }
body.dark-mode .chip-topic  { background-color: #2a2a2a; border-color: #5a7a95; color: #c8c8c8; }
body.dark-mode .chip-years  { border-color: #888; color: #aaa; }

/* Chevron */
.chevron-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.12);
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.15s, border-color 0.15s, background 0.15s;
    background: var(--white);
}
.ds-card[aria-expanded="true"] .chevron-toggle {
    transform: rotate(180deg);
    color: #ffffff;
    background: #09497a;
    border-color: #09497a;
}
body.dark-mode .chevron-toggle { color: #888; border-color: #333; background: #1e1e1e; }
body.dark-mode .ds-card[aria-expanded="true"] .chevron-toggle { color: #fff; background: #5a7a95; border-color: #5a7a95; }

/* Expanded panel */
.ds-expand { display: none; padding: 0 1.5rem 1.5rem; }
.ds-card.is-open .ds-expand { display: block; }
.ds-expand-inner {
    background-color: var(--ecru);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1.75rem;
    align-items: start;
}
body.dark-mode .ds-expand-inner { background-color: #181818; border-color: #333; }

.ds-description {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--charcoal);
    margin: 0 0 1.25rem 0;
}
.ds-description:empty { display: none; }
body.dark-mode .ds-description { color: #c8c8c8; }

/* Fact boxes */
.ds-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}
.ds-fact {
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
}
.ds-fact-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--sage);
    margin-bottom: 4px;
}
.ds-fact-value {
    font-size: 0.875rem;
    color: var(--charcoal);
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}
body.dark-mode .ds-fact { background-color: #121212; border-color: #333; }
body.dark-mode .ds-fact-label { color: #a8b361; }
body.dark-mode .ds-fact-value { color: #e0e0e0; }

/* CTA column */
.ds-cta-col { display: flex; flex-direction: column; gap: 0.625rem; align-items: stretch; }
.ds-btn {
    display: inline-block;
    text-align: center;
    padding: 11px 18px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: filter 0.15s, transform 0.1s;
    text-decoration: none;
}
.ds-btn-navy { background-color: #09497a; color: #ffffff; border: 1px solid #09497a; }
.ds-btn-navy:hover { filter: brightness(1.15); color: #ffffff; transform: translateY(-1px); }
.ds-btn-sage { background-color: var(--sage); color: #ffffff; }
.ds-btn-sage:hover { filter: brightness(1.08); color: #ffffff; transform: translateY(-1px); }
body.dark-mode .ds-btn-navy { background-color: #5a7a95; border-color: #5a7a95; }
body.dark-mode .ds-btn-sage { background-color: #a8b361; color: #1a1a1a; }
body.dark-mode .ds-btn-sage:hover { color: #1a1a1a; }


/* ============================================================================
   4. EMPTY STATE
============================================================================ */

.catalog-empty {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--charcoal);
}
.catalog-empty.visible { display: block; }
.catalog-empty h3 { color: var(--navy); font-size: 20px; margin: 0 0 10px; }
.catalog-empty p { font-size: 14px; color: #666; margin: 0; }
body.dark-mode .catalog-empty h3 { color: #c8d3df; }
body.dark-mode .catalog-empty p { color: #999; }


/* ============================================================================
   5. RESPONSIVE
============================================================================ */

@media (max-width: 768px) {
    .ds-expand-inner { grid-template-columns: 1fr; gap: 1.25rem; }
    .ds-cta-col { align-items: stretch; }
    .results-header .db-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .gs-tips-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ds-facts { grid-template-columns: 1fr; }
    .ds-meta-row { gap: 0.5rem 1rem; }
}

/* ============================================================================
   6. LANDING HUB (/databases/ index)
   Grouped collection tiles + quick-link jump nav. Echoes the RD directory
   pattern (jg-rd.css) but is databases-scoped and its own classes.
============================================================================ */

/* Warm ground so the white tiles read with depth rather than floating on
   white (de-sterilize pass). */
main.db-landing { background-color: var(--ecru); padding-bottom: 3rem; }
body.dark-mode main.db-landing { background-color: #161616; }

.db-landing-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Italic serif intro with sage rules (mirror of .rd-dir-intro) */
.db-landing-intro {
    text-align: center;
    max-width: 820px;
    margin: 1.75rem auto 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #8b8f72;
    border-bottom: 1px solid #8b8f72;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.12rem;
    line-height: 1.7;
    color: var(--charcoal);
}
body.dark-mode .db-landing-intro { color: #cfcfcf; border-color: #4a4f3f; }

/* Clearly-styled text hyperlink (the page's global reset strips link color
   and underline, so links inside prose need this to read as links). Navy /
   light-blue hardcoded - var(--navy) flips to light gray in dark mode and
   would not read as a link. */
.db-textlink {
    color: #09497a;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: bold;
}
.db-textlink:hover { color: #0d5c99; text-decoration: underline; }
.db-textlink:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
body.dark-mode .db-textlink { color: #8ab0c9; }
body.dark-mode .db-textlink:hover { color: #a9c9dd; }

/* Quick-link jump nav - modernized navy "blob grid" from the old page.
   One pill per collection; each jumps to that collection's tile. */
.db-quicknav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 0 auto 2.25rem;
    max-width: 1000px;
}
.db-quicknav a {
    display: inline-block;
    background-color: #09497a;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 5px 13px;
    border-radius: 4px;
    transition: background-color 0.15s;
}
.db-quicknav a:hover { background-color: #0d5c99; color: #ffffff; }
body.dark-mode .db-quicknav a { background-color: #1a1a1a; }
body.dark-mode .db-quicknav a:hover { background-color: #5a7a95; }

/* Group section */
.db-landing-group { margin-bottom: 2.5rem; scroll-margin-top: 20px; }
.db-landing-section-label {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    color: var(--navy);
    margin-bottom: 8px;
}
body.dark-mode .db-landing-section-label { color: #c8d3df; }
.db-accent-line {
    height: 3px;
    width: 60px;
    background-color: var(--sage);
    border-radius: 2px;
    margin-bottom: 1.25rem;
}
body.dark-mode .db-accent-line { background-color: #a8b361; }

/* Tile grid: 1 col mobile -> 2 -> 3 */
.db-landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.db-tile {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.4rem;
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 4px solid var(--sage);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    scroll-margin-top: 20px;
}
.db-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}
body.dark-mode .db-tile {
    background-color: #1e1e1e;
    border-color: #333;
    border-left-color: #a8b361;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.db-tile__name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--navy);
    margin: 0 0 0.4rem;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.db-tile__name .db-tile__arrow {
    color: var(--sage);
    font-weight: normal;
    transition: transform 0.18s ease;
}
.db-tile:hover .db-tile__arrow { transform: translateX(3px); }
.db-tile__ext-icon { font-size: 0.85em; color: var(--sage); }
.db-tile__desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--charcoal);
}
body.dark-mode .db-tile__name { color: #b0c8de; }
body.dark-mode .db-tile__name .db-tile__arrow,
body.dark-mode .db-tile__ext-icon { color: #a8b361; }
body.dark-mode .db-tile__desc { color: #c8c8c8; }

@media (max-width: 640px) {
    .db-landing-grid { grid-template-columns: 1fr; }
    .db-landing-intro { font-size: 1rem; }
}

/* ============================================================================
   7. RETURN-TO-TOP FLOATING BUTTON (landing + collection pages)
============================================================================ */

.db-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 26px;
    background-color: #09497a;   /* hardcoded - var(--navy) flips in dark mode */
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, background-color 0.15s;
}
.db-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.db-to-top:hover { background-color: #0d5c99; }
.db-to-top:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.db-to-top svg { width: 18px; height: 18px; flex-shrink: 0; }
body.dark-mode .db-to-top { background-color: #5a7a95; }
body.dark-mode .db-to-top:hover { background-color: #6b8aa5; }

@media (max-width: 640px) {
    .db-to-top { bottom: 16px; right: 16px; padding: 11px 18px; font-size: 0.9rem; }
}

/* ============================================================================
   END jg-databases.css
============================================================================ */