/* ==========================================================================
   Atlantic Council at IMF–World Bank Week: shared style template

   Used by:
     index.html        the signage player (video, panel, app card)
     app.html          signage: download the app
     social.html       signage: social posts
     newsletter.html   signage: Bangkok Bulletin
     download.html     the download-the-app web page

   One unit for everything: 1rem = 100 pixels of a 4K (3840 x 2160) screen.
   - Signage pages add class="is-signage" to <html>. The 4K stage is then
     scaled to fit whatever screen opens it.
   - The web page adds class="is-web" to <html>, which sets 1rem = 50px.
     That is the style guide at its normal web size (4K values are the web
     values doubled), so every component below works on both.

   Sections
     1. Tokens            5. Logo bar and clocks     9. Screen: social posts
     2. Foundations       6. Decorative artwork     10. Screen: Bangkok Bulletin
     3. Stage layouts     7. Signage player         11. Web: download page
     4. Components        8. Screen: download app   12. Diagnostics, motion
   ========================================================================== */


/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand colors (content.json "theme" can override the first five) */
  --green: #083f41;
  --green-dark: #073739;
  --orange: #d77743;
  --yellow: #febf2c;
  --white: #fefefe;

  /* Text */
  --ink: #073739;                           /* text on white, yellow, orange */
  --ink-soft: #3d5c5d;                      /* secondary text on white */
  --soft-white: rgba(254, 254, 254, 0.78);  /* secondary text on green */

  /* Surfaces and lines */
  --line: rgba(254, 254, 254, 0.14);
  --glass: rgba(4, 42, 44, 0.23);
  --glass-border: rgba(254, 254, 254, 0.10);
  --tint: rgba(254, 254, 254, 0.08);        /* quiet card on green */
  --tint-border: rgba(254, 254, 254, 0.16);
  --shadow: 0 .52rem 1.6rem rgba(0, 24, 25, 0.18);

  /* Shape */
  --radius: .56rem;        /* cards and panels (32px on the web) */
  --radius-inner: .3rem;   /* images inside cards */
  --radius-qr: .32rem;     /* white QR tile */
  --radius-pill: 999px;

  /* Type */
  --font: Montserrat, Arial, Helvetica, sans-serif;
  --weight-display: 800;
  --tracking-display: -.035em;
  --tracking-label: .14em;

  --logo-h: .7;            /* content.json logo.maxHeightPercent */
}


/* 2. Foundations ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
p, h1, h2, h3 { margin: 0; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.is-signage { font-size: calc(min(100vw, 177.7778vh) / 38.4); }
html.is-signage, html.is-signage body { height: 100%; margin: 0; background: #000; overflow: hidden; cursor: none; }
html.is-signage body { display: flex; align-items: center; justify-content: center; }

html.is-web { font-size: 50px; }
@media (max-width: 1100px) { html.is-web { font-size: 44px; } }
@media (max-width: 640px)  { html.is-web { font-size: 38px; } }


/* 3. Stage layouts --------------------------------------------------------- */
.stage {
  width: 38.4rem; height: 21.6rem;
  padding: .6rem; gap: .6rem;
  display: grid;
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(254, 191, 44, 0.10), transparent 14rem),
    radial-gradient(circle at 10% 84%, rgba(215, 119, 67, 0.08), transparent 12rem),
    linear-gradient(180deg, var(--green) 0%, var(--green) 58%, var(--green-dark) 100%);
}
.stage > .zone { position: relative; z-index: 1; }

/* Player: video 2880 x 1620, side column 780, logo bar 360 */
.stage.is-player { grid-template-columns: 28.8rem 1fr; grid-template-rows: 16.2rem 1fr; }

/* Full-width screens: content 1620 tall, the same logo bar below */
.stage.is-full { grid-template-columns: 1fr; grid-template-rows: 16.2rem 1fr; }
.screen { grid-column: 1; grid-row: 1; min-height: 0; }


