/* the photo viewer stays dark in both themes */
:root { --viewer: rgba(8, 10, 12, 0.94); --viewer-ink: rgba(255, 251, 247, 0.78); --viewer-btn: rgba(255, 251, 247, 0.12); --viewer-btn-hover: rgba(255, 251, 247, 0.22); }
.jr-sec { margin-top: clamp(56px, 9vw, 128px); }
.page { padding-bottom: 0; }
.page .wrap { max-width: calc(1520px + var(--edge) * 2); }
.jr-mast .h1 { letter-spacing: var(--ls-display); }
.jr-archive { margin-top: 0; }
/* follow buttons stand with the other page controls at 44px */
/* one follow component: the round plus / check button, as in the feed */
.follow-ico { display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; color: var(--ink); }
.follow-ico:hover { border-color: var(--ink); }
.follow-ico[aria-pressed="true"] { border-color: var(--ok); color: var(--ok); }

/* ---------- masthead ---------- */
.jr-mast { display: grid; gap: 12px; }

/* ---------- shared bits ---------- */
.jr-by { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--quiet); font-size: var(--fs-small); line-height: var(--lh-small); }
.jr-by .avatar { width: 28px; height: 28px; font-size: var(--fs-caption-tight); }
.jr-by b { overflow: hidden; color: var(--ink-2); font-weight: var(--fw-ui); white-space: nowrap; text-overflow: ellipsis; }
.jr-by span { white-space: nowrap; }
.avatar--logo { background: var(--bg-soft); border: 1px solid var(--line); }
.avatar--logo img { width: 62%; height: 62%; border-radius: 0; object-fit: contain; }
.verified { width: 16px; height: 16px; }
.verified .icon { width: 10px; height: 10px; }
.jstats { position: relative; z-index: 2; display: flex; align-items: center; gap: 2px; color: var(--quiet); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.jstat { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: inherit; font-size: inherit; font-weight: var(--fw-ui); }
.jstat .icon { width: 17px; height: 17px; }
button.jstat:hover { background: var(--bg-soft); color: var(--ink); }
button.jstat[aria-pressed="true"] { color: var(--cta); }
button.jstat[aria-pressed="true"] .icon { fill: currentColor; }
@media (prefers-reduced-motion: no-preference) {
    button.jstat[aria-pressed="true"] .icon { animation: pop 320ms var(--ease-out); }
    @keyframes pop { 40% { transform: scale(1.25); } }
}
/* one fact on the photo: distance and difficulty, or the kind of publication */
.jr-chip { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--scrim-66); color: var(--on-accent); font-size: var(--fs-caption); font-weight: var(--fw-button); line-height: var(--lh-caption); font-variant-numeric: tabular-nums; }
.jr-chip .icon { width: 14px; height: 14px; }
.jr-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jr-meta .jr-by { flex: 1 1 auto; }
.jr-meta .jstats { flex: none; }
.jr-by time { white-space: nowrap; }

/* ---------- lead ---------- */

/* ---------- archive ---------- */
.jr-archive__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.jr-archive__head h2:focus { outline: none; }
.jr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 20px; padding-bottom: 24px; margin: 32px 0; border-bottom: 1px solid var(--line); }
.jr-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.jr-filters .chip { min-height: 44px; padding: 0 16px; }
.jr-tools { display: flex; align-items: center; gap: 12px; }
.jr-sort .select { width: 200px; border-color: var(--field-edge); border-radius: 999px; }
.jr-filters .chip .n { color: var(--quiet); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.jr-filters .chip[aria-pressed="true"] .n { color: inherit; opacity: 0.72; }
.jr-search { display: flex; align-items: center; gap: 8px; width: 280px; min-height: 44px; padding: 0 4px 0 16px; border: 1px solid var(--field-edge); border-radius: 999px; background: var(--surface); color: var(--quiet); }
.jr-search input { flex: 1; align-self: stretch; min-width: 0; min-height: 42px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: var(--fs-body); }
.jr-search input::placeholder { color: var(--quiet); }
.jr-search input::-webkit-search-cancel-button { display: none; }
.jr-search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-a-18); }
.jr-search__clear { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--ink-2); }
.jr-search__clear .icon { width: 15px; height: 15px; }
.jr-status { margin: -12px 0 24px; color: var(--copy); font-size: var(--fs-small); }
.jr-status b { color: var(--ink); }

