body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

body>.section {
    flex: 1 0 auto;
}

footer.footer {
    margin-top: auto;
}

.contests-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 769px) {
    .contests-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .contests-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1408px) {
    .contests-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.contests-grid .card {
    min-width: 0;
    margin-bottom: 0;
    overflow-wrap: anywhere;
    border: 1px solid var(--bulma-border);
}

.contests-grid .card-header {
    flex-direction: column;
}

.contests-grid .card-header-title {
    gap: 0.75rem;
    justify-content: space-between;
    align-items: flex-start;
}

.contests-grid .title {
    min-width: 0;
    margin-bottom: 0;
}

.contest-count {
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--bulma-text);
}

.contest-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem 0.75rem;
    font-size: 0.875rem;
}

.contest-progress .progress {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.contests-grid pre {
    white-space: pre-wrap;
}

.contests-grid table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* Masonry-ish grid without JS */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 1rem;
    /* space between cards */
}

/* override Bulma’s .column padding/margins inside the grid */
.task-grid>.column {
    margin: 0 !important;
    padding: 0 !important;
}

.task-grid .card {
    min-width: 0;
    height: 100%;
    /* all cards same column height */
    display: flex;
    /* stretch footer to bottom      */
    flex-direction: column;
}

.task-grid .card-content {
    flex-grow: 1;
}

.task-grid .card-header .card-header-title {
    min-width: 0;
}

.task-grid .card-header .task-card-tags {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.75rem;
    align-self: center;
}

@media (max-width: 768px) {
    footer.footer .level {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

.task-grid .card-header .task-card-tags .tags {
    flex-wrap: nowrap;
}
