/* Bangkok Tails blog. Loads after ../css/style.css and uses its colours, fonts and pieces
   (page-top, footer, article, btn, ev-route-video / ev-route-steps from the events page).
   Phones first: the base rules are for phones, wider screens are added at the end. */

/* ---------- Dark title band (blog home and posts) ---------- */

.blog-hero, .post-hero {
  background: var(--teak-night); color: var(--rice-paper);
  padding: clamp(1.6rem, 5vw, 3.2rem) 0 clamp(1.8rem, 5vw, 3rem);
}
.blog-hero .kicker, .post-hero .kicker {
  font-size: 0.82rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--golden-hour);
}
.post-hero .kicker a { color: inherit; text-decoration: none; border-bottom: 2px solid rgba(239, 162, 74, 0.45); }
.post-hero .kicker a:hover { border-color: var(--golden-hour); }
.blog-hero h1, .post-hero h1 {
  margin-top: 0.4rem;
  font-weight: 600; font-variation-settings: "SOFT" 60, "WONK" 1;
  line-height: 1.04; letter-spacing: -0.015em; color: var(--rice-paper);
}
.blog-hero h1 { font-size: clamp(2.4rem, 1.3rem + 5vw, 4.6rem); }
.post-hero h1 { font-size: clamp(1.9rem, 1.2rem + 3.6vw, 3.6rem); max-width: 22ch; }
.blog-hero .tagline { margin-top: 0.8rem; font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem); color: var(--honey-light); max-width: 36rem; }
.post-date { margin-top: 0.8rem; color: var(--honey-light); font-size: 1rem; }

.draft-flag {
  display: inline-block; margin-bottom: 1rem; padding: 0.4em 0.9em; border-radius: 12px;
  background: var(--lantern); color: var(--teak-night); font-weight: 700; font-size: 0.85rem; line-height: 1.35;
}

/* ---------- Blog home: filter tags ---------- */

.blog-list { padding-block: clamp(1.4rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); }

.blog-filters ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.blog-filters button {
  min-height: 44px; padding: 0.45em 1em; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 0.95rem/1.2 var(--font-body);
  background: var(--honey-light); color: var(--teak-night);
}
.blog-filters button:hover { background: var(--golden-hour); }
.blog-filters button[aria-pressed="true"] { background: var(--lantern); }
html:not(.js) .blog-filters { display: none; }   /* without JavaScript every post simply shows */

/* ---------- Blog home: post cards ---------- */

.post-grid {
  list-style: none; margin: clamp(1.2rem, 4vw, 2rem) 0 0; padding: 0;
  display: grid; gap: clamp(14px, 2.4vw, 24px);
}
.post-card {
  position: relative; display: grid; gap: 0.55rem; align-content: start;
  background: #fff8ec; border: 1px solid rgba(135, 76, 27, 0.16); border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  box-shadow: 0 14px 30px -18px rgba(135, 76, 27, 0.55);
  transition: border-color 0.2s ease;
}
.post-card[hidden] { display: none; }
.post-card:hover { border-color: var(--lantern); }
.post-card:focus-within { outline: 3px solid var(--golden-hour); outline-offset: 3px; }

.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.7rem; }
.post-section { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--old-teak); }
.post-meta time { font-size: 0.88rem; color: #6b5a48; }
.draft-badge { font-size: 0.75rem; font-weight: 700; padding: 0.1em 0.6em; border-radius: 999px; background: var(--teak-night); color: var(--golden-hour); }

.post-card h2 {
  font-weight: 640; font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.7rem); line-height: 1.15;
}
.post-card h2 a { color: var(--teak-night); text-decoration: none; }
.post-card h2 a:focus-visible { outline: none; }
.post-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card is the link */
.post-summary { font-size: 0.98rem; }

.post-card-crew {
  display: flex; gap: 0.65rem; align-items: center;
  margin-top: 0.25rem; padding-top: 0.75rem; border-top: 1px solid rgba(135, 76, 27, 0.14);
  font-family: var(--font-display); font-style: italic; font-variation-settings: "SOFT" 80, "WONK" 1; font-size: 0.98rem; line-height: 1.35;
}
.post-card-crew img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.post-card-crew b {
  display: block; font-family: var(--font-body); font-style: normal;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--old-teak);
}

.blog-empty {
  margin-top: 1.4rem; padding: 1rem 1.15rem; border: 2px dashed rgba(135, 76, 27, 0.35); border-radius: 14px;
  color: #6b5a48; font-style: italic;
}
.blog-empty[hidden] { display: none; }

/* ---------- Post ---------- */

.post-main { padding-block: clamp(1.4rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4rem); }
.post-main .wrap { width: min(46rem, 100% - 32px); display: grid; gap: clamp(1.6rem, 4vw, 2.4rem); }

