/* Sets and expansions: /sets-and-expansions, generated from Content/expansions/ by
   Components/ShortCodes/Expansions.razor. Kept out of app.css because it is a page's worth of
   styling on its own; loaded site-wide like the other stylesheets. */

/* Floating trigger for the slide-out index, revealed once the index at the top scrolls away. */
.mdwg-expansion-jump {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid rgba(77, 163, 255, 0.5);
    border-radius: 2rem;
    background-color: rgba(19, 27, 51, 0.96);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, border-color 0.2s, box-shadow 0.2s;
}

.mdwg-expansion-jump.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.mdwg-expansion-jump:hover {
    border-color: #4da3ff;
    box-shadow: 0 0 20px rgba(77, 163, 255, 0.35);
}

.mdwg-expansion-jump i {
    font-size: 1.05rem;
    line-height: 1;
}

.mdwg-expansion-panel {
    /* Never the full screen, so the page stays visible behind it and there is somewhere to tap to
       dismiss it. Set through Bootstrap's own variable: its .offcanvas.offcanvas-end rule is two
       classes, so a plain width here loses the cascade to it. */
    --bs-offcanvas-width: min(22rem, 68vw);
    background-color: #131b33;
    border-left: 1px solid rgba(77, 163, 255, 0.45);
    border-radius: 0.75rem 0 0 0.75rem;
    /* Lifts the panel off the page behind it: without this, dark panel against dark page reads as
       one full-screen surface. */
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.6);
}

.mdwg-expansion-panel .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mdwg-expansion-panel .offcanvas-title {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 1rem;
}

/* One column in the panel however many the page itself shows. */
.mdwg-expansion-panel .mdwg-expansion-index {
    column-count: 1;
}

/* The panel is narrower than the page, so its copy is scaled down to keep every product on one
   line; anything still too long is truncated rather than wrapped. */
.mdwg-expansion-panel .offcanvas-body {
    padding: 0.9rem;
}

.mdwg-expansion-panel .mdwg-expansion-index-card {
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.7rem;
}

.mdwg-expansion-panel .mdwg-expansion-index-block {
    font-size: 0.88rem;
}

.mdwg-expansion-panel .mdwg-expansion-index-list {
    margin-top: 0.55rem;
}

.mdwg-expansion-panel .mdwg-expansion-index-list a {
    gap: 0.5rem;
    font-size: 0.85rem;
}

.mdwg-expansion-panel .mdwg-expansion-index-list span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mdwg-expansion-panel .mdwg-expansion-index-thumb {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}

/* A phone's panel is around 245px against the desktop's 352px, so it needs the tighter set of
   numbers for the longest names ("Crisis: Bases and Battleships") to fit on one line. */
