/* Home page: suguvosamangud.ee
   A printed-programme look: warm paper, dark ink, one red accent (the õ tilde in the wordmark),
   a book serif for headings, numbered index instead of cards. See CLAUDE.md → Design. */

.home {
    --paper: #f3eee4;
    --ink: #1f1b16;
    --muted: #6b6257;
    --rule: #d6ccbb;
    --accent: #b3261e;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-size: 17px;
}

.page > * {
    min-width: 0;
}

.page {
    display: grid;
    grid-template-columns: minmax(16rem, 22rem) 1fr;
    grid-template-areas:
        "masthead masthead"
        "join     index"
        "colophon colophon";
    column-gap: clamp(2rem, 6vw, 6rem);
    width: min(68rem, 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem) 2rem;
}

/* ---------- Masthead ---------- */

.masthead {
    grid-area: masthead;
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 3px double var(--ink);
}

.masthead-title {
    margin: 0;
    line-height: 0;
}

/* Typeset wordmark (Fraunces, outlined to paths). Height drives the size. */
.wordmark {
    display: block;
    width: auto;
    height: clamp(2.6rem, 7vw, 4rem);
    max-width: 100%;
}

.masthead-sub {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ---------- Join box ---------- */

.join {
    grid-area: join;
    align-self: start;
    padding: 1.25rem 1.25rem 1rem;
    border: 1.5px solid var(--ink);
    background: #fbf8f2;
}

.join h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.4rem;
}

.join p {
    margin: 0.3rem 0 1rem;
    color: var(--muted);
}

.join-form {
    display: flex;
}

.join-form input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border: 1.5px solid var(--ink);
    border-right: 0;
    border-radius: 0;
    background: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

.join-form input::placeholder {
    color: #bfb4a3;
}

.join-form input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.join-form button {
    padding: 0 1.2rem;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    cursor: pointer;
}

.join-form button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.join-error {
    margin: 0.6rem 0 0 !important;
    color: var(--accent) !important;
    font-weight: 600;
}

.join-error:empty {
    display: none;
}

/* ---------- Index of games and apps ---------- */

.index {
    grid-area: index;
}

.index section + section {
    margin-top: 2.5rem;
}

.index-title {
    margin: 0;
    padding-bottom: 0.4rem;
    border-bottom: 1.5px solid var(--ink);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.index-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.index-list a {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    grid-template-areas:
        "num name addr"
        "num desc desc";
    column-gap: 1rem;
    row-gap: 0.15rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rule);
    color: inherit;
    text-decoration: none;
}

.index-num {
    grid-area: num;
    padding-top: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.index-name {
    grid-area: name;
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.index-desc {
    grid-area: desc;
    color: var(--muted);
}

.index-addr {
    grid-area: addr;
    align-self: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.index-list a:hover .index-name,
.index-list a:focus-visible .index-name {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.index-list a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* ---------- Footer ---------- */

.colophon {
    grid-area: colophon;
    margin-top: 3.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ---------- 404 ---------- */

.not-found {
    width: min(40rem, 100%);
    margin: 0 auto;
    padding: 18vh 1.5rem 2rem;
}

.not-found-code {
    margin: 0;
    color: var(--accent);
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.not-found h1 {
    margin: 0.25rem 0 0.75rem;
    font-family: var(--serif);
    font-size: clamp(2rem, 6vw, 3rem);
}

.not-found p {
    margin: 0 0 1.5rem;
    color: var(--muted);
}

.not-found a {
    color: var(--ink);
    font-weight: 700;
}

.not-found a:hover {
    color: var(--accent);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 760px) {
    .page {
        grid-template-columns: 1fr;
        grid-template-areas:
            "masthead"
            "join"
            "index"
            "colophon";
    }

    .masthead {
        margin-bottom: 1.5rem;
    }

    .join {
        margin-bottom: 2.5rem;
    }

    .wordmark {
        height: auto;
        width: min(100%, 22rem);
    }

    .masthead-sub {
        font-size: 0.95rem;
    }

    .index-list a {
        grid-template-areas:
            "num name"
            "num desc"
            "num addr";
        grid-template-columns: 2rem 1fr;
    }

    .index-addr {
        align-self: start;
    }
}
