/**
 * Event Raids block + Current Raids landing.
 * Layout only; headers stay on .pokehub-block-header (04-blocks-front).
 *
 * Raid egg icons (normal vs shadow) do not share the same aspect ratio:
 * shadow assets include a wide aura. Always size by height (`width: auto`).
 */

.pokehub-raids-block-wrapper {
    --pokehub-raid-accent: var(--pokehub-raid-type-color, var(--me5rine-lab-color-secondary, #0485c8));
}

.pokehub-raids-type-section {
    margin: 1.15rem 0 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--me5rine-lab-border, #d7dce5) 80%, transparent);
    background: var(--me5rine-lab-surface, #fff);
    box-shadow: 0 1px 3px color-mix(in srgb, #0f172a 8%, transparent);
    --pokehub-raid-accent: var(--pokehub-raid-type-color, var(--me5rine-lab-color-secondary, #0485c8));
}

.pokehub-raids-type-section:first-of-type {
    margin-top: 0.35rem;
}

.pokehub-raids-type-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin: 0;
    padding: 0.45rem 0.75rem;
    color: #fff;
    background: var(--pokehub-raid-type-color, var(--me5rine-lab-primary, #2563eb));
}

.pokehub-raids-type-title__start {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    justify-self: start;
}

.pokehub-raids-type-title__label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.2;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pokehub-raids-type-title__marks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
}

.pokehub-raids-type-mark {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 1px 1px rgba(15, 23, 42, 0.35));
}

.pokehub-raids-type-title__dates {
    margin: 0;
    justify-self: end;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    color: inherit;
}

.pokehub-raids-type-icon {
    /* Shadow eggs include a wide aura: lock height, let width follow the asset. */
    height: 1.85rem;
    width: auto;
    max-width: none;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    flex: 0 0 auto;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.25));
}

@media (max-width: 639px) {
    .pokehub-raids-type-title {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "start dates"
            "marks marks";
        padding: 0.5rem 0.65rem;
    }

    .pokehub-raids-type-title__start {
        grid-area: start;
    }

    .pokehub-raids-type-title__marks {
        grid-area: marks;
    }

    .pokehub-raids-type-title__dates {
        grid-area: dates;
        font-size: 0.72rem;
    }
}

.pokehub-raids-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.75rem;
}

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

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

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

.pokehub-raid-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    min-width: 0;
    padding: 0.45rem 0.4rem 0.55rem;
    border-radius: var(--pokehub-fr-card-radius, 12px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    background:
        linear-gradient(
            to bottom,
            color-mix(in srgb, var(--pokehub-raid-accent) 14%, #ffffff) 0%,
            #ffffff 42%
        );
    box-shadow: var(--pokehub-fr-card-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pokehub-raid-card:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pokehub-raid-card__types {
    position: relative;
    z-index: 2;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
    margin: 0 0 0.15rem;
    padding: 0 1.35rem;
    box-sizing: border-box;
}

.pokehub-raid-card__shiny {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.85rem;
    line-height: 1;
    background: var(--admin-lab-color-white, #ffffff);
    border: 2px solid var(--admin-lab-color-white, #ffffff);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.pokehub-raid-card__regional,
.pokehub-raid-card__worldwide {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.85rem;
    line-height: 1;
    background: var(--admin-lab-color-white, #ffffff);
    border: 2px solid var(--admin-lab-color-white, #ffffff);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.pokehub-raid-card__art {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 7.5rem;
    height: 7.5rem;
    margin: 0.05rem 0 0.1rem;
}

.pokehub-raid-card__sprite {
    display: block;
    width: 7.5rem;
    height: 7.5rem;
    object-fit: contain;
    transform: scale(1.12);
    transform-origin: center 60%;
}

.pokehub-raid-card__name {
    margin: 0 0 0.2rem;
    width: 100%;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    color: var(--me5rine-lab-color-text, #0f172a);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.pokehub-raid-card__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    width: 100%;
    margin-top: auto;
}

.pokehub-raid-card__cp-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
    width: 100%;
}

.pokehub-raid-card__cp-list--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pokehub-raid-card__cp-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.22rem 0.28rem 0.28rem;
    border-radius: 6px;
    border: 1px solid var(--me5rine-lab-border, #e6e6e6);
    background: color-mix(in srgb, var(--me5rine-lab-surface-muted, #f7f9fa) 88%, #ffffff);
    box-sizing: border-box;
}

.pokehub-raid-card__cp-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--me5rine-lab-color-text-muted, #5d697d);
    white-space: nowrap;
}

.pokehub-raid-card__cp-value {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--me5rine-lab-color-text, #0f172a);
    white-space: nowrap;
}

.pokehub-raid-card__cp-min,
.pokehub-raid-card__cp-sep {
    font-weight: 600;
    color: var(--me5rine-lab-color-text-muted, #64748b);
}

.pokehub-raid-card__cp-max {
    color: var(--me5rine-lab-color-text, #0f172a);
}

.pokehub-raid-card__weather {
    list-style: none;
    margin: 0.12rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.28rem 0.45rem;
}

.pokehub-raid-card__weather-item {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    min-width: 0;
}

.pokehub-raid-card__weather-item img {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    object-fit: contain;
}

.pokehub-raid-card__weather-name {
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.2;
    color: var(--me5rine-lab-color-text, #0f172a);
}

.pokehub-raid-card--shadow {
    --pokehub-raid-accent: var(--pokehub-raid-type-color, #6d28d9);
}

.pokehub-current-raids {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.pokehub-current-raids > .pokehub-content-listing,
.pokehub-current-raids > .me5rine-lab-page-title,
.pokehub-current-raids > .me5rine-lab-lead,
.pokehub-current-raids > .me5rine-lab-dashboard-header {
    margin-bottom: 0;
}

.pokehub-current-raids-search {
    margin: 0;
    width: 100%;
}

.pokehub-current-raids-search .me5rine-lab-form-field {
    margin: 0;
    width: 100%;
    max-width: none;
}

.pokehub-current-raids-search__empty {
    margin: 0;
}

.pokehub-current-raids-groups {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pokehub-raids-family {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pokehub-raids-family + .pokehub-raids-family {
    padding-top: 1.75rem;
    border-top: 1px solid var(--me5rine-lab-border, #d7dce5);
}

.pokehub-raids-family .me5rine-lab-section-title {
    margin: 0;
}

.pokehub-raids-family .pokehub-raids-type-section:first-of-type {
    margin-top: 0;
}

.pokehub-raids-family:not(:has(.pokehub-raids-type-section:not([hidden]))) {
    display: none;
}

.pokehub-current-raids .pokehub-raids-type-section[hidden],
.pokehub-current-raids .pokehub-raid-card[hidden] {
    display: none !important;
}
