/* =========================================================
   Thoughts — a commonplace book.
   A quiet sticky column names the section; the stream runs newest
   first, broken by years. One-liners are set large in italic, longer
   thoughts step down, poems keep their line breaks.
   ========================================================= */

.page-thoughts { background-color: var(--tint, var(--room)); transition: background-color 1.4s ease; }
@media (prefers-reduced-motion: reduce) { .page-thoughts { transition: none; } }
.tg { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(40px, 6vw, 88px) clamp(56px, 7vw, 96px); }

.tg__title { font-family: var(--f-display); font-weight: 500; font-size: clamp(3.4rem, 2rem + 5vw, 7rem); line-height: .9; letter-spacing: -.03em; margin: 0; }
.tg__title em { font-style: italic; font-weight: 400; color: var(--accent); }
.tg__deck { margin: 0; font-size: 1.12rem; color: #CFC6B8; max-width: 34ch; }
.tg__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--rule); }
.tg__facts div { padding: 12px 0; display: grid; gap: 2px; }
.tg__facts b { font-family: var(--f-display); font-weight: 500; font-size: 1.6rem; line-height: 1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; text-transform: none; }
.tg__facts span { color: var(--muted); }
.tg__feed { justify-self: start; color: var(--muted); text-decoration: none; }
.tg__feed:hover { color: var(--accent); }

.tg__stream { min-width: 0; }
.tg__yr { display: flex; align-items: center; gap: 14px; margin: 0; padding: 40px 0 8px; color: var(--muted); font-weight: 400; }
.tg__stream > section:first-child .tg__yr { padding-top: 0; }
.tg__yr span { font-family: var(--f-display); font-size: 1.3rem; letter-spacing: 0; color: var(--accent); font-variant-numeric: lining-nums; }
.tg__yr::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* One column: the list alone, the section's front page folded into a pill. */
.tg--solo { grid-template-columns: minmax(0, 1fr); max-width: 820px; margin-inline: auto; padding-bottom: 140px; }

