/* gazette-specific layout on top of sylve-studio.css */

.brand { font-weight: 700; text-decoration: none; font-size: 1.05rem; letter-spacing: -0.02em; }
.tagline { color: var(--muted); font-size: 0.9rem; margin: 0; }

.page { max-width: 62rem; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }
.muted { color: var(--muted); }
h1.page-title { font-size: 1.6rem; margin: 0.25rem 0 0.15rem; letter-spacing: -0.02em; }

/* Two-column layout: feed + right rail. Stacks on mobile. */
.layout { display: grid; grid-template-columns: 1fr 18rem; gap: 1.75rem; align-items: start; }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }

/* Status dot */
.dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 999px; vertical-align: middle; }
.dot.active { background: var(--positive); }
.dot.lapsed { background: var(--muted); }

/* Active status dots breathe slowly; lapsed stays static. */
.dot.active { animation: gz-breathe 2.6s ease-in-out infinite; }
@keyframes gz-breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--positive) 55%, transparent); }
  50% { opacity: 0.72; box-shadow: 0 0 0 0.18rem color-mix(in srgb, var(--positive) 0%, transparent); }
}

/* Live indicator: a small pulsing dot plus the word "live". Signals auto-update. */
.live-indicator { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.live-indicator .live-dot { width: 0.42rem; height: 0.42rem; border-radius: 999px; background: var(--positive); animation: gz-live-pulse 2s ease-in-out infinite; }
@keyframes gz-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* New entries fade + slide in. Applied by JS only to genuinely new items. */
.gz-new { animation: gz-enter 0.25s ease-out both; }
@keyframes gz-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Theme toggle: floating circular icon button, pinned bottom-right, on every
   page (including the logged-out wall). Inline SVG icon, follows theme vars. */
.theme-fab {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  right: calc(1rem + env(safe-area-inset-right, 0px));
  width: 44px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--muted);
  z-index: 50;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--fg) 12%, transparent);
}
.theme-fab:hover:not(:disabled) { color: var(--fg); border-color: var(--accent); }
.theme-fab svg { display: block; transition: opacity 0.11s ease; }
.theme-fab.swapping svg { opacity: 0; }

/* Header member chip: "you are <handle> · log out". */
.gz-me { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); }
.gz-me .chip-you strong { color: var(--fg); font-weight: 600; }
.gz-me .chip-logout { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line); }
.gz-me .chip-logout:hover { color: var(--fg); border-color: var(--accent); }

/* Brand wordmark reads as clickable. */
.brand { cursor: pointer; }
.brand:hover { color: var(--accent); text-decoration: underline; }

/* Explicit "back to feed" affordance at the top of content on inner pages. */
.backlink { margin: 0 0 0.75rem; font-size: 0.85rem; }
.backlink a { color: var(--muted); text-decoration: none; }
.backlink a:hover { color: var(--fg); text-decoration: underline; }

/* Respect reduced motion: no pulses, breathing, or entry animation. */
@media (prefers-reduced-motion: reduce) {
  .dot.active, .live-indicator .live-dot, .gz-new { animation: none; }
  .gz-new { opacity: 1; transform: none; }
  .theme-fab svg { transition: none; }
}

/* Feed entry */
.entry { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.entry:first-child { border-top: none; }
.entry-head { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.entry-head a { text-decoration: none; font-weight: 600; }
.entry-head a:hover { text-decoration: underline; }
.entry-date { color: var(--muted); font-size: 0.82rem; margin-left: auto; }

/* Rendered markdown body */
.md { font-size: 0.95rem; }
.md h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.9rem 0 0.3rem; }
.md p { margin: 0.3rem 0; }
.md ul { margin: 0.3rem 0; padding-left: 1.2rem; }
.md li { margin: 0.12rem 0; }
.md a { color: var(--fg); text-underline-offset: 2px; }
.md code, .md strong { }

/* Right rail members list */
.rail h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.member { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.member:first-of-type { border-top: none; }
.member a { text-decoration: none; font-weight: 600; }
.member a:hover { text-decoration: underline; }
.member .streak { margin-left: auto; color: var(--muted); font-size: 0.8rem; }

/* Footer note */
.footnote { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.footnote a { color: var(--fg); }

/* DM box */
.dmbox { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; margin: 1rem 0 1.5rem; background: var(--surface); }
.dmbox h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.dmbox textarea { width: 100%; min-height: 4.5rem; margin-bottom: 0.5rem; }
.dmbox .row { display: flex; align-items: center; gap: 0.6rem; }
.dm-answer { margin-top: 0.75rem; padding: 0.75rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); font-size: 0.92rem; white-space: pre-wrap; }
.dm-note { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }

/* join page code blocks */
pre.code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.5; }
.tmpl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; overflow-x: auto; font-size: 0.85rem; }
.rules li { margin: 0.35rem 0; }

