/**
 * Homepage Rankings - magazine chart.
 * Printed-magazine chart page with Persona-style slashes, compact enough
 * that both full top-20 lists fit on one screen at 1080p. Box art keeps
 * its real aspect ratio; the game's banner is a faded backdrop on #1-3.
 * Markup: includes/home-rankings-chart.php
 * NextRust Slab comes from assets/css/theme/header-nav.css.
 */

.wkc-rankings {
    --wkc-green: #4da44b;        /* --wakasm-green */
    --wkc-green-deep: #2f6e2e;
    --wkc-ink: #0d0d0d;
    --wkc-panel: #131313;
    --wkc-card: #1c1c1c;
    --wkc-rule: #2a2a2a;
    --wkc-text: #e0e0e0;         /* --wakasm-light */
    --wkc-muted: #8d8d8d;
    --wkc-gold: #ffc107;         /* --wakasm-yellow */
    --wkc-silver: #9fb0bd;         /* steel, not white */
    --wkc-bronze: #ff6b35;       /* --wakasm-orange */
    --wkc-slab: 'NextRust Slab', 'Arial Black', Impact, sans-serif;
    --wkc-display: 'Changa', 'Arial Black', sans-serif;
    --wkc-body: 'Source Sans Pro', system-ui, sans-serif;
    --wkc-skew: -10deg;

    --wkc-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --wkc-dots: radial-gradient(circle, rgba(0, 0, 0, .55) 1.2px, transparent 1.7px);

    padding: 15px 20px 36px;
    background: linear-gradient(180deg, #0a0a0a 0%, #151515 100%);
}

/* ---- section heading ---- */
.wkc-rankings-head {
    margin-bottom: 22px;
    text-align: center;
}
/* Matches the other homepage section titles (home-redesign-v2.css) */
.wkc-rankings .section-title {
    margin: 0 0 15px;
    color: #fff;
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -2px;
    text-shadow: 0 0 30px rgba(77, 164, 75, .4);
}
.wkc-rankings .section-subtitle {
    margin: 0;
    color: #888;
    font-size: .9rem;
    font-style: italic;
}

/* ---- layout ---- */
.wkc-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
}

.wkc-chart {
    position: relative;
    isolation: isolate;
    padding: 26px 24px 36px;
    background: var(--wkc-panel);
    box-shadow: 10px 10px 0 #0a0a0a;
}
/* Torn green edges, top and bottom (site standard page pattern) */
.wkc-chart::before,
.wkc-chart::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 16px;
    z-index: 1;
    background: var(--wkc-green);
}
.wkc-chart::before {
    top: 0;
    clip-path: polygon(0% 0%, 10% 80%, 20% 60%, 30% 90%, 40% 50%, 50% 85%,
                       60% 40%, 70% 75%, 80% 55%, 90% 80%, 100% 0%, 100% 0%, 0% 0%);
}
.wkc-chart::after {
    bottom: 0;
    clip-path: polygon(0% 100%, 10% 20%, 20% 40%, 30% 10%, 40% 50%, 50% 15%,
                       60% 60%, 70% 25%, 80% 45%, 90% 20%, 100% 100%, 100% 100%, 0% 100%);
}
.wkc-chart a { color: inherit; text-decoration: none; }

.wkc-body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
.wkc-body::after {            /* film grain */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--wkc-noise);
    opacity: .06;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* ---- masthead: title left, kicker + month right, green double rule ---- */
.wkc-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 6px 0 10px;
    border-bottom: 4px solid var(--wkc-green);
    box-shadow: 0 3px 0 var(--wkc-panel), 0 5px 0 var(--wkc-green);
}
.wkc-title {
    margin: 0;
    color: #fff;
    font: 400 clamp(1.8rem, 2.2vw, 2.7rem)/1 var(--wkc-slab);
    letter-spacing: .01em;
    text-transform: uppercase;
    white-space: nowrap;
}
/* Persona slash behind the second word */
.wkc-title span {
    position: relative;
    display: inline-block;
    margin-left: .12em;
    padding: 0 .22em;
    color: var(--wkc-ink);
    z-index: 0;
}
.wkc-title span::before {
    content: "";
    position: absolute;
    inset: -.04em -.04em .02em;
    z-index: -1;
    background: var(--wkc-green);
    transform: skewX(var(--wkc-skew)) rotate(-2deg);
    box-shadow: 4px 4px 0 var(--wkc-ink);
}
.wkc-head-meta {
    display: grid;
    gap: 5px;
    justify-items: end;
    color: var(--wkc-muted);
    font: 700 .7rem/1 var(--wkc-display);
    letter-spacing: .2em;
    text-transform: uppercase;
    white-space: nowrap;
}
.wkc-kicker { color: var(--wkc-green); }

