/* ==========================================================================
   Info module, member side: the feed (cards), the article page and the .post-body typography.
   .post-body is also what the console editor uses for its canvas (assets/css/info-editor.css), so a post looks the
   same while it is written and when members read it.
   Built on the shared tokens/components (base.css, ui.css, shell.css). Motion only touches transform + opacity.
   ========================================================================== */

/* keep focused / scrolled-to elements clear of the sticky top bar and the bottom tab bar; a bouncing card never scrolls the page sideways */
html:has(.shell--app) { scroll-padding-top: calc(var(--topbar-h) + var(--safe-t) + 16px); scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); }
.app-frame { overflow-x: clip; }

/* ----------------------------------------------------------------- greeting */
.info-head { position: relative; }
.info-h1 { padding-right: 88px; font-size: clamp(2.1rem, 10vw, 2.9rem); line-height: 1; letter-spacing: -.04em; }
.info-h1 mark {
  display: inline-block; padding: 0 .2em .04em; color: var(--ink); background: var(--lime);
  border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: var(--shadow-sm); transform: rotate(-2.5deg);
}
.info-sub { max-width: 30ch; margin-top: 12px; font-weight: 600; color: var(--ink-2); }
.info-head__art { position: absolute; top: 0; right: 4px; width: 84px; height: 62px; pointer-events: none; }
.info-head__dot { position: absolute; display: grid; place-items: center; border: var(--bw) solid var(--ink); border-radius: 50%; animation: float 6s ease-in-out infinite; }
.info-head__dot .icon { width: 52%; height: 52%; }
.info-head__dot--a { top: 0; right: 0; width: 54px; height: 54px; background: var(--blue); box-shadow: var(--shadow-sm); --rot: 8deg; }
.info-head__dot--b { bottom: 0; left: 0; width: 30px; height: 30px; background: var(--pink); --rot: -10deg; animation-delay: -2.5s; }

