:root {
  color-scheme: light dark;
  --bg: #f6f6f4;
  --surface: rgba(255, 255, 255, .86);
  --surface-solid: #fff;
  --surface-soft: rgba(238, 238, 234, .8);
  --text: #17191f;
  --muted: #6b7079;
  --line: rgba(23, 25, 31, .1);
  --line-strong: rgba(23, 25, 31, .18);
  --primary: #e55235;
  --primary-strong: #c44129;
  --primary-soft: rgba(229, 82, 53, .08);
  --danger: #b4423a;
  --gold: #a16207;
  --gold-soft: #fbf1dc;
  --shadow: 0 24px 80px rgba(23, 25, 31, .08);
  --shadow-small: 0 12px 36px rgba(23, 25, 31, .06);
  --on-primary: #fff;
  --on-danger: #fff;
  --radius-xl: 24px;
  --radius-l: 16px;
  --radius-m: 10px;
  /* Card width in the visual grids: a wider window gets more columns, not wider cards. */
  --tile: 20rem;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open { overflow: hidden; }

button, input, textarea, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
img { max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
h1, h2, h3 { margin-top: 0; }
h2 { margin-bottom: 0; font-size: 1.2rem; }
h3 { margin: 0; font-size: 1rem; }
p { margin-top: 0; }

/* ---------- brand and buttons ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-decoration: none;
}
.brand-logo { width: 1.75rem; height: 1.35rem; }
.brand-hero { font-size: clamp(2.2rem, 7vw, 3.2rem); gap: .9rem; }
.brand-hero .brand-logo { width: 3.4rem; height: 2.6rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  font-size: .88rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: var(--on-primary); background: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-strong); }
.button-secondary { border-color: var(--line-strong); background: var(--surface-soft); }
.button-secondary:hover:not(:disabled) { border-color: var(--primary); }
.button-quiet { background: transparent; }
.button-quiet:hover:not(:disabled) { background: var(--surface-soft); }
.button-danger { color: var(--on-danger); background: var(--danger); }
.button-danger:hover:not(:disabled) { filter: brightness(.94); }
.button-small { padding: .38rem .7rem; font-size: .8rem; }
.button-wide { width: 100%; }

:where(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- public page ---------- */

.public .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  height: 2.6rem;
  padding: 0 clamp(.75rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  transition: transform .25s ease;
}
/* Scrolling down slides the bar away so the list has the whole screen; scrolling up brings it back. */
.public .topbar.is-hidden { transform: translateY(-100%); }
.public .brand { font-size: .95rem; gap: .4rem; }
.public .brand-logo { width: 1.35rem; height: 1.05rem; }
.tabs {
  display: flex;
  gap: .15rem;
  min-width: 0;
  overflow-x: auto;
  scroll-padding-inline: 2rem;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
/* Centred while there is room, scrollable from the first tab when there is not. */
.tabs > :first-child { margin-left: auto; }
.tabs > :last-child { margin-right: auto; }
.tab {
  text-decoration: none;
  padding: .3rem .7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, background-color .18s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-current="true"] { color: var(--primary-strong); background: var(--primary-soft); }
/* The strip moves only to bring the page's tab into view, no further than it must, with a little
   of the next tab beside it. A page opens that way before its first frame; where this is
   unsupported, the page's script does it. */
.tab[aria-current="true"] { scroll-initial-target: nearest; scroll-snap-align: end; }
.tools { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; }
.tools .button-small { padding: .25rem .55rem; font-size: .76rem; }
.space-link { text-decoration: none; }
/* The source on GitHub, right of the language switch; phones keep the room for the tabs. */
.tools .source-link { padding: .25rem .4rem; }
@media (max-width: 560px) { .tools .source-link { display: none; } }

.public .shell { max-width: 46rem; margin: 0 auto; padding: .75rem 1.25rem 3rem; }

/* The picture tabs fill the window; text, ALL included, keeps the reading measure. */
.public:is(.card-topic, .w-topic, .travel-topic) .shell { max-width: none; padding-inline: clamp(1.25rem, 3vw, 3rem); }
.public:is(.card-topic, .w-topic, .travel-topic) .back-to-top { right: calc(1rem + env(safe-area-inset-right, 0px)); }

.back-to-top {
  position: fixed;
  z-index: 9;
  right: max(calc(1rem + env(safe-area-inset-right, 0px)), calc((100% - 46rem) / 2 - 3.75rem));
  top: 61.8%;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
  box-shadow: var(--shadow-small);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(calc(-50% + 6px));
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease, color .18s ease, border-color .18s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%);
}
.back-to-top:active:not(:disabled) { transform: translateY(calc(-50% + 1px)); }
@media (hover: hover) {
  .back-to-top:hover { color: var(--primary-strong); border-color: var(--primary); }
}

.broadcast-strip {
  min-width: 0;
  margin: -.2rem 0 .3rem;
  padding: 0 0 .3rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
/* The embed shows the strip after its own request; keeping its line stops the feed below from moving. */
.broadcast-strip[hidden] { display: block; visibility: hidden; }
.broadcast-strip__value {
  display: block;
  min-height: 1.35em;
  overflow: hidden;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.broadcast-strip__value[href] { color: var(--primary-strong); }
.broadcast-strip__value[href]:hover { text-decoration: underline; }

.status { min-height: 1.5rem; padding: .5rem 0; text-align: center; }
.status:empty { min-height: 0; padding: 0; }

.insight-heading {
  padding: .85rem 0 .7rem;
  border-bottom: 2px solid var(--text);
  text-align: center;
}
.insight-heading h2 { margin: 0; font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.25; }
@media (min-width: 769px) {
  .insight-heading h2 {
    width: min(64rem, calc(100vw - 3rem));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}
.insight-date { margin-bottom: .25rem; color: var(--primary-strong); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.insight-hotspots-date { margin: 0; white-space: nowrap; text-transform: none; }
.insight-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: .9rem 0 1rem; }
.insight-gallery.is-single { grid-template-columns: 1fr; }
.insight-gallery.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insight-gallery-item { min-width: 0; margin: 0; }
.insight-gallery-media { display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: var(--radius-m); background: var(--surface-soft); }
.insight-gallery-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.insight-gallery-item figcaption { padding: .35rem 0 0; font-size: .72rem; line-height: 1.4; }
.insight-gallery-item figcaption a { color: var(--primary-strong); text-decoration: none; }
.insight-gallery-item figcaption a:hover { text-decoration: underline; text-underline-offset: .15em; }
.insight-change { margin: .65rem 0 1.15rem; padding: .7rem .85rem; border-left: 3px solid var(--primary); background: var(--primary-soft); }
.insight-change-heading { display: flex; align-items: baseline; gap: .45rem; margin-bottom: .2rem; }
.insight-change h3 { margin-bottom: 0; font-size: .82rem; }
.insight-change-meta { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.insight-change p { margin: 0; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.insight-group .group-title { margin-top: 1.25rem; padding-bottom: .4rem; border-bottom-width: 1px; }
.insight-group .group-title h2 { font-size: .9rem; }
.insight-hotspot .item-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  margin-bottom: .25rem;
}
.insight-angle { margin: .4rem 0 0; font-size: .92rem; line-height: 1.6; }
.insight-angle-label { margin-right: .5rem; color: var(--primary-strong); font-weight: 600; }
.insight-figure { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: .25rem 1rem; align-items: baseline; }
.insight-figure-value { color: var(--primary-strong); font-size: 1.4rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.insight-sources { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .55rem; font-size: .75rem; }
.insight-sources a { color: var(--primary-strong); text-decoration: none; }
.insight-sources a:hover { text-decoration: underline; text-underline-offset: .15em; }
.insight-citation { color: var(--primary-strong); text-decoration: underline; text-underline-offset: .15em; overflow-wrap: anywhere; }

@media (max-width: 768px) {
  /* Horizontal swipes switch tabs (public.js), so the browser must not take them over. */
  .public :is(.worth, .digest),
  .public:is(.catalog, .travel) .shell { touch-action: pan-y pinch-zoom; }
  .public .shell.is-loading {
    touch-action: pan-y pinch-zoom;
    min-height: calc(100vh - 2.6rem);
    min-height: calc(100dvh - 2.6rem);
  }
}

.day-block {
  content-visibility: auto;
  contain-intrinsic-size: auto 28rem;
}
.day-divider, .group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--text);
}
.day-divider { margin: 2rem 0 .1rem; }
.day-divider h2 { margin: 0; font-size: 1rem; font-weight: 750; letter-spacing: .01em; }
.day-block.day-heading-hidden > .group:first-of-type .group-title { margin-top: .5rem; }
.day-block:not(:first-child) > .group:first-of-type .group-title { margin-top: .8rem; }
/* 精选 opens ALL: picture cards four to a row, two on phones. */
.worth-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin: 1rem 0 1.6rem; }
.worth .group-title a { color: inherit; text-decoration: none; }
.worth-card .item-meta { margin-top: .6rem; font-size: .75rem; }
.worth-card .item-title { margin-top: .3rem; font-size: .95rem; line-height: 1.5; }
.worth-card .item-title a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* A card without a picture gives its room to the whole title. */
.worth-card:not(:has(.image-news-media)) .item-title a { -webkit-line-clamp: 6; }
@media (max-width: 768px) {
  .worth-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .worth-card .item-title a { -webkit-line-clamp: 3; }
}
/* Read counts and list pages, shared by Reads, 分享 and 解说. */
.read-views { display: inline-flex; align-items: center; vertical-align: middle; gap: .3rem; white-space: nowrap; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.reads-pagination, .read-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; font-size: .85rem; }
.reads-pagination a, .read-actions a { color: var(--muted); text-decoration: none; }
.load-more {
  display: flex;
  min-height: 1px;
  align-items: center;
  justify-content: center;
  padding: .75rem 0 1.5rem;
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}
.load-more:empty { padding: 0; }
/* Empty marker after a group with more items on the server; scrolling it into view fetches them. */
.group-more { min-height: 1px; }

.group + .group { margin-top: 1.5rem; }
.group-title { margin: 1.2rem 0 .1rem; }
.group-title h2 { font-size: 1rem; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.group-title p { margin: 0; }

.item { position: relative; padding: 1.05rem 0 1.1rem; border-bottom: 1px solid var(--line); }
.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .78rem;
}
.item-source { font-weight: 500; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .05rem .45rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-top { color: var(--gold); background: var(--gold-soft); }
.badge-new { color: var(--primary-strong); background: var(--primary-soft); }
.badge-new::before { content: ""; width: .4rem; height: .4rem; border-radius: 999px; background: var(--primary); }
/* `pretty` fills lines; `balance` split CJK headlines inside numbers and words ("6 / 万亿"). */
.item-title { margin: 0 0 .35rem; font-size: 1.08rem; font-weight: 680; line-height: 1.4; letter-spacing: -.005em; text-wrap: pretty; }
.item-title a { text-decoration: none; }
.item-title a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: .15em; }
.item-summary { margin: 0; color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: .95rem; line-height: 1.65; }
.item-tags { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin-top: .55rem; }
.tag { color: var(--muted); font-size: .72rem; }
.empty { padding: 3rem 1rem; text-align: center; }
.empty .button { margin-top: .8rem; }

/* ---------- picture cards ---------- */

/* Pictures tile in cards while text reads down a list. A picture topic's cards flow across its
   days and fill the window; in ALL's column each picture topic tiles its cards under its heading. */
.public.card-topic .digest,
.image-news-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 100%), 1fr));
  gap: clamp(.9rem, 1.6vw, 1.5rem);
}
.public.card-topic :is(.day-block, .group) { display: contents; }
.public.card-topic :is(.day-divider, .group-title) { display: none; }
:is(.public.card-topic, .image-news-group) :is(.group-title, .group-more, .empty, .postcards) { grid-column: 1 / -1; }
/* Fashion's upright photographs stand three to a row. */
.fashion-group { --tile: 13rem; }
/* Picture and travel cards share one look; a photograph runs to its card's edges. */
.image-news-card,
.postcard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface-solid);
  box-shadow: var(--shadow-small);
}

