/* ==========================================================================
   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), 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 */
    --chalk:        #a9c6f2;  /* primary writing / body text */
    --chalk-bright: #dcebff;  /* headings / emphasis (brightest, still blue) */
    --chalk-dim:    #6f8cbb;  /* faded chalk */
    --chalk-dark:   #46658f;  /* chalk lines / borders */
    --chalk-darker: #294066;  /* very dark blue chalk */
    --chalk-fill:   #182b49;  /* button / hover fill */

    --dust: 0 0 7px rgba(150, 185, 240, 0.22);

    --font-hand:   "Kalam", "Comic Sans MS", cursive, sans-serif;
    --font-scrawl: "Rock Salt", "Kalam", cursive;

    --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-hand);
    font-size: 1.02rem;
    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.05;
    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);
}

a { color: var(--chalk); text-decoration: none; }
a:hover { color: var(--chalk-bright); }

/* ======================= 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 */
.als-rail-toggle, .als-rail-expand {
    background: transparent; border: 1px solid var(--chalk-dark);
    color: var(--chalk); border-radius: 6px; line-height: 1;
    padding: 0.15rem 0.5rem; font-size: 1.1rem; cursor: pointer;
}
.als-rail-toggle:hover, .als-rail-expand:hover { color: var(--chalk-bright); border-color: var(--chalk); }
.als-rail-head { display: flex; justify-content: flex-end; margin-bottom: 0.4rem; }
.als-rail-expand { display: none; position: fixed; top: 0.7rem; left: 0.7rem; z-index: 3000; background: var(--board-2); }

@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)); }
    body.als-collapsed .als-rail-expand { display: inline-flex; }
}

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

.als-brand {
    display: 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; }
.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 dashed 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;
    color: var(--chalk); padding: 0.28rem 0.1rem;
}
.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; 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; }
.als-nav-mini { font-family: var(--font-hand); color: var(--chalk-dim); font-size: 1.02rem; }
.als-nav-mini:hover { color: var(--chalk-bright); }

/* ======================= the board (content) ======================= */
.als-board {
    flex: 1 0 auto;
    border: 2px dashed var(--chalk-dark);
    border-radius: 10px;
    padding: 1.6rem 1.7rem;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* cards: chalk-outlined boxes drawn on the board */
.als-card {
    background: var(--board-2);
    border: 2px dashed 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 dashed 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 dashed var(--chalk-dark);
    color: var(--chalk-darker); 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-scrawl); font-size: 1.15rem; color: var(--chalk-bright);
    background: linear-gradient(0deg, rgba(5, 7, 11, 0.92), transparent);
    text-shadow: var(--dust);
}

/* ======================= buttons ======================= */
.btn-arcane {
    background: transparent; border: 2px solid var(--chalk);
    color: var(--chalk-bright); font-family: var(--font-hand); font-weight: 700;
    text-shadow: var(--dust);
}
.btn-arcane:hover { background: var(--chalk-fill); border-color: var(--chalk-bright); color: #fff; }

.btn-steel {
    background: transparent; border: 2px solid var(--chalk-dark);
    color: var(--chalk-dim); font-family: var(--font-hand);
}
.btn-steel:hover { background: var(--chalk-darker); border-color: var(--chalk); color: var(--chalk); }

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

/* 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 dashed var(--chalk-dark);
    border-radius: 8px;
    color: var(--chalk-dim);
    font-size: 0.98rem;
}
.als-verify-banner a { color: var(--chalk); text-decoration: underline dashed; }

/* 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.85rem; white-space: nowrap; font-family: var(--font-hand);
}
.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 { border-style: dashed; }

/* footer */
.als-footer {
    margin-top: 1.2rem; padding: 1rem 0.3rem;
    border-top: 1px dashed 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-hand);
}
.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);
}

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-hand);
    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-hand); 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.75rem; color: var(--chalk-dim);
    border: 1px dashed 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-darker); font-size: 0.85rem; margin-left: 0.5rem; }
.als-comment-lister {
    font-family: var(--font-scrawl); font-size: 0.75rem; 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-darker); 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); }
