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

:root {
    --ink: #17262a;
    --ink-soft: #4d6165;
    --paper: #eef6f6;
    --card: #ffffff;
    --teal: #0e7c7b;
    --teal-deep: #0a5f5e;
    --teal-tint: #d7ebe9;
    --coral: #ff6f59;
    --line: #cfe3e1;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
}

a {
    color: var(--teal-deep);
}

/* ---------- Header ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--card);
}

.brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--teal-deep);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-mark {
    color: var(--coral);
}

/* ---------- Layout ---------- */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.feed-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}

.subtitle {
    color: var(--ink-soft);
    margin: 4px 0 0;
    font-size: 0.95rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.95rem;
    text-decoration: none;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--teal-deep);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover {
    border-color: var(--teal);
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--ink-soft);
    cursor: pointer;
    text-decoration: underline;
}

.link-btn.danger {
    color: var(--coral);
}

.link-btn.small {
    font-size: 0.85rem;
}

.icon-btn, .icon-btn-link {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    text-decoration: none;
}

.icon-btn:hover, .icon-btn-link:hover {
    background: var(--teal-tint);
}

.inline-form {
    display: inline;
}

/* ---------- Post card ---------- */

.feed {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}

.post-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.username {
    font-size: 1rem;
    margin: 0;
}

.content {
    margin: 0 0 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
}

.post-stats {
    display: flex;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
    margin-bottom: 8px;
}

.post-actions {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

.post-actions a {
    text-decoration: none;
    color: var(--ink-soft);
}

.post-actions a:hover {
    color: var(--teal-deep);
}

/* ---------- Empty states ---------- */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}

.empty-state-inline {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* ---------- Forms ---------- */

.form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}

.form-card h1 {
    margin-bottom: 20px;
}

form label {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 16px 0 6px;
}

form input[type="text"],
form input:not([type]),
form input[type="file"],
form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--paper);
    color: var(--ink);
}

form textarea {
    resize: vertical;
}

form input:focus,
form textarea:focus {
    outline: 2px solid var(--teal);
    outline-offset: 1px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

/* ---------- Comments ---------- */

.comments-section {
    margin-top: 24px;
}

.comments-section h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.comment-form input {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    background: var(--card);
}

.comment-form-row {
    display: flex;
    gap: 8px;
}

.comment-form-row input {
    flex: 1;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
}

.comment-body {
    flex: 1;
}

.comment-body p {
    margin: 2px 0 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .site-header {
        padding: 16px;
    }
    .page {
        padding: 24px 14px 60px;
    }
    .form-card {
        padding: 20px;
    }
}