/* ---------- visual news (𝐏) ---------- */

.image-news-card { padding: 0 0 .85rem; overflow: hidden; }
.image-news-card .image-news-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface-soft);
}
.image-news-card .image-news-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.image-news-card .image-news-media:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.image-news-card .item-meta,
.image-news-card .item-title,
.image-news-card .item-summary,
.image-news-card .item-tags { margin-right: .85rem; margin-left: .85rem; }
.image-news-caption {
  display: block;
  margin: .6rem .85rem 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.image-news-card .item-meta { margin-top: .75rem; }
.image-news-card .item-title { font-size: 1rem; }
.image-news-card .item-summary { font-size: .88rem; line-height: 1.55; }
/* Fashion photographs stand upright; a crop keeps the face in frame. */
.fashion-card .image-news-media { aspect-ratio: 3 / 4; }
.fashion-card .image-news-media img { object-position: 50% 0; }
/* 趣图's pictures show whole, at their own ratio: a meme's words are part of the joke. */
.fun-card .image-news-media { aspect-ratio: auto; }
.fun-card .image-news-media img { height: auto; }

@media (hover: hover) {
  .image-news-card { transition: transform .2s ease, box-shadow .2s ease; }
  .image-news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-small), 0 0 0 1px var(--line-strong); }
  .image-news-card .image-news-media:hover img { transform: scale(1.03); }
  .fun-card .image-news-media:hover img { transform: none; }
}

