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

body {
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #4a4540;
  background: #e8e4de;
}

a { color: #6b7f5e; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ===== Header ===== */
.site-header {
  background: #7a8b6e;
  border-bottom: 1px solid #697a5e;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: #faf8f5;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.logo:hover { text-decoration: none; }

.header-nav { display: flex; gap: 16px; }
.header-nav a {
  color: #d6ddd1;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
}
.header-nav a:hover { color: #faf8f5; text-decoration: none; }

.badge {
  background: #c07a5a;
  color: #faf8f5;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 2px;
}

/* ===== Container ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== Cards ===== */
.card {
  background: #faf8f5;
  border: 1px solid #d5cfc7;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 12px;
}

/* ===== Buttons ===== */
button, .btn {
  display: inline-block;
  background: #7a8b6e;
  color: #faf8f5;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
button:hover, .btn:hover { background: #697a5e; text-decoration: none; }

.btn-secondary { background: #e8e4de; color: #4a4540; }
.btn-secondary:hover { background: #d5cfc7; }

.btn-danger { background: #c07a5a; }
.btn-danger:hover { background: #a8684c; }

.btn-sm { padding: 4px 12px; font-size: 12px; }

.tag {
  display: inline-block;
  background: #e8e4de;
  color: #7a7570;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
}

/* ===== Forms ===== */
input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c8c2b8;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: #fdfcfa;
}
input:focus, textarea:focus { outline: none; border-color: #7a8b6e; }

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
  color: #5a554f;
}

.field-errors { color: #c07a5a; font-size: 12px; list-style: none; margin-top: 4px; }

.search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.search-form input { flex: 1; }

.form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-row input[type="text"] { flex: 1; min-width: 120px; }

.error { color: #c07a5a; margin-bottom: 8px; }

hr { border: none; border-top: 1px solid #d5cfc7; margin: 16px 0; }

.inline-form { display: inline; }

/* ===== Auth Pages ===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding-top: 80px;
  flex-wrap: wrap;
}

.auth-hero { max-width: 400px; }
.auth-hero h1 { color: #6b7f5e; font-size: 48px; margin-bottom: 8px; }
.auth-hero p { font-size: 18px; color: #7a7570; }

.auth-form-box {
  background: #faf8f5;
  border: 1px solid #d5cfc7;
  border-radius: 8px;
  padding: 24px;
  width: 360px;
  box-shadow: 0 2px 4px rgba(74,69,64,.08);
}
.auth-form-box input { margin-bottom: 12px; }
.auth-form-box button { width: 100%; padding: 10px; font-size: 16px; }
.auth-form-box .btn-secondary { margin-top: 8px; }

/* ===== Avatars ===== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-md { width: 56px; height: 56px; font-size: 20px; }
.avatar-lg { width: 120px; height: 120px; font-size: 40px; }

.avatar-placeholder {
  background: #8a9b7e;
  color: #faf8f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ===== Feed Layout ===== */
.feed-layout { display: flex; gap: 16px; }

.sidebar { width: 200px; flex-shrink: 0; }
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  padding: 6px 8px;
  border-radius: 4px;
  color: #4a4540;
  font-weight: 600;
}
.sidebar-nav a:hover { background: #e0dbd4; text-decoration: none; }

.feed-main { flex: 1; min-width: 0; }

/* ===== Posts ===== */
.post-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.post-author { font-weight: 600; color: #6b7f5e; }
.post-time { font-size: 12px; color: #a09a92; display: block; }
.post-body { margin-bottom: 8px; word-wrap: break-word; }
.post-image { margin-bottom: 8px; }
.post-image img { border-radius: 4px; }

.new-post-card textarea { margin-bottom: 8px; }
.new-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.file-label {
  font-size: 13px;
  color: #7a7570;
  cursor: pointer;
}
.file-label input { width: 80px; font-size: 12px; }

/* ===== Comments ===== */
.post-comments { border-top: 1px solid #e8e4de; padding-top: 8px; margin-top: 8px; }
.comment { margin-bottom: 6px; font-size: 13px; }
.comment-time { font-size: 11px; color: #a09a92; margin-left: 4px; }
.comment-form { display: flex; gap: 6px; margin-top: 6px; }
.comment-form input { flex: 1; padding: 6px 8px; font-size: 13px; }
.comment-form button { padding: 6px 12px; font-size: 12px; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}
.page-info { font-size: 13px; color: #a09a92; }

/* ===== Profile ===== */
.profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
}
.profile-info h1 { font-size: 24px; margin-bottom: 4px; }
.bio { color: #7a7570; margin-bottom: 4px; }
.friend-count { font-size: 13px; color: #a09a92; margin-bottom: 8px; }

.profile-body { display: flex; gap: 16px; }
.profile-sidebar { width: 280px; flex-shrink: 0; }
.profile-main { flex: 1; min-width: 0; }

.section-title { font-size: 16px; margin-bottom: 8px; }

/* ===== People List ===== */
.people-list { list-style: none; }
.person-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e8e4de;
}
.person-item:last-child { border-bottom: none; }
.request-actions { margin-left: auto; display: flex; gap: 6px; }

/* ===== Albums ===== */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.album-card { display: block; padding: 0; overflow: hidden; }
.album-card:hover { text-decoration: none; }
.album-cover { width: 100%; height: 160px; object-fit: cover; }
.album-placeholder {
  width: 100%;
  height: 160px;
  background: #e0dbd4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a09a92;
  font-size: 13px;
}
.album-info { padding: 10px; }
.album-info span { font-size: 12px; color: #a09a92; display: block; }

.album-grid-sm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.album-grid-sm img { width: 100%; height: 60px; object-fit: cover; border-radius: 2px; }
.album-placeholder-sm {
  height: 60px;
  background: #e0dbd4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #a09a92;
  border-radius: 2px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.photo-item img { width: 100%; border-radius: 4px; }
.photo-caption { font-size: 13px; color: #7a7570; margin-top: 4px; }

.meta { font-size: 13px; color: #a09a92; }

/* ===== Narrow Page ===== */
.narrow-page { max-width: 700px; margin: 0 auto; }
.narrow-page h1 { margin-bottom: 16px; }

.empty-state { color: #a09a92; text-align: center; padding: 16px 0; }

/* ===== Responsive ===== */
@media (max-width: 700px) {
  .feed-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-body { flex-direction: column; }
  .profile-sidebar { width: 100%; }
  .auth-page { flex-direction: column; align-items: center; padding-top: 40px; }
  .auth-hero { text-align: center; }
}
