/* ==========================================================================
   Azeroth Listing Service — "blue chalk on a black chalkboard"
   Matte black board, everything drawn in blue / very-dark-blue chalk.
   Hand-chalk fonts (self-hosted) for headings/nav/buttons; body copy is a
   clean sans for legibility. Chalk-dust grain, sketchy hand-drawn borders,
   a left chalkboard sidebar with a chalk tray. No white, no gold.
   ========================================================================== */

/* ---- self-hosted chalk fonts (never a font CDN) ---- */
@font-face {
    font-family: "Kalam";
    src: url("/lib/fonts/kalam-400.woff2") format("woff2");
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: "Kalam";
    src: url("/lib/fonts/kalam-700.woff2") format("woff2");
    font-weight: 700; font-display: swap;
}
@font-face {
    font-family: "Rock Salt";
    src: url("/lib/fonts/rock-salt-400.woff2") format("woff2");
    font-weight: 400; font-display: swap;
}

:root {
    /* the board */
    --board:      #0a0c11;
    --board-2:    #0d1118;   /* drawn boxes */
    --board-deep: #07080b;

    /* the chalk — blue only.
       Text ladder (contrast vs the board): bright ≈16:1, chalk ≈13:1,
       dim ≈11:1, faint ≈8.7:1 — nothing written on the board dips below
       ~8.5:1; de-emphasis leans on size/weight, not fading. dark/darker
       are for lines and borders, never for text. */
    --chalk:        #bcd3f7;  /* primary writing / body text */
    --chalk-bright: #dcebff;  /* headings / emphasis (brightest, still blue) */
    --chalk-dim:    #a9c6f2;  /* secondary text — barely stepped down */
    --chalk-faint:  #93aedb;  /* most de-emphasized text (timestamps etc.) */
    --chalk-dark:   #46658f;  /* chalk lines / borders */
    --chalk-darker: #294066;  /* very dark blue chalk (borders/underlines only) */
    --chalk-fill:   #182b49;  /* button / hover fill */

    --dust: 0 0 4px rgba(150, 185, 240, 0.12);

    --font-hand:   "Kalam", "Comic Sans MS", cursive, sans-serif;
    --font-scrawl: "Rock Salt", "Kalam", cursive;
    /* body copy is a clean sans for legibility; the chalk hands are for
       headings, the wordmark, nav, and buttons */
    --font-body:   system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --sidebar-w: 264px;

    /* Bootstrap var mapping */
    --bs-body-bg: var(--board);
    --bs-body-color: var(--chalk);
    --bs-emphasis-color: var(--chalk-bright);
    --bs-border-color: var(--chalk-dark);
    --bs-primary: var(--chalk-dark);
    --bs-primary-rgb: 70, 101, 143;
    --bs-link-color: var(--chalk);
    --bs-link-hover-color: var(--chalk-bright);
}

body {
    background-color: var(--board);
    color: var(--chalk);
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    overflow-x: hidden;  /* the collapsed rail slides off-screen to the left */
    background-image:
        radial-gradient(680px 340px at 16% 10%, rgba(70, 101, 143, 0.10), transparent 55%),
        radial-gradient(760px 380px at 88% 78%, rgba(70, 101, 143, 0.08), transparent 55%),
        linear-gradient(180deg, var(--board), var(--board-deep));
    background-attachment: fixed;
    min-height: 100vh;
}

/* chalk-dust grain over the whole board (grayscale noise, faint) */
body::after {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 2000;
    opacity: 0.025;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 120px 120px;
}

.als-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* chalk stroke edges roughened via SVG displacement */
.chalk-rough { filter: url(#chalkEdge); text-shadow: var(--dust); }

h1, h2, h3, h4, h5 {
    font-family: var(--font-hand);
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--chalk-bright);
    text-shadow: var(--dust);
}

/* Inline text links are underlined so they read as links; anchors that are
   really buttons, nav items, cards, or the wordmark opt out just below. */
a {
    color: var(--chalk);
    text-decoration: underline; text-decoration-color: var(--chalk-dark);
    text-underline-offset: 0.15em; text-decoration-thickness: 1px;
}
a:hover { color: var(--chalk-bright); text-decoration-color: var(--chalk-bright); }

.btn, .als-nav a, .als-nav-mini, .als-card-link, a.als-card,
.als-topbar-brand, .als-brand {
    text-decoration: none;
}

/* ======================= layout shell ======================= */
.als-shell { display: flex; align-items: stretch; min-height: 100vh; }
.als-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: 1.1rem 1.1rem 0; }

