/* Funder logo cards. NB `.. div:: overview` renders as class="overview", not an id.

   Uniform height regardless of aspect ratio, on a white plate: logo_ciusss.png is
   near-black on transparent (invisible on a dark card) and logo_udem.png is an opaque
   near-white raster that cannot be inverted, so a white plate is the only treatment
   that works for both in either theme. Round it so it reads as a deliberate plate
   rather than a raw slab in dark mode. */
.overview .sd-card-img-top {
    height: 120px;
    object-fit: contain;
    padding: 1rem;
    background: white;
    border-radius: 6px;
}

/* these cards carry no text; drop the empty body so the card is just the plate */
.overview .sd-card-body {
    display: none;
}

/* key-facts table: allow cell wrapping */
#key-facts table td,
#key-facts table th {
    white-space: normal;
}

#key-facts table code,
#key-facts table span.pre {
    white-space: normal;
}

/* furo's overflow-x:auto forces overflow-y:auto too, clipping rotated headers */
#datasets .table-wrapper.container {
    overflow: visible;
}

/* datasets overview table */
#datasets table p {
    font-size: 1rem;
    line-height: 1.6;
}

#datasets table th {
    height: 100px;
    vertical-align: bottom;
    white-space: nowrap;
    border: 0;
    width: 30px;
}

#datasets table th > p {
    transform: rotate(-45deg);
    width: 30px;
}

/* dataset name column — wide, upright */
#datasets table th:first-child {
    width: 165px;
    height: auto;
}

#datasets table th:first-child > p {
    transform: none;
    width: auto;
}

#datasets a {
    text-decoration: none;
}

/* furo's overflow-x:auto forces overflow-y:auto too, clipping rotated headers */
#assets .table-wrapper.container {
    overflow: visible;
}

/* assets overview table */
#assets table p {
    font-size: 1rem;
    line-height: 1.6;
}

#assets table th {
    height: 100px;
    vertical-align: bottom;
    white-space: nowrap;
    border: 0;
    width: 30px;
}

#assets table th > p {
    transform: rotate(-45deg);
    width: 30px;
}

/* dataset name column — wide, upright */
#assets table th:first-child {
    width: 120px;
    height: auto;
}

#assets table th:first-child > p {
    transform: none;
    width: auto;
}

#assets a {
    text-decoration: none;
}

/* keep asset-name and "other" columns on one line */
#assets table td:first-child,
#assets table td:last-child {
    white-space: nowrap;
}

/* zero padding and center for all columns after dataset name */
#assets table td + td {
    padding: 0;
    text-align: center;
}

#assets table td + td p {
    margin: 0;
}

#assets table td + td:empty,
#assets table td + td:has(> p:empty) {
    background-color: #f0f0f0;
}

/* furo adds padding:0 .25rem on td and margin:.25rem on td p — on a 20px column
   that consumes nearly all the space before the icon renders, clipping it.
   Zero both out for every column after the dataset name. */
#datasets table td + td {
    padding: 0;
    text-align: center;
}

#datasets table td + td p {
    margin: 0;
}

[data-theme="light"] #datasets table td + td:empty,
[data-theme="light"] #datasets table td + td:has(> p:empty) {
    background-color: #f0f0f0;
}

[data-theme="light"] #datasets table.docutils td,
[data-theme="light"] #datasets table.docutils th {
  border-left-color: #aaa;
  border-right-color: #aaa;
  border-bottom-color: #aaa;
  border-top-color: #aaa;
}

#datasets table.docutils th {
  background-color: transparent;
}

/* ---------------------------------------------------------------- *
 * landing-page dataset gallery                                      *
 * ---------------------------------------------------------------- */

.ds-gallery .ds-card {
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-gallery .ds-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ds-gallery .ds-card .sd-card-body {
    padding: 0.75rem;
}

.ds-gallery .ds-card p {
    margin: 0 0 0.35rem;
    line-height: 1.4;
}

.ds-gallery .ds-card p:last-child {
    margin-bottom: 0;
    font-size: 0.85rem;
    color: var(--color-foreground-secondary);
}

.ds-gallery a,
.ds-gallery .sd-stretched-link::after {
    text-decoration: none;
}

/* uniform tile: artwork varies from 110x232 to 600x259 with baked-in white, black
   and grey backgrounds, so contain it and let the letterbox follow the theme */
.ds-tile {
    height: 180px;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-background-secondary);
}

.ds-tile img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.ds-tile--emoji {
    font-size: 4.5rem;
    line-height: 1;
}

/* dataset page hero: same artwork as the gallery tile, shown larger above
   the key-facts table */
.ds-hero {
    max-height: 260px;
    margin: 1rem 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-background-secondary);
}

.ds-hero img {
    max-height: 260px;
    max-width: 100%;
    object-fit: contain;
}

.ds-hero-credit {
    margin: -0.75rem 0 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-foreground-secondary);
}