/* 4. Components ------------------------------------------------------------ */

/* Glass card: the green panel look */
.glass {
  background: var(--glass);
  border: .02rem solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: inset 0 .02rem rgba(255, 255, 255, 0.05), var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Small yellow label above a headline */
.eyebrow {
  color: var(--yellow);
  font-weight: 800; letter-spacing: var(--tracking-label); text-transform: uppercase; line-height: 1.35;
}

/* Rounded label with a dot */
.pill {
  display: inline-flex; align-items: center; gap: .16rem;
  min-height: .64rem; padding: 0 .26rem;
  border: .02rem solid var(--tint-border); border-radius: var(--radius-pill);
  color: rgba(254, 254, 254, 0.90); background: rgba(254, 254, 254, 0.07);
  font-size: .28rem; font-weight: 750; line-height: 1;
}
.pill-dot {
  width: .14rem; height: .14rem; border-radius: 50%; flex: none;
  background: var(--yellow); box-shadow: 0 0 0 .09rem rgba(254, 191, 44, 0.12);
}
/* Larger pill for full-width screens: yellow text, orange dot */
.pill.is-lg {
  align-self: flex-start; gap: .24rem;
  min-height: .92rem; padding: 0 .44rem;
  color: var(--yellow); font-size: .38rem; font-weight: 800;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
}
.pill.is-lg .pill-dot { width: .22rem; height: .22rem; background: var(--orange); box-shadow: 0 0 0 .1rem rgba(215, 119, 67, 0.18); }

.divider {
  height: .02rem; width: 100%;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* Type scale */
.display {
  font-size: calc(1.84rem * var(--fit, 1)); font-weight: var(--weight-display);
  line-height: .96; letter-spacing: var(--tracking-display); text-wrap: balance;
}
.display.is-md { font-size: calc(1.36rem * var(--fit, 1)); line-height: 1; }
.lede-lg {
  font-size: calc(.52rem * var(--fit, 1)); line-height: 1.5; color: var(--soft-white);
  max-width: 14.6rem; text-wrap: pretty;
}

/* QR code tile: white square, code drawn inside */
.qr { width: 2.4rem; height: 2.4rem; padding: .14rem; background: var(--white); border-radius: .18rem; }
.qr svg, .qr img { width: 100%; height: 100%; display: block; object-fit: contain; shape-rendering: crispEdges; }
.qr.is-placeholder {
  background: transparent; border: .04rem dashed currentColor; opacity: .6;
  display: grid; place-items: center; text-align: center; font-size: .3rem; font-weight: 700;
}

/* Scan card: QR tile beside a short call to action */
.qr-card {
  align-self: flex-start;
  display: flex; align-items: center; gap: .64rem;
  padding: .48rem .84rem .48rem .48rem;
  border-radius: .64rem;
  background: var(--yellow); color: var(--ink);
}
.qr-card.is-orange { background: var(--orange); }
.qr-card.is-light  { background: var(--white); }
.qr-card .qr { width: 4.3rem; height: 4.3rem; padding: .3rem; border-radius: var(--radius-qr); flex: none; }
.qr-card-text { display: flex; flex-direction: column; gap: .18rem; }
.qr-card-title { font-size: .78rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; max-width: 5.4rem; text-wrap: balance; }
.qr-card-caption { font-size: .42rem; font-weight: 600; line-height: 1.3; }
.qr-card-url { font-size: .32rem; font-weight: 500; opacity: .82; overflow-wrap: anywhere; }
.qr-card [hidden] { display: none; }

/* Round avatar with an initial fallback */
.avatar {
  flex: none; width: .72rem; height: .72rem; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--yellow); color: var(--green); font-size: .32rem; font-weight: 800;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Phone frame for app screenshots */
.phone {
  flex: none; width: 4.7rem; aspect-ratio: 9 / 19.5;
  padding: .18rem; border-radius: .82rem;
  background: rgba(254, 254, 254, 0.14);
  border: .02rem solid rgba(254, 254, 254, 0.26);
  box-shadow: 0 .6rem 1.8rem rgba(0, 20, 21, 0.35);
}
.phone.is-hero { width: 5.6rem; padding: .2rem; border-radius: .96rem; background: rgba(254, 254, 254, 0.18); border-color: rgba(254, 254, 254, 0.3); }
.phone-screen {
  width: 100%; height: 100%; overflow: hidden;
  border-radius: .64rem; background: var(--green-dark);
}
.phone.is-hero .phone-screen { border-radius: .76rem; }
.phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-screen.is-empty {
  display: grid; place-items: center; align-content: center; gap: .2rem;
  padding: .4rem; text-align: center;
  border: .04rem dashed rgba(254, 191, 44, 0.6);
  color: var(--soft-white); font-size: .32rem; font-weight: 600; line-height: 1.35;
}
.phone-screen.is-empty svg { width: .9rem; height: .9rem; color: var(--yellow); }

/* Text that shrinks to fit its box (script sets --fit) */
.fit { flex: 1 1 auto; min-height: 0; width: 100%; overflow: hidden; display: flex; flex-direction: column; --fit: 1; }
.fit-inner { margin: auto 0; display: flex; flex-direction: column; align-items: center; }


/* 5. Logo bar and clocks --------------------------------------------------- */
.bar {
  grid-column: 1; grid-row: 2;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem;
  padding: 0 .72rem;
}
/* The clocks sit clear of the corner and flower artwork */
.stage.is-player .bar { padding: 0 4.4rem; }
.stage.is-full .bar { padding: 0 4.4rem; }
.bar-left { justify-self: start; text-align: left; }
.bar-center { display: flex; align-items: center; justify-content: center; height: 3.6rem; }
.bar-right { justify-self: end; text-align: right; }
.event-logo {
  display: block; width: auto; height: calc(3.2rem * var(--logo-h)); max-width: 17rem;
  object-fit: contain;
  filter: drop-shadow(0 .24rem .64rem rgba(0, 25, 26, 0.24));
}
.wordmark { font-size: .9rem; font-weight: var(--weight-display); letter-spacing: var(--tracking-display); line-height: 1; }
.clock[hidden] { display: none; }
.clock-label { font-size: .26rem; margin-bottom: .12rem; white-space: nowrap; }
.clock-time { font-size: .64rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-date { margin-top: .1rem; font-size: .26rem; color: var(--soft-white); white-space: nowrap; }


/* 6. Decorative artwork: behind everything, partly off the edges ------------ */
.pattern-wash {
  position: absolute; inset: auto 0 0; height: 52%; z-index: 0;
  background-repeat: repeat, repeat;
  background-size: auto, 15rem auto;
  background-position: center, center bottom;
  opacity: .12; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 100%);
}
.pattern-wash[hidden] { display: none; }
.accent { position: absolute; z-index: 0; pointer-events: none; height: auto; }
.accent[hidden] { display: none; }
/* Nudge the artwork here if it needs adjusting on your screen */
.accent-corner { width: 9.6rem; left: -1rem; bottom: -1.1rem; opacity: .9; }
.accent-flower { width: 5.2rem; left: 24.4rem; bottom: -2.2rem; opacity: .72; transform: rotate(-5deg); }
.stage.is-full .accent-flower { left: auto; right: -.2rem; bottom: -3.4rem; width: 3.4rem; opacity: .85; transform: rotate(-4deg); }


/* 7. Signage player (index.html) ------------------------------------------ */
.video {
  grid-column: 1; grid-row: 1; overflow: hidden;
  border-radius: var(--radius); background: #000;
  box-shadow: 0 .52rem 1.6rem rgba(0, 24, 25, 0.22);
}
.video iframe, #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; transition: opacity .6s ease; }
.video.is-starting iframe { opacity: 0; }

.notice {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; text-align: center;
  padding: 1.4rem;
  background:
    radial-gradient(circle at 82% 10%, rgba(254, 191, 44, 0.10), transparent 12rem),
    var(--green-dark);
}
.notice[hidden] { display: none; }
.notice-inner { max-width: 16rem; display: grid; justify-items: center; gap: .44rem; }
.notice .eyebrow { font-size: .3rem; }
.notice-title { font-size: 1.3rem; font-weight: var(--weight-display); line-height: .95; letter-spacing: var(--tracking-display); text-wrap: balance; }
.notice-body { font-size: .44rem; line-height: 1.55; color: var(--soft-white); max-width: 13.8rem; }

/* Right column: rotating panel on top, app download card below */
.side {
  grid-column: 2; grid-row: 1 / -1; min-height: 0;
  display: grid; grid-template-rows: 3fr 2fr; gap: .6rem;
}
.stage.no-app-promo .side { grid-template-rows: 1fr; }
.panel { position: relative; overflow: hidden; min-height: 0; }
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--white);
  opacity: 0;
  transition: opacity .5s ease;
}
/* Outgoing slide fades first, then the new one fades in, so text never overlaps */
.slide.is-active { opacity: 1; z-index: 2; transition: opacity .7s ease .45s; }

