/**
 * Wakasm Ideas - public page
 * Standard Page Design Pattern: black bg, clip-path side edges,
 * green torn edges top/bottom via pseudo-elements.
 */

/* Full-width override: kill Genesis content padding/max-width
   (matches the catalog-list.css pattern) */
body.page-template-page-wakasm-ideas .site-inner,
body.page-template-page-wakasm-ideas .content-sidebar-wrap,
body.page-template-page-wakasm-ideas .content {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

body.page-template-page-wakasm-ideas .entry,
body.page-template-page-wakasm-ideas .entry-content {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

body.page-template-page-wakasm-ideas .entry-header,
body.page-template-page-wakasm-ideas .entry-title {
    display: none;
}

.wakasm-ideas-page {
    position: relative;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 60px clamp(16px, 3vw, 48px) 80px;
    margin: 0;
    width: 100%;
    min-height: 80vh;
    box-sizing: border-box;

    clip-path: polygon(
        0% 0%, 100% 0%,
        98% 5%, 99% 10%, 97% 15%, 100% 20%, 98% 25%, 99% 30%, 97% 35%, 100% 40%,
        98% 45%, 99% 50%, 97% 55%, 100% 60%, 98% 65%, 99% 70%, 97% 75%, 100% 80%,
        98% 85%, 99% 90%, 97% 95%,
        100% 100%, 0% 100%,
        2% 95%, 1% 90%, 3% 85%, 0% 80%, 2% 75%, 1% 70%, 3% 65%, 0% 60%,
        2% 55%, 1% 50%, 3% 45%, 0% 40%, 2% 35%, 1% 30%, 3% 25%, 0% 20%,
        2% 15%, 1% 10%, 3% 5%
    );
}

.wakasm-ideas-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    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%);
    z-index: 1;
}

.wakasm-ideas-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    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%);
    z-index: 1;
}

/* ===========================================================
   Header
   =========================================================== */
.wi-header {
    text-align: center;
    margin: 0 auto 40px;
    max-width: 900px;
}

.wi-title {
    font-family: 'Press Start 2P', 'NexaRustSlab', Impact, sans-serif;
    font-size: 2.4rem;
    color: #4da44b;
    margin: 0 0 16px;
    text-shadow: 3px 3px 0 #000;
    line-height: 1.2;
}

.wi-subtitle {
    font-size: 1.05rem;
    color: #ccc;
    line-height: 1.6;
    margin: 0;
}

/* ===========================================================
   Controls (sort + balance)
   =========================================================== */
.wi-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 auto 32px;
    max-width: 1100px;
}

.wi-sort-label {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wi-sort-tabs {
    display: flex;
    gap: 4px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 4px;
}

.wi-sort-tab {
    display: inline-block;
    padding: 8px 16px;
    color: #ccc;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.wi-sort-tab:hover {
    background: #1a1a1a;
    color: #fff;
}

.wi-sort-tab.is-active {
    background: #4da44b;
    color: #000;
    font-weight: 600;
}

.wi-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #f4c542;
    font-weight: 600;
    background: #0d0d0d;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #333;
}

/* .wi-balance-coin: canonical sizing comes from .wakasm-coin--mini in coin.css */

/* ===========================================================
   Grid
   =========================================================== */
.wi-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    margin: 0;
}

@media (min-width: 1400px) {
    .wi-grid { gap: 20px; }
}

@media (max-width: 1100px) {
    .wi-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 800px) {
    .wi-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

@media (max-width: 500px) {
    .wi-grid { grid-template-columns: repeat(2, 1fr); }
    .wakasm-ideas-page { padding: 40px 4% 60px; }
    .wi-title { font-size: 1.6rem; }
}

/* ===========================================================
   Idea card
   =========================================================== */
.wi-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0d0d0d;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    padding: 16px 20px;
    transition: border-color 0.15s ease, transform 0.15s ease;
    position: relative;
    grid-column: span 2;
}

/* Vote button always sits at the BOTTOM of the card, centered horizontally.
   margin-top: auto pushes it to the bottom regardless of how much content
   is above; align-self: center horizontally centers it. */
.wi-card > .wi-card-vote {
    order: 99;
    align-self: center;
    margin-top: auto;
    padding-top: 8px;
}

.wi-card--single-game {
    grid-column: span 1;
}

.wi-card:hover {
    border-color: #4da44b;
    transform: translateY(-1px);
}

.wi-card-main {
    min-width: 0;
    max-width: 720px;
}

