/* Acts Radio Samui: shared styles for the English and Thai pages */

/* ---------- Fonts (self-hosted, no requests to Google) ---------- */
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("fonts/poppins-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* Thai (Poppins has no Thai characters, so the browser takes them from Prompt) */
@font-face {
  font-family: "Prompt";
  src: url("fonts/prompt-thai-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;   /* Thai characters only */
}
@font-face {
  font-family: "Prompt";
  src: url("fonts/prompt-thai-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;   /* Thai characters only */
}
@font-face {
  font-family: "Prompt";
  src: url("fonts/prompt-thai-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;   /* Thai characters only */
}

/* ---------- Colours: taken from the logo ---------- */
:root {
  --ink: #000000;        /* logo black */
  --red: #E31E24;        /* logo red */
  --paper: #FFFFFF;
  --muted: #555555;      /* secondary text, 7:1 on white */
  --studio: #1A1918;     /* behind the photo while it loads */
  --panel: #262422;      /* behind the player: warm charcoal from the studio photo */

  --font: "Poppins", "Prompt", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 34rem;      /* comfortable line length */
  --gutter: 1.25rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;  /* 17px */
  line-height: 1.65;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }


/* ---------- Opening: logo, verse, player ---------- */
.opening {
  max-width: calc(64rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 3.5rem) var(--gutter) 0;
  text-align: center;
}
.opening h1 { margin: 0; }
.logo { width: clamp(180px, 46vw, 240px); margin: 0 auto; }

.verse { margin: clamp(1.5rem, 4vw, 2rem) 0 0; }
.verse p {
  margin: 0;
  font-size: clamp(1.05rem, 4.3vw, 1.35rem);
  font-style: italic;
  line-height: 1.45;
}
.verse cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Panel behind the AzuraCast player (the player itself is transparent).
   --player-height trims the empty space under the controls: if the
   controls ever look cut off on a phone, raise it (e.g. to 130px). */
.player {
  --player-height: 108px;
  --player-scale: 1;
  max-width: var(--measure);
  margin: clamp(1.75rem, 5vw, 2.5rem) auto 0;
}
.player-panel {
  background: var(--panel);
  border-radius: 14px;
  padding: 0.5rem 0.5rem 0.25rem;
}
.player iframe {
  display: block;
  width: calc(100% / var(--player-scale));
  height: var(--player-height);
  border: 0;
  transform: scale(var(--player-scale));
  transform-origin: 0 0;
  margin-bottom: calc(var(--player-height) * (var(--player-scale) - 1));
}
/* On phones the player is enlarged so its text and buttons are easier to use */
@media (max-width: 40rem) {
  .player { --player-scale: 1.2; }
}
/* On desktop the whole player is larger: wider panel, enlarged contents */
@media (min-width: 60rem) {
  .player { --player-scale: 1.2; max-width: 36rem; }
}

/* ---------- About ----------
   Desktop: photo to the left of the text, larger than the text column.
   Phones: photo across the full width, text below. */
.story {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(2rem, 5vw, 2.5rem);
}
.story-photo img {
  width: 100%;
  background: var(--studio);
}
.story-text { padding: 0 var(--gutter); }
.story-text p {
  margin: 0 auto;
  max-width: var(--measure);
  text-wrap: pretty;   /* avoids a single word on the last line */
}
.story-text p + p { margin-top: 1em; }   /* space between the About paragraphs */
@media (min-width: 72rem) {   /* side by side only where both columns have room */
  .story {
    max-width: calc(76rem + 2 * var(--gutter));
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--gutter);
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);   /* photo two-thirds, text one-third */
    column-gap: 3rem;
    align-items: stretch;
  }
  /* The photo fills the full height of the text beside it */
  .story-photo { position: relative; min-height: 24rem; }
  .story-photo img {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
  }
  .story-text { display: flex; flex-direction: column; justify-content: center; }
  .story-text { padding: 0; }
  .story-text p { margin: 0; }
  .story-text p + p { margin-top: 1em; }
}

/* ---------- Get involved ---------- */
.involved {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: clamp(2.5rem, 7vw, 3.5rem) auto 0;
  padding: 0 var(--gutter);
}
/* Centred on desktop to match the top of the page and the footer */
@media (min-width: 60rem) {
  .involved { text-align: center; }
}

h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}
.involved h2 { color: var(--red); }
.involved p { margin: 0; text-wrap: pretty; }
/* Line break used on desktop only */
.wide-only { display: none; }
@media (min-width: 60rem) { .wide-only { display: inline; } }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--ink);
}
/* Phones: two per row */
@media (max-width: 40rem) {
  .links { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; column-gap: 1.5rem; text-align: left; }
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 0;   /* larger tap target */
}
.links a:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.links svg { width: 1.35rem; height: 1.35rem; fill: currentColor; flex: none; }

.footer .tip {
  margin: 0 auto 1.25rem;
  font-size: 0.9375rem;
}

/* ---------- Footer, opened by the heartbeat line from the logo ---------- */
.heartbeat {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 3rem;
  overflow: visible;
}
.heartbeat path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.footer {
  max-width: calc(64rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: 3rem var(--gutter) 2.5rem;   /* same gap above and below the line */
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
.footer p { margin: 0 auto 0.6rem; max-width: var(--measure); text-wrap: balance; }
.footer .notice { max-width: none; }

/* ---------- Language switch ---------- */
.lang {
  position: absolute;
  top: 1rem;
  right: var(--gutter);
  font-size: 0.875rem;
  color: var(--muted);
}
.lang a { text-decoration: none; padding: 0.25rem 0.2rem; }
.lang a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.lang a:not([aria-current]):hover { color: var(--red); }
.lang span { margin: 0 0.15rem; }

/* ---------- Thai page ---------- */
:lang(th) body, body:lang(th) { line-height: 1.8; }   /* room for Thai vowels and tone marks */
.verse p:lang(th) { font-style: normal; }             /* Thai text is not set in italics */
.nw { white-space: nowrap; }   /* keeps a word from breaking across lines */