@media (max-width: 560px) {
  .insight-gallery { grid-template-columns: 1fr; }
  .insight-hotspots-date { white-space: normal; text-align: right; }
  .insight-figure { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- photographs (𝑾) ---------- */

/* Rows share one height: every photograph grows with its own ratio (--ratio, width / height),
   so none is cropped. The filler keeps the last row at its natural widths. */
.photo-group,
.public.w-topic .digest {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .45rem;
}
/* Photographs take the row height from their group, which the gallery tab flattens. */
.photo-group { --row: 13rem; }
.public.w-topic .photo-group { --row: 18rem; }
.public.w-topic .digest { gap: .6rem; }
.photo-group::after,
.public.w-topic .digest::after { content: ""; flex-grow: 1000000; }
.photo-group > .group-title,
.public.w-topic .empty { flex-basis: 100%; }
.photo-group > .group-more,
.public.w-topic .group-more { flex: 0 0 0; }
.public.w-topic .day-block,
.public.w-topic .photo-group { display: contents; }
.public.w-topic .day-divider,
.public.w-topic .group-title { display: none; }
.photo {
  position: relative;
  /* Growth is the ratio scaled up: a line whose factors sum below 1 shares out only that
     fraction of its free space, which left a lone portrait short of the row's end. */
  flex: calc(var(--ratio) * 100) 1 calc(var(--ratio) * var(--row));
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--surface-soft);
}
.photo-media { display: block; aspect-ratio: var(--ratio); }
.photo-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.photo-media:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.photo-badge {
  position: absolute;
  top: .45rem;
  left: .45rem;
  padding: .05rem .4rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .06em;
  pointer-events: none;
}
/* An administrator's switch on 𝑾 photographs (app.js): an outlined heart until the
   photograph is published, then filled. A card shows it when pointed at; otherwise only a
   published photograph keeps a faint mark, and on touch screens a waiting one takes no tap. */
.publish-button svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.publish-button[aria-pressed="true"] { color: #f5a48f; }
.publish-button[aria-pressed="true"] svg { fill: currentColor; }
.photo-publish {
  position: absolute;
  top: .4rem;
  right: .4rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
  opacity: 0;
  cursor: pointer;
  transition: opacity .2s ease;
}
.photo-publish[aria-pressed="true"] { opacity: .1; }
.photo:focus-within .photo-publish { opacity: 1; }
.photo-publish:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) {
  .photo:hover .photo-publish { opacity: 1; }
}
@media (hover: none) {
  .photo-publish[aria-pressed="false"] { visibility: hidden; }
}
.photo-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  padding: 2rem .7rem .55rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  font-size: .8rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.photo-title, .photo-credit { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-title { font-weight: 650; }
.photo-credit { font-size: .72rem; opacity: .82; }
.photo:focus-within .photo-caption { opacity: 1; }
@media (hover: hover) {
  .photo:hover .photo-caption { opacity: 1; }
  .photo-media:hover img { transform: scale(1.03); }
}
@media (max-width: 560px) {
  .photo-group,
  .public.w-topic .photo-group { --row: 11rem; }
  .photo-group,
  .public.w-topic .digest { gap: .35rem; }
}

/* ---------- travel (𝑻𝒓𝒂𝒗𝒆𝒍) ---------- */

/* Rows are 4px tall and each postcard or 趣图 picture spans the rows its height needs (travel.js), so
   pictures at their own ratio pack into columns while the cards keep reading order. In ALL the
   cards have a grid below their group's heading; the travel and 趣图 tabs join them all. */
.postcards,
.public:is(.travel-topic, .fun-topic) .digest {
  --postcard-gap: clamp(.9rem, 1.4vw, 1.3rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--tile), 100%), 1fr));
  grid-auto-rows: 4px;
  align-items: start;
  gap: 0 var(--postcard-gap);
}
.public.travel-topic .day-block,
.public.travel-topic .postcard-group,
.public:is(.travel-topic, .fun-topic) .postcards { display: contents; }
.public.travel-topic .day-divider,
.public.travel-topic .group-title { display: none; }
.postcard-group > .group-title { margin-bottom: .75rem; }
.postcards > .group-more,
.public.travel-topic .group-more,
.public.travel-topic .empty { grid-column: 1 / -1; }
.postcard,
.postcards > .fun-card { margin: 0 0 var(--postcard-gap); overflow: hidden; }
.postcard-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: var(--ratio, 1.333);
  background: var(--surface-soft);
}
.postcard-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.postcard-media:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.postcard-count {
  position: absolute;
  top: .5rem;
  right: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .1rem .5rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  font-size: .68rem;
  font-weight: 700;
  pointer-events: none;
}
/* Two stacked frames: the post has more photographs than the one shown. */
.postcard-count::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-shadow: 2px -2px 0 -1px currentColor;
}
.postcard-body { display: grid; gap: .3rem; padding: .75rem .9rem .85rem; }
.postcard-place {
  justify-self: start;
  color: var(--primary-strong);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-decoration: none;
}
.postcard-title { line-height: 1.38; text-wrap: pretty; }
.postcard-words {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-size: .88rem;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  quotes: "「" "」";
}
:lang(en) .postcard-words { quotes: "\201C" "\201D"; }
.postcard-words::before { content: open-quote; }
.postcard-words::after { content: close-quote; }
.postcard-meta { margin: 0; color: var(--muted); font-size: .74rem; }
.postcard-meta a { text-decoration: none; }
/* The time and each subject keep together; one wider than the card wraps inside itself. */
.postcard-meta span { display: inline-block; overflow-wrap: anywhere; }
.postcard-tag { text-transform: capitalize; }
.postcard-more { justify-self: start; margin-top: .15rem; color: var(--muted); font-size: .76rem; text-decoration: none; }
.postcard-place:hover,
.postcard-meta a:hover,
.postcard-more:hover { color: var(--primary-strong); text-decoration: underline; text-underline-offset: .15em; }
@media (hover: hover) {
  .postcard { transition: transform .2s ease, box-shadow .2s ease; }
  .postcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-small), 0 0 0 1px var(--line-strong); }
  .postcard-media:hover img { transform: scale(1.03); }
}
/* In ALL the postcards share the reading column with the news, so they stay small. */
.public:not(.travel-topic) .postcard-group > .postcards { --tile: 13rem; --postcard-gap: .75rem; }
@media (min-width: 769px) {
  .public:not(.travel-topic) .postcard-group .postcard-title { font-size: .92rem; }
  .public:not(.travel-topic) .postcard-group .postcard-words { font-size: .84rem; -webkit-line-clamp: 2; }
}