.progress {
  position: absolute; left: 0; bottom: 0; z-index: 4;
  height: .05rem; width: 0; background: var(--yellow);
}
.panel.on-yellow .progress { background: var(--green); }
@keyframes panel-progress { from { width: 0; } to { width: 100%; } }

.panel-empty {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center; text-align: center; padding: .56rem;
  font-size: .38rem; line-height: 1.5; color: var(--soft-white);
}
.panel-empty[hidden] { display: none; }

/* Text promo slide */
.promo { padding: .56rem .52rem .48rem; }
.promo .pill { margin-bottom: .4rem; }
.promo .eyebrow { font-size: calc(.3rem * var(--fit)); margin-bottom: .3rem; }
.promo .headline {
  font-size: calc(1.1rem * var(--fit)); font-weight: var(--weight-display);
  line-height: .96; letter-spacing: var(--tracking-display); text-wrap: balance;
}
.promo .lede { margin-top: .4rem; font-size: calc(.42rem * var(--fit)); line-height: 1.55; color: var(--soft-white); text-wrap: pretty; }

.promo.is-yellow { background: var(--yellow); color: var(--ink); }
.promo.is-yellow .eyebrow, .promo.is-yellow .lede { color: var(--ink); }
.promo.is-yellow .lede { opacity: .82; }
.promo.is-yellow .pill { color: var(--ink); border-color: rgba(8, 63, 65, .2); background: rgba(8, 63, 65, .06); }
.promo.is-yellow .pill-dot { background: var(--green); box-shadow: 0 0 0 .09rem rgba(8, 63, 65, .12); }
.promo.is-yellow .divider { background: linear-gradient(90deg, transparent, rgba(8, 63, 65, .22), transparent); }

