/* ==========================================================================
   TGL APAC — the blog
   Loaded on the posts page, a single article and the category archives.
   Written entirely in the palette's tokens: the live site runs the nightfall
   palette, where --white is a dark ground, --ink is white and --card is a
   deep violet, so a hard-coded #fff or a navy heading would disappear.
   The one exception is the banner, which uses --panel, the token for a
   surface that is dark in every palette, and so sets its own white text the
   way the quote form and the footer do.
   ========================================================================== */

/* --------------------------------------------------------------- banner  */
.bl-head{position:relative;background:var(--panel);color:#fff;
  padding:clamp(48px,7vw,96px) 0 clamp(50px,6.5vw,88px)}
.bl-head .eyebrow{display:inline-flex;align-items:center;gap:12px;color:var(--yellow);margin:0}
.bl-head .eyebrow::before{content:'';flex:0 0 auto;width:36px;height:2px;background:var(--yellow)}
.bl-head h1{margin:16px 0 0;max-width:17ch;color:#fff;
  font-size:clamp(40px,5.6vw,68px);line-height:1.04;letter-spacing:-.015em}
.bl-head h1 em{font-style:normal;color:var(--yellow)}
.bl-lead-in{margin-top:18px;max-width:58ch;font-size:clamp(16px,1.6vw,19px);
  line-height:1.72;color:rgba(255,255,255,.74)}

.bl-filter{display:flex;flex-wrap:wrap;gap:9px;margin-top:30px}

/* ----------------------------------------------------------------- chips */
.bl-chip{display:inline-flex;align-items:center;padding:6px 14px 5px;border-radius:999px;
  border:1px solid var(--line);font-family:var(--f-alt);font-size:11.5px;
  letter-spacing:.15em;text-transform:uppercase;color:var(--ink);white-space:nowrap;
  transition:background .25s,border-color .25s,color .25s}
.bl-chip:hover{background:var(--yellow);border-color:var(--yellow);color:var(--navy)}
/* On the banner the chip stands on a fixed dark surface, so it carries its
   own pale border rather than the palette's line colour. */
.bl-head .bl-chip{border-color:rgba(255,255,255,.26);color:rgba(255,255,255,.84)}
.bl-head .bl-chip:hover,.bl-head .bl-chip.is-on{background:var(--yellow);
  border-color:var(--yellow);color:var(--navy)}

/* ------------------------------------------------------------- meta line */
.bl-meta{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0;
  font-family:var(--f-alt);font-size:12.5px;letter-spacing:.05em;color:var(--text)}
.bl-sep{opacity:.5}
/* The date and the reading time wrap as one piece. Loose, a card narrow
   enough to break the line left the separator stranded at the end of it. */
.bl-when{display:inline-flex;align-items:center;gap:10px;white-space:nowrap}
/* In a card there is no width for the category and the date on one line, and
   whether they fit varies with the length of the category, so the titles in a
   row started at different heights. Stacked, every card agrees. */
.bl-card .bl-meta{flex-direction:column;align-items:flex-start;gap:11px}
.bl-meta-hero{margin-top:22px;color:rgba(255,255,255,.68)}

/* --------------------------------------------------------------- listing */
.bl-sec{padding-top:clamp(2.6rem,5vw,4.4rem)}

/* The whole card is a target, but only the title is a link: its ::after is
   stretched across the card. One link per article for a screen reader, and
   the category chip stays clickable because it is lifted above it. */
.bl-card,.bl-lead{position:relative}
.bl-go::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}
.bl-card .bl-chip,.bl-lead .bl-chip{position:relative;z-index:2}

/* ------------------------------------------------------- the lead article */
.bl-lead{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:clamp(26px,3.6vw,54px);align-items:center;
  margin-bottom:clamp(34px,4.5vw,58px);padding-bottom:clamp(34px,4.5vw,58px);
  border-bottom:1px solid var(--line)}
.bl-lead-art{position:relative;margin:0;overflow:hidden;border-radius:6px;
  aspect-ratio:16/9;background:var(--off)}
.bl-lead-art img{display:block;width:100%;height:100%;object-fit:cover;
  transition:transform 1.2s var(--ease)}
.bl-lead:hover .bl-lead-art img{transform:scale(1.05)}
.bl-lead-body h2{margin:14px 0 12px;font-size:clamp(25px,3vw,38px);line-height:1.08}
.bl-lead-body .bl-card-ex{font-size:16.5px;margin-bottom:22px}
.bl-lead .more{margin-top:0}
.bl-lead:hover .more{gap:14px}

/* ------------------------------------------------------------- the cards */
/* Six tracks with each card spanning two, so a short last row can start half
   a column in and sit centred rather than pushed to the left. Same device as
   .cards on the homepage. */
