/* EETime Web — Phase 2. Clean, light, rounded cards (user's chosen style). */
:root { --pagew: 700px; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f6f4ef;
  color: #26241f;
}
a { color: #b8860b; text-decoration: none; }

#topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  /* side padding matches the centered content column (main: --pagew + 14px inner
     padding), so the header lines up with the page on wide screens */
  padding: 10px max(18px, calc((100% - var(--pagew)) / 2 + 14px));
  background: #fffdf8;
  border-bottom: 1px solid #eadfc8;
}
.brand { font-size: 20px; font-weight: 800; color: #26241f; display: inline-flex; align-items: center; }
.brand-logo { height: 38px; width: 38px; border-radius: 10px; display: block; }
#mainnav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
#mainnav a {
  padding: 7px 13px; border-radius: 999px; color: #5c5546; font-weight: 600; font-size: 14px;
}
#mainnav a.active { background: #f3c96b; color: #26241f; }
#userbox { display: flex; align-items: center; gap: 10px; font-size: 14px; }
#userbox img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

main { max-width: var(--pagew); margin: 18px auto 40px; padding: 0 14px; }
.foot { text-align: center; font-size: 12px; padding: 18px; }

.card {
  background: #fff; border-radius: 18px; padding: 16px 18px;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(60, 50, 20, .07);
}
.center { text-align: center; }
.muted { color: #8a8271; }
.small { font-size: 12px; }

.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #eee; }
.post-head .name { font-weight: 700; }
.post-text { white-space: pre-wrap; line-height: 1.55; margin: 6px 0 10px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 3px; }
.media img, .media video { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; background: #000; }
.media.single img, .media.single video { height: auto; max-height: 480px; object-fit: contain; border-radius: 12px; }
.place { display: inline-block; background: #fdf3d7; color: #7a5b12; border-radius: 999px; padding: 3px 10px; font-size: 12px; margin: 4px 0; }
.counts { display: flex; gap: 16px; font-size: 13px; color: #8a8271; margin-top: 10px; }
.tag { display: inline-block; background: #f1ead9; border-radius: 6px; padding: 1px 7px; font-size: 11px; color: #7a5b12; margin-left: 6px; }

button, .btn {
  background: #f3c96b; border: 0; color: #26241f; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; font-size: 14px;
  display: inline-block;
}
button.ghost, .btn.ghost { background: #fff; border: 1px solid #d9cfb4; }
button:disabled { opacity: .55; cursor: default; }

form.login { max-width: 380px; margin: 30px auto; }
form.login label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; }
form.login input {
  width: 100%; padding: 11px 13px; border: 1px solid #ddd3ba; border-radius: 12px; font-size: 15px;
}
.error { background: #fdecec; color: #a33; border-radius: 12px; padding: 10px 13px; font-size: 14px; margin: 12px 0; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: #8a8271; font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #eadfc8; }
#googleLoginArea { display: flex; justify-content: center; min-height: 40px; }
.google-note { margin: 8px 0; }
.notice { background: #fdf3d7; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }

.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; background: #eee; }
.month-title { font-weight: 800; margin: 18px 0 8px; }
.day-title { font-weight: 700; font-size: 13px; color: #7a5b12; margin: 10px 0 6px; }

.goal { display: flex; align-items: center; gap: 12px; }
.goal .bar { flex: 1; height: 9px; background: #f1ead9; border-radius: 99px; overflow: hidden; }
.goal .bar > div { height: 100%; background: #f3c96b; }
.goal.done .bar > div { background: #7bc47f; }

.appbanner {
  background: #26241f; color: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.appbanner .grow { flex: 1; min-width: 180px; }
.appbanner .btn { background: #f3c96b; }
.appbanner .btn.store { background: #fff; }
.pager { text-align: center; margin: 16px 0; }

/* Phase 2: composer, reactions, comments */
.hidden { display: none !important; }
.composer textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #ddd3ba; border-radius: 12px;
  font-size: 15px; font-family: inherit; resize: vertical; background: #fffdf8;
}
.composer-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.composer-row label { display: flex; align-items: center; gap: 6px; }
.composer-row select {
  padding: 7px 10px; border: 1px solid #ddd3ba; border-radius: 999px; font-size: 13px; background: #fff;
}
.composer-row button { margin-left: auto; }
.post-actions { display: flex; gap: 8px; margin-top: 10px; }
button.small-btn, .small-btn { padding: 6px 14px; font-size: 13px; }
.reaction-img { width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.emoji-btn {
  background: #fff; border: 1px solid #eadfc8; border-radius: 12px; padding: 5px;
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.emoji-btn img { width: 30px; height: 30px; object-fit: contain; }
.comments-box { margin-top: 12px; border-top: 1px solid #f1ead9; padding-top: 10px; }
.comment { margin: 8px 0; }
.comment-nested { margin-left: 34px; }
.comment-main { display: flex; gap: 8px; }
.comment-main img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #eee; flex: none; }
.comment-body { background: #fbf8f1; border-radius: 12px; padding: 7px 11px; flex: 1; }
.comment-body .name { font-weight: 700; font-size: 13px; }
.comment-text { white-space: pre-wrap; line-height: 1.45; font-size: 14px; }
.link-btn {
  background: none; border: 0; color: #b8860b; font-weight: 600; font-size: 12px;
  padding: 0 0 0 8px; cursor: pointer; display: inline;
}
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input {
  flex: 1; padding: 9px 12px; border: 1px solid #ddd3ba; border-radius: 999px; font-size: 14px;
}

/* Composer photo picker: thumbnails, per-photo upload progress, remove */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-strip:not(:empty) { margin-top: 10px; }
.photo-thumb { position: relative; width: 78px; height: 78px; flex: none; }
.photo-thumb img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px; background: #eee; display: block;
}
.photo-thumb.is-error img { opacity: .45; }
.photo-progress {
  position: absolute; left: 6px; right: 6px; bottom: 6px; height: 5px;
  background: rgba(38, 36, 31, .35); border-radius: 99px; overflow: hidden;
}
.photo-progress i { display: block; height: 100%; background: #f3c96b; border-radius: 99px; }
.photo-failed {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-size: 11px; font-weight: 700; color: #a33;
}
.photo-remove {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
  padding: 0; border-radius: 50%; background: #26241f; color: #fff;
  font-size: 12px; line-height: 22px; text-align: center;
}

/* photo lightbox */
.media img.zoomable { cursor: zoom-in; }
#lightbox { position: fixed; inset: 0; z-index: 999; background: rgba(12,10,6,.94);
  display: none; align-items: center; justify-content: center; }
#lightbox .lb-img { max-width: 94vw; max-height: 92vh; border-radius: 10px; object-fit: contain; }
#lightbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1; }
#lightbox .lb-close { top: 14px; right: 14px; }
#lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
#lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
#lightbox .lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 14px; background: rgba(255,255,255,.14); padding: 3px 12px; border-radius: 999px; }

/* Square upgrade: category chips, compact cards, detail actions, load more */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  background: #fff; border: 1px solid #d9cfb4; color: #5c5546;
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.chip.active { background: #f3c96b; border-color: #f3c96b; color: #26241f; }
.sq-card { cursor: pointer; }
.sq-card:focus-visible { outline: 2px solid #b8860b; outline-offset: 2px; }
.sq-cover {
  width: 100%; height: 200px; object-fit: cover; border-radius: 12px;
  display: block; background: #eee; margin-bottom: 10px;
}
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sq-head { margin: 8px 0 0; }
.loadmore { text-align: center; margin: 4px 0 18px; }
.grow-head { flex: 1; min-width: 0; }
button.toggle-on { background: #f3c96b; border-color: #f3c96b; }

/* Share page guest intro ("New to EETime?") */
.guest-intro h2 { margin: 2px 0 8px; font-size: 20px; }
.gi-lead { line-height: 1.55; margin: 0 0 14px; }
.gi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.gi-item { display: flex; gap: 12px; align-items: center; }
.gi-icon { width: 56px; height: 56px; object-fit: contain; flex: none; }
.gi-cta { text-align: center; margin-top: 18px; }
.gi-cta .btn { margin: 0 4px 6px; }
.gi-cta p { margin: 8px 0 0; }
