/* ====================================================================
   Announcements — slate redesign page styles.
   Tokens come from extensions/index_new/styles.css (theme-light /
   theme-dark), linked alongside this file. Bare .an-* classes are
   page-unique (no collision with index_new / for_churches). Loaded for
   both the logged-in shell and the logged-out marketing page; $user_id
   picks which renders.

   The collapsible comment threads + the report/suggest modal keep their
   original utility-class markup (rendered by the per-page compiled
   css_style, which is theme-aware via the older --text-primary/--card-bg
   vars) so the existing AJAX/JS keeps working untouched. This sheet only
   restyles the primary surfaces: chrome, hero, tabs, feed cards, badges,
   action bars, voting, visibility, FAB.
   ==================================================================== */

.mv-root.an-root { background: var(--bg); color: var(--text-1); min-height: 60vh; --an-on-fill: #FFFFFF; }
.mv-root.an-root *, .mv-root.an-root *::before, .mv-root.an-root *::after { box-sizing: border-box; }

/* Clear the fixed 68px app top bar on the logged-in shell only (marker
   class keeps it off the logged-out marketing page). Done here rather than
   via the pt68px utility, which isn't in any stylesheet this redesign links
   — same reason Browse Groups/Friends moved it into page CSS. */
.mv-root.an-root-in { padding-top: 68px; }

/* ---------- Page wrap (logged-in) ---------- */
.an-page {
  display: flex; flex-direction: column; gap: 28px;
  box-sizing: border-box;
  max-width: 1440px; margin-left: auto; margin-right: auto; padding: 40px 64px 96px;
  flex: 1; min-width: 0;
}

/* ---------- Logged-in page head ---------- */
.an-head { padding-bottom: var(--sp-6); border-bottom: 1px solid var(--border); }
.an-head-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 14px;
}
.an-head-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.an-head h1 {
  font-family: var(--font-serif); font-size: 44px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.04; color: var(--text-1); margin: 0;
}
.an-head h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.an-head .sub { margin-top: 12px; font-size: 14.5px; color: var(--text-2); max-width: 560px; line-height: 1.55; }

/* ---------- Logged-out marketing hero ---------- */
.an-breadcrumb { display: flex; align-items: center; gap: 8px; padding: 28px 0 0; font-family: var(--font-sans); font-size: 13px; }
.an-breadcrumb a { color: var(--text-3); text-decoration: none; }
.an-breadcrumb a:hover { color: var(--text-1); }
.an-breadcrumb .sep { color: var(--text-muted); display: inline-flex; }
.an-breadcrumb .cur { color: var(--text-1); font-weight: 600; }

.an-hero { padding: 48px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.an-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 16px;
}
.an-hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.an-hero h1 {
  font-family: var(--font-serif); font-size: 64px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.02; color: var(--text-1); margin: 0; max-width: 760px;
}
.an-hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.an-hero .sub { margin-top: 22px; font-size: 16px; color: var(--text-2); line-height: 1.6; max-width: 620px; }
.an-hero-cta { display: flex; align-items: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.an-hero .an-hero-cta { padding-bottom: 36px; }
.an-hero-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px;
  background: var(--accent); color: var(--an-on-fill); border: 0; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 10px 24px -10px var(--accent);
}
.an-hero-btn:hover { filter: brightness(1.05); }
.an-hero-btn.ghost { background: var(--surface); color: var(--text-1); border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.an-hero-btn.ghost:hover { border-color: var(--border-strong); filter: none; }

/* Logged-out: constrain the tabbed feed to a readable column under the hero. */
.an-feed-wrap { max-width: 820px; margin: 0 auto; padding-bottom: 88px; }

/* ---------- Toolbar: tabs (left) + submit actions (right) ---------- */
.an-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.an-toolbar-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.an-tool-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); transition: filter .15s, border-color .15s, color .15s;
}
.an-tool-btn:hover { color: var(--text-1); border-color: var(--border-strong); }
.an-tool-btn svg { flex-shrink: 0; }
.an-tool-btn.ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.an-tool-btn.ghost:hover { filter: none; color: var(--text-1); border-color: var(--border-strong); }

