/* static/css/wall/wall.css
   The Wall — a dark gallery where every message hangs as a lit plaque:
   pixel stamp first, words in a warm serif beside it. Read-only board
   (the writing form and stamp editor arrive in later steps). */

:root {
    --wb-bg:      #0a0a0c;
    --wb-card-a:  #17171b;
    --wb-card-b:  #0f0f12;
    --wb-line:    rgba(255, 255, 255, 0.09);
    --wb-ink:     #f5f5f7;   /* message text — bright, always */
    --wb-ink-2:   #c4c4cd;   /* meta — still clearly readable */
    --wb-amber:   #f0a830;

    /* magnet palette — stamp cell colors, index 1..f (0 = empty) */
    --wb-p1: #f5f5f7;  --wb-p2: #ffd23f;  --wb-p3: #f0a830;
    --wb-p4: #ff6b35;  --wb-p5: #e63946;  --wb-p6: #ff7ab6;
    --wb-p7: #b86bff;  --wb-p8: #5e60ce;  --wb-p9: #4cc9f0;
    --wb-pa: #00b4d8;  --wb-pb: #2ec4b6;  --wb-pc: #57cc99;
    --wb-pd: #a7c957;  --wb-pe: #8d6e63;  --wb-pf: #495057;
}

/* ---- stage ---- */
.wb-stage {
    min-height: calc(100vh - 160px);
    padding: 44px 24px 72px;
    background:
        radial-gradient(110% 70% at 50% 0%, #141318 0%, var(--wb-bg) 58%);
}

.wb-wrap {
    max-width: 640px;
    margin: 0 auto;
}

/* ---- top line: the palette strip (no title, no words) ---- */
.wb-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    animation: wb-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---- composer: one field, one button ---- */
.wb-compose {
    margin-bottom: 22px;
    padding: 16px 18px;
    border: 1px solid var(--wb-line);
    border-radius: 16px;
    background: linear-gradient(160deg, var(--wb-card-a), var(--wb-card-b));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
    animation: wb-rise 0.55s 0.05s both;
}

/* ---- stamp editor: canvas left, textarea right ----
   The canvas renders at exactly 155px tall (8 cells x 17px + 7 gaps +
   padding + border). The right column is pinned to the same 155px, so
   textarea + button row always close flush with the canvas bottom. */
.wb-editor {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.wb-canvas {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 17px);
    grid-auto-rows: 17px;
    gap: 1px;
    padding: 5px;
    border: 1px solid var(--wb-line);
    border-radius: 10px;
    background: #2a2a33;   /* lighter plate — the "paint here" surface */
}

.wb-cell {
    padding: 0;
    border: none;
    border-radius: 2px;
    cursor: pointer;
}

.wb-cell.wb-c0 {
    background: #1b1b21;   /* empty cells darker than the plate — grid reads instantly */
}

.wb-swatch {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.18s ease;
}

.wb-swatch.is-active {
    box-shadow: 0 0 0 2px var(--wb-bg), 0 0 0 4px var(--wb-amber);
    transform: scale(1.06);
}

.wb-clear {
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: #8e8e99;
    font-family: 'Chivo Mono', ui-monospace, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.wb-clear:hover {
    color: var(--wb-ink);
    border-color: var(--wb-line);
}

.wb-write {
    flex: 1 1 auto;
    min-width: 0;
    height: 155px;          /* = canvas height */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wb-input {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--wb-line);
    border-radius: 10px;
    padding: 10px 12px;
    resize: none;
    background: rgba(255, 255, 255, 0.04);   /* the "write here" surface */
    font-family: Georgia, serif;
    font-size: 0.90rem;
    line-height: 1.5;
    color: var(--wb-ink);
}

.wb-input::placeholder {
    color: #8e8e99;
}

.wb-input:focus {
    outline: none;
}

.wb-compose:focus-within {
    border-color: rgba(240, 168, 48, 0.45);
}

.wb-compose-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wb-error {
    flex: 1 1 auto;
    text-align: right;
    font-family: 'Chivo Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #ff8f6b;   /* warm warning — bright on dark */
}

.wb-send {
    padding: 5px 22px;
    border: 1px solid rgba(240, 168, 48, 0.5);
    border-radius: 10px;
    background: linear-gradient(165deg, #2a2118, #1a1510);
    color: var(--wb-amber);
    font-family: 'Chivo Mono', ui-monospace, monospace;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

.wb-send:hover {
    color: #ffc663;
    border-color: var(--wb-amber);
}

.wb-send:active {
    transform: scale(0.96);
}

.wb-login-hint {
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 1px dashed var(--wb-line);
    border-radius: 16px;
    font-family: 'Chivo Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    color: var(--wb-ink-2);
    animation: wb-rise 0.55s 0.05s both;
}

.wb-login-hint a {
    color: var(--wb-amber);
    text-decoration: none;
}

.wb-login-hint a:hover {
    color: #ffc663;
}

/* ---- the stack of plaques ---- */
.wb-board {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wb-post {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    background: linear-gradient(160deg, #1f1f26, #16161c);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 22px 50px -28px rgba(0, 0, 0, 0.8);
    animation: wb-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

/* ---- the stamp: 8x8 pixel art ---- */
.wb-stamp {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 11px);
    grid-auto-rows: 11px;
    gap: 1px;
    padding: 5px;
    border: 1px solid var(--wb-line);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
}

.wb-stamp i {
    border-radius: 1.5px;
}

.wb-stamp--empty {
    background:
        repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.04) 0 3px, transparent 3px 7px);
    width: 103px;
    height: 103px;
}

.wb-c0 { background: transparent; }
.wb-c1 { background: var(--wb-p1); }
.wb-c2 { background: var(--wb-p2); }
.wb-c3 { background: var(--wb-p3); }
.wb-c4 { background: var(--wb-p4); }
.wb-c5 { background: var(--wb-p5); }
.wb-c6 { background: var(--wb-p6); }
.wb-c7 { background: var(--wb-p7); }
.wb-c8 { background: var(--wb-p8); }
.wb-c9 { background: var(--wb-p9); }
.wb-ca { background: var(--wb-pa); }
.wb-cb { background: var(--wb-pb); }
.wb-cc { background: var(--wb-pc); }
.wb-cd { background: var(--wb-pd); }
.wb-ce { background: var(--wb-pe); }
.wb-cf { background: var(--wb-pf); }

/* ---- words ---- */
.wb-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    min-height: 107px;      /* = Mosaic height — info bar sits at its bottom edge */
}

.wb-text {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.22rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--wb-ink);
    overflow-wrap: break-word;
}

.wb-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Chivo Mono', ui-monospace, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--wb-ink-2);
}

.wb-meta--top {
    width: 100%;    /* own full row above Mosaic + message */
}

.wb-author::after {
    content: "\00B7";
    margin-left: 10px;
    color: var(--wb-amber);
}

/* ---- empty board ---- */
.wb-empty {
    padding: 56px 20px;
    text-align: center;
    border: 1px dashed var(--wb-line);
    border-radius: 16px;
    animation: wb-rise 0.55s both;
}

.wb-empty-mark {
    display: block;
    margin-bottom: 14px;
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    color: var(--wb-amber);
}

.wb-empty p {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.1rem;
    color: var(--wb-ink-2);
}

/* ---- motion ---- */
@keyframes wb-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wb-head, .wb-post, .wb-empty { animation: none; }
}

/* ---- narrow screens (560px down): posts stack, editor stays side by side,
   side padding minimal (2px) ---- */
@media (max-width: 560px) {
    .wb-post {
        flex-direction: column;
        gap: 14px;
    }
    .wb-body {
        min-height: 0;
    }
    .wb-stage {
        padding: 20px 2px 48px;
    }
    .wb-post,
    .wb-compose,
    .wb-login-hint {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px 2px;
    }
    .wb-head {
        padding: 0 2px;
    }
}

/* ---- 480px down: Mosaic + buttons on top row, textarea below ---- */
@media (max-width: 480px) {
    .wb-editor {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: stretch;
    }
    .wb-write {
        display: contents;   /* textarea and button row place on the grid directly */
    }
    .wb-canvas {
        grid-column: 1;
        grid-row: 1;
    }
    .wb-compose-foot {
        grid-column: 2;
        grid-row: 1;
        flex-direction: column;
        align-items: stretch;
        justify-content: space-between;
    }
    .wb-input {
        grid-column: 1 / -1;
        grid-row: 2;
        min-height: 112px;
    }
}