.bl-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:24px}
.bl-grid > .bl-card{grid-column:span 2}
.bl-grid > .bl-card:nth-child(3n+1):nth-last-child(2){grid-column:2 / span 2}
.bl-grid > .bl-card:nth-child(3n+1):nth-last-child(1){grid-column:3 / span 2}

.bl-card{display:flex;flex-direction:column;overflow:hidden;
  background:var(--card);border:1px solid var(--line);border-radius:4px;
  transition:border-color .3s,box-shadow .35s var(--ease),transform .35s var(--ease)}
.bl-card:hover{border-color:rgba(var(--yellow-rgb),.6);
  box-shadow:0 20px 46px rgba(var(--navy-rgb),.13);transform:translateY(-6px)}
.bl-card:hover .more{gap:14px}
.bl-card-art{position:relative;margin:0;overflow:hidden;aspect-ratio:16/9;background:var(--off)}
.bl-card-art img{display:block;width:100%;height:100%;object-fit:cover;
  transition:transform 1.2s var(--ease)}
.bl-card:hover .bl-card-art img{transform:scale(1.06)}
.bl-card-body{display:flex;flex:1;flex-direction:column;padding:22px 24px 24px}
.bl-card-body h3{margin:13px 0 10px;font-size:20px;line-height:1.22}
.bl-card-ex{margin:0 0 18px;font-size:14.5px;line-height:1.7;color:var(--text)}

/* ----------------------------------------------------------------- pager */
.bl-pager{margin-top:clamp(34px,4.5vw,58px)}
.bl-pager .nav-links{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px}
.bl-pager .page-numbers{display:inline-flex;align-items:center;justify-content:center;
  min-width:42px;height:42px;padding:0 14px;border:1px solid var(--line);border-radius:3px;
  font-family:var(--f-head);font-weight:700;font-size:14px;color:var(--ink);
  transition:background .25s,border-color .25s,color .25s}
.bl-pager a.page-numbers:hover{background:var(--yellow);border-color:var(--yellow);color:var(--navy)}
.bl-pager .page-numbers.current{background:var(--yellow);border-color:var(--yellow);color:var(--navy)}
.bl-pager .page-numbers.dots{border-color:transparent}