/* profile / thread */
.bio { color: var(--muted); font-size: 0.95rem; margin: 0.2rem 0 1rem; max-width: 40rem; }
.msg { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.msg:first-of-type { border-top: none; }
.msg-head { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.3rem; }
.msg-head .who { font-weight: 600; }
.msg-head .when { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.msg-body { white-space: pre-wrap; font-size: 0.95rem; }

.topic-row { border-top: 1px solid var(--line); padding: 0.8rem 0; display: flex; align-items: baseline; gap: 0.6rem; }
.topic-row:first-of-type { border-top: none; }
.topic-row a { text-decoration: none; font-weight: 600; }
.topic-row a:hover { text-decoration: underline; }
.topic-row .meta { margin-left: auto; color: var(--muted); font-size: 0.82rem; }

/* The wall: shown to non-members and on 401/403. Paper card, monospace chrome. */
.wall { display: flex; justify-content: center; padding: 1.5rem 0 3rem; }
.wall-card {
  width: 100%; max-width: 34rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.5rem 1.4rem;
}
.wall-head { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; }
.wall-mark { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.wall-live { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.wall-live .live-dot { width: 0.42rem; height: 0.42rem; border-radius: 999px; background: var(--positive); animation: gz-live-pulse 2s ease-in-out infinite; }
.wall-eyebrow { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.7rem; }
.wall-thesis {
  font-family: var(--font-serif, Georgia, "Times New Roman", serif);
  font-size: 1.45rem; line-height: 1.3; color: var(--fg); margin: 0 0 0.7rem; letter-spacing: -0.01em;
}
.wall-sub { color: var(--muted); font-size: 0.92rem; line-height: 1.55; margin: 0 0 0.4rem; }
.wall-notice {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--fg); font-size: 0.85rem; padding: 0.55rem 0.7rem; margin: 0.8rem 0 0;
}
.wall-fallback { margin-top: 0.5rem; }
.wall-fallback > summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; list-style: none; }
.wall-fallback > summary:hover { color: var(--fg); }
.wall-fallback > summary::-webkit-details-marker { display: none; }
.wall-fallback[open] > summary { margin-bottom: 0.55rem; }
.wall-section { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.wall-h { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 0.5rem; }
.wall-p { font-size: 0.9rem; margin: 0 0 0.6rem; }
.wall-p a, .wall-note a { color: var(--fg); }
.wall-code { font-size: 0.78rem; margin: 0.4rem 0 0; }
.wall-login { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.wall-login input { flex: 1 1 14rem; min-width: 0; }
.wall-note { font-size: 0.82rem; color: var(--muted); margin: 0.55rem 0 0; }

/* join page: the members-only gate note up top. */
.join-gate {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 0.75rem 0.9rem; margin: 1rem 0 0; font-size: 0.9rem; line-height: 1.5;
}
.join-gate code { font-size: 0.85em; }

/* ---- Tweet card ---------------------------------------------------------- */
.tweet { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.tweet:first-child { border-top: none; }
.tw-head { display: flex; align-items: baseline; gap: 0.55rem; margin-bottom: 0.5rem; }
.tw-who { text-decoration: none; font-weight: 600; }
.tw-who:hover { text-decoration: underline; }
.tw-when { color: var(--muted); font-size: 0.82rem; margin-left: auto; }

/* The headline IS the tweet: large and prominent. */
.tw-headline { font-size: 1.15rem; line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 0.55rem; white-space: pre-wrap; word-break: break-word; }

.tw-img { display: block; margin: 0 0 0.6rem; }
.tw-img img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* Action bar: reactions + comment toggle. */
.tw-actions { display: flex; align-items: center; gap: 0.4rem; margin: 0.2rem 0 0.1rem; }
.tw-react, .tw-comment-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.28rem 0.55rem; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.82rem; line-height: 1;
}
.tw-react:hover, .tw-comment-btn:hover { color: var(--fg); border-color: var(--accent); }
.tw-react.on { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tw-glyph { font-size: 0.95rem; line-height: 1; }
.tw-count { font-variant-numeric: tabular-nums; min-width: 0.7em; text-align: center; }
.tw-comment-btn { margin-left: auto; }

/* Comment region. */
.tw-comments { margin: 0.7rem 0 0.2rem; padding: 0.7rem 0 0; border-top: 1px solid var(--line); }
.tw-thread { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; }
.tw-c { font-size: 0.9rem; }
.tw-c.tw-pending { opacity: 0.55; }
.tw-c-who { font-weight: 600; text-decoration: none; }
.tw-c-who:hover { text-decoration: underline; }
.tw-c-when { color: var(--muted); font-size: 0.78rem; margin-left: 0.4rem; }
.tw-c-body { white-space: pre-wrap; word-break: break-word; margin-top: 0.1rem; }
.tw-c-empty { color: var(--muted); font-size: 0.88rem; margin: 0; }
.tw-reply { display: flex; gap: 0.5rem; align-items: flex-end; }
.tw-reply-in { flex: 1 1 auto; min-height: 2.1rem; resize: vertical; }
.tw-reply-send { flex: 0 0 auto; }
.tw-reply-note { color: var(--muted); font-size: 0.82rem; margin: 0.4rem 0 0; }

/* Details disclosure holding the structured body. Collapsed by default. */
.tw-details { margin-top: 0.7rem; }
.tw-details > summary { cursor: pointer; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; list-style: none; }
.tw-details > summary::-webkit-details-marker { display: none; }
.tw-details > summary::before { content: "\25B8"; display: inline-block; margin-right: 0.35rem; transition: transform 0.12s ease; }
.tw-details[open] > summary::before { transform: rotate(90deg); }
.tw-details > summary:hover { color: var(--fg); }
.tw-details .md { margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .tw-details > summary::before { transition: none; }
}

/* ---- Copy button on snippets -------------------------------------------- */
.copyable { position: relative; }
.gz-copy {
  position: absolute; top: 0.4rem; right: 0.4rem;
  padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.72rem; line-height: 1.4;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.gz-copy:hover { color: var(--fg); border-color: var(--accent); }
.gz-copy.copied { color: var(--positive); border-color: var(--positive); }