/* ---- #1-3: three cards across ---- */
.wkc-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.wkc-hero {
    --accent: var(--wkc-green);
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 138px;
    padding: 12px 12px 12px 10px;
    overflow: hidden;
    background: var(--wkc-card);
    border-bottom: 4px solid var(--accent);
}
.wkc-hero--r1 { --accent: var(--wkc-gold); }
.wkc-hero--r2 { --accent: var(--wkc-silver); }
.wkc-hero--r3 { --accent: var(--wkc-bronze); }

/* banner backdrop + halftone */
.wkc-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .3;
    filter: saturate(.75);
    transition: opacity .25s ease, scale .6s ease;
}
.wkc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(19, 19, 19, .85) 0%, rgba(19, 19, 19, .35) 70%),
        var(--wkc-dots) 0 0 / 6px 6px;
}
.wkc-hero:hover .wkc-bg { opacity: .5; scale: 1.05; }

.wkc-hero-art {
    display: grid;
    place-items: center;
    height: var(--wkc-art-h, 112px);
}
.wkc-hero-img {
    display: block;
    max-width: var(--wkc-art-w, 84px);
    max-height: var(--wkc-art-h, 112px);
    width: auto;
    height: auto;
    object-fit: contain;
    transform: rotate(-3deg);
    filter: drop-shadow(5px 5px 0 rgba(0, 0, 0, .65));
    transition: transform .25s ease;
}
.wkc-hero:hover .wkc-hero-img { transform: rotate(0) scale(1.04); }

.wkc-hero-text {
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
}
.wkc-hero-num {
    color: var(--accent);
    font: 400 3.4rem/.85 var(--wkc-slab);
    transform: skewX(var(--wkc-skew));
    transform-origin: left bottom;
    text-shadow: 3px 3px 0 var(--wkc-ink);
}
.wkc-hero-months {
    color: var(--wkc-muted);
    font: 700 .62rem/1 var(--wkc-display);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.wkc-hero-months b { color: var(--accent); font-size: 1.1em; }
.wkc-hero-title {
    margin-top: 2px;
    color: #fff;
    font: 800 1.05rem/1.1 var(--wkc-display);
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--wkc-ink);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .2s ease;
}
.wkc-hero:hover .wkc-hero-title { color: var(--accent); }

/* ---- #4-10 large rows | #11-25 compact rows filling the same height ---- */
.wkc-lower {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px;
}
.wkc-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}
.wkc-rows li { margin: 0; }

/* shared row parts */
.wkc-row {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    overflow: hidden;
    transition: background .15s ease;
}
a.wkc-row:hover { background: rgba(77, 164, 75, .1); }
.wkc-row-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.wkc-row-months {
    color: var(--wkc-muted);
    font: 600 .72rem/1 var(--wkc-body);
    white-space: nowrap;
}
.wkc-row--tbd .wkc-row-title {
    color: #555;
    font: italic 400 .88rem/1 var(--wkc-body);
    text-transform: none;
}

