/* UK Newsroom: wire-service bulletin Mini App */

:root {
  --milk: #FAF9F6;
  --ink: #2B2B2B;
  --ink-soft: #4a4946;
  --muted: #6a6862;
  --red: #C41E3A;
  --steel: #3B5A78;
  --forest: #3D6B4F;

  --font-head: "Oswald", "Archivo Narrow", "Arial Narrow", Impact, sans-serif;
  --font-body: "Source Sans 3", "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Courier Prime", "Courier New", monospace;
  --font-mast: "Noto Serif Display", "Times New Roman", Georgia, serif;

  --ticker-h: 32px;
  --nav-h: 58px;
  --gutter: 16px;
  --col: 720px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
body.is-locked { overflow: hidden; }

:focus-visible { outline: 3px solid var(--sec, var(--red)); outline-offset: 3px; }

/* ---------- Ticker ---------- */

.ticker {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--ticker-h);
  z-index: 100;
  display: flex;
  align-items: stretch;
  background: var(--ink);
  color: #d8d3c8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
}

.ticker-flag {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 0 14px;
  background: var(--ink);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  animation: breathe 2.2s ease-in-out infinite;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--red);
  animation: ring 2.2s ease-out infinite;
}
@keyframes ring {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(3.2); opacity: 0; }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ticker-window {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: tick var(--tick-dur, 420s) linear infinite;
}
@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.tk-set { display: inline-flex; flex: none; }
.tk-item { padding-left: 0; }
.tk-sep { color: #e0566c; padding: 0 1.1em; font-weight: 700; }

/* ---------- Masthead (rebuilt from logo.png) ---------- */

.masthead {
  padding: calc(var(--ticker-h) + 26px) var(--gutter) 18px;
  display: flex;
  justify-content: center;
}

.logo {
  margin: 0;
  width: 100%;
  max-width: 560px;
  container-type: inline-size;
}

.logo-word {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  white-space: nowrap;
  line-height: 1;
  font-family: var(--font-mast);
  filter: drop-shadow(0 0.35cqw 0.3cqw rgba(0, 10, 40, 0.28));
}

.lg-uk,
.lg-news,
.lg-room {
  display: inline-block;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.lg-uk {
  --nat: 38.7cqw;
  --sx: 0.897;
  position: relative;
  font-family: "Playfair Display", var(--font-mast);
  font-size: 27.5cqw;
  font-weight: 900;
  letter-spacing: -0.02em;
  transform: scaleX(var(--sx));
  transform-origin: 0 100%;
  margin-right: calc(var(--nat) * (var(--sx) - 1) + 0.4cqw);
  background-image:
    linear-gradient(115deg, rgba(120, 170, 255, 0.5) 0, rgba(120, 170, 255, 0) 30%),
    linear-gradient(180deg, #2a5cbf 0%, #123c96 18%, #0a2a72 45%, #061b52 72%, #020d30 100%);
  -webkit-text-stroke: 0.3cqw #d9a469;
  paint-order: stroke fill;
}
/* lens flare on the U, as in the logo */
.lg-uk::before {
  content: "";
  position: absolute;
  left: 3.5cqw;
  top: 47%;
  width: 7cqw;
  height: 7cqw;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, #fff 0 8%, rgba(190, 215, 255, 0.85) 18%, rgba(120, 165, 255, 0) 62%),
    linear-gradient(90deg, transparent 0 30%, rgba(255, 255, 255, 0.8) 50%, transparent 70%) center / 100% 2px no-repeat,
    linear-gradient(0deg, transparent 0 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%) center / 2px 100% no-repeat;
  -webkit-text-fill-color: initial;
  pointer-events: none;
}

.lg-news {
  --nat: 51.5cqw;
  --sx: 0.662;
  font-size: 23cqw;
  font-weight: 900;
  font-stretch: 62.5%;
  letter-spacing: -0.015em;
  transform: scaleX(var(--sx));
  transform-origin: 0 100%;
  margin-right: calc(var(--nat) * (var(--sx) - 1));
  -webkit-text-stroke: 0.5cqw #a30f20;
  paint-order: stroke fill;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0 30%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(175deg, #e02a3a 0%, #b30f1f 30%, #8d0a18 62%, #650612 100%);
}

.lg-room {
  --nat: 52.4cqw;
  --sx: 0.586;
  font-size: 23cqw;
  font-weight: 800;
  font-stretch: 62.5%;
  letter-spacing: -0.01em;
  transform: scaleX(var(--sx));
  transform-origin: 0 100%;
  margin-right: calc(var(--nat) * (var(--sx) - 1));
  -webkit-text-stroke: 0.45cqw #0a2a66;
  paint-order: stroke fill;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0 30%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, #123f86 0%, #0a2a66 40%, #061b47 75%, #030f2d 100%);
}

.lg-swoosh {
  position: relative;
  display: block;
  width: 96%;
  height: 1.5cqw;
  margin: 0.4cqw auto 0;
  border-radius: 50%;
  background: linear-gradient(90deg,
    rgba(6, 27, 82, 0) 0%, #08205c 10%, #0b2a6b 28%, #7e1024 42%,
    #c81f30 50%, #7e1024 58%, #0b2a6b 72%, #08205c 90%, rgba(6, 27, 82, 0) 100%);
}
.lg-swoosh::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20cqw;
  height: 4.4cqw;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 190, 130, 0.95) 0, rgba(255, 110, 70, 0.55) 30%, rgba(255, 90, 60, 0) 70%);
}

/* ---------- Press pass tabs ---------- */

.passes {
  position: sticky;
  top: var(--ticker-h);
  z-index: 40;
  background: var(--milk);
  border-bottom: 2px solid var(--ink);
}

.passes-inner {
  max-width: var(--col);
  margin: 0 auto;
  padding: 10px var(--gutter) 0;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.pass {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 17px 8px 9px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--red);
  background: #fff;
  border: 2px solid var(--red);
  border-bottom: 0;
  margin-bottom: -2px;
  transition: background-color 0.18s, color 0.18s, transform 0.18s var(--ease-out);
}
.pass::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 18px;
  height: 5px;
  margin-left: -9px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  opacity: 0.75;
}
.pass:hover { transform: translateY(-2px); }
.pass:active { transform: translateY(1px); }
.pass.is-active { background: var(--red); color: var(--milk); }

/* ---------- Wire ---------- */

.wire { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter); }