/* mobile top strip */
.als-topbar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--chalk-dark);
    background: var(--board);
}
.als-topbar-brand { font-family: var(--font-scrawl); font-size: 1.15rem; color: var(--chalk-bright); }
.als-scrawl-btn {
    background: transparent; border: 1px solid var(--chalk-dark);
    color: var(--chalk); border-radius: 6px; padding: 0.15rem 0.6rem; font-size: 1.1rem;
}

/* ======================= sidebar rail ======================= */
.als-sidebar {
    background: linear-gradient(180deg, var(--board-2), var(--board));
    /* hide the scrollbar that used to separate the rail from the board */
    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* old Edge */
}
.als-sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* don't animate the rail on first paint when restoring a collapsed state */
body:not(.als-ready) .als-sidebar { transition: none !important; }

/* rail collapse/expand controls — big vertically-centered tabs that ride the
   rail's edge so they're easy to spot. Hidden on mobile (uses the hamburger). */
.als-rail-toggle, .als-rail-expand {
    display: none; position: fixed; top: 50%; transform: translateY(-50%);
    z-index: 3000; align-items: center; justify-content: center;
    background: var(--board-2); border: 2px solid var(--chalk-dark); border-left: none;
    color: var(--chalk); line-height: 1; cursor: pointer;
    font-size: 1.9rem; padding: 1rem 0.4rem;
    border-radius: 0 10px 10px 0; box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
    /* Hidden by default. The outgoing handle uses THIS (no-delay) transition,
       so it vanishes right away when clicked; the incoming handle's own rule
       (below) carries the delay that waits for the rail to finish sliding. */
    opacity: 0; visibility: hidden;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
                opacity 0.12s ease, visibility 0s linear 0.12s;
}
.als-rail-toggle:hover, .als-rail-expand:hover {
    color: var(--chalk-bright); border-color: var(--chalk);
    box-shadow: 2px 0 16px rgba(150, 185, 240, 0.4);
}

@media (min-width: 992px) {
    .als-sidebar {
        position: sticky; top: 0;
        flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
        height: 100vh; overflow-y: auto;
        /* framed on BOTH sides, with breathing room off the browser's left
           edge so the rail never sits flush against browser chrome/sidebars
           (the collapsed rule below overrides this margin to slide it away) */
        margin-left: 1.25rem;
        border-left: 2px solid var(--chalk-dark);
        border-right: 2px solid var(--chalk-dark);
        transition: margin-left 0.25s ease;
    }
    .als-topbar { display: none; }

    /* collapsed: slide the rail off-screen; the board reclaims the space.
       state lives on <body> so the pop-out button (a sibling of the shell)
       also reacts. */
    body.als-collapsed .als-sidebar { margin-left: calc(-1 * var(--sidebar-w)); }

    /* both handles live on desktop; opacity/visibility decides which shows.
       hide tab rides the rail's right border; show tab sits on the left edge. */
    .als-rail-toggle, .als-rail-expand { display: inline-flex; }
    .als-rail-toggle { left: calc(1.25rem + var(--sidebar-w)); }
    .als-rail-expand { left: 0; }

    /* The handle for the current state fades in only AFTER the rail's ~0.25s
       slide completes, so the sequence is: old handle vanishes → rail finishes
       moving → new handle appears. */
    body:not(.als-collapsed) .als-rail-toggle,
    body.als-collapsed .als-rail-expand {
        opacity: 1; visibility: visible;
        transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
                    opacity 0.16s ease 0.28s, visibility 0s linear 0.28s;
    }

    /* once fully collapsed AND the user has gone idle (als-idle is toggled in
       _Layout.cshtml), the show tab gently beckons (nudge + glow) so someone
       who missed the rail closing still notices how to reopen it. Any mouse
       movement / interaction drops als-idle and the nudging stops. */
    body.als-idle.als-collapsed .als-rail-expand { animation: als-rail-beckon 2.6s ease-in-out infinite; }

    /* don't fade/delay the handle on first paint when restoring rail state */
    body:not(.als-ready) .als-rail-toggle,
    body:not(.als-ready) .als-rail-expand { transition: none !important; }
}

@keyframes als-rail-beckon {
    0%, 50%, 100% {
        transform: translate(0, -50%);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4); border-color: var(--chalk-dark);
    }
    65% {
        transform: translate(6px, -50%);
        box-shadow: 2px 0 20px rgba(150, 185, 240, 0.65); border-color: var(--chalk-bright);
    }
    80% {
        transform: translate(0, -50%);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4); border-color: var(--chalk-dark);
    }
}

