:root {
    --bg: #ebe7df;
--surface: #f7f4ef;
--surface-2: #efebe4;

--text: #2f2d2b;
--muted: #6c6963;

--border: #d4cec4;

--accent: #4f6780;
}

* {
    box-sizing: border-box;
}

html {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 2rem;

    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif;
    font-size: 18px;
    line-height: 1.7;

}

/* ---------- Links ---------- */

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .15s;
}

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

/* ---------- Top bar ---------- */

.topbar {
    max-width: 60vw;
    margin: 0 auto 2.5rem;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text);
}

.topbar nav {
    display: flex;
    gap: 1rem;
}

.topbar nav a {
    padding: .45rem .9rem;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface);
}

/* ---------- Thread list ---------- */

.thread-list {
    max-width: 60vw;
    margin: 0 auto;
}

.thread-card {
    display: block;

    margin-bottom: 1.25rem;
    padding: 1.5rem;

    color: inherit;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 8px;

    transition: background .15s;
}

.thread-card:hover {
    background: var(--surface-2);
}

.thread-card h2 {
    margin: 0 0 .75rem;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text);
}

.thread-card p {
    margin: 0;

    color: var(--muted);

    font-family:
        Charter,
        "Iowan Old Style",
        "Palatino Linotype",
        Georgia,
        serif;

    line-height: 1.75;
}

/* ---------- Thread posts ---------- */

.post {
    display: grid;
    grid-template-columns: 200px 1fr;

    max-width: 60vw;
    margin: 1rem auto;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 8px;

    overflow: hidden;
}

.author {
    padding: 1.5rem;

    background: var(--surface-2);

    border-right: 1px solid var(--border);
}

.author h3 {
    margin: 0;

    font-size: 1rem;
    font-weight: 600;

    color: var(--text);
}

.content {
    min-width: 0;

    padding: 1.2rem;
font-family: "Source Serif 4", Georgia, serif;

    font-size: 1.1rem;
    line-height: 1.85;
    max-width: 60vw;

}


.content header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;

    margin-bottom: .6rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
}

.header-actions {
    display: flex;
    gap: .5rem;
}


.mini-btn {
    display: inline-block;

    padding: .2rem .6rem;

    font-size: .82rem;
    font-family: system-ui, sans-serif;
    text-decoration: none;

    color: var(--muted);

    border: 1px solid var(--border);
    border-radius: 4px;

    background: var(--surface-2);

    transition: .15s;
}

.mini-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.mini-btn.danger:hover {
    color: #d65a5a;
    border-color: #d65a5a;
}
time {
    color: var(--muted);
    font-size: .9rem;
}

.content p {
    margin: 0;

    white-space: pre-wrap;
    word-break: break-word;

    font-size: 1.08rem;
    line-height: 1.8;
}

.content p + p {
    margin-top: 1.25rem;
}

/* ---------- Reply form ---------- */

.reply {
    max-width: 60vw;
    margin: 2rem auto;
    margin-top: 0;
}

.reply form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reply textarea {
    width: 100%;
    min-height: 180px;

    padding: 1rem;

    resize: none;

    background: var(--bg);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 8px;

    font: inherit;
}

.reply textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.reply button {
    align-self: flex-end;

    padding: .8rem 1.6rem;

    background: var(--surface-2);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;

    cursor: pointer;

    transition: .15s;
}

.reply button:hover {
    background: #4a4641;
    border-color: #7d766e;
}

/* ---------- Authentication ---------- */

.auth-card {
    max-width: 420px;

    margin: 5rem auto;

    padding: 2rem;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 8px;
}

