:root {
    --ink: #2b2b2b;
    --muted: #767676;
    --border: #e2e2e2;
    --accent: #b0553d;
    --bg: #faf8f5;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.site-title { font-size: 1.3em; font-weight: 700; color: var(--ink); }
.site-header nav a { margin-left: 16px; font-size: 0.95em; }

.site-main { max-width: 720px; margin: 0 auto; padding: 24px; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.85em; padding: 24px; }

.login-box { max-width: 360px; margin: 60px auto; text-align: center; }
.login-box form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.login-box input { padding: 10px; font-size: 1em; border: 1px solid var(--border); border-radius: 6px; }
.login-box button { padding: 10px; font-size: 1em; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; }

.error { color: #a33; font-weight: 600; }
.success { color: #2a7a2a; font-weight: 600; }
.hint { color: var(--muted); font-size: 0.85em; margin-top: -8px; }
.empty { color: var(--muted); font-style: italic; }

.feed { display: flex; flex-direction: column; gap: 28px; }
.post-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.post-card img { width: 100%; border-radius: 6px; display: block; }
.post-date { color: var(--muted); font-size: 0.85em; margin-bottom: 8px; }
.caption, .story-text { margin: 10px 0; white-space: pre-wrap; }
.post-meta { color: var(--muted); font-size: 0.8em; margin-top: 8px; }
.video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 6px; }
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.tags { margin-top: 10px; }
.tag { display: inline-block; background: #f1e9e2; color: var(--accent); padding: 2px 10px; border-radius: 12px; font-size: 0.85em; margin-right: 6px; margin-bottom: 6px; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.gallery-thumb { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: #fff; font-size: 1.6em; text-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.search-form button, .post-form button, .admin-table button {
    padding: 10px 16px; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer;
}
.result-count { color: var(--muted); }

.post-form { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.post-form input, .post-form select, .post-form textarea {
    padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 1em; font-family: inherit;
}
.type-field { display: none; }

.admin-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9em; }
.admin-table th, .admin-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