/* motion-averse users: no nudge, but keep a steady glow so it still stands out */
@media (prefers-reduced-motion: reduce) {
    body.als-collapsed .als-rail-expand {
        animation: none;
        box-shadow: 2px 0 16px rgba(150, 185, 240, 0.45); border-color: var(--chalk);
    }
}

.als-sidebar-body { display: flex; flex-direction: column; min-height: 100%; padding: 1.4rem 1.15rem; }

.als-brand {
    position: relative;
    display: inline-block;
    font-family: var(--font-scrawl);
    font-size: 1.9rem; line-height: 1.15;
    color: var(--chalk-bright);
    margin-bottom: 0.15rem;
    /* a little air between the wordmark and the rail's left border */
    padding-left: 0.8rem;
}
.als-brand:hover { color: #fff; }
/* Each line of the wordmark gets its own draw-in underline (same effect the
   main nav uses). The second line is delayed so the bar sweeps under
   "Azeroth" first, then "Listings". */
.als-brand-line {
    position: relative; display: block; width: fit-content;
}
.als-brand-line::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -0.02rem;
    height: 2px; background: var(--chalk-bright); border-radius: 2px; opacity: 0.85;
    transition: right 0.22s ease;
}
.als-brand:hover .als-brand-line::after { right: 0; }
.als-brand:hover .als-brand-line:nth-child(2)::after { transition-delay: 0.22s; }
.als-brand-sub {
    font-family: var(--font-hand);
    color: var(--chalk-dim); font-size: 0.95rem; letter-spacing: 0.04em;
    padding-left: 0.8rem; /* stays aligned with the wordmark above */
    margin-bottom: 1.4rem;
    /* hand-drawn underline beneath the wordmark */
    border-bottom: 2px solid var(--chalk-darker);
    padding-bottom: 0.9rem;
}

/* main nav — chalk list with an underline that draws in on hover */
.als-nav { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.als-nav li { margin: 0.15rem 0; }
.als-nav a {
    position: relative; display: inline-block;
    font-family: var(--font-hand); font-size: 1.28rem; font-weight: 700;
    color: var(--chalk); padding: 0.28rem 0.5rem;
}
.als-nav a::before { content: "✶"; color: var(--chalk-dark); margin-right: 0.5rem; font-size: 0.9em; }
.als-nav a::after {
    content: ""; position: absolute; left: 0.5rem; right: 100%; bottom: 0.05rem;
    height: 2px; background: var(--chalk); border-radius: 2px; opacity: 0.85;
    transition: right 0.22s ease;
}
.als-nav a:hover { color: var(--chalk-bright); text-shadow: var(--dust); }
.als-nav a:hover::after { right: 0.6rem; }

.als-nav-auth { display: flex; flex-direction: column; gap: 0.4rem; padding: 0 8px; }
.als-nav-mini { font-family: var(--font-body); color: var(--chalk-dim); font-size: 0.98rem; padding: 0 0.5rem; }
.als-nav-mini:hover { color: var(--chalk-bright); }

/* ======================= the board (content) ======================= */
.als-board {
    flex: 1 0 auto;
    padding: 1.6rem 1.7rem;
}

/* cards: chalk-outlined boxes drawn on the board */
.als-card {
    background: var(--board-2);
    border: 2px solid var(--chalk-dark);
    border-radius: 8px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}
.als-card .card-title, .als-card h2, .als-card h3 { color: var(--chalk-bright); }

/* Discover cards are whole-card links; keep the chalk look, brighten on hover */
a.als-card-link { color: var(--chalk); }
a.als-card-link:hover { border-color: var(--chalk); color: var(--chalk); }
.als-card-img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
    border-bottom: 2px solid var(--chalk-dark);
    border-radius: 8px 8px 0 0;
}
.als-card-img-empty {
    aspect-ratio: 16 / 9;
    display: flex; align-items: center; justify-content: center;
    border-bottom: 2px solid var(--chalk-dark);
    color: var(--chalk-faint); font-family: var(--font-scrawl);
}

.als-hero-img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
    border-radius: 8px; border: 2px solid var(--chalk-dark);
}
.als-space { position: relative; }
.als-space-img { width: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--chalk-darker); }
.als-space-title {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 0.75rem 1rem;
    font-family: var(--font-hand); font-weight: 700; font-size: 1.15rem; color: var(--chalk-bright);
    background: linear-gradient(0deg, rgba(5, 7, 11, 0.92), transparent);
    text-shadow: var(--dust);
}

