/* Foton's Slops — additions on top of the original stylesheet (index-*.css). */
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;600&display=swap");

:root {
  --cjk: "Noto Serif TC", "Songti TC", "PMingLiU", "PingFang TC", serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, var(--cjk);
  --display: "IM Fell English", "Cormorant Garamond", Georgia, var(--cjk);
  --gold: #d9a964;                      /* a touch closer to the journal's old gold */
  --line: #d9a96447;
}
html[data-lang="zh"] body { letter-spacing: .02em; }
html[data-lang="zh"] .intro-inner .over,
html[data-lang="zh"] .meta, html[data-lang="zh"] .tip-cat { letter-spacing: .3em; }
html[data-lang="zh"] #panel h2 { font-size: 46px; font-weight: 600; letter-spacing: .06em; }
html[data-lang="zh"] .prologue, html[data-lang="zh"] #panel .motif,
html[data-lang="zh"] .tip-motif, html[data-lang="zh"] .lede, html[data-lang="zh"] .il-text,
html[data-lang="zh"] .loadtext, html[data-lang="zh"] #layouts button small { font-style: normal; }

/* One city per category, so the category filter bar is not needed. */
#legend { display: none !important; }
#panel .sibs { display: none; }

.label { font-size: 19px; padding: 3px 12px; }
.label .g { font-size: 14px; }
.label.current { font-size: 24px; }
.tools a.btn { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 8px 16px;
  font-size: 16px; color: inherit; text-decoration: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all .3s; }
.tools a.btn:hover { border-color: var(--gold); color: #ffe7b5; }
#f-version { color: var(--ink-dim); font-size: 13px; }

/* City labels: name, the other language in small caps, and a live count underneath */
.label { flex-wrap: wrap; justify-content: center; row-gap: 0; max-width: 16em; }
.label .sub { font-family: ui-monospace, "SF Mono", Menlo, Consolas, var(--cjk); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); opacity: .9; margin-left: 2px; }
.label .cnt { flex-basis: 100%; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, var(--cjk); font-size: 10.5px; letter-spacing: .12em; color: var(--ink-dim); opacity: .85; margin-top: -2px; }
.label.current .cnt, .label.dim .cnt { opacity: 0; }

