
/* Navbar spacing. Icon->label spacing is the link's flex .gap-1 (matching the
   right-hand Ditto/user side); here we just add a little more room between the
   items themselves (Bootstrap's default .navbar-brand margin is 1rem). */
.navbar .navbar-brand {
    margin-right: 1.25rem;
}
.navbar .navbar-brand [aria-hidden="true"] {
    margin-right: 0 !important;
}

#footer {
    background-color: #ECECEC;
}

.alert {
    z-index: 1031;
}

.button-success {
    color: #fff;
    background-color: #569E39;
    border-color: #569E39;
}

/* ------------------------------------------------------------------ */
/* Homepage dataset cards (Grand-Challenge style)                     */
/* ------------------------------------------------------------------ */

/* Responsive grid that fills the container width: as many equal columns as
   fit, each stretched to use the leftover space. */
.dataset-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .dataset-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.85rem;
    }
}

.dataset-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

/* Superuser-only shortcut to the dataset's Django admin change page. */
.dataset-card-edit {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    margin: 0.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
    color: #5b5191;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dataset-card-edit:hover,
.dataset-card-edit:focus {
    background: #5b5191;
    color: #fff;
    border-color: #5b5191;
    outline: none;
}

.dataset-card:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.10);
    border-color: #cdd3da;
    transform: translateY(-2px);
    color: inherit;
}

/* Logo on top, on a plain (no colour) card. */
.dataset-card-logo {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
}

.dataset-card-logo img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.dataset-card-body {
    padding: 0 1.1rem 0.5rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dataset-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Short description, cropped to a few lines with an ellipsis. */
.dataset-card-desc {
    margin: 0;
    font-size: 0.85rem;
    color: #5b6168;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Task tags and venue tags kept on separate rows. */
.dataset-card-tagrows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}

.dataset-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.ds-tag {
    font-size: 0.72rem;
    padding: 0.12rem 0.5rem;
    border-radius: 1rem;
    white-space: nowrap;
    line-height: 1.4;
}

.ds-tag-task {            /* what the dataset is for */
    background: #eef2ff;
    color: #3730a3;
}

.ds-tag-venue {          /* where it was presented/used */
    background: #ecfdf5;
    color: #065f46;
}

.dataset-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.1rem;
    border-top: 1px solid #eef0f2;
    font-size: 0.78rem;
    color: #6b7280;
}

/* Disabled (non-public) datasets shown to administrators are dimmed. */
.dataset-card-disabled {
    opacity: 0.6;
    filter: grayscale(50%);
}

.dataset-card-disabled:hover {
    opacity: 1;
    filter: none;
}

/* ------------------------------------------------------------------ */
/* Page editor "layout" super-blocks (rendered on public dataset pages) */
/* ------------------------------------------------------------------ */

/* Responsive image container: one image fills the width; several form a
   mosaic. Gallery presets pin a fixed number of columns. */
.ds-media {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
    margin: 0.25rem 0;
}

/* Grid items default to min-width:auto, which lets a large image overflow its
   column; min-width:0 lets the track (and the image) shrink to fit. */
.ds-media > * { min-width: 0; }

.ds-media img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0.3rem;
}

.ds-gallery-2 { grid-template-columns: repeat(2, 1fr); }
.ds-gallery-3 { grid-template-columns: repeat(3, 1fr); }
.ds-gallery-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 576px) {
    .ds-gallery-3, .ds-gallery-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Image placeholders are an editor-only affordance — never shown publicly. */
.ds-img-placeholder { display: none; }

@media screen and (max-width:900px), screen and (max-height:500px) {
#author {display:none;}
}