/* The land is a dotted mask, so it takes the theme's colour. */
.travel-map-slot[hidden] { display: none; }
.travel-map { max-width: 50rem; margin: .25rem auto 1.1rem; }
.travel-map-canvas { position: relative; aspect-ratio: 360 / 142; }
.travel-map-land {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  -webkit-mask: url("/world.svg") center / 100% 100% no-repeat;
  mask: url("/world.svg") center / 100% 100% no-repeat;
}
.travel-map figcaption { margin-top: .35rem; color: var(--muted); font-size: .72rem; text-align: center; }
/* The week's favorites stand beside the map where the screen leaves room, one or two a side. */
.travel-atlas { display: grid; grid-template-columns: 1fr minmax(0, 50rem) 1fr; align-items: center; gap: 2rem; margin: .25rem 0 1.1rem; }
.travel-atlas .travel-map { grid-column: 2; width: 100%; margin: 0; }
/* A side holds its favorite nearest the map, and an outer one where its own width allows. */
.travel-side { display: flex; gap: 1rem; container-type: inline-size; }
.travel-side.is-left { grid-column: 1; flex-direction: row-reverse; }
.travel-side.is-right { grid-column: 3; }
.travel-favorite { position: relative; display: block; flex: 0 1 15rem; min-width: 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius-l); background: var(--surface-soft); box-shadow: var(--shadow-small); color: #fff; text-decoration: none; }
.travel-favorite[hidden], .travel-favorite + .travel-favorite { display: none; }
@container (min-width: 25rem) {
  .travel-favorite + .travel-favorite:not([hidden]) { display: block; }
}
.travel-favorite img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.travel-favorite:hover img { transform: scale(1.03); }
.travel-favorite-text { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; gap: .15rem; padding: 2.4rem .9rem .8rem; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); }
.travel-favorite-place { color: #f5a48f; font-size: .72rem; font-weight: 650; letter-spacing: .02em; }
.travel-favorite strong { font-size: .95rem; line-height: 1.35; }
.travel-favorite-likes { color: rgba(255, 255, 255, .85); font-size: .75rem; }
@media (max-width: 87.49rem) {
  .travel-atlas { display: block; }
  .travel-atlas .travel-map { max-width: 50rem; margin: 0 auto; }
  .travel-side { display: none; }
}
.travel-wander { margin-left: .6rem; padding: 0; border: 0; color: var(--primary-strong); background: none; font-weight: 650; cursor: pointer; }
.travel-wander:hover { text-decoration: underline; text-underline-offset: .15em; }
.travel-pin {
  position: absolute;
  width: .7rem;
  height: .7rem;
  margin: -.35rem 0 0 -.35rem;
  border: 2px solid var(--surface-solid);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}
.travel-pin.is-recent::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: var(--primary);
  opacity: .28;
  animation: travel-pulse 2.4s ease-out infinite;
}
@keyframes travel-pulse {
  from { transform: scale(.4); opacity: .45; }
  to { transform: scale(1.6); opacity: 0; }
}
.travel-pin-label {
  position: absolute;
  bottom: calc(100% + .35rem);
  left: 50%;
  z-index: 1;
  padding: .12rem .45rem;
  border-radius: .35rem;
  color: var(--surface-solid);
  background: var(--text);
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 2px);
  transition: opacity .15s ease, transform .15s ease;
}
/* Destinations without moments this week stay as faint footprints. */
.travel-pin.is-past {
  width: .42rem;
  height: .42rem;
  margin: -.21rem 0 0 -.21rem;
  border-width: 1px;
  box-shadow: none;
  opacity: .5;
}
.travel-pin:hover,
.travel-pin:focus-visible { z-index: 2; transform: scale(1.25); opacity: 1; }
.travel-pin:hover .travel-pin-label,
.travel-pin:focus-visible .travel-pin-label { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 560px) {
  .travel-pin { width: .55rem; height: .55rem; margin: -.275rem 0 0 -.275rem; border-width: 1.5px; }
  .travel-pin.is-past { width: .34rem; height: .34rem; margin: -.17rem 0 0 -.17rem; border-width: 1px; }
}