/* ---------- Tabs ---------- */
.an-tabs {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  flex-wrap: wrap;
}
.an-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--text-3); text-decoration: none; cursor: pointer; transition: color .15s, background .15s; border: 0; background: transparent;
}
.an-tab:hover { color: var(--text-1); }
.an-tab.active { color: var(--text-1); background: var(--surface-2); font-weight: 600; }
.an-tab svg { flex-shrink: 0; }

/* ---------- Feed ---------- */
.an-feed { display: flex; flex-direction: column; gap: 18px; }
.an-empty {
  text-align: center; padding: 64px 24px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface);
}
.an-empty .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.an-empty h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--text-1); margin: 0 0 6px; }
.an-empty p { font-size: 14px; color: var(--text-2); margin: 0; }

/* ---------- Card ---------- */
.an-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden; transition: border-color .18s, box-shadow .18s;
}
.an-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-elev); }
.an-card-pad { padding: 22px 24px; }
.an-card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 14px; }
.an-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--surface-2); flex-shrink: 0; display: block; }
.an-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No-picture fallback: slate->coral gradient + bold white initial, matching
   the Friends feed avatars (fr-avatar). */
.an-avatar .mono { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--brand)); color: var(--an-on-fill); font-family: var(--font-sans); font-size: 15px; font-weight: 700; }
.an-head-col { flex: 1; min-width: 0; }

/* Badges — compact pills, with extra breathing room before the title below */
.an-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.an-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase;
  background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border);
}
.an-badge.accent  { background: var(--accent-soft);  color: var(--accent-strong); border-color: color-mix(in oklab, var(--accent) 24%, transparent); }
.an-badge.success { background: var(--success-soft); color: var(--success);       border-color: color-mix(in oklab, var(--success) 26%, transparent); }
.an-badge.warning { background: var(--warning-soft); color: var(--warning);       border-color: color-mix(in oklab, var(--warning) 26%, transparent); }
.an-badge.danger  { background: color-mix(in oklab, var(--danger) 12%, transparent); color: var(--danger); border-color: color-mix(in oklab, var(--danger) 26%, transparent); }
.an-badge.brand   { background: var(--brand-soft);   color: var(--brand);          border-color: color-mix(in oklab, var(--brand) 26%, transparent); }
.an-badge svg { flex-shrink: 0; }

.an-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-family: var(--font-sans); font-size: 12.5px; }
.an-meta a { color: var(--text-2); font-weight: 600; text-decoration: none; }
.an-meta a:hover { color: var(--text-1); }
.an-meta .date { color: var(--text-3); }
.an-meta .dot { color: var(--text-muted); }

/* Post title: clean sans heading (not the heavy serif display face), matching
   the calmer, more readable rhythm of the Friends feed. Scoped under .mv-root
   so it beats the `.mv-root h1..h4 { font-family: serif }` base rule. */
.mv-root .an-title { font-family: var(--font-sans); font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; color: var(--text-1); margin: 0; max-width: 640px; }
/* Post body: primary-tone text at the Friends feed's comfortable measure
   (14.5px / 1.6), capped to ~70 chars so long descriptions don't run the
   full card width. */
.an-body { margin-top: 10px; font-size: 14.5px; color: var(--text-1); line-height: 1.6; white-space: pre-wrap; max-width: 640px; }
.an-shot { margin-top: 14px; }
.an-shot img { max-width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); display: block; }

/* Admin response */
.an-admin { padding: 16px 24px; background: var(--accent-soft); border-top: 1px solid var(--border); }
.an-admin-h { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.an-admin-h .lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.an-admin-h .date { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); }
.an-admin-h svg { color: var(--accent-strong); }
.an-admin p { font-size: 14.5px; color: var(--text-1); line-height: 1.65; margin: 0; white-space: pre-wrap; max-width: 640px; }

/* ---------- Action bar (announcement like + comments) ---------- */
.an-actions { display: flex; align-items: center; gap: 18px; padding: 13px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
.an-act {
  display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--text-3); transition: color .15s;
}
.an-act:hover { color: var(--text-1); }
.an-act.js-like-announcement-btn:hover { color: var(--danger); }
.an-act.liked { color: var(--danger); }
.an-act svg { flex-shrink: 0; }

