/* Shared by all three designs: the reader sheet and the live feed bits.
   Each design sets the --r-* tokens in its own styles.css. */
[hidden] { display: none !important; }
[data-author-only] { display: none !important; }
.is-author [data-author-only] { display: inline-block !important; }
[data-open] { cursor: pointer; }
.stats { font-size: 13px; opacity: .7; margin: 6px 0 10px; letter-spacing: .02em; }
.post-img img, .thumb.has-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img span { display: none; }

.reader { width: min(720px, 100vw); max-width: 100vw; max-height: 100dvh; margin: auto; padding: 0; border: 0; border-radius: 22px; background: var(--r-bg, #fff); color: var(--r-ink, #222); font-family: var(--r-body, system-ui, sans-serif); box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); overflow-y: auto; }
@media (max-width: 640px) { .reader { border-radius: 22px 22px 0 0; margin-bottom: 0; max-height: 92dvh; } }
.reader::backdrop { background: rgba(10, 10, 20, .55); backdrop-filter: blur(4px); }
.reader[open] { animation: reader-in 520ms cubic-bezier(.22, 1, .36, 1); }
@keyframes reader-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.reader-inner { position: relative; padding: 36px clamp(20px, 5vw, 48px) 40px; }
.reader-close { position: sticky; top: 0; float: right; margin: -18px -18px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--r-soft, #eee); color: inherit; font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.reader-kind { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--r-accent, #c55); margin: 0 0 8px; }
.reader-title { font-family: var(--r-head, Georgia, serif); font-size: clamp(28px, 5vw, 40px); line-height: 1.1; margin: 0 0 6px; font-weight: 500; }
.reader-date { font-size: 14px; opacity: .65; margin: 0 0 20px; }
.reader-img img { width: 100%; border-radius: 14px; margin-bottom: 20px; display: block; }
.reader-body { font-size: 18px; line-height: 1.7; }
.reader.is-passage .reader-body { font-family: var(--r-head, Georgia, serif); font-style: italic; font-size: 21px; }
.reader-chapter { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; padding-top: 22px; border-top: 1px solid var(--r-line, #e6e6e6); }
.reader-actions button, .reader-buy { font: inherit; font-size: 15px; font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--r-line, #ddd); background: transparent; color: inherit; cursor: pointer; text-decoration: none; }
.reader-heart[aria-pressed="true"] { background: var(--r-accent, #c55); border-color: var(--r-accent, #c55); color: var(--r-on-accent, #fff); }
.reader-heart.pop { animation: pop 420ms cubic-bezier(.22, 1, .36, 1); }
@keyframes pop { 40% { transform: scale(1.18); } }
.reader-buy { margin-left: auto; background: var(--r-accent, #c55); border-color: var(--r-accent, #c55); color: var(--r-on-accent, #fff); }
.reader-comments h3 { font-family: var(--r-head, Georgia, serif); font-size: 22px; margin: 0 0 12px; font-weight: 500; }
.reader-comments ol { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.reader-comments li { background: var(--r-soft, #f4f4f4); border-radius: 14px; padding: 12px 16px; }
.reader-comments li.by-author { border-left: 4px solid var(--r-accent, #c55); }
.reader-comments li p { margin: 0; }
.c-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 14px; margin-bottom: 4px !important; }
.c-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; background: var(--r-accent, #c55); color: var(--r-on-accent, #fff); padding: 1px 8px; border-radius: 999px; }
.c-date { opacity: .55; font-size: 12px; }
.reader-comments form { display: grid; gap: 10px; }
.reader-comments input, .reader-comments textarea { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--r-line, #ddd); background: var(--r-field, #fff); color: inherit; width: 100%; }
.reader-comments textarea { min-height: 80px; resize: vertical; }
.reader-comments button[type=submit] { justify-self: start; font: inherit; font-weight: 600; padding: 11px 20px; border-radius: 999px; border: 0; background: var(--r-ink, #222); color: var(--r-bg, #fff); cursor: pointer; }
.reader-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.reader-msg { font-size: 14px; margin: 0; min-height: 1em; }
@media (prefers-reduced-motion: reduce) { .reader[open], .reader-heart.pop { animation: none; } }

/* Community bits on every card: a heart readers can tap without opening the
   post, a comment link, how long ago, and the latest comment. */
.social { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 15px; margin-top: 14px; }
.social a { color: inherit; font-weight: 600; text-decoration: none; }
.social a:hover { text-decoration: underline; }
.heart-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--r-line, #ddd); background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px 6px 10px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: background 160ms, border-color 160ms; }
.heart-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.heart-btn[aria-pressed="true"] { border-color: var(--r-accent); color: var(--r-accent); }
.heart-btn[aria-pressed="true"] svg { fill: currentColor; }
.heart-btn.pop svg { animation: pop 420ms cubic-bezier(.22, 1, .36, 1); }
.last { font-size: 15px; line-height: 1.45; margin: 10px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--r-soft, #f4f4f4); }
.last::before { content: "Latest comment"; display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .heart-btn.pop svg { animation: none; } }