.wi-card-title {
    font-family: 'NexaRustSlab', 'Roboto Slab', serif;
    font-size: 1.15rem;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.25;
}

.wi-card-desc {
    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 10px;
}
.wi-card-desc p { margin: 0; }
.wi-card-desc p + p { margin-top: 6px; }

/* Goal bar */
.wi-goal {
    margin: 14px 0 16px;
}

.wi-goal-bar {
    background: #1a1a1a;
    border: 1px solid #333;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 6px;
}

.wi-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #4da44b, #6ec96a);
    transition: width 0.4s ease;
}

.wi-goal-text {
    font-size: 0.85rem;
    color: #888;
}

.wi-goal-text strong { color: #4da44b; }

/* Linked games disclosure - lives in its own grid row, spans full card width */
.wi-linked {
    margin-top: 4px;
    border-top: 1px solid #222;
    padding-top: 10px;
    width: 100%;
}

.wi-linked-summary {
    cursor: pointer;
    color: #4da44b;
    font-size: 0.85rem;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wi-linked-summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.wi-linked[open] .wi-linked-summary::before {
    transform: rotate(90deg);
}

.wi-linked-summary::-webkit-details-marker { display: none; }

.wi-linked-count {
    font-weight: 600;
}

/* Progress pill */
.wi-linked-progress {
    display: inline-flex;
    gap: 6px;
}

.wi-prog-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.75rem;
    color: #bbb;
    text-transform: none;
    letter-spacing: 0;
}

.wi-prog-icon {
    color: #4da44b;
    font-weight: 700;
    line-height: 1;
}

/* Entries grid: box-art tiles, normalized 3:4 aspect ratio,
   checkmark badge in top-right corner of each thumb. */
.wi-linked-list {
    list-style: none;
    padding: 12px 0 4px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px 12px;
}

.wi-entry {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    padding: 0;
    border: 0;
}

.wi-entry-thumb-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    border: 1px solid #2a2a2a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.wi-entry-thumb {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
}

.wi-entry-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

a.wi-entry-thumb:hover img {
    transform: scale(1.05);
}

.wi-entry-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
}

.wi-entry-thumb-letter {
    font-family: 'Press Start 2P', 'NexaRustSlab', monospace;
    font-size: 1.8rem;
    color: #4da44b;
    opacity: 0.7;
    text-shadow: 2px 2px 0 #000;
}

/* Checkmark badge - top-right corner of thumb, clearly visible whether on or off */
.wi-entry-check {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

.wi-entry-check.is-on {
    background: #4da44b;
    color: #000;
    border: 2px solid #0d0d0d;
}

.wi-entry-check.is-off {
    background: rgba(13, 13, 13, 0.85);
    color: transparent;
    border: 2px dashed #555;
}

.wi-entry-title {
    display: block;
    color: #ddd;
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.wi-entry-title a {
    color: #ddd;
    text-decoration: none;
}

.wi-entry-title a:hover {
    color: #4da44b;
}

.wi-entry.is-done .wi-entry-title {
    color: #999;
}

.wi-entry.is-done .wi-entry-thumb-wrap {
    border-color: rgba(77, 164, 75, 0.55);
    box-shadow: 0 0 0 1px rgba(77, 164, 75, 0.25), 0 2px 4px rgba(0, 0, 0, 0.4);
}

@media (max-width: 800px) {
    .wi-linked-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px 8px;
    }
    .wi-entry-title { font-size: 0.72rem; }
}

/* Vote column - normalized across all card variants: fixed size,
   vertically centered in row 1 regardless of how much content sits beside it */
.wi-card-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 80px;
    flex-shrink: 0;
    align-self: center;
}

.wi-vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #1a1a1a;
    border: 2px solid #4da44b;
    color: #4da44b;
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    width: 80px;
    box-sizing: border-box;
}

.wi-vote-btn:hover:not(:disabled) {
    background: #4da44b;
    color: #000;
    transform: scale(1.05);
}

.wi-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #666;
    color: #888;
}

.wi-vote-just-voted {
    animation: wi-pulse 0.6s ease;
}

@keyframes wi-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); background: #f4c542; color: #000; border-color: #f4c542; }
    100% { transform: scale(1); }
}

/* .wi-vote-coin: canonical sizing comes from .wakasm-coin--mini in coin.css */

.wi-vote-num {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Press Start 2P', monospace;
}