@media (max-width: 575.98px) {
    .mdwg-expansion-panel .offcanvas-body {
        padding: 0.75rem;
    }

    .mdwg-expansion-panel .mdwg-expansion-index-card {
        padding: 0.7rem;
        margin-bottom: 0.6rem;
    }

    .mdwg-expansion-panel .mdwg-expansion-index-block {
        font-size: 0.8rem;
    }

    .mdwg-expansion-panel .mdwg-expansion-index-list a {
        gap: 0.4rem;
        font-size: 0.74rem;
    }

    .mdwg-expansion-panel .mdwg-expansion-index-thumb {
        flex: 0 0 20px;
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 575.98px) {
    .mdwg-expansion-jump span {
        display: none;
    }

    .mdwg-expansion-jump {
        padding: 0.7rem;
    }
}

.mdwg-expansion-index-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

/* Columns rather than a grid: cards flow down each column at their natural height, so a block
   with one product doesn't leave the empty space a row of equal-height cells would. */
.mdwg-expansion-index {
    column-count: 3;
    column-gap: 1rem;
}

@media (max-width: 991.98px) {
    .mdwg-expansion-index {
        column-count: 2;
    }
}

@media (max-width: 575.98px) {
    .mdwg-expansion-index {
        column-count: 1;
    }
}

.mdwg-expansion-index-card {
    position: relative;
    display: block;
    break-inside: avoid;
    margin-bottom: 1rem;
    overflow: hidden;
    background-color: #131b33;
    background-image: linear-gradient(to right, #131b33 0%, #131b33 42%, rgba(19, 27, 51, 0.9) 62%, rgba(19, 27, 51, 0.84) 100%), var(--mdwg-index-art);
    background-repeat: no-repeat;
    background-position: center, right center;
    /* Art scaled to the card's height, not its width: a one-line card gets a small image
       instead of one sized for a card three times taller. */
    background-size: cover, 50% auto;
    background-clip: border-box, padding-box;
    background-origin: border-box, padding-box;
    border: 1px solid rgba(77, 163, 255, 0.15);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.mdwg-expansion-index-card:hover {
    transform: translateY(-2px);
    border-color: rgba(77, 163, 255, 0.5);
    box-shadow: 0 0 18px rgba(77, 163, 255, 0.25);
}

.mdwg-expansion-index-block {
    display: block;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}

.mdwg-expansion-index-list {
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}

.mdwg-expansion-index-list li + li {
    margin-top: 0.35rem;
}

/* Above the block title's stretched-link overlay, so each expansion stays clickable. */
.mdwg-expansion-index-list a {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
}

.mdwg-expansion-index-list a:hover {
    color: #4da3ff;
}

/* Where you are, in both the page index and the panel. Deliberately unlike :hover — a lit marker
   and a glow rather than the lift and border hover uses. */
.mdwg-expansion-index-list a.active,
.mdwg-expansion-index-block.active {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 0 14px rgba(77, 163, 255, 0.75);
}

.mdwg-expansion-index-list a.active::before {
    content: "";
    flex: 0 0 3px;
    width: 3px;
    height: 1.2em;
    border-radius: 2px;
    background-color: #4da3ff;
    box-shadow: 0 0 10px rgba(77, 163, 255, 0.9);
}

.mdwg-expansion-index-card:has(.active) {
    border-color: rgba(77, 163, 255, 0.7);
    box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.25), 0 0 28px rgba(77, 163, 255, 0.22);
}

/* Lit edge down the current card. */
.mdwg-expansion-index-card:has(.active)::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: linear-gradient(180deg, #4da3ff, rgba(77, 163, 255, 0));
}

.mdwg-expansion-index-thumb {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* A block's own file opens the section: a lit panel carrying the title art and the intro copy,
   with the block's products listed beneath it. */
.mdwg-expansion-intro {
    position: relative;
    margin-top: 1.75rem;
    padding: 2.5rem 1.5rem 2.25rem;
    border: 1px solid rgba(77, 163, 255, 0.18);
    border-radius: 0.75rem;
    overflow: hidden;
    background-image:
        radial-gradient(120% 130% at 50% -25%, rgba(77, 163, 255, 0.2), rgba(77, 163, 255, 0) 62%),
        linear-gradient(180deg, #141d38 0%, #0d1428 100%);
}

/* A short accent line centred on the panel's top edge. */
.mdwg-expansion-intro::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, rgba(77, 163, 255, 0), #4da3ff, rgba(77, 163, 255, 0));
}

.mdwg-expansion-intro-art {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 auto 1.5rem;
    filter: drop-shadow(0 6px 22px rgba(77, 163, 255, 0.35));
}

.mdwg-expansion-intro-body {
    max-width: 820px;
    color: rgba(255, 255, 255, 0.82);
}

.mdwg-expansion-intro-body > p:last-of-type {
    margin-bottom: 0;
}

/* Labelled rule between the block's intro and its products. */
.mdwg-expansion-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.mdwg-expansion-divider::before,
.mdwg-expansion-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(77, 163, 255, 0), rgba(77, 163, 255, 0.4), rgba(77, 163, 255, 0));
}

.mdwg-expansion-divider span {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mdwg-expansion-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.mdwg-expansion-btn i {
    font-size: 1rem;
    line-height: 1;
}

/* Cosmic accent bar under each block heading. */
.mdwg-expansion-block h1 {
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mdwg-expansion-block h1::after {
    content: "";
    display: block;
    width: 90px;
    height: 3px;
    margin-top: 0.65rem;
    background: linear-gradient(90deg, #4da3ff, rgba(77, 163, 255, 0));
}

/* Breathing room when jumping to a block or an expansion. */
.mdwg-expansion-block,
.mdwg-expansion {
    scroll-margin-top: 1rem;
}
