:root {
  --bg: #F0F1F8;
  --surface: #FFFFFF;
  --ink: #171B33;
  --ink-soft: #4A4F6B;
  --cobalt: #2A4B8D;
  --cobalt-deep: #1D3568;
  --coral: #E0654F;
  --line: rgba(42, 75, 141, 0.14);
  --shadow-card: 0 1px 2px rgba(29, 53, 104, 0.06), 0 14px 32px -14px rgba(29, 53, 104, 0.28);

  --font-head: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mark: "Playfair Display", "Fraunces", Georgia, serif;

  --gutter: 16px;
  --radius: 22px;
  --duration-fast: 160ms;
  --duration-normal: 320ms;
  --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(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

button { font: inherit; color: inherit; }

img { display: block; max-width: 100%; }

/* ---------- Masthead ---------- */

.masthead { padding: 0 0 6px; }

.masthead-panel {
  position: relative;
  overflow: hidden;
  padding: max(26px, env(safe-area-inset-top)) var(--gutter) 24px;
  border-radius: 0 0 40px 40px;
  background:
    radial-gradient(70% 55% at 8% 4%, rgba(224, 101, 79, 0.34), transparent 70%),
    radial-gradient(75% 60% at 96% 98%, rgba(42, 75, 141, 0.30), transparent 70%),
    linear-gradient(168deg, #D9DFF6 0%, #ECE6F3 55%, #F8E4DE 100%);
  box-shadow: 0 22px 40px -28px rgba(29, 53, 104, 0.5);
  text-align: center;
  animation: panel-in 700ms var(--ease-out) both;
}

.masthead-panel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--cobalt) 0 50%, var(--coral) 50% 100%);
  opacity: 0.9;
}

.emblem {
  --d: min(90vw, 410px);
  --fs: calc(var(--d) * 0.168);
  position: relative;
  width: var(--d);
  height: var(--d);
  margin: 0 auto;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(42, 75, 141, 0.06),
    0 26px 50px -18px rgba(29, 53, 104, 0.45);
  animation: emblem-in 900ms 120ms var(--ease-out) both;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wordmark {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 92%;
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--font-mark);
  font-weight: 900;
  font-size: var(--fs);
  line-height: 1;
  letter-spacing: -0.048em;
  text-align: center;
}

.wm-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.05em;
  white-space: nowrap;
}