/* #4-10 */
.wkc-rows--lg { display: grid; gap: 6px; }
.wkc-row--lg {
    grid-template-columns: 46px 40px minmax(0, 1fr) auto;
    column-gap: 12px;
    height: 50px;
    padding-right: 10px;
    background: var(--wkc-card);
}
.wkc-row--lg .wkc-bg {
    left: 40%;
    width: 60%;
    opacity: .2;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 75%);
            mask-image: linear-gradient(90deg, transparent, #000 75%);
}
a.wkc-row--lg:hover .wkc-bg { opacity: .38; }
.wkc-row--lg .wkc-row-num {
    align-self: stretch;
    display: grid;
    place-items: center;
    background: var(--wkc-green);
    color: var(--wkc-ink);
    font: 400 1.5rem/1 var(--wkc-slab);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
    transition: background .15s ease;
}
a.wkc-row--lg:hover .wkc-row-num { background: #fff; }
.wkc-row--lg .wkc-row-title {
    color: #fff;
    font: 800 .95rem/1.1 var(--wkc-display);
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--wkc-ink);
}
.wkc-row--lg.wkc-row--tbd .wkc-row-num { background: #2a2a2a; color: #555; }
.wkc-row--lg.wkc-row--tbd { grid-template-columns: 46px minmax(0, 1fr); }
.wkc-row-art {
    display: grid;
    place-items: center;
    height: 42px;
}
.wkc-row-img {
    display: block;
    max-width: 40px;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .7));
}

/* #11-25: rows share out the height of the #4-10 column exactly */
.wkc-rows--sm {
    display: grid;
    grid-auto-rows: 1fr;
}
.wkc-rows--sm li { border-bottom: 2px dotted #333; }
.wkc-row--sm {
    grid-template-columns: 2.1em minmax(0, 1fr) auto;
    column-gap: 10px;
    height: 100%;
    padding-right: 4px;
}
.wkc-row--sm .wkc-row-num {
    color: var(--wkc-green);
    font: 400 .98rem/1 var(--wkc-slab);
    text-align: right;
}
.wkc-row--sm .wkc-row-title {
    color: var(--wkc-text);
    font: 600 .88rem/1.1 var(--wkc-body);
}
a.wkc-row--sm:hover .wkc-row-title { color: var(--wkc-green); }
.wkc-row--sm .wkc-row-months { font-size: .68rem; }
.wkc-row--sm.wkc-row--tbd .wkc-row-num { color: #444; }
.wkc-row--sm.wkc-row--tbd { grid-template-columns: 2.1em minmax(0, 1fr); }

/* Missing art: lettered block instead of an empty frame. */
.wkc-art-missing {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: var(--wkc-dots) 0 0 / 5px 5px, var(--wkc-green-deep);
    color: #fff;
    font: 400 1.4rem/1 var(--wkc-slab);
}
.wkc-row-img.wkc-art-missing { width: 32px; font-size: .8rem; }

/* ---- CTA ---- */
.wkc-cta {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
    padding: 11px 28px;
    background: var(--wkc-green);
    color: var(--wkc-ink);
    font: 400 .95rem/1 var(--wkc-slab);
    letter-spacing: .06em;
    text-transform: uppercase;
    transform: skewX(var(--wkc-skew));
    box-shadow: 5px 5px 0 var(--wkc-ink);
    transition: background .15s ease, translate .15s ease, box-shadow .15s ease;
}
.wkc-cta span { display: block; transform: skewX(calc(var(--wkc-skew) * -1)); }
.wkc-cta:hover { background: #fff; translate: -2px -2px; box-shadow: 7px 7px 0 var(--wkc-green-deep); }

/* ---- responsive ---- */
@media (max-width: 1600px) {
    .wkc-hero { --wkc-art-w: 64px; --wkc-art-h: 92px; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
    .wkc-hero-num { font-size: 2.8rem; }
    .wkc-hero-title { font-size: .88rem; -webkit-line-clamp: 3; }
    .wkc-row--sm .wkc-row-months { display: none; }
}

@media (max-width: 1200px) {
    .wkc-columns { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; }
    .wkc-row--sm .wkc-row-months { display: block; }
}

@media (max-width: 760px) {
    .wkc-rankings { padding: 15px 10px 24px; }
    .wkc-rankings .section-title { font-size: 1.8rem; letter-spacing: -1px; }
    .wkc-chart { padding: 24px 14px 34px; box-shadow: 6px 6px 0 #0a0a0a; }
    .wkc-head { flex-wrap: wrap; align-items: center; }
    .wkc-head-meta { justify-items: start; }
    .wkc-podium { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .wkc-hero { min-height: 0; }
    .wkc-lower { grid-template-columns: minmax(0, 1fr); }
    .wkc-rows--sm { grid-auto-rows: 34px; }
    .wkc-cta { padding: 11px 18px; font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
    .wkc-bg, .wkc-hero-img, .wkc-row, .wkc-cta { transition: none; }
}