/* The viewer: the photograph beside its story; stacked on narrow screens. */
.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  background: rgb(8, 9, 12);
  /* Horizontal swipes turn the page, so the browser must not take them over. */
  touch-action: pan-y pinch-zoom;
}
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) min(24rem, 34vw); }
.viewer::backdrop { background: transparent; }
/* The reserved scrollbar gutter lies outside the top layer; darken it with the viewer. */
:root:has(.viewer[open]) { background: rgb(8, 9, 12); }
.viewer:focus { outline: none; }
.viewer-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  margin: 0;
  padding: 3.25rem clamp(.75rem, 4vw, 4rem) 1rem;
}
.viewer-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-dots { display: flex; justify-content: center; gap: .45rem; min-height: 1.6rem; padding-top: .7rem; }
.viewer-dot {
  width: .5rem;
  height: .5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  cursor: pointer;
}
.viewer-dot[aria-current="true"] { background: #fff; }
.viewer-panel {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 0;
  padding: 3.5rem 1.5rem 1.5rem;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  font-size: .9rem;
  line-height: 1.65;
}
.viewer-panel a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.viewer-panel a:hover { color: #fff; text-decoration: underline; text-underline-offset: .15em; }
.viewer-panel .viewer-place { align-self: flex-start; color: #f5a48f; font-size: .78rem; font-weight: 650; letter-spacing: .02em; }
.viewer-spot { margin: -.35rem 0 0; color: rgba(255, 255, 255, .6); font-size: .78rem; }
.viewer-title { margin: 0; font-size: 1.2rem; line-height: 1.4; }
.viewer-words { margin: 0; color: rgba(255, 255, 255, .88); }
.viewer-original { color: rgba(255, 255, 255, .62); font-size: .82rem; }
.viewer-original summary { cursor: pointer; }
.viewer-original p { margin: .35rem 0 0; white-space: pre-line; }
.viewer-author { align-self: flex-start; font-size: .82rem; }
.viewer-about { margin-top: .5rem; padding-top: .9rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.viewer-about h3 { margin: 0 0 .3rem; color: rgba(255, 255, 255, .6); font-size: .76rem; font-weight: 650; letter-spacing: .04em; }
.viewer-about p { margin: 0 0 .45rem; }
.viewer-about .viewer-fact { padding-left: .65rem; border-left: 2px solid #f5a48f; }
.viewer-part { margin: .2rem 0 .65rem; padding: .7rem .8rem; border-radius: var(--radius-m); background: rgba(255, 255, 255, .06); }
.viewer-about .viewer-part p { margin: 0; }
.viewer-about .viewer-part .viewer-part-label { margin-bottom: .3rem; color: #f5a48f; font-size: .76rem; font-weight: 650; letter-spacing: .02em; }
.viewer-guide { font-size: .84rem; }
.viewer-story { display: contents; }
.viewer-map { flex-shrink: 0; max-width: 20rem; margin-bottom: .35rem; }
.viewer-map .travel-map-land { background: rgba(255, 255, 255, .32); }
.viewer-map .travel-pin { transition: left .8s ease, top .8s ease; }
.viewer-trail { position: absolute; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 999px; background: #f5a48f; opacity: .6; }
/* The viewer's buttons stay faint, four-fifths see-through, until pointed at or focused. */
.viewer-button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: none;
  opacity: .2;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, opacity .18s ease;
}
.viewer-button:hover:not(:disabled),
.viewer-button:focus-visible { opacity: 1; background: rgba(255, 255, 255, .18); }
.viewer-button:disabled { opacity: 0; pointer-events: none; }
.viewer-close { top: .6rem; right: .6rem; }
.viewer-publish { top: .6rem; right: 3.85rem; }
.viewer-publish svg { width: 1.35rem; height: 1.35rem; }
.viewer-previous, .viewer-next { top: 50%; transform: translateY(-50%); }
.viewer-previous { left: .6rem; }
.viewer-next { right: calc(min(24rem, 34vw) + .6rem); }
@media (max-width: 768px) {
  .viewer[open] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 62%) minmax(0, 1fr); }
  .viewer-stage { padding: 3rem .5rem .25rem; }
  .viewer-panel { padding: 1rem 1.25rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, .08); border-left: 0; }
  .viewer-map { max-width: 13rem; }
  .viewer-next { right: .6rem; }
}
@media (hover: none) {
  .viewer-previous, .viewer-next { display: none; }
}
/* A photograph alone (𝑾): one column, its caption below it. */
.viewer.is-solo[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.is-solo .viewer-stage { padding: 3.25rem clamp(.75rem, 5vw, 4.5rem) 1rem; }
.is-solo .viewer-next { right: .6rem; }
.viewer-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: .25rem .8rem;
  padding-top: .8rem;
  font-size: .86rem;
  line-height: 1.45;
  text-align: center;
}
.viewer-caption-title { font-weight: 650; }
.viewer-caption a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.viewer-caption a:hover { color: #fff; text-decoration: underline; text-underline-offset: .15em; }


/* Viewers that play (public.js): a triangle to play, two bars to pause, and a line along the
   top that fills as each photograph's time passes. */
.play-button { top: .6rem; left: .6rem; }
.play-button::before { content: ""; width: .8rem; height: .9rem; background: currentColor; clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
.is-playing .play-button::before { background: linear-gradient(90deg, currentColor 35%, transparent 0 65%, currentColor 0); clip-path: none; }
.play-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: #f5a48f;
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
/* One physical pixel on high-density screens; elsewhere 1px already is one. */
@media (min-resolution: 2dppx) {
  .play-progress { height: .5px; }
}

.insight-story-number { color: var(--primary-strong); font-variant-numeric: tabular-nums; }
.insight-story-status { display: inline-block; margin-right: .5rem; padding: .12rem .4rem; border-radius: .3rem; background: var(--surface-soft); color: var(--muted); font-size: .72rem; font-weight: 500; vertical-align: middle; }
.insight-picture-title { display: block; margin-bottom: .4rem; color: var(--text); font-weight: 600; }
.insight-change p { white-space: pre-line; }
.insight-references { margin: 0; padding-left: 1.5rem; color: var(--muted); font-size: .82rem; line-height: 1.65; overflow-wrap: anywhere; }
.insight-references li + li { margin-top: .35rem; }

/* ---------- dark, motion, responsive ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: rgba(24, 26, 32, .88);
    --surface-solid: #181a20;
    --surface-soft: rgba(10, 11, 15, .6);
    --text: #e9eaef;
    --muted: #9a9fab;
    --line: rgba(233, 234, 239, .1);
    --line-strong: rgba(233, 234, 239, .18);
    --primary-strong: #f07a61;
    --primary-soft: rgba(229, 82, 53, .18);
    --danger: #ef8d86;
    --gold: #e0b45a;
    --gold-soft: rgba(224, 180, 90, .16);
    --shadow: 0 24px 80px rgba(0, 0, 0, .3);
    --shadow-small: 0 12px 36px rgba(0, 0, 0, .2);
    --on-primary: #2b0f0d;
    --on-danger: #2b0f0d;
  }
  .brand-logo { filter: brightness(0) invert(1); }
  .group-title { border-bottom-color: var(--line-strong); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