.auth-card h1 {
    margin: 0 0 2rem;

    text-align: center;

    font-size: 1.8rem;
    font-weight: 600;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-card label {
    font-weight: 600;
}

.auth-card input {
    padding: .85rem 1rem;

    background: var(--bg);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-card button {
    margin-top: .5rem;

    padding: .85rem;

    background: var(--surface-2);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;

    cursor: pointer;

    transition: .15s;
}

.auth-card button:hover {
    background: #4a4641;
    border-color: #7d766e;
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {

    body {
        padding: 1rem;
    }

    .topbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .post {
        grid-template-columns: 1fr;
    }

    .author {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .reply button {
        width: 100%;
        align-self: stretch;
    }
}
.user-menu {
    display: inline-block;
    position: relative;
}

.user-menu summary {
    list-style: none;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: #333;
    color: white;
    border-radius: 4px;
}

.user-menu summary::-webkit-details-marker {
    display: none;
}

.user-menu ul {
    position: absolute;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #222;
    min-width: 180px;
    border: 1px solid #444;
}

.user-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: black;
    text-decoration: none;
}

.user-menu li a:hover {
    background: #444;
}
.pagination{
  background-color: #ebe7df;
  color: #fff;
  /* padding: 20px 0; */
  text-align: center;
}

.pagination ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
  display: inline-block;
}

.pagination li {
  display: inline;
  margin: 0 5px;
}

/* ---------- NewThreadForm---------- */

.form-page {
    max-width: 60vw;
    margin: 2rem auto;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.form-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.form-header h1 {
    margin: 0;
    font-size: 1.7rem;
}

.form-header p {
    margin: .5rem 0 0;
    color: var(--muted);
}

.thread-form {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.content {
    max-width: 60vw;
}

.thread-form label {
    font-family: system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}

/* ---------- NewThreadForm---------- */
.content {
    max-width: 60vw;
}

.thread-form label {
    font-family: system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}

.thread-form input,
.thread-form select,
.thread-form textarea {
    width: 100%;

    padding: .75rem .9rem;

    background: var(--surface-2);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
}

.thread-form input:focus,
.thread-form select:focus,
.thread-form textarea:focus {
    outline: none;
    border-color: #7c93b7;
}

.thread-form textarea {
    min-height: 220px;
    resize: none;

    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.8;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}

.thread-form button {
    padding: .6rem 1.3rem;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface-2);
    color: var(--text);

    font-size: .95rem;
    cursor: pointer;

    transition: .15s;
}

.thread-form button:hover {
    border-color: var(--text);
    background: var(--surface);
}

.thread-form input,
.thread-form select,
.thread-form textarea {
    width: 100%;

    padding: .75rem .9rem;

    background: var(--surface-2);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
}

.thread-form input:focus,
.thread-form select:focus,
.thread-form textarea:focus {
    outline: none;
    border-color: #7c93b7;
}

.thread-form textarea {
    min-height: 220px;
    resize: none;

    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.8;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: .5rem;
}

.thread-form button {
    padding: .6rem 1.3rem;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: var(--surface-2);
    color: var(--text);

    font-size: .95rem;
    cursor: pointer;

    transition: .15s;
}

.thread-form button:hover {
    border-color: var(--text);
    background: var(--surface);
}

.error {
    margin: -.3rem 0 .2rem;
    color: #d66;
    font-size: .9rem;
    font-family: system-ui, sans-serif;
}

.category-header {
    max-width: 60vw;
    margin: 2rem auto 1rem;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;

    padding: 1.5rem;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.category-header h1 {
    margin: 0;
    font-size: 2rem;
}

.category-header p {
    margin: .5rem 0 0;
    color: var(--muted);
    font-family: "Source Serif 4", Georgia, serif;
}

.new-thread-btn {
    white-space: nowrap;

    padding: .6rem 1rem;

    text-decoration: none;

    color: var(--text);
    background: var(--surface-2);

    border: 1px solid var(--border);
    border-radius: 6px;

    transition: .15s;
}

.new-thread-btn:hover {
    border-color: var(--text);
}
.thread-meta {
    display: flex;
    gap: 1rem;
    color: var(--muted);
    font-size: .9rem;
}
 input {
    padding: .45rem 1rem;

    background: var(--bg);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
}
 select{
    padding: .65rem 1rem;

    background: var(--bg);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 6px;

    font: inherit;
}