.jr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; }
.jcard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; min-width: 0; }
.jcard__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: var(--bg-soft); box-shadow: 0 0 0 1px var(--line); transition: box-shadow 200ms, transform 300ms var(--ease-out); }
.jcard__media img { width: 100%; height: 100%; object-fit: cover; }
.jcard:hover .jcard__media { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.jcard__title { font-size: var(--fs-h4); line-height: var(--lh-h4); }
.jcard:hover .jcard__title a { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }
mark { padding: 0 2px; border-radius: 3px; background: var(--orange-soft); color: inherit; box-shadow: inset 0 -2px 0 var(--orange); }
.jr-plain { display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; height: 100%; background: var(--bg-soft); color: var(--quiet); }
.jr-plain img { width: 44px; height: 44px; }
.jr-plain b { color: var(--ink-2); font: var(--fw-title) var(--fs-small)/var(--lh-small) var(--font-text); }
.jr-plain__ring { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); color: var(--link); }
.jr-plain__ring .icon { width: 26px; height: 26px; }
.jr-more { display: flex; justify-content: center; margin-top: 40px; }
.jr-empty b { color: var(--ink); }


/* ---------- authors: three people, a light list ---------- */
.jr-authors h2 { margin-bottom: 24px; }
.jr-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 40px; }
.jr-person { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.jr-person__who { display: flex; align-items: center; gap: 16px; min-width: 0; min-height: 56px; border-radius: var(--r); }
.jr-person__who > span:last-child { display: grid; min-width: 0; }
.jr-person__who b { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: var(--fw-title); line-height: var(--lh-h4); }
.jr-person__who b + span { color: var(--quiet); font-size: var(--fs-small); line-height: var(--lh-small); }
.jr-person__who:hover b { text-decoration: underline; }

/* ---------- invite ---------- */
.jr-invite { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding: clamp(24px, 4vw, 56px); border-radius: var(--r-lg); background: var(--orange-soft); }
.jr-invite__copy { display: grid; gap: 24px; justify-items: start; }
.jr-invite__photo { overflow: hidden; border-radius: var(--r-lg); }
.jr-invite__photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------- quick posts: one calm column ---------- */
.qp { max-width: 760px; margin-inline: auto; }
.qp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.qp-compose { display: flex; align-items: center; gap: 12px; padding: 16px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.qp-compose input { flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border: 1px solid var(--field-edge); border-radius: 999px; background: var(--bg-soft); color: var(--ink); font-size: var(--fs-body); }
.qp-compose input:focus { outline: none; border-color: var(--orange); background: var(--surface); }
.qp-note { margin-top: 12px; }
.qp-feed { display: grid; gap: 40px; margin-top: 40px; }
.qp-feed .post { gap: 16px; padding: 24px; box-shadow: none; }
.qp-feed .post__head .follow-ico { margin-left: auto; }
.qp-feed .post__who a:hover b { text-decoration: underline; }
.qp-feed .post__who span { font-size: var(--fs-small); }
.qp-text { color: var(--ink-2); font-size: var(--fs-body); line-height: var(--lh-body); }
.qp-text.is-clamped { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qp-line { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.qp-line .qp-text { min-width: 0; }
.qp-more { flex: none; padding: 0; border: 0; background: none; color: var(--link); font: var(--fw-button) var(--fs-button)/var(--lh-button) var(--font-text); }
.qp-more:hover { text-decoration: underline; }
.qp-media { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; overflow: hidden; border-radius: 12px; }
.qp-media a { position: relative; display: block; overflow: hidden; background: var(--bg-soft); }
.qp-media img { width: 100%; height: 100%; object-fit: cover; }
.qp-media a:hover { opacity: 0.9; }
.qp-media--1 a { grid-column: span 6; aspect-ratio: 16 / 10; }
.qp-media--4 a { grid-column: span 3; aspect-ratio: 4 / 3; }
.qp-media--4 a:first-child { grid-column: span 6; aspect-ratio: 16 / 9; }
.qp-media .more-n { position: absolute; inset: 0; display: grid; place-items: center; background: var(--scrim-55); color: var(--on-accent); font: var(--fw-heading) var(--fs-h3)/var(--lh-h3) var(--font-display); }
.qp-suggest { width: min(100%, 420px); padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; }

/* ---------- photo viewer ---------- */
.lbx { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--viewer); color: var(--on-accent); overscroll-behavior: contain; }
.lbx::backdrop { background: var(--viewer); }
.lbx[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lbx__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0 24px; color: var(--viewer-ink); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.lbx__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 12px 76px 28px; }
.lbx__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.lbx__btn { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--viewer-btn); color: var(--on-accent); }
.lbx__btn:hover { background: var(--viewer-btn-hover); }
.lbx__btn:focus-visible { outline-color: var(--focus); }
.lbx__nav { position: absolute; top: 50%; translate: 0 -50%; }
.lbx__prev { left: 16px; }
.lbx__next { right: 16px; }

@media (max-width: 1023px) {
    .jr-people { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
    .jr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jr-invite { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .jr-bar { display: grid; }
    .jr-filters { flex-wrap: nowrap; margin-inline: calc(var(--edge) * -1); padding-inline: var(--edge); overflow-x: auto; scrollbar-width: none; }
    .jr-filters::-webkit-scrollbar { display: none; }
    .jr-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .jr-search { width: 100%; }
    .jr-sort .select { width: 164px; }
    .jr-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .jr-invite .btn { width: 100%; }
    .qp-feed { gap: 28px; margin-top: 28px; }
    .qp-feed .post { padding: 20px; }
    .lbx__stage { padding: 8px 8px 72px; }
    .lbx__nav { top: auto; bottom: 12px; translate: none; }
    .lbx__prev { left: calc(50% - 56px); }
    .lbx__next { right: calc(50% - 56px); }
}
/* touch: every control at least 44 x 44; text links grow their box, not the layout */
@media (pointer: coarse) {
    .jr-filters .chip { min-height: 44px; }
    .jr-search { min-height: 48px; }
    .jr-search input { min-height: 44px; }
    .jr-search__clear { width: 44px; height: 44px; }
    .jcard__title a, .qp-feed .post__who a { display: inline-block; padding-block: 12px; margin-block: -12px; }
    .qp-feed .post__act { min-width: 44px; justify-content: center; }
    .qp-feed .post__head > a { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
    .qp-more { min-width: 44px; min-height: 44px; }
    .qp-suggest .person__name { display: inline-flex; align-items: center; min-height: 44px; }
    .ftr a { display: flex; align-items: center; min-height: 44px; padding-block: 0; }
}
@media (max-width: 767px) {
    .ftr__brand p { font-size: var(--fs-body); }
}

/* Server-rendered forms and progressive pagination use the concept components. */
.journal-page .jr-tools { margin: 0; }
.journal-page .jr-sort { display: block; }
.journal-page .jr-empty { grid-column: 1 / -1; }
.journal-page .jr-grid.qp-feed { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin-inline: auto; }
.journal-page .pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.journal-page .pager [aria-disabled] { opacity: .5; }
.journal-page .jr-by b { min-width: 0; }
.journal-page .jr-by > span:last-child { flex: none; }
.journal-page .jr-grid[aria-busy="true"] { opacity: .6; }
.journal-page [data-journal-live-status] { margin-bottom: 16px; color: var(--quiet); font-size: var(--fs-small); }
@media (max-width: 767px) {
    .journal-page .jr-meta { flex-wrap: wrap; }
}

@media (max-width: 767px) {
    .journal-page .jr-tools { width:100%; grid-template-columns:minmax(0,1fr); gap:10px; }
    .journal-page .jr-search, .journal-page .jr-sort, .journal-page .jr-sort .select { width:100%; min-width:0; }
    .journal-page .jr-search input { font-size:16px; }
    .journal-page .jr-grid:not(.qp-feed) .jcard__media { margin-inline:-16px; border-radius:0; }
}