/* ---------- Voting (feature requests) ---------- */
.an-vote { padding: 16px 24px; background: var(--surface-2); border-top: 1px solid var(--border); }
.an-vote-q { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 12px; }
.an-vote-btns { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-vote-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s;
}
.an-vote-btn svg { flex-shrink: 0; }
.an-vote-btn .ct { font-family: var(--font-mono); font-size: 11px; }
.an-vote-btn.yes { background: var(--success-soft); color: var(--success); border-color: color-mix(in oklab, var(--success) 26%, transparent); }
.an-vote-btn.yes:hover { background: color-mix(in oklab, var(--success) 18%, transparent); }
.an-vote-btn.yes.on { background: var(--success); color: var(--an-on-fill); border-color: var(--success); }
.an-vote-btn.no { background: var(--surface); color: var(--text-3); border-color: var(--border); }
.an-vote-btn.no:hover { color: var(--text-1); border-color: var(--border-strong); }
.an-vote-btn.no.on { background: var(--text-3); color: var(--surface); border-color: var(--text-3); }
.an-vote-note { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); opacity: 0; transition: opacity .25s; }
.an-not-helpful-wrapper { display: inline-flex; align-items: center; gap: 12px; }
.an-not-helpful-wrapper:hover .an-vote-note { opacity: 1; }

/* ---------- Visibility toggle (owner, existing posts) ---------- */
.an-vis { display: flex; align-items: center; justify-content: flex-end; padding: 11px 24px; border-top: 1px solid var(--border); }
.an-vis-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-3); transition: all .15s;
}
.an-vis-btn:hover { color: var(--text-1); border-color: var(--border-strong); }
.an-vis-btn svg { flex-shrink: 0; }

/* ---------- Comments (collapsible) — slate frame around utility-class thread ---------- */
.an-comments { border-top: 1px solid var(--border); background: var(--surface-2); padding: 18px 24px; }
.an-comments .js-comment-input,
.an-comments .js-comment-input:focus {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); resize: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-1);
  font-family: var(--font-sans); font-size: 14px; outline: 0;
}
.an-comments .js-comment-input:focus { border-color: var(--accent); }
.an-comment-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; background: var(--surface); flex-shrink: 0; }
.an-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.an-comment-avatar .mono { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--brand)); color: var(--an-on-fill); font-family: var(--font-sans); font-size: 12px; font-weight: 700; }
.an-post-btn {
  display: inline-flex; align-items: center; padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--an-on-fill); border: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
}
.an-post-btn:hover { filter: brightness(1.05); }

/* ---------- Mobile FAB ---------- */
.an-fab { position: fixed; bottom: 24px; right: 24px; z-index: 150; }
.an-fab-btn {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--an-on-fill); border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 28px -8px var(--accent);
}
.an-fab-btn:hover { filter: brightness(1.05); }
.an-fab-menu {
  position: absolute; bottom: 66px; right: 0; min-width: 200px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-elev);
}
.an-fab-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 18px; background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--text-2); text-align: left; white-space: nowrap;
}
.an-fab-item:hover { background: var(--surface-2); color: var(--text-1); }
.an-fab-item .bug { color: var(--danger); }
.an-fab-item .feat { color: var(--success); }

