:root {
  --primary-color: #0055ff;
  --bg-color: #f6f7f9;
  --card-bg: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: #707070;
  --pinned-bg: #fffdf0;
  --pinned-border: #ffd700;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  padding: 0 0 100px 0; /* Padding at bottom for floating button safety */
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Ad Slots */
header {
  padding: 16px 0 8px 0;
  text-align: center;
}
.ad-slot-top {
  width: 100%;
  min-height: 90px;
  background-color: #eaeaea;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
}

/* Category Navigation Filter */
.category-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.category-nav a {
  padding: 8px 16px;
  background: #e9ecef;
  color: var(--text-main);
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.category-nav a.active {
  background: var(--primary-color);
  color: #fff;
  font-weight: bold;
}

/* Search Bar */
.search-box {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Post Card Styling */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-left: 4px solid transparent;
}
.card.pinned {
  background: var(--pinned-bg);
  border-left-color: var(--pinned-border);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.tag-pinned {
  background: #fff3cd;
  color: #856404;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Truncate exceptionally long titles */
}
.card-title a {
  color: var(--text-main);
  text-decoration: none;
}
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* In-Feed Ad Container */
.ad-in-feed {
  background: #fff;
  border: 1px dashed #ccc;
  border-radius: 8px;
  min-height: 100px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
}

/* Floating Action Button (+) */
.fab-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 1000; /* Safe clearance from ad units */
}