.promo.is-orange { background: var(--orange); color: var(--ink); }
.promo.is-orange .eyebrow, .promo.is-orange .lede { color: var(--ink); }
.promo.is-orange .lede { opacity: .86; }
.promo.is-orange .divider { background: linear-gradient(90deg, transparent, rgba(8, 63, 65, .24), transparent); }

.promo.has-image .fit-inner { margin: auto 0 0; }
.promo-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.promo-scrim { position: absolute; inset: 0; z-index: 0; background: linear-gradient(to top, rgba(7, 55, 57, .94) 0%, rgba(7, 55, 57, .55) 48%, rgba(7, 55, 57, 0) 78%); }
.promo.has-image > .fit, .promo.has-image > .qr-block { position: relative; z-index: 1; }

.qr-block { flex: none; width: 100%; display: grid; justify-items: center; gap: .3rem; margin-top: .44rem; }
.qr-block .divider { margin-bottom: .14rem; }
.qr-caption { font-size: .32rem; line-height: 1.35; font-weight: 700; max-width: 5.6rem; }

/* Image slide */
.image-slide .image-main { width: 100%; height: 100%; display: block; }

/* QR card on top of an image slide */
.image-qr {
  position: absolute; z-index: 1;
  display: grid; justify-items: center; gap: .12rem;
  width: 2.8rem; padding: .18rem .18rem .16rem;
  background: var(--white); color: var(--ink);
  border-radius: .26rem;
  box-shadow: 0 .24rem .8rem rgba(0, 24, 25, 0.28);
}
.image-qr .qr { width: 100%; height: auto; aspect-ratio: 1 / 1; padding: 0; border-radius: 0; background: transparent; }
.image-qr-caption { font-size: .22rem; font-weight: 750; line-height: 1.25; text-align: center; }
.image-qr.is-large { width: 3.6rem; }
.image-qr.is-large .image-qr-caption { font-size: .26rem; }
.image-qr.is-bottom-center { left: 50%; bottom: .36rem; transform: translateX(-50%); }
.image-qr.is-bottom-right { right: .36rem; bottom: .36rem; }
.image-qr.is-bottom-left { left: .36rem; bottom: .36rem; }
.image-qr.is-top-right { right: .36rem; top: .36rem; }
.image-qr.is-top-left { left: .36rem; top: .36rem; }
.image-qr.is-center { left: 50%; top: 50%; transform: translate(-50%, -50%); }

