
.page-title {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0; /* Center spacing vertically */
    width: 100%;
    color: #fff; /* Adjust to match your design */
    display: block; /* Ensure it's treated as a block element */
}

.heroes-intro {
    color: #ccc;
    font-size: 1.15rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
    text-transform: none;
    font-weight: normal;
}

/* The shared last-updated line sits between the centered intro and the filter
   bar — center it too (elsewhere it lives inside centered wrappers). */
.rs-last-updated {
    text-align: center;
}

.heroes-list {
    display: grid;
    /* Fixed column counts (5 desktop -> 2 mobile): uniform card widths and
       left-aligned rows even when a filter leaves only a few heroes. */
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    max-width: 100%; /* Removed hardcoded width to allow full responsiveness */
    box-sizing: border-box; /* Ensure padding does not affect grid width */
}

@media (max-width: 1199px) {
    .heroes-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .heroes-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 767px) {
    .heroes-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.hero-item {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: var(--ast-global-color-8);
}

.hero-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hero-item picture {
    display: block;
}

.hero-item-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Name left, role icon(s) pinned top right; the icon column never shrinks, so
   a two-line name (Jeff the Land Shark) wraps while the icon stays on the
   first line. */
.hero-item-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 12px;
    text-align: left;
}

.hero-item-name {
    font-weight: bold;
    min-width: 0;
}

.hero-item-roles {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hero-item-roles picture {
    display: flex;
}

.hero-card-role-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Triple-role (Deadpool): the three icons sit right of the name when the card
   is wide enough, otherwise they wrap to their own left-aligned second row.
   Regular cards must NOT wrap — their name shrinks (min-width: 0) and the
   single icon stays top right. */
.hero-item-meta--multirole {
    flex-wrap: wrap;
}
.hero-item--hidden {
    display: none;
}

/* Filter bar (frontpage-style dropdowns; structure/behavior from filter-ui.css +
   js/filter-popup.js). Only page-scoped spacing lives here — the shared sheet
   provides mobile (≤768px) side padding but no desktop gutter. */
.main-container > .filter-buttons {
    margin-top: 20px;
    padding-left: 20px;
    padding-right: 20px;
}

.main-container > .active-filters-parent {
    padding-left: 20px;
    padding-right: 20px;
}

/* Astra's .ast-container already insets the page 20px on phones; dropping the
   page-scoped side padding here keeps the filter row, badges and grid flush
   with each other at that single 20px instead of doubling up to 40px. */
@media (max-width: 768px) {
    .main-container > .filter-buttons,
    .main-container > .active-filters-parent {
        padding-left: 0;
        padding-right: 0;
    }

    .heroes-list {
        padding-left: 0;
        padding-right: 0;
    }
}