/* Crew pick box */
.crew-pick {
  display: grid; grid-template-columns: 64px 1fr; gap: 0.9rem; align-items: center;
  background: var(--honey-light); border-radius: var(--radius); padding: 0.95rem 1.1rem;
  box-shadow: 0 14px 30px -18px rgba(135, 76, 27, 0.55);
}
.crew-pick img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.crew-pick-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--old-teak); }
.crew-pick-name {
  font-family: var(--font-display); font-weight: 640; font-variation-settings: "SOFT" 60, "WONK" 1;
  font-size: 1.3rem; line-height: 1.2; color: var(--teak-night); text-decoration: none;
}
.crew-pick-name:hover { text-decoration: underline; }
.crew-pick-name [lang="th"] { font-weight: 450; font-size: 0.8em; color: var(--old-teak); }
.crew-pick-line {
  margin-top: 0.15rem;
  font-family: var(--font-display); font-style: italic; font-variation-settings: "SOFT" 80, "WONK" 1; font-size: 1.05rem; line-height: 1.4;
}

/* Link card to a related post (top or end of a post) */
.link-card {
  display: grid; gap: 0.2rem; padding: 0.9rem 1.1rem; border-radius: var(--radius);
  background: var(--honey-light); color: var(--teak-night); text-decoration: none;
  border-left: 5px solid var(--golden-hour);
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.25;
}
.link-card:hover { background: var(--golden-hour); }
.link-card span { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--old-teak); }

/* Post body (Markdown). .article in style.css sets h2, lists and paragraph spacing. */
.post-body > * + * { margin-top: 0.9rem; }
.post-body > h2 { margin-top: clamp(1.8rem, 4vw, 2.4rem); }
.post-body > h2:first-child { margin-top: 0; }
.post-body ul, .post-body ol { margin-bottom: 0; }
.post-body sup a { text-decoration: none; font-weight: 700; }

/* [CHECK] marks on facts not yet matched to a source */
mark.check {
  background: #ffe08a; color: var(--teak-night); font: 700 0.8em/1 var(--font-body);
  padding: 0.15em 0.35em; border-radius: 4px; white-space: nowrap;
}

/* Marcus's tip and photo, until they are in */
.marcus-placeholder {
  padding: 1rem 1.15rem; border: 2px dashed rgba(135, 76, 27, 0.45); border-radius: 14px;
  background: rgba(242, 189, 112, 0.18); color: #6b5a48; font-style: italic;
}
/* Marcus's tip box, and his photo inside it once it is in */
.marcus-tip { background: var(--honey-light); border-radius: 14px; padding: 1rem 1.1rem 1.1rem; display: grid; gap: 0.4rem; }
.marcus-tip p + p { margin-top: 0; }
.marcus-tip-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--old-teak); }
.marcus-tip-photo { margin: 0.5rem 0 0; }
.marcus-tip-photo img { width: 100%; border-radius: 10px; }
.marcus-tip-photo figcaption { margin-top: 0.4rem; font-size: 0.9rem; color: #6b5a48; }

/* Getting there */
.post-route {
  display: grid; gap: 0.9rem; justify-items: start;
  background: #fff8ec; border: 1px solid rgba(135, 76, 27, 0.16); border-radius: var(--radius);
  padding: clamp(1rem, 3vw, 1.5rem);
}
.post-route > * { max-width: 100%; }
.post-route h2 {
  font-weight: 620; font-variation-settings: "SOFT" 50, "WONK" 1;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.8rem); line-height: 1.15; color: var(--old-teak);
}
.post-route-place { display: block; font-family: var(--font-body); font-size: 0.55em; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--skytrain-teal); }
.post-route h3 { margin: 0.5rem 0 0; font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--old-teak); }
.post-route-image { width: 100%; border-radius: 14px; }
.post-route sup a { text-decoration: none; font-weight: 700; }

/* FAQ */
.post-faq { border-top: 2px solid rgba(135, 76, 27, 0.14); padding-top: 1.1rem; }
.post-faq h2 {
  font-weight: 620; font-variation-settings: "SOFT" 50, "WONK" 1;
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.8rem); line-height: 1.15; color: var(--old-teak);
}
.post-faq h3 { margin: 1rem 0 0.25rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; color: var(--teak-night); }
.post-faq p { margin: 0; }

/* Sources */
.post-sources { font-size: 0.92rem; border-top: 2px solid rgba(135, 76, 27, 0.14); padding-top: 1.1rem; }
.post-sources h2 { font-family: var(--font-body); font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--skytrain-teal); }
.post-sources ol { margin: 0.5rem 0 0; padding-left: 1.3rem; display: grid; gap: 0.35rem; }
.post-sources li:target { background: rgba(239, 162, 74, 0.2); border-radius: 6px; }

/* Previous / next */
.post-nav { display: grid; gap: 0.7rem; }
.post-nav a {
  display: grid; gap: 0.2rem; padding: 0.9rem 1.1rem; border-radius: 14px;
  background: var(--honey-light); color: var(--teak-night); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.25;
}
.post-nav a:hover { background: var(--golden-hour); }
.post-nav span { font-family: var(--font-body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--old-teak); }
.post-nav-next { text-align: right; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .post-nav { grid-template-columns: 1fr 1fr; }
  .post-nav-next { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card { transition: none; }
}

/* The episode video at the top of a post (frontmatter "episode") */
.post-episode { margin: 0 0 1.6rem; }
.post-episode-frame {
  position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 14px 30px -18px rgba(135, 76, 27, 0.55);
}
.post-episode-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-episode figcaption { margin-top: 0.55rem; font-size: 0.9rem; line-height: 1.45; color: var(--old-teak); }