/* Social post slide (one post at a time in the panel) */
.social { padding: .44rem .52rem .4rem; }
.social-top { flex: none; display: grid; justify-items: center; gap: .22rem; width: 100%; }
.who { display: flex; align-items: center; justify-content: center; gap: .2rem; max-width: 100%; }
.who-text { min-width: 0; text-align: left; }
.who .name { font-size: .34rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .handle { font-size: .28rem; color: var(--soft-white); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.social-media { flex: none; width: 100%; margin-top: .32rem; aspect-ratio: 16 / 10; border-radius: var(--radius-inner); overflow: hidden; background: rgba(254, 254, 254, .06); }
.social-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.social .fit { margin-top: .28rem; }
.social-text { font-size: calc(.4rem * var(--fit)); line-height: 1.5; text-wrap: pretty; }
.social.no-image .social-text { font-size: calc(.66rem * var(--fit)); font-weight: 600; line-height: 1.16; letter-spacing: -.02em; text-wrap: balance; }
.social-foot { flex: none; width: 100%; margin-top: .24rem; display: grid; justify-items: center; gap: .18rem; }
.social-foot .date { font-size: .28rem; color: var(--soft-white); }

/* Web page slide */
.iframe-slide iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* App download card */
.app-promo {
  position: relative; overflow: hidden; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: .4rem .52rem; text-align: center; --fit: 1;
}
.app-promo[hidden] { display: none; }
.app-inner { display: flex; flex-direction: column; align-items: center; width: 100%; }
.app-promo .eyebrow { font-size: calc(.28rem * var(--fit)); margin-bottom: calc(.14rem * var(--fit)); }
.app-headline { font-size: calc(.78rem * var(--fit)); font-weight: var(--weight-display); line-height: .96; letter-spacing: var(--tracking-display); text-wrap: balance; }
.app-body { margin-top: calc(.16rem * var(--fit)); font-size: calc(.32rem * var(--fit)); line-height: 1.45; color: var(--soft-white); text-wrap: pretty; }
.app-qr {
  flex: none; margin-top: calc(.32rem * var(--fit));
  width: calc(3.6rem * var(--fit)); height: calc(3.6rem * var(--fit));
  padding: calc(.2rem * var(--fit)); background: var(--white); border-radius: .24rem;
}
.app-qr svg, .app-qr img { width: 100%; height: 100%; display: block; object-fit: contain; shape-rendering: crispEdges; }
.app-qr.is-placeholder {
  background: transparent; border: .03rem dashed currentColor; opacity: .6;
  display: grid; place-items: center; font-size: .28rem; font-weight: 700;
}
.app-caption { margin-top: calc(.22rem * var(--fit)); font-size: calc(.3rem * var(--fit)); font-weight: 750; line-height: 1.3; }
.app-inner > [hidden] { display: none; }

.app-promo.is-yellow { background: var(--yellow); color: var(--ink); border-color: transparent; }
.app-promo.is-yellow .eyebrow, .app-promo.is-yellow .app-body { color: var(--ink); }
.app-promo.is-yellow .app-body { opacity: .82; }
.app-promo.is-orange { background: var(--orange); color: var(--ink); border-color: transparent; }
.app-promo.is-orange .eyebrow, .app-promo.is-orange .app-body { color: var(--ink); }
.app-promo.is-light { background: var(--white); color: var(--ink); border-color: transparent; }
.app-promo.is-light .eyebrow { color: var(--orange); }
.app-promo.is-light .app-body { color: var(--ink); opacity: .8; }
.app-promo.is-light .app-qr { box-shadow: inset 0 0 0 .02rem rgba(8, 63, 65, .14); }


/* 8. Screen: download the app (app.html) ---------------------------------- */
.screen-app {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.1rem .7rem 1.3rem;
}
.app-copy { width: 16.4rem; flex: none; display: flex; flex-direction: column; gap: .56rem; }
.app-copy .lede-lg { margin-top: -.04rem; }
.app-copy .qr-card { margin-top: .24rem; }
.phones { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.phones .phone:not(.is-hero) { margin-top: 1.6rem; }


/* 9. Screen: social posts (social.html) ----------------------------------- */
.screen-social { display: flex; flex-direction: column; gap: .52rem; padding: .7rem 1rem .6rem; }
.social-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.social-head-copy { display: flex; flex-direction: column; gap: .36rem; }
.follow { display: flex; flex-direction: column; align-items: flex-end; gap: .12rem; padding-bottom: .1rem; text-align: right; }
.follow .eyebrow { color: var(--soft-white); font-size: .3rem; }
.follow-handle { font-size: .64rem; font-weight: 700; color: var(--yellow); letter-spacing: -.01em; }
.follow [hidden] { display: none; }

.post-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; gap: .44rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.post-grid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.post-card {
  min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: .34rem;
  padding: .52rem .6rem .56rem;
  border-radius: .52rem;
  background: var(--tint); border: .02rem solid var(--tint-border);
  color: var(--white);
  transition: background-color .6s ease, color .6s ease, border-color .6s ease;
}
.post-card.is-featured { background: var(--white); border-color: var(--white); color: var(--ink); }
.post-head { flex: none; display: flex; align-items: center; gap: .28rem; min-width: 0; }
.post-head .avatar { width: 1.08rem; height: 1.08rem; font-size: .38rem; background: var(--orange); color: var(--ink); }
.post-card.is-featured .post-head .avatar { background: var(--green); color: var(--yellow); }
.post-who { min-width: 0; flex: 1 1 auto; }
.post-name { font-size: .42rem; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { font-size: .32rem; line-height: 1.3; color: var(--soft-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-card.is-featured .post-meta { color: var(--ink-soft); }
.post-tag {
  flex: none; padding: .12rem .24rem; border-radius: var(--radius-pill);
  background: var(--yellow); color: var(--ink);
  font-size: .26rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.post-body { flex: 1 1 auto; min-height: 0; display: flex; gap: .34rem; overflow: hidden; --fit: 1; }
.post-text { flex: 1 1 auto; min-width: 0; font-size: calc(.46rem * var(--fit)); line-height: 1.4; font-weight: 500; text-wrap: pretty; }
.post-image { flex: none; width: 36%; align-self: flex-start; aspect-ratio: 1; border-radius: var(--radius-inner); overflow: hidden; background: rgba(254, 254, 254, .06); }
.post-card.is-featured .post-image { background: rgba(8, 63, 65, .06); }
.post-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-empty {
  grid-column: 1 / -1; grid-row: 1 / -1;
  display: grid; place-items: center; text-align: center;
  font-size: .5rem; color: var(--soft-white);
}
.post-empty[hidden] { display: none; }

@keyframes post-in {
  from { opacity: 0; transform: translateY(.4rem) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.post-card.is-entering { animation: post-in .9s cubic-bezier(.2, .7, .2, 1) both; }
.post-card.is-leaving { opacity: 0; transition: opacity .5s ease; }


/* 10. Screen: Bangkok Bulletin (newsletter.html) -------------------------- */
.screen-news {
  display: flex; align-items: center; gap: 1.1rem;
  padding: .7rem 1.1rem .7rem 1.3rem;
}
.news-copy { width: 17rem; flex: none; display: flex; flex-direction: column; gap: .52rem; }
.news-logo { display: block; max-width: 14rem; max-height: 3.8rem; width: auto; height: auto; object-fit: contain; object-position: left center; }
.news-title { font-size: calc(2.3rem * var(--fit, 1)); max-width: 9ch; line-height: .92; letter-spacing: -.04em; }
.news-copy .qr-card { margin-top: .24rem; }
.news-copy [hidden] { display: none; }

.news-art { flex: 1 1 auto; min-width: 0; display: grid; place-items: center; }
.mail { position: relative; width: 10.6rem; height: 12.4rem; }
.mail-back {
  position: absolute; inset: 0;
  border-radius: var(--radius); background: var(--yellow);
  transform: translate(.8rem, .7rem) rotate(4deg);
}
.mail-card {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column;
  border-radius: var(--radius); background: var(--white); color: var(--ink);
  transform: rotate(-3deg);
  box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, 0.35);
}
.mail-meta { flex: none; display: grid; gap: .08rem; padding: .42rem .56rem; border-bottom: .02rem solid rgba(8, 63, 65, .14); font-size: .3rem; color: var(--ink-soft); }
.mail-meta strong { color: var(--ink); font-weight: 700; }
.mail-mast { flex: none; display: grid; gap: .1rem; padding: .56rem; background: var(--green); color: var(--white); }
.mail-mast .eyebrow { font-size: .24rem; }
.mail-mast-title { font-size: .74rem; font-weight: var(--weight-display); letter-spacing: -.02em; line-height: 1; }
.mail-mast-logo { display: block; max-height: 1.1rem; max-width: 7rem; width: auto; object-fit: contain; object-position: left center; }
.mail-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: .28rem; padding: .56rem; }
.mail-body img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: var(--radius-inner); }
.mail-photo { flex: none; height: 3rem; border-radius: var(--radius-inner); background: rgba(8, 63, 65, .08); }
.sk { flex: none; height: .22rem; border-radius: .11rem; background: rgba(8, 63, 65, .15); }
.sk.is-heading { height: .34rem; background: rgba(8, 63, 65, .78); }


/* 11. Web: download page (download.html) ---------------------------------- */
html.is-web body {
  min-height: 100vh; overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 10%, rgba(254, 191, 44, 0.10), transparent 14rem),
    radial-gradient(circle at 10% 84%, rgba(215, 119, 67, 0.08), transparent 12rem),
    linear-gradient(180deg, var(--green) 0%, var(--green) 58%, var(--green-dark) 100%);
}
.web-page { position: relative; min-height: 100vh; overflow: hidden; }
.web-page .pattern-wash { height: 60%; background-size: 12rem auto; background-position: center bottom; }
.web-top { display: flex; align-items: center; min-height: 1.4rem; }
.web-logo { display: block; height: 1.3rem; width: auto; max-width: 70vw; object-fit: contain; font-size: .32rem; font-weight: 700; color: var(--soft-white); }
.web-page .accent-corner { position: absolute; width: 9rem; left: -3rem; bottom: -1.6rem; }
.web-page .accent-flower { position: absolute; width: 3rem; left: auto; right: -.1rem; bottom: auto; top: 1.4rem; transform: none; opacity: .85; }

.web-shell {
  position: relative; z-index: 1;
  width: min(calc(100% - .8rem), 25rem);
  margin: 0 auto; padding: .8rem 0 1.2rem;
}
.web-hero {
  min-height: calc(100vh - 2rem);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: .8rem; align-items: center;
}
.web-copy { display: flex; flex-direction: column; gap: .44rem; }
.web-copy .display { font-size: clamp(1rem, 5vw, 1.44rem); max-width: 14ch; }
.web-lede { font-size: max(.36rem, 16px); line-height: 1.65; color: var(--soft-white); max-width: 12.4rem; }

.web-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .24rem; max-width: 13rem; margin-top: .16rem; }
.web-actions .is-featured { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .16rem;
  min-height: 1.28rem; padding: .28rem .44rem;
  border-radius: .36rem; border: .02rem solid var(--tint-border);
  background: var(--tint); color: var(--white);
  font: inherit; font-size: max(.32rem, 15px); font-weight: 700; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: rgba(254, 254, 254, 0.14); }
.btn:focus-visible { outline: .06rem solid var(--yellow); outline-offset: .06rem; }
.btn.is-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn.is-primary:hover { background: #ffcb4f; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.btn svg { width: .4rem; height: .4rem; flex: none; }

.web-features { display: flex; flex-wrap: wrap; gap: .16rem; margin-top: .16rem; padding: 0; list-style: none; }
.web-features li {
  display: inline-flex; align-items: center; gap: .14rem;
  min-height: .7rem; padding: 0 .26rem;
  border-radius: var(--radius-pill); border: .02rem solid var(--tint-border); background: rgba(254, 254, 254, 0.05);
  font-size: max(.28rem, 13px); font-weight: 600; color: rgba(254, 254, 254, 0.9);
}
.web-features li::before { content: ""; width: .14rem; height: .14rem; border-radius: 50%; background: var(--yellow); flex: none; }

.web-visual { position: relative; display: grid; place-items: center; min-height: 13rem; }
.web-visual .phone { width: 5.2rem; transform: rotate(-5deg); }
.web-visual .phone-glow {
  position: absolute; width: 10rem; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 191, 44, .16), rgba(215, 119, 67, .12) 40%, transparent 70%);
}

@media (max-width: 900px) {
  .web-hero { grid-template-columns: 1fr; min-height: 0; padding-top: .4rem; }
  .web-copy .display { max-width: 13ch; }
  .web-visual { min-height: 11rem; }
  .web-visual .phone { width: 4.4rem; }
}
@media (max-width: 560px) {
  .web-actions { grid-template-columns: 1fr; }
  .web-visual { min-height: 9rem; }
  .web-visual .phone { width: 3.8rem; }
  .web-logo { height: 1rem; }
}


/* 12. Diagnostics and motion ---------------------------------------------- */
.debug {
  position: absolute; left: .6rem; top: .6rem; z-index: 10; max-width: 24rem;
  padding: .24rem .3rem; border-radius: .2rem;
  background: rgba(7, 55, 57, .92); border: .02rem solid var(--line);
  font-size: .32rem; line-height: 1.5; color: var(--white); white-space: pre-wrap;
}
.debug[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .slide, .slide.is-active { transition-duration: .001ms; transition-delay: 0s; }
  .post-card.is-entering { animation: none; }
  .btn { transition: none; }
}
