* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #1a1a2e;
  color: #eaeaea;
}

.header {
  background: #16213e;
  padding: 1rem 2rem;
  border-bottom: 1px solid #0f3460;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e94560;
  text-decoration: none;
}

.logo:hover {
  text-decoration: underline;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1, h2, h3 {
  margin-top: 0;
}

a {
  color: #e94560;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.breadcrumb {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: #e94560;
}

.breadcrumb span {
  margin: 0 0.25rem;
}

/* Sections list */
.sections-list .subtitle {
  color: #aaa;
  margin-bottom: 2rem;
}

.section-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.section-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #16213e;
  border-radius: 8px;
  border: 1px solid #0f3460;
  color: inherit;
  text-decoration: none;
}

.section-card:hover {
  border-color: #e94560;
  background: #1a2744;
}

.section-name {
  font-weight: 600;
  text-transform: capitalize;
}

.section-count {
  color: #888;
  font-size: 0.9rem;
}

.empty {
  color: #888;
  font-style: italic;
}

/* Section view */
.post-form-container {
  background: #16213e;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #0f3460;
}

.post-form .form-group,
.comment-form .form-group {
  margin-bottom: 1rem;
}

.post-form label,
.comment-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #bbb;
}

.post-form input[type="file"],
.comment-form input[type="file"] {
  padding: 0.25rem 0;
}

.post-form .hint,
.comment-form .hint {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.25rem;
}

.post-form input,
.post-form textarea,
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 4px;
  color: #eaeaea;
  font-family: inherit;
}

.post-form input:focus,
.post-form textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #e94560;
}

.error {
  display: block;
  color: #e94560;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 4px;
  color: #eaeaea;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  background: #16213e;
  border-color: #e94560;
}

.btn-primary {
  background: #e94560;
  border-color: #e94560;
  color: #fff;
}

.btn-primary:hover {
  background: #d63850;
  border-color: #d63850;
}

/* Posts feed */
.posts-feed h2 {
  margin-bottom: 1rem;
}

.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-card {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem 1.5rem;
  background: #16213e;
  border-radius: 8px;
  border: 1px solid #0f3460;
}

.post-card:hover {
  border-color: #e94560;
  background: #1a2744;
}

.post-card-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 8px;
}

.post-card .author-link {
  position: relative;
  z-index: 1;
}

/* Post cards with single link (e.g. user posts view) */
.post-card > a:not(.post-card-link) {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.post-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 0.5rem;
}

.post-preview {
  margin: 0;
  color: #bbb;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Post detail */
.post-detail {
  background: #16213e;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid #0f3460;
}

.post-detail .post-meta {
  margin-bottom: 1rem;
}

.post-image {
  margin-bottom: 1rem;
}

.post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.post-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
}

/* Comments */
.comments-section {
  margin-top: 2rem;
}

.comment-form {
  margin-bottom: 2rem;
  padding: 1rem;
  background: #16213e;
  border-radius: 8px;
  border: 1px solid #0f3460;
}

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  padding: 1rem;
  background: #16213e;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid #0f3460;
}

.comment-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 0.5rem;
}

.comment-image {
  margin-bottom: 0.5rem;
}

.comment-image img {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  border-radius: 6px;
  display: block;
}

.comment-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 3rem;
}

.error-page h1 {
  margin-bottom: 2rem;
}