/* staff shortcut above the feed */
.info-staff {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 10px 12px;
  font-size: .9rem; font-weight: 700; background: var(--blue-soft); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.info-staff > span { display: inline-flex; align-items: center; gap: 8px; }
.info-staff .btn { flex: none; min-height: 44px; white-space: nowrap; }

.info-rise { margin-top: 20px; animation: info-pop .55s var(--ease-pop) both; }
@keyframes info-pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.info-rise .btn--sm { min-height: 44px; }

/* ----------------------------------------------------------------- feed cards */
.info-list { display: grid; gap: 24px; margin: 22px 0 0; padding: 0; list-style: none; }
.info-item { min-width: 0; }
.info-card { padding: 0; }
.info-card.is-pinned { background: var(--sun-soft); }
.info-card:focus-visible { border-radius: var(--r-lg); }

.info-cover {
  position: relative; isolation: isolate; aspect-ratio: 2 / 1; overflow: hidden; background: var(--paper-2);
  border-bottom: var(--bw) solid var(--ink); border-radius: calc(var(--r-lg) - var(--bw)) calc(var(--r-lg) - var(--bw)) 0 0;
}
.info-cover__img { width: 100%; height: 100%; object-fit: cover; }

/* generated banner for posts without a cover photo */
.info-art {
  --a: #ffd23f; --b: #f79b22; position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 12% 112%, rgba(255, 255, 255, .4) 0 26%, transparent 27%),
    radial-gradient(circle at 96% -8%, rgba(255, 255, 255, .3) 0 30%, transparent 31%),
    linear-gradient(135deg, var(--a), var(--b));
}
.info-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(22, 18, 15, .14) 1.4px, transparent 1.6px); background-size: 16px 16px; }
.info-art .icon { position: relative; z-index: 1; width: 22%; height: auto; aspect-ratio: 1; color: var(--ink); stroke-width: 1.5; filter: drop-shadow(4px 4px 0 rgba(255, 255, 255, .55)); transform: rotate(-9deg); animation: bob 4.5s ease-in-out infinite; }
.info-art--1 { --a: #ffd23f; --b: #f79b22; } .info-art--2 { --a: #66c6ef; --b: #1f98d1; } .info-art--3 { --a: #ff7ab6; --b: #971958; }
.info-art--4 { --a: #c9e04e; --b: #19a974; } .info-art--5 { --a: #f79b22; --b: #e8392a; } .info-art--6 { --a: #1f98d1; --b: #971958; }

.info-pin { position: absolute; z-index: 2; top: 10px; left: 10px; box-shadow: var(--shadow-sm); transform: rotate(-3deg); }

.info-body { display: grid; gap: 8px; padding: 14px 16px 16px; }
.info-title { font-size: 1.3rem; line-height: 1.12; letter-spacing: -.025em; }
.info-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.info-meta { display: flex; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.info-by { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.info-by__name { max-width: 16ch; overflow: hidden; font-weight: 800; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.info-date { flex: none; white-space: nowrap; }
.info-meta .info-date::before { content: "·"; margin-right: 10px; }
.info-more-hint {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; margin-left: auto; color: var(--ink);
  background: var(--lime); border: 2.5px solid var(--ink); border-radius: 50%; transition: transform .2s var(--ease-pop);
}
@media (hover: hover) { a.card:hover .info-more-hint { transform: translateX(3px) rotate(-8deg); } }

.info-more { margin-top: 24px; }
.info-more .btn { white-space: nowrap; }

/* ----------------------------------------------------------------- article page */
.post-banner { margin-bottom: 16px; }
.post-hero { margin: 0 0 20px; overflow: hidden; background: var(--paper-2); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.post-hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.post-head { display: grid; gap: 12px; margin-bottom: 22px; }
.post-chips { margin: 0; }
.post-title { font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 1.05; letter-spacing: -.035em; }
.post-by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 16px; font-size: .9rem; font-weight: 700; color: var(--ink-2); border-bottom: 3px dashed rgba(22, 18, 15, .25); }
.post-by .info-by__name { max-width: 22ch; }
.post-staff { margin: 0; }
.post-staff .btn { min-height: 44px; }
.post-foot { margin-top: 30px; }
.post-foot .btn { white-space: nowrap; }
.back-btn[data-share] { width: 44px; height: 44px; }

/* ----------------------------------------------------------------- .post-body: blog typography */
.post-body { font-size: 1.06rem; font-weight: 500; line-height: 1.7; color: var(--ink); overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin: 0 0 1em; }
/* (the sanitiser turns h1 into h2 and h4-h6 into h3; the editor canvas may still show a pasted h1/h4 until the post is saved) */
.post-body h1, .post-body h2 { margin: 1.7em 0 .55em; font-size: clamp(1.45rem, 5.5vw, 1.85rem); line-height: 1.1; letter-spacing: -.03em; }
.post-body h3, .post-body h4, .post-body h5, .post-body h6 { margin: 1.5em 0 .45em; font-size: 1.22rem; line-height: 1.15; color: var(--plum); }
.post-body strong { font-weight: 800; }
.post-body a { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post-body a:hover { color: var(--plum); }

/* (the editor canvas is a .post-body too, but Quill draws its own list markers: see info-editor.css) */
.post-body:not(.ql-editor) ul, .post-body:not(.ql-editor) ol { margin: 0 0 1em; padding-left: 1.5em; }
.post-body:not(.ql-editor) li { margin: .3em 0; padding-left: .2em; }
.post-body li::marker { font-weight: 800; color: var(--plum); }
.post-body:not(.ql-editor) li > ul, .post-body:not(.ql-editor) li > ol { margin: .3em 0 0; }

.post-body blockquote {
  margin: 1.3em 0; padding: .8em 1em .8em 1.1em; font-weight: 600; background: var(--sun-soft);
  border-left: 8px solid var(--ink); border-radius: 0 var(--r) var(--r) 0;
}
.post-body blockquote > :last-child { margin-bottom: 0; }
/* the editor writes one <blockquote> per line: neighbours read as one quote */
.post-body blockquote + blockquote { margin-top: 0; padding-top: .3em; border-top-right-radius: 0; }
.post-body blockquote:has(+ blockquote) { margin-bottom: 0; padding-bottom: .3em; border-bottom-right-radius: 0; }

.post-body pre {
  margin: 1.3em 0; padding: 14px 16px; overflow-x: auto; font: 500 .9rem/1.55 ui-monospace, Menlo, Consolas, monospace; tab-size: 2;
  color: #fff; white-space: pre; background: var(--ink); border-radius: var(--r);
}
.post-body code { padding: .1em .38em; font: 600 .9em ui-monospace, Menlo, Consolas, monospace; background: var(--paper-2); border: 1.5px solid rgba(22, 18, 15, .3); border-radius: 6px; }
.post-body hr { margin: 1.9em 0; border: 0; border-top: 3px dashed var(--ink); opacity: .35; }

.post-body img {
  display: inline-block; max-width: 100%; height: auto; margin: .4em 0; vertical-align: bottom; background: var(--paper-2);
  border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.post-body figure { margin: 1.4em 0; text-align: center; }
.post-body figcaption { margin-top: .6em; font-size: .88rem; font-weight: 600; color: var(--ink-2); }

.post-body .ql-align-center { text-align: center; }
.post-body .ql-align-right { text-align: right; }
.post-body .ql-align-justify { text-align: justify; }
.post-body .ql-indent-1 { padding-left: 2em; }
.post-body .ql-indent-2 { padding-left: 4em; }
.post-body .ql-indent-3 { padding-left: 6em; }
