/* ================================================
   RABBIT — A Neurodivergent Hangout
   Style: Warm parchment. Cosy & readable.
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&family=Nunito:wght@400;500;600&display=swap');

/* ── Variables ── */
:root {
    --bg:           #f5f0e8;
    --bg-card:      #fdfaf4;
    --bg-hover:     #f0ead8;
    --border:       #e0d5c0;
    --border-hover: #c8b898;
    --text:         #2d2418;
    --text-muted:   #6b5a42;
    --text-faint:   #a08c6e;
    --accent:       #b86a1a;
    --accent-soft:  #d4823a;
    --accent-light: #f5e6d0;
    --accent-glow:  rgba(184, 106, 26, 0.12);
    --green:        #3a6e42;
    --green-light:  #e8f5ea;
    --red:          #9e2a2a;
    --red-light:    #fdf0f0;
    --radius:       14px;
    --radius-sm:    8px;
    --shadow:       0 2px 12px rgba(100, 80, 40, 0.1);
    --shadow-lg:    0 4px 24px rgba(100, 80, 40, 0.15);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body:    'Nunito', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ── */
html {
    font-size: 17px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.75;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(184,106,26,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(58,110,66,0.05) 0%, transparent 50%);
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

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

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

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
    background: rgba(253, 250, 244, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.85rem 0;
    box-shadow: 0 2px 8px rgba(100,80,40,0.08);
}

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

.logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text) !important;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:hover {
    color: var(--accent) !important;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.main-nav a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.nav-username {
    color: var(--accent);
    font-weight: 600;
}

/* ── Main ── */
main.container {
    padding-top: 2.25rem;
    padding-bottom: 3.5rem;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

/* ── Category List ── */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.75rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    border-color: var(--accent-soft);
    background: var(--accent-light);
}

.category-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    display: block;
}

.category-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    display: block;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-faint);
    text-align: right;
    flex-shrink: 0;
    line-height: 1.6;
}

/* ── Thread List ── */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.thread-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.1rem 1.4rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.thread-item:hover {
    border-color: var(--accent-soft);
    background: var(--accent-light);
    color: inherit;
    box-shadow: var(--shadow-lg);
}

.thread-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.thread-stats {
    font-size: 0.85rem;
    color: var(--text-faint);
    text-align: right;
    flex-shrink: 0;
    min-width: 70px;
}

.badge-pinned {
    font-size: 0.72rem;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-soft);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.4rem;
    vertical-align: middle;
    font-weight: 600;
}

.badge-locked {
    font-size: 0.72rem;
    background: #f0ede8;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ── Posts ── */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 1.5rem;
}

.post {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.post-author {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

.post-time {
    color: var(--text-faint);
    font-size: 0.85rem;
}

.post-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    word-break: break-word;
}

.post-body p { margin-bottom: 0.85rem; }
.post-body p:last-child { margin-bottom: 0; }

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.like-btn {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.like-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.like-btn.liked {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.edit-link {
    font-size: 0.85rem;
    color: var(--text-faint);
    font-weight: 500;
}

.edit-link:hover {
    color: var(--text-muted);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.4rem;
}

label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}

textarea {
    min-height: 160px;
    resize: vertical;
    line-height: 1.7;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-soft);
    border-color: var(--accent-soft);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text);
    background: var(--bg-hover);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: #e0b0b0;
}

.btn-danger:hover {
    background: var(--red-light);
    border-color: var(--red);
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.4rem;
    border-bottom: 2px solid var(--border);
}

.page-header h1 {
    font-size: 2rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-faint);
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.breadcrumb a {
    color: var(--text-muted);
}

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

.breadcrumb span {
    margin: 0 0.4rem;
}

/* ── Alerts ── */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 1.4rem;
    border: 1.5px solid;
    font-weight: 500;
}

.alert-error {
    background: var(--red-light);
    border-color: #e0b0b0;
    color: var(--red);
}

.alert-success {
    background: var(--green-light);
    border-color: #a0c8a8;
    color: var(--green);
}

/* ── Auth Pages ── */
.auth-wrap {
    max-width: 440px;
    margin: 3rem auto;
}

.auth-wrap h1 {
    text-align: center;
    margin-bottom: 0.4rem;
}

.auth-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1.4rem;
}

/* ── Notification Badge ── */
.nav-notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.notif-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    line-height: 1.5;
    min-width: 20px;
    text-align: center;
}

/* ── Search highlight ── */
mark {
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 2px;
    padding: 0 2px;
}

/* ── Footer ── */
.site-footer {
    border-top: 2px solid var(--border);
    padding: 1.75rem 0;
    margin-top: 3.5rem;
    font-size: 0.875rem;
    color: var(--text-faint);
    text-align: center;
    font-weight: 500;
}

.site-footer a {
    color: var(--text-muted);
}

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

/* ── Utility ── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

/* ── Responsive ── */
@media (max-width: 640px) {
    html { font-size: 16px; }

    .site-header .container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .main-nav {
        gap: 1rem;
        font-size: 0.9rem;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .card {
        padding: 1.1rem 1.25rem;
    }

    .post {
        padding: 1.1rem 1.25rem;
    }

    .category-item {
        flex-wrap: wrap;
    }

    .thread-stats {
        display: none;
    }

    .auth-wrap {
        margin: 1.5rem auto;
    }
}
