/* The Bookface — a Facebook-parody theme. Plain CSS, served by propshaft. */

:root {
  --fb-blue: #1877f2;
  --fb-blue-dark: #166fe5;
  --bg: #f0f2f5;
  --card: #ffffff;
  --ink: #050505;
  --muted: #65676b;
  --line: #ced0d4;
  --bubble: #f0f2f5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--fb-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.topbar__inner {
  max-width: 680px; margin: 0 auto; padding: .55rem 1rem;
  display: flex; align-items: center; gap: .6rem;
}
.topbar__spacer { flex: 1; }
.topbar__name { color: var(--ink); font-weight: 600; font-size: .9rem; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--fb-blue); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--fb-blue);
  color: #fff; display: grid; place-items: center; font-size: 1.4rem; font-weight: 900;
  font-family: Georgia, "Times New Roman", serif;
}
.brand__word { font-size: 1.15rem; letter-spacing: -.02em; }

/* ---- avatars ---- */
.avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fb-blue), #4293ff);
  color: #fff; display: inline-grid; place-items: center;
  font-weight: 700; font-size: .85rem; letter-spacing: .02em;
}
.avatar--sm { width: 30px; height: 30px; font-size: .72rem; }

/* ---- layout ---- */
.page { max-width: 680px; margin: 1.25rem auto; padding: 0 1rem; }
.feed { display: flex; flex-direction: column; gap: 1rem; }
.backlink { display: inline-block; font-weight: 600; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.1rem;
}
.empty, .muted { color: var(--muted); }
.signin-prompt p { margin: 0 0 .8rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  border: 0; border-radius: 8px; padding: .5rem .9rem;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--fb-blue); color: #fff; }
.btn--primary:hover { background: var(--fb-blue-dark); }
.btn--ghost { background: var(--bubble); color: var(--ink); }
.btn--ghost:hover { background: #e4e6e9; }
.btn--sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 7px; }
.btn--big { padding: .7rem 1.1rem; font-size: 1.05rem; }
.btn--google { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--google:hover { background: #f7f8fa; }
.btn--google .g {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  color: #ea4335; border: 1px solid var(--line);
  display: inline-grid; place-items: center; font-weight: 900; font-family: Georgia, serif;
}
.btn--dev { background: #e7f0ff; color: var(--fb-blue); border: 1px solid #cfe0ff; }
.btn--dev:hover { background: #d8e7ff; }
/* button_to wraps a form — kill its default block margins */
.topbar form, .signin form, .composer form, .comment-form, .post form { margin: 0; }

.signin { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.signin__label { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---- composer ---- */
.composer__row { display: flex; gap: .6rem; align-items: flex-start; }
.composer__input, .comment-form__input {
  flex: 1; width: 100%; resize: vertical; border: 0; background: var(--bubble);
  border-radius: 18px; padding: .6rem .9rem; font: inherit; color: var(--ink);
}
.composer__input:focus, .comment-form__input:focus { outline: 2px solid #cfe0ff; }
.composer__actions { display: flex; justify-content: flex-end; margin-top: .6rem; }

/* ---- posts ---- */
.post__head { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.post__author { font-weight: 700; }
.post__time { color: var(--muted); font-size: .8rem; }
.post__body { white-space: pre-wrap; }
.post__body p { margin: 0 0 .5rem; }
.post__foot { margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.post__comments-link { font-weight: 600; color: var(--muted); }

/* ---- comment thread ---- */
.thread__title { font-size: 1rem; margin: 0 0 .8rem; }
.thread__list { margin-top: .9rem; display: flex; flex-direction: column; gap: .7rem; }

.comment {
  display: flex; gap: .55rem; align-items: flex-start;
  margin-left: calc(var(--indent, 0) * 1.75rem);
}
.comment__body { flex: 1; min-width: 0; }
.comment__bubble { background: var(--bubble); border-radius: 16px; padding: .5rem .8rem; }
.comment__author { font-weight: 700; font-size: .9rem; }
.comment__text { white-space: pre-wrap; }
.comment__text p { margin: .15rem 0 0; }
.comment__meta { display: flex; align-items: center; gap: .8rem; margin: .2rem 0 0 .8rem; }
.comment__time { color: var(--muted); font-size: .78rem; }

.reply { font-size: .8rem; }
.reply__toggle {
  cursor: pointer; color: var(--muted); font-weight: 700; list-style: none;
}
.reply__toggle::-webkit-details-marker { display: none; }
.reply[open] .reply__toggle { color: var(--fb-blue); }
.comment-form { margin-top: .5rem; display: flex; gap: .4rem; align-items: flex-start; }
.comment-form__actions { display: flex; }

/* ---- media / uploads ---- */
.is-hidden { display: none !important; }
.composer__actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; }
.composer__previews { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0; }
.composer__previews:empty { margin: 0; }
.upload-tile {
  position: relative; width: 84px; height: 84px; border-radius: 10px;
  background: var(--bubble) center/cover no-repeat; border: 1px solid var(--line);
}
.upload-tile.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px;
  border: 3px solid var(--line); border-top-color: var(--fb-blue); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.upload-tile__remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-weight: 700; cursor: pointer; line-height: 1;
}

.media { display: grid; gap: 3px; margin: .5rem 0; border-radius: 12px; overflow: hidden; }
.media--1 { grid-template-columns: 1fr; }
.media--2, .media--4 { grid-template-columns: 1fr 1fr; }
.media--3 { grid-template-columns: 1fr 1fr; }
.media--3 .media__item:first-child { grid-column: 1 / -1; }
.media__item { display: block; }
.media__item img { display: block; width: 100%; height: 100%; max-height: 460px; object-fit: cover; }
.media--1 .media__item img { max-height: 560px; object-fit: contain; background: #000; }

/* ---- reactions ---- */
.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0 .2rem; }
.reactions__counts { display: flex; gap: .35rem; flex-wrap: wrap; }
.reactions__count {
  background: var(--bubble); border: 1px solid var(--line); border-radius: 999px;
  padding: .1rem .55rem; font-size: .82rem; font-weight: 600; color: var(--muted);
}
.reactions__palette { display: flex; gap: .15rem; flex-wrap: wrap; }
.reactions__palette form { margin: 0; }
.reactions__btn {
  border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: .12rem .3rem; font-size: 1.1rem; line-height: 1; cursor: pointer;
  filter: grayscale(.35); opacity: .8; transition: transform .06s ease;
}
.reactions__btn:hover { background: var(--bubble); filter: none; opacity: 1; transform: scale(1.15); }
.reactions__btn--mine { background: #e7f0ff; border-color: #cfe0ff; filter: none; opacity: 1; }
/* comments carry a lighter reactions row */
.comment .reactions { margin: .35rem 0 0 .2rem; }
.comment .reactions__btn { font-size: 1rem; }

/* ---- flashes ---- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .6rem .9rem; border-radius: 10px; font-weight: 600; }
.flash--notice { background: #e7f7ec; color: #1a7f37; }
.flash--alert { background: #fdeaea; color: #c0362c; }
.field-errors { background: #fdeaea; color: #c0362c; padding: .5rem .8rem; border-radius: 8px; margin-bottom: .6rem; font-size: .9rem; }