/* the top bar has more buttons now: keep them on one line and let the layout hints go first */
.brand, .brand span, .tools button, .tools a.btn { white-space: nowrap; }
.tools { gap: 6px; }
.tools button, .tools a.btn { padding: 8px 13px; }
.tools .ico-only { width: 38px; padding: 8px 0; }
@media (width <= 1360px) { #layouts button small { display: none; } #layouts button { padding: 8px 16px; } }
@media (width <= 1000px) { .tools a.btn { display: none; } }
/* "new" and "read" marks */
.label .nb { order: -1; flex-basis: 100%; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, var(--cjk); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #ffd27a; text-shadow: 0 0 8px #ffb44a; }
.label .cnt { opacity: 0; transition: opacity .3s; }
.label:hover .cnt { opacity: .85; }
body:not(.focused) .label .cnt { opacity: .7; }
em.new { font-style: normal; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #1a1206; background: #ffd27a; border-radius: 6px; padding: 0 5px; margin-left: 8px; vertical-align: 2px; }
em.read { font-style: normal; color: var(--ink-dim); margin-left: 8px; font-size: 12px; }
.post-list button.was-read b { color: #e6d9c0; font-weight: 500; }
body.riding #panel, body.riding #labels { opacity: .25; }
#btn-ride.on { border-color: var(--gold); color: #ffe7b5; }

/* ── Search ── */
#search { place-items: start center; padding-top: 14vh; }
#search .overlay-inner { padding: 22px 24px 14px; }
#s-input { width: calc(100% - 34px); background: #ffffff0a; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 21px; color: var(--ink); outline: none; }
#s-input:focus { border-color: var(--gold); }
#s-input::-webkit-search-cancel-button { display: none; }
#s-list { list-style: none; margin: 12px 0 6px; padding: 0; max-height: 52vh; overflow-y: auto; }
#s-list button { width: 100%; display: grid; grid-template-columns: 1.4em 1fr auto; gap: 0 8px; align-items: baseline; text-align: left; padding: 7px 10px; border-radius: 9px; border-left: 2px solid transparent; }
#s-list button .g { color: var(--c); font-size: 14px; }
#s-list button b { font-weight: 600; font-size: 18.5px; color: #fff4dd; }
#s-list button i { grid-column: 2; font-size: 14.5px; color: var(--ink-dim); }
html[data-lang="zh"] #s-list button i { font-style: italic; }
#s-list button time { grid-column: 3; grid-row: 1; font-size: 12px; letter-spacing: .1em; color: var(--ink-dim); text-transform: uppercase; white-space: nowrap; }
#s-list button.sel, #s-list button:hover { background: color-mix(in srgb, var(--c) 20%, transparent); border-left-color: var(--c); }
#s-list .none { padding: 10px; color: var(--ink-dim); font-style: italic; }
#f-toast { position: fixed; z-index: 40; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; padding: 8px 18px; font-size: 16px; pointer-events: none; }
body.reading #f-toast { display: none; }
#f-toast.sticky { pointer-events: auto; }
#f-toast a { color: var(--gold); margin-left: 6px; }
#f-quality button { color: var(--ink-dim); font-style: italic; padding: 0 2px; }
#f-quality button.on { color: var(--gold); font-style: normal; text-decoration: underline; text-underline-offset: 3px; }

/* ── City panel: article list ── */
#panel .text p.city-intro { margin: 0 0 14px; font-size: 18px; color: #eadfcb; }
#panel .text p.city-intro:first-letter { float: none; font: inherit; color: inherit; padding: 0; }
.post-list { list-style: none; margin: 0; padding: 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.post-list button { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline;
  padding: 9px 12px 10px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 4px 10px 10px 4px;
  background: color-mix(in srgb, var(--c) 7%, transparent); transition: background .2s, transform .2s, border-color .2s; }
.post-list button:hover, .post-list button:focus-visible { background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c); transform: translateX(3px); }
.post-list time { grid-column: 1 / -1; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.post-list b { font-weight: 600; font-size: 19px; line-height: 1.25; color: #fff4dd; }
.post-list i { font-size: 14px; color: var(--c); font-style: italic; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.post-list button:hover i, .post-list button:focus-visible i { opacity: 1; }
html[data-lang="zh"] .post-list i { font-style: normal; }

/* ── Contents ── */
#f-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px 22px; }
#f-toc section { border-top: 2px solid var(--c); padding-top: 8px; }
#f-toc h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 400; }
#f-toc h4 button { font-family: var(--display); font-size: 23px; color: #fff4dd; text-align: left; }
#f-toc h4 button span { color: var(--c); font-size: 16px; }
#f-toc h4 button:hover { color: var(--c); }
#f-toc h4 small { color: var(--ink-dim); font-size: 13px; white-space: nowrap; }
#f-toc ul { list-style: none; margin: 0; padding: 0; }
#f-toc li button { width: 100%; text-align: left; padding: 3px 6px; border-radius: 5px; font-size: 16.5px; line-height: 1.3; color: #eadfcb; }
#f-toc li button:hover, #f-toc li button:focus-visible { background: color-mix(in srgb, var(--c) 24%, transparent); color: #fff; }

/* ── Reader: an illuminated frame around the article ── */
#reader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 2.2vh 2.4vw;
  background: #08050cb8; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: .5s both fade; }
.r-frame { position: relative; width: min(1500px, 100%); height: 100%; display: flex; flex-direction: column;
  background: #120c16; border: 1px solid var(--gold); border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 4px #120c16, 0 0 0 5px var(--line), 0 30px 90px #000c; animation: .6s cubic-bezier(.2,.7,.2,1) both r-in; }
@keyframes r-in { 0% { opacity: 0; transform: translateY(18px) scale(.985); } }
.r-bar { display: flex; align-items: center; gap: 14px; padding: 8px 12px 8px 14px; min-height: 52px;
  border-bottom: 1px solid var(--line); background: linear-gradient(#1c1322, #140d19); position: relative; }
.r-bar:after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--c), transparent); }
.r-bar button, .r-bar a { color: var(--ink-dim); border-radius: 8px; padding: 4px 9px; font-size: 17px; text-decoration: none; white-space: nowrap; transition: color .2s, background .2s; }
.r-bar button:hover, .r-bar a:hover { color: #fff; background: #ffffff12; }
.r-title { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.r-title span { color: var(--c); font-size: 15px; }
.r-title b { font-family: var(--display); font-weight: 400; font-size: 23px; color: #fff4dd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-title time { color: var(--ink-dim); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.r-tools { display: flex; align-items: center; gap: 2px; }
#r-pos { color: var(--ink-dim); font-size: 14px; min-width: 3.6em; text-align: center; }
#r-close { font-size: 26px; line-height: 1; padding: 0 9px 3px; }
.r-body { position: relative; flex: 1; background: #f8f5ef; }
#r-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .35s; }
#r-frame.ready { opacity: 1; }
#r-heavy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px;
  text-align: center; background: #120c16; color: var(--ink); font-size: 20px; }
#r-heavy-go { border: 1px solid var(--gold); color: #fbeccc; border-radius: 30px; padding: 9px 28px; font-size: 18px; }
#r-heavy-go:hover { background: #e2b86626; }
body.reading header#top, body.reading #panel, body.reading #labels, body.reading #tip { opacity: 0; pointer-events: none; }

@media (width <= 860px) {
  #reader { padding: 0; }
  .r-frame { border-radius: 0; border: 0; box-shadow: none; }
  .r-title time, #r-back span, #r-pos { display: none; }
  .r-title { justify-content: flex-start; }
  .r-title b { font-size: 19px; }
  .tools a.btn, #btn-body { display: none; }
  .label .sub { display: none; }
  html[data-lang="zh"] #panel h2 { font-size: 34px; }
  .post-list b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #reader, .r-frame, #panel.swap > :not(.close) { animation: none !important; }
}

.help-classic { color: var(--gold); }
