/* Curiosity Hub blog: the explorer's notebook, on paper. Colours from channels/curiosity.json. */
:root {
  --paper: #f3eee3;
  --ink: #1e1b18;
  --muted: #6b6257;
  --accent: #e07b2e;
  --accent-ink: #a8541a;
  --highlight: #f2c14e;
  --sea: #bfd6de;
  --line: rgba(30, 27, 24, .14);
  --serif: "Cormorant Garamond", Georgia, "Noto Sans Thai", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", "Noto Sans Thai", cursive;
  --col: 720px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper) url(/paper.jpg) repeat;
  background-blend-mode: multiply;
  color: var(--ink);
  font: 18px/1.7 var(--sans);
  text-rendering: optimizeLegibility;
}
body.lang-th { font-family: "Noto Sans Thai", var(--sans); line-height: 1.85; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ---------- Header & footer ---------- */
header.site, footer.site { max-width: 1040px; margin: 0 auto; padding: 18px 16px; }
header.site { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 26px/1 var(--serif); }
.brand img { border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
header.site nav { display: flex; gap: 18px; flex-wrap: wrap; font: 20px/1 var(--hand); }
header.site nav a { color: var(--ink); text-decoration: none; }
header.site nav a:hover { color: var(--accent); }
header.site nav a.lang { border: 1.5px solid var(--ink); border-radius: 4px; padding: 3px 6px 1px; font-size: 16px; }
footer.site { margin-top: 64px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 15px; text-align: center; }
footer.site a { color: var(--muted); }

main { padding: 0 16px; }

/* ---------- Home ---------- */
.intro { max-width: 1040px; margin: 24px auto 32px; }
.intro h1 { font: 700 clamp(40px, 7vw, 68px)/1.05 var(--serif); margin: 0 0 8px; }
.intro p { font: 24px/1.3 var(--hand); color: var(--muted); margin: 0; }
.cards { max-width: 1040px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }
.card a { display: block; color: inherit; text-decoration: none; }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #fff; padding: 6px; box-shadow: 0 2px 10px rgba(40, 30, 20, .18); transform: rotate(-.6deg); transition: transform .2s; }
.card:nth-child(even) img { transform: rotate(.6deg); }
.card a:hover img { transform: rotate(0) scale(1.01); }
.card h2 { font: 700 28px/1.15 var(--serif); margin: 18px 0 8px; }
.card a:hover h2 { color: var(--accent-ink); }
.card p { margin: 0 0 6px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.card .meta { font: 18px/1.3 var(--hand); color: var(--accent-ink); }
.card.big { grid-column: 1 / -1; }
@media (min-width: 820px) {
  .card.big a { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: center; }
  .card.big h2 { font-size: 40px; margin-top: 0; }
  .card.big p { font-size: 17px; }
}

/* ---------- Post ---------- */
.post { max-width: var(--col); margin: 0 auto; }
.post-head { margin: 24px 0 28px; }
.kicker { font: 19px/1.3 var(--hand); color: var(--accent-ink); margin: 0 0 6px; }
.post h1 { font: 700 clamp(36px, 6vw, 54px)/1.08 var(--serif); margin: 0 0 16px; letter-spacing: -.01em; }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted); margin: 0; }

.prose p { margin: 0 0 1.15em; }
.prose h2 { font: 700 34px/1.15 var(--serif); margin: 2em 0 .6em; scroll-margin-top: 16px; }
.prose h2 .watch { font: 18px/1 var(--hand); text-decoration: none; white-space: nowrap; margin-left: 8px; padding: 2px 8px 0; border-radius: 4px; background: var(--highlight); color: var(--ink); vertical-align: middle; }
.prose h2 .watch:hover { background: var(--accent); color: #fff; }
.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 22px; border-left: 4px solid var(--accent); font: italic 500 24px/1.45 var(--serif); }
.prose blockquote p { margin: 0 0 .4em; }
.prose blockquote .by, .prose blockquote cite { display: block; font: normal 18px/1.4 var(--hand); color: var(--muted); margin-top: .5em; }
.prose strong { font-weight: 600; }
.prose mark { background: linear-gradient(transparent 45%, rgba(242, 193, 78, .65) 45%); padding: 0 2px; color: inherit; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose hr { border: 0; text-align: center; margin: 2em 0; }
.prose hr::after { content: "✦  ✦  ✦"; color: var(--accent); letter-spacing: .4em; }

/* Pictures: prints taped into the notebook. */
figure { margin: 1.8em -24px 1.9em; position: relative; }
figure img { width: 100%; background: #fff; padding: 7px; box-shadow: 0 3px 14px rgba(40, 30, 20, .2); }
figure::before { content: ""; position: absolute; z-index: 1; top: -11px; left: 50%; width: 110px; height: 24px; margin-left: -55px; background: rgba(242, 222, 160, .72); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); transform: rotate(-2deg); }
.prose > figure:nth-of-type(odd) img { transform: rotate(-.35deg); }
.prose > figure:nth-of-type(even) img { transform: rotate(.35deg); }
figcaption { font: 18px/1.35 var(--hand); color: var(--muted); margin: 10px 24px 0; text-align: center; }
figcaption .credit { display: block; font: 13px/1.4 var(--sans); opacity: .85; margin-top: 2px; }
figcaption .credit a { color: inherit; }
.figs { display: grid; gap: 18px 14px; margin: 1.8em -24px 1.9em; grid-template-columns: 1fr 1fr; }
.figs figure { margin: 0; }
.figs figure.wide { grid-column: 1 / -1; }
.figs figure.wide figcaption { font-size: 18px; margin: 10px 24px 0; }
/* An original portrait keeps its shape: narrower, centred. */
figure.portrait { max-width: 380px; margin-left: auto; margin-right: auto; }
.figs figcaption { margin: 8px 6px 0; font-size: 16px; }
@media (max-width: 760px) {
  figure, .figs { margin-left: -10px; margin-right: -10px; }
  .figs { grid-template-columns: 1fr; }
}

/* Video: a picture until it's clicked. */
.video { position: relative; aspect-ratio: 16 / 9; margin: 0 -24px 36px; background: #000; box-shadow: 0 4px 18px rgba(40, 30, 20, .28); }
.video button { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.video button img { width: 100%; height: 100%; object-fit: cover; }
.video .play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--accent); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); transition: transform .15s; }
.video .play::after { content: ""; position: absolute; left: 33px; top: 25px; border-style: solid; border-width: 17px 0 17px 28px; border-color: transparent transparent transparent #fff; }
.video button:hover .play, .video button:focus-visible .play { transform: scale(1.08); }
.video button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 760px) { .video { margin: 0 -16px 28px; } }

.watch-box { margin: 48px 0 8px; padding: 22px 24px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 5px 5px 0 var(--highlight); text-align: center; }
.watch-box p { margin: 0 0 14px; font: 21px/1.35 var(--hand); }
.button { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font: 600 17px/1 var(--sans); padding: 13px 22px; border-radius: 6px; }
.button:hover { background: var(--accent-ink); color: #fff; }

.post-foot { margin-top: 48px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 15px; line-height: 1.55; color: var(--muted); }
.post-foot h2 { font: 700 24px/1.2 var(--serif); color: var(--ink); margin: 1.6em 0 .5em; }
.post-foot ol, .post-foot ul { padding-left: 1.2em; }
.post-foot li { margin-bottom: .35em; }
.post-foot a { color: var(--muted); }
.post-foot .note { font-style: italic; }
.page { margin-top: 32px; }
.page h1 { font: 700 48px/1.1 var(--serif); }

::selection { background: rgba(242, 193, 78, .55); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* "In short": the answer to the title's question, right under it. */
.answer { margin: 0 0 32px; padding: 14px 18px; background: rgba(255, 255, 255, .55); border-left: 4px solid var(--highlight); border-radius: 0 6px 6px 0; font-size: 17px; line-height: 1.6; }
.answer p { margin: 0; }
.answer strong { font: 20px/1 var(--hand); color: var(--accent-ink); margin-right: 2px; }
@media (max-width: 760px) { .answer { font-size: 16px; line-height: 1.55; } }