.tpill { position: fixed; z-index: 40; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: baseline; gap: 14px; max-width: calc(100% - 32px); padding: 11px 20px 12px; border-radius: 999px;
  background: #17121Bd9; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--fg); cursor: pointer;
  border: 1px solid #EEE7DA26; box-shadow: 0 18px 40px -16px #000, 0 0 0 1px #0006; transition: border-color .2s, transform .3s var(--ease, ease); }
.tpill:hover { border-color: var(--accent); }
.tpill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tpill__t { font-family: var(--f-display); font-style: italic; font-size: 1.3rem; line-height: 1; white-space: nowrap; }
.tpill__t em { color: var(--accent); }
.tpill__s { min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpill.is-filtered { border-color: var(--accent); }
.tpill.is-filtered .tpill__s { color: var(--accent); }

/* The panel: the section's front page over the list. */
.tp { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0D0A10f2; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--fg); overflow: hidden; }
.tp[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: tp-in .35s cubic-bezier(.2, .7, .1, 1); }
.tp::backdrop { background: transparent; }
@keyframes tp-in { from { opacity: 0; transform: translateY(24px); } }
.tp__inner { overflow-y: auto; overscroll-behavior: contain; width: 100%; max-width: 620px; margin-inline: auto; padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 32px; display: grid; gap: 26px; align-content: start; }
.tp__top { display: flex; justify-content: space-between; align-items: center; }
.tp__eyebrow { color: var(--muted); }
.tp__close { font: inherit; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.tp__close:hover { border-color: var(--accent); color: var(--accent); }
.tp__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); display: flex; justify-content: center; background: #0D0A10; }
.tp__show { width: 100%; max-width: 588px; font: inherit; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #17121B; background: var(--accent); border: 0; border-radius: 999px; padding: 14px 18px; cursor: pointer; }
.tp__show:hover { filter: brightness(1.08); }
.tp button:focus-visible, .tp a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html:has(.tp[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .tp[open] { animation: none; } }

/* By year: words against pictures. Colours checked for colour-blind contrast on the room. */
.tl { margin: 0; display: grid; gap: 10px; --tl-w: #C0821C; --tl-p: #1F9A8A; }
.tl__cap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tl__label { color: var(--muted); }
.tl__key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tl__dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.tl__dot--w { background: var(--tl-w); } .tl__dot--p { background: var(--tl-p); margin-left: 8px; }
.tl__plot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 92px; border-bottom: 1px solid var(--rule); }
.tl__col { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; text-decoration: none; color: inherit; }
.tl__bar { display: flex; flex-direction: column-reverse; justify-content: flex-start; gap: 2px; min-height: 0; }
.tl__seg { display: block; width: 100%; min-height: 2px; }
.tl__seg:last-child { border-radius: 4px 4px 0 0; }
.tl__seg--w { background: var(--tl-w); } .tl__seg--p { background: var(--tl-p); }
.tl__yr { font-size: .58rem; color: var(--muted); text-align: center; padding-top: 4px; position: absolute; top: 100%; left: 0; right: 0; }
.tl__col:hover .tl__bar, .tl__col:focus-visible .tl__bar { filter: brightness(1.25); }
.tl__col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl__tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #1D1822; border: 1px solid var(--rule); padding: 4px 8px; color: var(--fg); pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2; }
.tl__col:first-child .tl__tip { left: 0; transform: none; } .tl__col:last-child .tl__tip { left: auto; right: 0; transform: none; }
.tl__col:hover .tl__tip, .tl__col:focus-visible .tl__tip { opacity: 1; }
.tl__note { margin: 18px 0 0; color: var(--muted); font-size: .92rem; }

/* Filters */
.tf { border-bottom: 1px solid var(--rule); padding-bottom: 18px; }
.tf__sum { display: flex; gap: 12px; margin: 0; color: var(--fg); padding: 0 0 14px; }
.tf__status { margin-left: auto; color: var(--muted); }
.tf__body { display: grid; gap: 14px; }
.tf__group { display: grid; gap: 6px; }
.tf__label { color: var(--muted); }
.tf__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tf__opt { display: inline-flex; gap: 6px; align-items: baseline; color: var(--soft, #CFC6B8); background: none; border: 1px solid var(--rule); padding: 5px 9px; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.tf__opt:hover:not(:disabled) { border-color: var(--accent); color: var(--fg); }
.tf__n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tf__opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #17121B; }
.tf__opt[aria-pressed="true"] .tf__n { color: #17121Bb3; }
.tf__opt:disabled { opacity: .3; cursor: default; }
/* Colour: big blocks, each the average of its photos, with their own colours along the foot. */
.tf__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tf__tile { position: relative; display: grid; align-content: space-between; gap: 6px; min-height: 92px; padding: 12px 12px 18px; border: 0; border-radius: 4px; background: var(--c); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; transition: transform .2s var(--ease, ease), box-shadow .2s, opacity .2s; }
.tf__tile:hover:not(:disabled) { transform: translateY(-2px); }
.tf__tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--room), 0 0 0 4px var(--fg); }
.tf__tile[aria-pressed="true"] .tf__tile-name::after { content: " ✓"; }
.tf__tile:disabled { opacity: .22; cursor: default; }
.tf__tile-name { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.tf__tile-n { font-size: 1.1rem; letter-spacing: 0; font-variant-numeric: tabular-nums; opacity: .85; }
.tf__tile-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; display: flex; }
.tf__tile-strip i { flex: 1 1 0; }
.tf button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tf__foot { display: flex; gap: 16px; justify-content: flex-end; }
.tf__act { font: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 0; padding: 4px 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.tf__act:hover { color: var(--fg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.th[hidden], .tg__stream > section[hidden] { display: none; }
.th.is-picked { animation: picked 1.6s ease-out; }
@keyframes picked { 0%, 30% { background: #F0B34722; } 100% { background: transparent; } }

/* One thought */
.th { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 80px; }
.th__no { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; color: var(--muted); text-decoration: none; padding-top: .7em; font-variant-numeric: tabular-nums; }
a.th__no:hover { color: var(--accent); }
h1.th__no { margin: 0; font-weight: inherit; line-height: inherit; }
.th__body { display: grid; gap: 12px; min-width: 0; }
.th__text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.th--s .th__text { font-family: var(--f-display); font-style: italic; font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.6rem); line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; max-width: 22ch; }
.th--m .th__text { font-family: var(--f-display); font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem); line-height: 1.25; text-wrap: pretty; max-width: 34ch; }
.th--l .th__text { font-family: var(--f-book); font-size: 1.12rem; line-height: 1.6; color: #CFC6B8; max-width: 60ch; }
.th__text.is-poem { font-family: var(--f-book); font-style: italic; font-size: 1.2rem; line-height: 1.5; color: var(--fg); }
.th__title { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); line-height: 1.1; text-wrap: balance; }
.th__by { margin: -4px 0 0; color: var(--muted); font-size: .92rem; }
.th__img { margin: 4px 0 0; max-width: min(360px, 100%); }
.th__img img { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px #EEE7DA1f, 0 24px 40px -24px #000; }
.th__meta { margin: 0; display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.th__meta a { text-decoration: none; }
.th__meta a:hover { color: var(--accent); }

/* Photo posts: the picture leads, the words are its caption */
.th--photo .th__img { margin: 0; max-width: 100%; order: -1; }
.th--photo .th__img img, .th--photo .th__img video { --maxh: min(72svh, 640px); display: block; aspect-ratio: var(--ar); width: min(100%, calc(var(--maxh) * var(--ar))); height: auto; background: #0003; box-shadow: 0 0 0 1px #EEE7DA1f, 0 24px 40px -24px #000; }
.th__img video[data-autoplay] { cursor: pointer; }
.th__img video:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.th--photo .th__text { font-family: var(--f-display); font-style: normal; font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); line-height: 1.3; letter-spacing: 0; text-wrap: pretty; max-width: 40ch; color: var(--fg); }
.th--photo.th--l .th__text { font-family: var(--f-book); font-size: 1.08rem; line-height: 1.6; color: #CFC6B8; max-width: 60ch; }

/* A thought's own page */
.tg--single { grid-template-columns: minmax(0, 1fr); max-width: 980px; gap: 40px; min-height: calc(100svh - 55px - 120px); align-content: center; }
.th--single { border-bottom: 0; padding: 0; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.th--single .th__no { padding-top: 0; color: var(--accent); }
.th--single.th--s .th__text { font-size: clamp(2.4rem, 1.2rem + 4.6vw, 5.4rem); line-height: 1.02; max-width: 18ch; }
.th--single.th--m .th__text { font-size: clamp(1.7rem, 1.1rem + 2vw, 2.8rem); max-width: 28ch; }
.th--single .th__img { max-width: min(520px, 100%); }
.th--single.th--photo .th__img { max-width: 100%; }
.th--single.th--photo .th__img img, .th--single.th--photo .th__img video { --maxh: min(80svh, 820px); }
.th--single.th--photo .th__text { font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); max-width: 36ch; }
.th--single.th--photo.th--l .th__text { font-family: var(--f-book); font-size: 1.15rem; max-width: 60ch; }
.tg__pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; border-top: 1px solid var(--rule); padding-top: 18px; }
.tg__pager a { text-decoration: none; color: var(--muted); }
.tg__pager a:hover { color: var(--accent); }
.tg__pager [rel="next"] { justify-self: end; }

@media (prefers-reduced-motion: reduce) { .th.is-picked { animation: none; outline: 1px solid var(--accent); } }

@media (max-width: 880px) {
  .tg { grid-template-columns: minmax(0, 1fr); }
  .th { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .th__no { padding-top: 0; }
}
