textarea {
  width: 100%;
  box-sizing: border-box;
  height: 120px;
  padding: 15px;
  font-size: 1rem;
  border-radius: 3px;
  border: 1px solid hsl(0, 0%, 80%);
  resize: none;
  font-family: Arial, Helvetica, sans-serif;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#charCount {
  width: 100%;
  text-align: right;
  font-size: 0.9rem;
  color: #555;
  font-style: italic;
}

#postBtn {
  margin-top: 15px;
  align-self: flex-end;
  padding: 10px 25px;
  font-weight: 700;
  background: black;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#status {
  margin-top: 15px;
  font-style: italic;
  min-height: 20px;
  width: 100%;
  text-align: center;
}

/* Nothing to say yet: no blank line between the composer and the feed. */
#status:empty {
  display: none;
}

#posts {
  margin-top: 20px;
  width: 100%;
  border-top: 1px solid #ccc;
  padding-top: 16px;
}

.post {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 15px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.post-content {
  word-wrap: break-word;
  margin-top: 8px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  margin-top: 8px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
}

.post-actions img {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.post-content img[src$='.gif'] {
  max-width: 100%;
  border-radius: 3px;
  margin-top: 8px;
}

/* two-column layout: feed and right column (the sidebar is fixed, see global.css) */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 28px;
  padding: 0 20px;
}

main.feed {
  width: 100%;
  max-width: 680px;
  min-width: 0;
  margin: 0 auto;
  padding: 20px 0;
  gap: 12px;
}

.rightbar {
  position: sticky;
  top: 65px;
  max-height: calc(100vh - 65px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 0;
}

/* feed heading and composer */

.feed-header h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-header h2 svg {
  width: 24px;
  height: 24px;
}

.feed-header p {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.9rem;
}

.composer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 15px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: none;
  color: black;
  cursor: pointer;
}

.composer-icon:hover {
  background: #f2f2f2;
}

.composer-icon svg {
  width: 26px;
  height: 26px;
}

#postCategory {
  margin-left: auto;
  margin-top: 15px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: white;
  font: inherit;
  font-size: 0.9rem;
}

.feed-empty {
  text-align: center;
  color: #777;
  padding: 20px 0;
}

/* right column boxes */

.side-box {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid #e3e3e3;
  border-radius: 3px;
}

.side-box h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.side-empty {
  margin: 0;
  color: #777;
  font-size: 0.9rem;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.suggestion-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.suggestion-link img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.suggestion-name,
.suggestion-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.suggestion-username {
  font-size: 0.8rem;
  color: #666;
}

.suggestion button {
  padding: 5px 10px;
  border: 1px solid black;
  border-radius: 3px;
  background: black;
  color: white;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.suggestion button.following {
  background: white;
  color: black;
}

.popular-post {
  display: block;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  color: inherit;
  text-decoration: none;
}

.popular-post:first-child {
  border-top: none;
  padding-top: 0;
}

.popular-post:hover .popular-text {
  text-decoration: underline;
}

.popular-meta {
  font-size: 0.8rem;
  color: #666;
}

.popular-text {
  margin: 2px 0;
  font-size: 0.9rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.popular-likes {
  font-size: 0.8rem;
  color: #888;
}

/* narrower screens: drop the right column */

@media (max-width: 1150px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .rightbar {
    position: static;
    width: 100%;
    max-width: 680px;
    max-height: none;
    margin: 0 auto;
    padding: 0 0 20px;
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .layout {
    padding: 0 10px;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  #postCategory {
    grid-area: 2 / 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    font-size: 16px;
  }

  #postBtn {
    grid-area: 2 / 2;
    margin: 0;
  }

  .composer-icon {
    width: 44px;
    height: 44px;
    margin: 0;
  }

  #charCount {
    margin: 0;
  }

  #status:empty {
    display: none;
  }

  #posts {
    margin-top: 20px;
  }
}

.news-source {
  margin: -4px 0 8px;
  color: #777;
  font-size: 0.8rem;
}
.news-source a {
  color: inherit;
}
.news-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.news-item strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.4;
}
.news-item time {
  display: block;
  margin-top: 4px;
  color: #888;
  font-size: 0.8rem;
}
.news-item:hover strong {
  text-decoration: underline;
}
.news-box button {
  margin-top: 10px;
  padding: 7px 10px;
  font-size: 0.85rem;
}
.news-box[hidden] {
  display: none;
}

/* The post's destination is required; it stands out once there's something to post. */
#postCategory.needs-destination {
  border-color: #c58c00;
  box-shadow: 0 0 0 1px #c58c00;
}

/* Phones: a folded composer is a single "write a post…" box until it's tapped (scripts/index.js). */
@media (max-width: 760px) {
  .composer-compact .post-article-toggle,
  .composer-compact .post-format-toolbar,
  .composer-compact .post-editor-media,
  .composer-compact .post-editor-footer,
  .composer-compact .post-editor-preview,
  .composer-compact .post-format-help,
  .composer-compact .composer-actions,
  .composer-compact #status {
    display: none;
  }

  .composer-compact #postContent {
    height: 48px;
    min-height: 0;
    overflow: hidden;
  }
}

/* Signed out (scripts/index.js): an invitation to join in place of the composer. */
.signed-out-feed .post-editor,
.signed-out-feed #postContent,
.signed-out-feed .composer-actions,
.signed-out-feed #status {
  display: none;
}