/* ======================= buttons =======================
   Two tiers, both clearly visible: arcane (primary — brightest border,
   glowing) and steel (secondary — one step down, never faded). A faint
   chalk-fill behind each lifts them off the board. */
.btn-arcane {
    background: rgba(24, 43, 73, 0.5); border: 2px solid var(--chalk);
    color: var(--chalk-bright); font-family: var(--font-hand); font-weight: 700;
    text-shadow: var(--dust);
    box-shadow: 0 0 10px rgba(150, 185, 240, 0.14);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.1s ease;
}
.btn-arcane:hover, .btn-arcane:focus-visible {
    background: #2a4a80; border-color: #fff; color: #fff;
    box-shadow: 0 0 20px rgba(150, 185, 240, 0.6), inset 0 0 12px rgba(150, 185, 240, 0.25);
    transform: translateY(-1px);
}
.btn-arcane:active { transform: translateY(0); }

.btn-steel {
    background: rgba(24, 43, 73, 0.35); border: 2px solid var(--chalk-dim);
    color: var(--chalk); font-family: var(--font-hand); font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.1s ease;
}
.btn-steel:hover, .btn-steel:focus-visible {
    background: var(--chalk-fill); border-color: var(--chalk-bright); color: #fff;
    box-shadow: 0 0 16px rgba(150, 185, 240, 0.4), inset 0 0 10px rgba(150, 185, 240, 0.18);
    transform: translateY(-1px);
}
.btn-steel:active { transform: translateY(0); }

/* stars */
.als-star { color: var(--chalk-bright); }
.als-star-empty { color: var(--chalk-dark); }

/* a clickable ballot star (button reset + chalk glow on hover) */
.als-star-btn {
    background: none; border: none; padding: 0 0.15rem;
    font-size: 1.45rem; line-height: 1; cursor: pointer;
}
.als-star-btn:hover { color: var(--chalk-bright); text-shadow: 0 0 6px rgba(150, 185, 240, 0.6); }
span.als-star-btn { cursor: default; }
span.als-star-btn:hover { color: inherit; text-shadow: none; }

/* notification bell badge */
.als-bell { position: relative; }
.als-bell .badge {
    position: absolute; top: -4px; right: -6px;
    background: var(--chalk-fill); border: 1px solid var(--chalk-dark); color: var(--chalk-bright);
}

/* an unread notification card — a brighter chalk outline until the visit ends */
.als-notification-new {
    border-color: var(--chalk);
    box-shadow: 0 0 8px rgba(150, 185, 240, 0.25);
}

/* the "verify your email" strip above the board (unverified accounts) */
.als-verify-banner {
    margin-bottom: 0.8rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--chalk-dark);
    border-radius: 8px;
    color: var(--chalk-dim);
    font-size: 0.98rem;
}
.als-verify-banner a { color: var(--chalk); text-decoration: underline; }

/* event status chips (Events index + detail + Manage) */
.als-status-chip {
    display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px;
    border: 1px solid var(--chalk-dark); color: var(--chalk-dim);
    font-size: 0.9rem; white-space: nowrap; font-family: var(--font-body);
}
.als-status-voting_open { border-color: var(--chalk-bright); color: var(--chalk-bright); }
.als-status-inviting { border-color: var(--chalk); color: var(--chalk); }
.als-status-closed { opacity: 0.8; }

/* footer */
.als-footer {
    margin-top: 1.2rem; padding: 1rem 0.3rem;
    border-top: 1px solid var(--chalk-dark);
    color: var(--chalk-dim); font-size: 0.95rem;
}

/* forms — chalk-outline inputs on the board */
.form-control, .form-select {
    background-color: var(--board-2); border: 1px solid var(--chalk-dark); color: var(--chalk);
    font-family: var(--font-body);
}
.form-control::placeholder { color: var(--chalk-dim); }
.form-control:focus, .form-select:focus {
    background-color: var(--board-2); border-color: var(--chalk-bright); color: var(--chalk-bright);
    box-shadow: 0 0 0 0.2rem rgba(150, 185, 240, 0.18);
}

/* the "Choose File" button on file inputs — a solid chalk chip so the label
   reads dark-on-light, with a bright glowing lift on hover */