/* --------------------------------------------------------- the article   */
.bl-hero{background:var(--panel);color:#fff;padding:clamp(44px,6vw,84px) 0 clamp(36px,4.5vw,60px)}
.bl-hero-head{padding-bottom:clamp(26px,3.4vw,42px)}
.bl-hero .eyebrow{margin:0;color:var(--yellow)}
.bl-hero .eyebrow a{border-bottom:1px solid rgba(var(--yellow-rgb),.4)}
.bl-hero .eyebrow a:hover{border-bottom-color:var(--yellow)}
.bl-hero h1{margin:16px 0 0;max-width:22ch;color:#fff;
  font-size:clamp(32px,4.4vw,56px);line-height:1.08;letter-spacing:-.012em}
.bl-hero-art{position:relative;margin:0;overflow:hidden;border-radius:6px;
  aspect-ratio:16/9;background:rgba(255,255,255,.06)}
.bl-hero-art img{display:block;width:100%;height:100%;object-fit:cover}

.bl-body{padding-top:clamp(2.8rem,5vw,4.6rem)}
.bl-body-flush{padding-top:clamp(2.2rem,4vw,3.4rem)}

/* ------------------------------------------------------------- the prose */
.bl-prose{max-width:72ch;margin:0 auto;font-size:17px;line-height:1.82;color:var(--text)}
.bl-prose > :first-child{margin-top:0}
.bl-prose p{margin:0 0 1.05em}
.bl-prose h2{margin:1.9em 0 .55em;font-size:clamp(23px,2.5vw,30px);line-height:1.18}
/* The brand rule in front of a heading, the same mark the eyebrows carry. */
.bl-prose h2::before{content:'';display:block;width:34px;height:3px;border-radius:2px;
  margin-bottom:16px;background:var(--yellow)}
.bl-prose h3{margin:1.7em 0 .45em;font-size:clamp(18px,1.9vw,21px);line-height:1.25}
.bl-prose strong{font-weight:500;color:var(--ink)}
.bl-prose em{font-style:italic}

/* ul and ol are stripped in main.css, so the blog puts them back; a reader
   needs to see which of these is a list of options and which is a sequence. */
.bl-prose ul,.bl-prose ol{margin:0 0 1.3em;padding-left:1.35em}
.bl-prose ul{list-style:disc}
.bl-prose ol{list-style:decimal}
.bl-prose li{margin-bottom:.52em;padding-left:.22em}
.bl-prose li::marker{color:var(--ink)}
.bl-prose li > ul,.bl-prose li > ol{margin:.5em 0 0}

/* The brand yellow is 1.8 to 1 on paper, so it goes under a link rather than
   into it: the words read in the page's own ink and the yellow does the
   signalling. */
.bl-prose a{color:var(--ink);text-decoration:underline;text-decoration-color:var(--yellow);
  text-decoration-thickness:2px;text-underline-offset:3px;transition:background .2s}
.bl-prose a:hover{background:var(--yellow-soft)}

.bl-prose blockquote{margin:1.6em 0;padding:4px 0 4px 22px;border-left:3px solid var(--yellow);
  font-family:var(--f-head);font-size:19px;line-height:1.55;color:var(--ink)}

/* A three column table does not fit a phone, and shrinking the type until it
   does is not a fix, so it scrolls sideways inside its own box. */
.bl-scroll{margin:0 0 1.5em;overflow-x:auto;-webkit-overflow-scrolling:touch}
.bl-prose table{width:100%;min-width:460px;border-collapse:collapse;font-size:15px;line-height:1.6}
.bl-prose th,.bl-prose td{padding:12px 15px;text-align:left;vertical-align:top;
  border-bottom:1px solid var(--line)}
.bl-prose thead th{background:var(--off);color:var(--ink);
  font-family:var(--f-head);font-weight:700;font-size:13px;letter-spacing:.04em}
.bl-prose tbody tr:last-child td{border-bottom:0}

/* --------------------------------------------------------- prev and next */
.bl-nav{display:grid;grid-template-columns:1fr 1fr;gap:18px;max-width:72ch;
  margin:clamp(38px,5vw,62px) auto 0;padding-top:clamp(24px,3vw,34px);
  border-top:1px solid var(--line)}
.bl-nav-go{display:flex;flex-direction:column;gap:7px;padding:17px 20px;
  border:1px solid var(--line);border-radius:4px;
  transition:border-color .3s,transform .3s var(--ease)}
.bl-nav-go:hover{border-color:rgba(var(--yellow-rgb),.6);transform:translateY(-3px)}
.bl-nav-next{align-items:flex-end;text-align:right}
/* Alone in the grid, Older still belongs on the right. */
.bl-nav-next:only-child{grid-column:2}
.bl-nav-l{font-family:var(--f-alt);font-size:11px;letter-spacing:.18em;
  text-transform:uppercase;color:var(--text)}
.bl-nav-t{font-family:var(--f-head);font-weight:700;font-size:16px;line-height:1.3;color:var(--ink)}

/* ------------------------------------------------------------ keep reading */
.bl-more{background:var(--off)}
.bl-more .hb{margin-bottom:34px}
.bl-more .hb h2 em{font-style:normal}

/* ---------------------------------------------------------------- narrow */
@media (max-width:1000px){
  .bl-grid{grid-template-columns:repeat(4,1fr)}
  .bl-grid > .bl-card:nth-child(3n+1):nth-last-child(2),
  .bl-grid > .bl-card:nth-child(3n+1):nth-last-child(1){grid-column:span 2}
  .bl-grid > .bl-card:nth-child(2n+1):nth-last-child(1){grid-column:2 / span 2}
}

@media (max-width:900px){
  .bl-lead{grid-template-columns:1fr;gap:24px;align-items:start}
  .bl-lead-body h2{font-size:clamp(24px,5vw,30px)}
}

@media (max-width:700px){
  .bl-grid{grid-template-columns:1fr;gap:20px}
  .bl-grid > .bl-card,
  .bl-grid > .bl-card:nth-child(3n+1):nth-last-child(2),
  .bl-grid > .bl-card:nth-child(3n+1):nth-last-child(1),
  .bl-grid > .bl-card:nth-child(2n+1):nth-last-child(1){grid-column:1 / -1}
  .bl-head h1{max-width:none}
  .bl-prose{font-size:16.5px}
}

/* The table is given the width it needs on a phone instead of the width it
   would like. Sideways scrolling inside an article is a thing readers do not
   discover, so the type and the padding come down far enough that three
   columns fit the screen; .bl-scroll stays as the safety net for anything
   wider that gets written later. */
@media (max-width:760px){
  .bl-prose table{min-width:0;font-size:13.5px}
  .bl-prose th,.bl-prose td{padding:10px 9px}
  .bl-prose thead th{font-size:12px}
}

@media (max-width:640px){
  .bl-nav{grid-template-columns:1fr}
  .bl-nav-next,.bl-nav-next:only-child{grid-column:1;align-items:flex-start;text-align:left}
}