.wi-vote-label {
    font-size: 0.65rem;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

/* Empty state */
.wi-empty {
    text-align: center;
    color: #888;
    padding: 60px 20px;
    font-style: italic;
}

/* ===========================================================
   Single-game card variant (1x1 box wrapping one linked game)
   Vertical tile: box art on top, title below, compact vote at bottom.
   =========================================================== */
.wi-card--single-game {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 8px 16px;
    gap: 8px;
}

.wi-card--single-game .wi-single-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
    background: #000;
}

.wi-card--single-game .wi-single-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.wi-card--single-game:hover .wi-single-thumb img {
    transform: scale(1.06);
}

.wi-card--single-game .wi-card-main {
    max-width: none;
    min-width: 0;
    text-align: center;
}

.wi-card--single-game .wi-linked {
    display: none;
}

.wi-card--single-game .wi-card-title {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.2;
    font-family: 'NexaRustSlab', 'Roboto Slab', serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wi-card--single-game .wi-card-title a {
    color: #fff;
    text-decoration: none;
}

.wi-card--single-game .wi-card-title a:hover {
    color: #4da44b;
}

/* Single-game vote button uses the SAME size + style as other cards;
   margin-top:auto from the base .wi-card-vote rule pushes it to the bottom. */
.wi-card--single-game .wi-card-vote {
    align-self: center;
    align-items: center;
}

/* ===========================================================
   Multi-game card variant (fanned/stacked box art collage)
   =========================================================== */
/* Multi-game card: stack + main as a side-by-side header row, then
   linked entries full-width, then centered vote button at the bottom. */
.wi-card--multi-game .wi-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.wi-card--multi-game .wi-stack {
    flex-shrink: 0;
}
.wi-card--multi-game .wi-card-main {
    flex: 1;
    min-width: 0;
}

.wi-stack {
    position: relative;
    width: 130px;
    height: 110px;
    flex-shrink: 0;
    align-self: start;
}

.wi-stack-thumb {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    border: 2px solid #1a1a1a;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    background: #000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wi-stack-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fan layout - each thumb offset + rotated slightly */
.wi-stack-thumb--0 { top: 18px; left: 0;   transform: rotate(-8deg); }
.wi-stack-thumb--1 { top: 8px;  left: 18px; transform: rotate(-3deg); }
.wi-stack-thumb--2 { top: 22px; left: 36px; transform: rotate(2deg); }
.wi-stack-thumb--3 { top: 6px;  left: 52px; transform: rotate(6deg); }
.wi-stack-thumb--4 { top: 24px; left: 66px; transform: rotate(10deg); }

.wi-stack-thumb:hover {
    transform: translateY(-4px) rotate(0deg) scale(1.1);
    z-index: 100 !important;
    box-shadow: 0 6px 12px rgba(77, 164, 75, 0.4);
    border-color: #4da44b;
}

.wi-stack-more {
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: #4da44b;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 50;
    border: 2px solid #0d0d0d;
}

@media (max-width: 600px) {
    .wi-card--multi-game {
        grid-template-columns: 110px 1fr auto;
        gap: 12px;
    }
    .wi-stack { width: 100px; height: 90px; }
    .wi-stack-thumb { width: 50px; height: 50px; }
    .wi-stack-thumb--0 { top: 16px; left: 0;   }
    .wi-stack-thumb--1 { top: 6px;  left: 14px; }
    .wi-stack-thumb--2 { top: 20px; left: 28px; }
    .wi-stack-thumb--3 { top: 4px;  left: 42px; }
    .wi-stack-thumb--4 { top: 22px; left: 54px; }
}

/* CTA strip */
.wi-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 40px auto 0;
    max-width: 1100px;
}

.wi-cta-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #4da44b;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.wi-cta-btn:hover {
    background: #6ec96a;
    transform: translateY(-1px);
}

a.wi-cta-btn.wi-cta-patreon,
a.wi-cta-btn.wi-cta-patreon:link,
a.wi-cta-btn.wi-cta-patreon:visited {
    background: #ff424d !important;
    background-color: #ff424d !important;
    color: #fff !important;
}
a.wi-cta-btn.wi-cta-patreon:hover,
a.wi-cta-btn.wi-cta-patreon:focus {
    background: #e6353f !important;
    background-color: #e6353f !important;
    color: #fff !important;
}

.wi-cta-secondary {
    background: transparent;
    color: #ccc;
    border: 1px solid #444;
}
.wi-cta-secondary:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #4da44b;
}