.desk { --sec: var(--red); padding-top: 34px; scroll-margin-top: calc(var(--ticker-h) + var(--nav-h)); }
.desk--business { --sec: var(--steel); }
.desk--sports { --sec: var(--forest); }

.desk-head {
  padding-top: 10px;
  border-top: 8px solid var(--sec);
}
.desk-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(44px, 13vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--sec);
}
.bulletin {
  position: relative;
  padding: 26px 0 0;
  cursor: pointer;
}

.bulletin-top { display: flex; align-items: center; gap: 12px; margin-left: calc(var(--gutter) * -1); }

.tag {
  display: inline-block;
  padding: 5px 12px 4px calc(var(--gutter) + 0px);
  background: var(--sec);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.2s var(--ease-out);
}
.headline {
  margin: 16px 0 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 7.4vw, 34px);
  line-height: 1.08;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.headline a {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--sec), var(--sec));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 3px;
  transition: background-size 0.3s var(--ease-out);
}

.photo { position: relative; margin: 20px 0 22px; }
.photo::before {
  content: "";
  position: absolute;
  inset: 8px -8px -8px 8px;
  background: radial-gradient(circle, var(--sec) 1.2px, transparent 1.6px) 0 0 / 6px 6px;
  opacity: 0.3;
}
.photo img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  background: #e9e6df;
  outline: 1px solid rgba(43, 43, 43, 0.22);
}
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0.7px, transparent 1.1px) 0 0 / 4px 4px;
  mix-blend-mode: multiply;
  opacity: 0.1;
  pointer-events: none;
}

.preview {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.55;
}
.photo + .preview { margin-top: 0; }

.readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 3px solid var(--sec);
  background: none;
  color: var(--sec);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  cursor: pointer;
}
.readmore-arrow { display: inline-block; transition: transform 0.25s var(--ease-out); }

.bulletin:hover .headline a { background-size: 100% 3px; }
.bulletin:hover .readmore-arrow { transform: translateX(5px); }
.bulletin:hover .tag { transform: translateX(6px); }
.bulletin:active .headline a { background-size: 100% 3px; }

/* perforated wire-paper rule */
.perf {
  height: 16px;
  margin: 28px 0 0;
  border: 0;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 13px) 0 2px / 100% 2px no-repeat,
    radial-gradient(circle, rgba(43, 43, 43, 0.6) 1.6px, transparent 2px) 3px 9px / 11px 6px repeat-x;
  opacity: 0.85;
}

.wire-end {
  max-width: var(--col);
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  font-family: var(--font-head);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 13px;
}
.wire-end-block { width: 28px; height: 8px; background: var(--red); align-self: center; }

/* ---------- Article view ---------- */

.article-view {
  --sec: var(--red);
  position: fixed;
  inset: var(--ticker-h) 0 0 0;
  z-index: 60;
  background: var(--milk);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.article-view[hidden] { display: none; }
.article-view.is-open { animation: view-in 0.32s var(--ease-out); }
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.article-view.desk--business { --sec: var(--steel); }
.article-view.desk--sports { --sec: var(--forest); }

.av-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--milk);
  border-bottom: 2px dashed rgba(43, 43, 43, 0.5);
}
.av-back {
  display: block;
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  min-height: 48px;
  padding: 0 var(--gutter);
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--ink);
  cursor: pointer;
}
.av-back:hover { color: var(--sec); }

.av-body { max-width: 680px; margin: 0 auto; padding: 26px var(--gutter) calc(64px + env(safe-area-inset-bottom)); }

.filed {
  display: inline-block;
  margin: 0;
  padding: 5px 12px 4px;
  background: var(--sec);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.av-headline {
  margin: 16px 0 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(30px, 8.4vw, 42px);
  line-height: 1.06;
  text-wrap: balance;
}

#avPhoto .photo { margin: 24px 0 30px; }

.av-text p {
  margin: 0 0 1.2em;
  font-size: 17.5px;
  line-height: 1.8;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
.av-text p:first-child::first-line { font-weight: 600; }

.av-end { margin-top: 12px; }

.noscript { padding: 24px var(--gutter); text-align: center; }

/* ---------- Small screens and motion ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .preview { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .pulse, .pulse::after { animation: none; }
  .article-view.is-open { animation: none; }
  * { transition: none !important; scroll-behavior: auto !important; }
}