.wm-le,
.wm-courrier,
.wm-francais {
  display: inline-block;
  padding: 0.04em 0.03em 0.02em;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.wm-le {
  font-size: 0.76em;
  background-image: linear-gradient(180deg, #0a2a6e 0%, #04122f 100%);
}

.wm-courrier {
  background-image: linear-gradient(180deg, #0c4499 0%, #06225a 42%, #020a22 100%);
}

.wm-c {
  font-size: 1.32em;
  line-height: 0;
  margin-right: -0.01em;
  background-image: linear-gradient(180deg, #0b48a3 0%, #061d52 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.wm-i {
  position: relative;
  display: inline-block;
}

.wm-i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.1em;
  width: 0.25em;
  height: 0.25em;
  margin-left: -0.1em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff4a4a, #d10f17 70%, #8f0a10);
  -webkit-text-fill-color: initial;
}

.wm-rule {
  display: flex;
  gap: 0.05em;
  margin: 0.01em 0.02em 0.02em;
  animation: rule-in 800ms 500ms var(--ease-out) both;
  transform-origin: center;
}

.wm-rule i {
  display: block;
  flex: 1;
  height: 0.028em;
  min-height: 2px;
}

.wm-rule i:first-child { background: linear-gradient(90deg, #1b4fa8, #0d2f78); }
.wm-rule i:last-child { background: linear-gradient(90deg, #7d0d12, #e12029); }

.wm-francais {
  display: block;
  margin-top: -0.06em;
  font-size: 1.29em;
  letter-spacing: -0.045em;
  background-image: linear-gradient(180deg, #f0202a 0%, #bd141c 50%, #5e0a10 100%);
}

.tagline {
  margin: 20px 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cobalt-deep);
  animation: fade-up 700ms 650ms var(--ease-out) both;
}

.tagline b { color: var(--coral); margin: 0 0.4em; }

@keyframes panel-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes emblem-in {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes rule-in {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Feed ---------- */

.feed {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px var(--gutter) 8px;
}

.section { margin-bottom: 38px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 2px 16px;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.pill {
  display: inline-block;
  padding: 7px 15px 6px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  background: var(--cobalt);
  color: #fff;
}

.pill--coral { background: var(--coral); color: #1B1220; }

.story { position: relative; }

.story h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}

.story p {
  margin: 0;
  color: var(--ink-soft);
}

.more {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--cobalt);
  cursor: pointer;
  text-align: left;
}

/* stretched hit area: the whole card opens the article */
.more::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.more:focus-visible { outline: none; }
.more:focus-visible::after { outline: 3px solid var(--coral); outline-offset: 2px; }

.arrow { display: inline-block; transition: transform var(--duration-fast) var(--ease-out); }
.story:hover .arrow { transform: translateX(4px); }

/* Politics: wide banner above a large headline */

.story--banner {
  margin-bottom: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out);
}

.story--banner:active { transform: scale(0.988); }

.story--banner .thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.story--banner .body { padding: 18px 20px 20px; }

.story--banner h3 {
  font-size: clamp(25px, 6.6vw, 31px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  font-weight: 800;
  margin-bottom: 10px;
}

.story--banner p { font-size: 16px; }

/* Economy/Business: rounded-square thumbnail left of compact text */

.story--thumb {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 15px;
  align-items: start;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform var(--duration-normal) var(--ease-out);
}

.story--thumb:active { transform: scale(0.988); }

.story--thumb .thumb {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(224, 101, 79, 0.22);
}

.story--thumb h3 {
  font-size: 18px;
  line-height: 1.22;
  margin-bottom: 6px;
}

.story--thumb p { font-size: 14.5px; line-height: 1.5; }

.story--thumb .more { margin-top: 8px; font-size: 14.5px; }

/* Finance: text only, serious and ruled */

.fin-list {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-left: 5px solid var(--cobalt);
  overflow: hidden;
}

.story--text {
  padding: 20px 20px 20px 18px;
  border-top: 1px solid var(--line);
}

.story--text:first-child { border-top: 0; }

.story--text h3 {
  font-size: 21px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.story--text p { font-size: 15.5px; }

/* ---------- Footer ---------- */

.foot {
  max-width: 640px;
  margin: 18px auto 0;
  padding: 34px var(--gutter) max(40px, env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
}

.foot-mark {
  margin: 0 0 8px;
  font-family: var(--font-mark);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--cobalt-deep);
}

.foot-mark b { font-weight: 900; }
.foot-mark em { font-style: normal; color: var(--coral); }

.foot-line {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Full-screen article overlay ---------- */

.reader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-normal) var(--ease-out), transform var(--duration-normal) var(--ease-out);
}

.reader[hidden] { display: none; }

.reader.is-open { opacity: 1; transform: none; }

.reader-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgba(240, 241, 248, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.reader-brand {
  font-family: var(--font-mark);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--cobalt-deep);
}

.reader-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--cobalt);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(42, 75, 141, 0.7);
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast);
}

.reader-close:hover { background: var(--cobalt-deep); }
.reader-close:active { transform: scale(0.96); }
.reader-close:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.reader-img {
  width: 100%;
  height: auto;
  max-height: 46vh;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #dfe3f3;
}

.reader-body {
  position: relative;
  max-width: 640px;
  margin: -26px auto 0;
  padding: 26px 22px 44px;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
}

.reader-title {
  margin: 14px 0 20px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(27px, 7.4vw, 36px);
  line-height: 1.13;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.reader-text p {
  margin: 0 0 1.05em;
  font-size: 17.5px;
  line-height: 1.68;
  color: #262a45;
}

.reader-text p:first-child {
  font-size: 19.5px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--ink);
}

.reader-close--foot {
  margin-top: 14px;
  padding: 0 24px;
  background: var(--coral);
  color: #1B1220;
  box-shadow: 0 8px 18px -8px rgba(224, 101, 79, 0.8);
}

.reader-close--foot:hover { background: #d4573f; }

@media (min-width: 700px) {
  .feed { padding-top: 36px; }
  .story--banner h3 { font-size: 32px; }
}

@media (max-width: 360px) {
  .story--thumb { grid-template-columns: 76px 1fr; gap: 12px; }
  .story--thumb .thumb { width: 76px; height: 76px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
}

.reader:focus { outline: none; }