.form-control[type="file"]::file-selector-button {
    background: var(--chalk); border: none; border-right: 1px solid var(--chalk-dark);
    color: var(--board-deep); font-family: var(--font-hand); font-weight: 700;
    margin: -0.375rem 0.75rem -0.375rem -0.75rem; padding: 0.375rem 0.9rem;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]::file-selector-button:hover {
    background: var(--chalk-bright); color: #000; cursor: pointer;
    box-shadow: 0 0 14px rgba(150, 185, 240, 0.55), inset 0 0 8px rgba(255, 255, 255, 0.35);
}

code { color: var(--chalk); }

/* offcanvas (mobile drawer) chalkboard skin */
.offcanvas { background: var(--board-2); color: var(--chalk); }

/* ======================= confirm dialog ======================= */
/* <dialog> renders in the top layer, so it floats above everything —
   including the fixed chalk-dust grain overlay. */
dialog.als-confirm {
    background: var(--board-2); color: var(--chalk);
    border: 2px solid var(--chalk-dark); border-radius: 10px;
    padding: 1.5rem 1.75rem; max-width: min(26rem, 90vw);
    font-family: var(--font-body);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), var(--dust);
}
dialog.als-confirm::backdrop {
    background: rgba(5, 7, 11, 0.65);
    backdrop-filter: blur(2px);
}
.als-confirm-msg { color: var(--chalk-bright); font-size: 1.05rem; margin-bottom: 1.2rem; }
.als-confirm-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

/* ======================= social: favorites ======================= */
.als-fav-btn {
    background: transparent; border: 2px solid var(--chalk-dark); border-radius: 999px;
    color: var(--chalk-dim); font-family: var(--font-body); font-size: 0.95rem;
    padding: 0.15rem 0.8rem; line-height: 1.5;
}
.als-fav-btn:hover { border-color: var(--chalk); color: var(--chalk-bright); text-shadow: var(--dust); }
.als-fav-btn.is-fav {
    border-color: var(--chalk); color: var(--chalk-bright);
    background: var(--chalk-fill); text-shadow: var(--dust);
}

/* star pinned over a space image (bottom bar holds the title) */
.als-space-fav { position: absolute; top: 0.6rem; right: 0.6rem; }
.als-space-fav .als-fav-btn { background: rgba(5, 7, 11, 0.75); }
.als-space-fav .als-fav-btn.is-fav { background: var(--chalk-fill); }

/* inspiration-board cards: the ✕ eraser sits over the card corner */
.als-board-card { position: relative; }
.als-unfav-btn {
    position: absolute; top: 0.45rem; right: 0.45rem; z-index: 2;
    width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: rgba(5, 7, 11, 0.8); border: 1px solid var(--chalk-dark);
    color: var(--chalk-dim); font-size: 1.1rem; line-height: 1;
}
.als-unfav-btn:hover { border-color: var(--chalk); color: var(--chalk-bright); }

/* "hidden" marker on the owner's own cards */
.als-hidden-badge {
    font-size: 0.85rem; color: var(--chalk-dim);
    border: 1px solid var(--chalk-dark); border-radius: 4px;
    padding: 0.05rem 0.4rem; margin-left: 0.4rem; vertical-align: middle;
}

/* ======================= social: comments ======================= */
.als-comment {
    border-left: 2px solid var(--chalk-darker);
    padding: 0.4rem 0 0.4rem 0.9rem;
    margin-bottom: 0.9rem;
}
.als-comment-meta { color: var(--chalk-bright); margin-bottom: 0.15rem; }
.als-comment-time { color: var(--chalk-faint); font-size: 0.9rem; margin-left: 0.5rem; }
.als-comment-lister {
    font-family: var(--font-hand); font-weight: 700; font-size: 0.8rem; color: var(--chalk-bright);
    border: 1px solid var(--chalk-dark); border-radius: 4px;
    padding: 0.05rem 0.4rem; margin-left: 0.4rem; vertical-align: middle;
}
.als-comment-removed { color: var(--chalk-faint); font-style: italic; }
.als-comment-children { margin-top: 0.8rem; margin-left: 0.4rem; }
.als-comment-reply summary {
    color: var(--chalk-dim); font-size: 0.9rem; cursor: pointer;
    list-style: none; display: inline-block;
}
.als-comment-reply summary::before { content: "↩ "; }
.als-comment-reply summary:hover { color: var(--chalk-bright); }
.als-comment-reply[open] summary { color: var(--chalk-bright); }
