/* ============================================================
   Chirp — style.css
   Minimal monospace look: warm paper background, green accent
   ============================================================ */

/* IBM Plex, served from this site (assets/fonts, SIL Open Font License),
   so pages load nothing from Google or any other third party. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f5f4f0;
  --white:    #ffffff;
  --border:   #e0ddd6;
  --text:     #1a1917;
  --muted:    #8c8984;
  --accent:   #2d6a4f;
  --danger:   #c0392b;
  --warn:     #d4710a;
  --mono:     'IBM Plex Mono', monospace;
  --sans:     'IBM Plex Sans', sans-serif;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Login page ── */
body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 32px;
  width: 100%;
  max-width: 360px;
}

.login-title {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-group label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.form-group input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border .12s;
  width: 100%;
}

.form-group input:focus { border-color: var(--accent); }

.btn-submit {
  width: 100%;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 5px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  transition: opacity .12s;
}

.btn-submit:hover { opacity: .85; }

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 5px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Main layout ── */
.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.3px;
}

.app-user {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logout-btn {
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: 12px;
  padding: 0;
}

.logout-btn:hover { color: var(--danger); }

/* ── Sections ── */
.section { margin-bottom: 36px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ── Cards ── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn .18s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

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

.card-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Card action buttons */
.card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-action {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
  text-decoration: none;
  display: inline-block;
}

.btn-action:hover { border-color: var(--text); color: var(--text); }
.btn-action.del   { border: 1px solid var(--border); }
.btn-action.del:hover { border-color: var(--danger); color: var(--danger); }

/* Pill (the "you" badge on the People list) */
.pill {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
  flex-shrink: 0;
  letter-spacing: .03em;
}

.pill-you { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }

/* ── Tabs ── */
.tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  text-decoration: none;
  transition: all .12s;
}

.tab-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.tab-btn.active {
  background: var(--text);
  color: var(--white);
  border-color: var(--text);
}

/* ── Inline forms (comment box) ── */
.add-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.add-row input,
.add-row select {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 11px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border .12s;
}

.add-row input:focus,
.add-row select:focus { border-color: var(--accent); }

.btn-add {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .12s;
}

.btn-add:hover { opacity: .85; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--white);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 20px;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  white-space: nowrap;
  z-index: 100;
}

#toast.show { opacity: 1; }

/* ============================================================
   Feed additions
   ============================================================ */

a { color: inherit; }
[hidden] { display: none !important; }

.app-title { text-decoration: none; }

.me-link { text-decoration: none; color: var(--text); }
.me-link:hover { color: var(--accent); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-switch {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Tab spacing ── */
.tabs { margin-bottom: 20px; }

/* ── Composer ── */
.composer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 28px;
}

.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  min-height: 60px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: transparent;
  line-height: 1.5;
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

.char-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.char-count.near { color: var(--warn); }

/* ── Posts ── */
.card.post {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.post-author {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
}
.post-author:hover .card-name { text-decoration: underline; text-underline-offset: 3px; }

.post-body {
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.act {
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .12s;
}
.act:hover       { color: var(--text); }
.act .ico        { font-size: 14px; }
.act.like.on     { color: var(--danger); }
.act.del         { margin-left: auto; }
.act.del:hover   { color: var(--danger); }

/* ── Comments ── */
.comments {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.comment-author {
  font-weight: 500;
  text-decoration: none;
  flex-shrink: 0;
}
.comment-author:hover { text-decoration: underline; }

.comment-body { flex: 1; overflow-wrap: anywhere; }

.comment .link-btn.del {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  line-height: 1;
}
.comment .link-btn.del:hover { color: var(--danger); }

.comment-form { margin-top: 4px; }
.comment-form input { flex: 1; min-width: 160px; }

/* ── People & profile ── */
.card-main > a.card-name { text-decoration: none; display: block; }
.card-main > a.card-name:hover { text-decoration: underline; text-underline-offset: 3px; }

.user-bio { font-size: 13px; margin-top: 4px; }

.btn-action.follow.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}

.follows-you { color: var(--accent); }

.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 20px;
}

.profile-name {
  font-size: 18px;
  font-weight: 500;
}

.more-btn {
  display: block;
  margin: 14px auto 0;
}

@media (max-width: 520px) {
  .shell { padding: 28px 16px 60px; }
  .app-header { margin-bottom: 24px; }
}