/* ---------- Report / Suggest modal (slate frame; inner form keeps utility markup) ---------- */
.an-modal-overlay { position: fixed; inset: 0; background: rgba(11,20,38,0.55); z-index: 1000000; }
.an-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100%; max-width: 520px; z-index: 1000001; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-elev);
}
.an-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.an-modal-head h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--text-1); margin: 0; }
.an-modal-x { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--text-3); cursor: pointer; }
.an-modal-x:hover { background: var(--surface-2); color: var(--text-1); }
.an-modal-body { padding: 20px 22px 24px; max-height: 64vh; overflow-y: auto; }
.an-field { margin-bottom: 16px; }
.an-label { display: block; font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.an-label .opt { font-weight: 400; color: var(--text-3); }
.an-input, .an-textarea {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-1); font-family: var(--font-sans); font-size: 14px; outline: 0; transition: border-color .15s, background .15s;
}
.an-input:focus, .an-textarea:focus { border-color: var(--accent); background: var(--surface); }
.an-textarea { resize: none; }
.an-dropzone { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 16px; text-align: center; cursor: pointer; transition: border-color .15s; }
.an-dropzone:hover { border-color: var(--accent); }
.an-dropzone .hint { font-size: 13px; color: var(--text-3); margin: 0; }
.an-dropzone .ic { color: var(--text-muted); margin-bottom: 8px; display: inline-flex; }
.an-dropzone img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.an-dropzone .remove { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--danger); background: transparent; border: 0; cursor: pointer; }
.an-toggle-row {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.an-toggle-left { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.an-toggle-left svg { color: var(--text-3); }
.an-switch { position: relative; width: 40px; height: 22px; border-radius: var(--radius-pill); background: var(--border-strong); cursor: pointer; transition: background .25s; flex-shrink: 0; }
.an-switch.on { background: var(--accent); }
.an-switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--an-on-fill); transition: transform .25s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.an-switch.on .an-switch-knob { transform: translateX(18px); }
.an-toggle-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.an-modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.an-btn-primary { display: inline-flex; align-items: center; padding: 10px 20px; border-radius: var(--radius-pill); background: var(--accent); color: var(--an-on-fill); border: 0; cursor: pointer; font-family: var(--font-sans); font-size: 14px; font-weight: 600; }
.an-btn-primary:hover { filter: brightness(1.05); }
.an-btn-ghost { display: inline-flex; align-items: center; padding: 10px 20px; border-radius: var(--radius-pill); background: var(--surface); color: var(--text-2); border: 1px solid var(--border); cursor: pointer; font-family: var(--font-sans); font-size: 14px; font-weight: 600; }
.an-btn-ghost:hover { color: var(--text-1); border-color: var(--border-strong); }
.an-success { padding: 32px 24px; text-align: center; }
.an-success .ic { color: var(--success); margin-bottom: 16px; display: inline-flex; }
.an-success h4 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--text-1); margin: 0 0 8px; }
.an-success p { font-size: 14px; color: var(--text-2); margin: 0 0 24px; }

/* ---------- Desktop / mobile show-hide ---------- */
.an-only-mobile { display: none; }

/* ====================================================================
   Responsive
   ==================================================================== */
@media (max-width: 1600px) {
  .an-page { padding-left: 48px; padding-right: 48px; }
}
@media (max-width: 1180px) {
  .an-page { padding: 32px 40px 80px; }
}
@media (max-width: 900px) {
  .an-hero h1 { font-size: 50px; }
  .an-hero .sub { font-size: 15px; }
}
@media (max-width: 767px) {
  .an-page { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 720px) {
  .an-page { padding-top: 24px; padding-bottom: 60px; }
  .an-head h1 { font-size: 34px; }
  .an-hero { padding: 28px 0 8px; }
  .an-hero h1 { font-size: 40px; }
  .an-card-pad, .an-actions, .an-vote, .an-admin, .an-vis, .an-comments { padding-left: 18px; padding-right: 18px; }
  .an-title { font-size: 19px; }
  /* Stack the toolbar: full-width segmented tab row over full-width action buttons. */
  .an-toolbar { gap: 10px; flex-direction: column; align-items: stretch; }
  .an-tabs { display: flex; width: 100%; gap: 4px; }
  .an-tab { flex: 1; min-width: 0; justify-content: center; text-align: center; padding: 9px 6px; font-size: 12px; gap: 5px; }
  .an-tab svg { display: none; } /* drop tab icons on phone so the 3 labels fit without a scroller */
  /* Show the real labeled buttons on mobile (more discoverable than the FAB). */
  .an-toolbar-actions { display: flex; width: 100%; gap: 8px; }
  .an-tool-btn { flex: 1; justify-content: center; }
  .an-only-mobile { display: none; } /* FAB retired — the visible buttons replace it */
  .an-vote-btns { flex-direction: column; align-items: stretch; }
  .an-vote-btn { justify-content: center; }
  .an-not-helpful-wrapper { width: 100%; }
  .an-not-helpful-wrapper .an-vote-btn { width: 100%; }
  .an-modal-actions { flex-direction: column-reverse; }
  .an-modal-actions .an-btn-primary, .an-modal-actions .an-btn-ghost { width: 100%; justify-content: center; }
}

/* Phone portrait: hide the hero eyebrow/pill above the main H1 (section eyebrows stay). */
@media (max-width: 560px) { .mv-root .an-head-eyebrow { display: none !important; } }
