:root {
    --bg: #000000;
    --card-bg: #121212;
    --border: #2b2b2b;
    --text: #f2f2f2;
    --text-muted: #a8a8a8;
    --accent: #ed4956;
    --link: #4cb5f9;
    --radius: 8px;
    --content-width: 600px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background: var(--bg);
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
}

.site-header__image {
    display: block;
    width: 100%;
    max-width: var(--content-width);
    max-height: 220px;
    margin: 0 auto;
    border-radius: 16px;
    object-fit: cover;
}

.site-main {
    min-height: 70vh;
    padding: 16px 0 60px;
}

.feed {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 8px;
}

.feed__empty {
    text-align: center;
    color: var(--text-muted);
    margin-top: 60px;
}

.messages {
    max-width: var(--content-width);
    margin: 0 auto 16px;
    padding: 0 8px;
}

.messages__item {
    background: rgba(237, 73, 86, 0.12);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 8px;
}

.post {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.post__media {
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post__media img,
.post__media video {
    width: 100%;
    max-height: 700px;
    object-fit: contain;
    display: block;
    background: #000;
}

.post__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    color: var(--text);
    transition: transform 0.15s ease;
}

.like-btn__icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.like-btn.is-liked {
    color: var(--accent);
}

.like-btn.is-liked .like-btn__icon {
    fill: var(--accent);
    stroke: var(--accent);
}

.like-btn.is-bouncing {
    transform: scale(1.25);
}

.post__delete-form {
    margin-left: auto;
}

.post__delete-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
}

.post__likes {
    padding: 4px 12px 0;
    font-size: 14px;
    font-weight: 600;
}

.post__caption {
    padding: 6px 12px 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    white-space: pre-wrap;
}

.post__timestamp {
    padding: 6px 12px 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.comments-toggle {
    display: block;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 12px 0;
    cursor: pointer;
    text-align: left;
}

.comments-toggle:hover {
    color: var(--text);
}

.post__comments {
    display: none;
    padding: 8px 12px 0;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.post__comments.is-open {
    display: flex;
}

.comment {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
}

.comment__meta {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.comment__text {
    flex: 1;
    word-break: break-word;
}

.comment__delete-form {
    flex-shrink: 0;
}

.comment__delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.comment__delete-btn:hover {
    color: var(--accent);
}

.comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 14px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.comment-form textarea {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    padding: 6px 0;
    max-height: 80px;
    background: transparent;
    color: var(--text);
}

.comment-form textarea::placeholder {
    color: var(--text-muted);
}

.comment-form__submit {
    background: none;
    border: none;
    color: var(--link);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.comment-form__submit:disabled {
    color: var(--text-muted);
    cursor: default;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    background: var(--card-bg);
}

.site-footer__inner {
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-footer__copy {
    font-size: 12px;
    color: var(--text-muted);
}

.site-footer__admin-link {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
}

.site-footer__admin-btn {
    font-size: 11px;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
}

.site-footer__admin-btn--ghost {
    margin-left: auto;
}

.site-footer__logout-form {
    margin: 0;
}

.auth-box {
    max-width: 340px;
    margin: 40px auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
}

.auth-box__title {
    font-size: 18px;
    margin: 0 0 18px;
}

.auth-box__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-box__form input[type="password"],
.auth-box__form input[type="file"],
.auth-box__form textarea {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 9px 10px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    background: var(--card-bg);
    color: var(--text);
}

.auth-box__form input::placeholder,
.auth-box__form textarea::placeholder {
    color: var(--text-muted);
}

.field-label {
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.field-error {
    color: var(--accent);
    font-size: 12px;
    text-align: left;
}

.auth-box__submit {
    background: var(--link);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.auth-box__back {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
}

@media (min-width: 600px) {
    .site-main {
        padding-top: 24px;
    }

    .feed {
        gap: 28px;
    }
}

@media (max-width: 400px) {
    .feed {
        padding: 0;
        gap: 12px;
    }

    .post {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .auth-box {
        margin: 20px 12px;
    }
}
