:root {
  --bg: #F3EDE4;
  --surface: #FBF8F3;
  --ink: #1F2622;
  --ink-soft: #56605A;
  --emerald: #1B5E4A;
  --emerald-deep: #134536;
  --copper: #C17A4A;
  --copper-deep: #8F5430;
  --copper-soft: #EBD3BC;
  --line: rgba(27, 94, 74, 0.55);

  /* wordmark colors sampled from logo.png */
  --logo-navy: #00286F;
  --logo-red: #D20314;

  --font-head: "Bitter", "Rockwell", Georgia, serif;
  --font-body: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mark: "Fira Sans Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;

  --app-w: min(100vw, 480px);
  --gutter: 18px;
  --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; }

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: clip;
  background: var(--bg);
}

img { display: block; max-width: 100%; }

/* ---------- Wordmark (rebuilt from logo.png) ---------- */

.wm-hex,
.wm-dir {
  font-family: var(--font-mark);
  font-weight: 800;
}

.wm-hex { color: var(--logo-navy); }
.wm-dir { color: var(--logo-red); margin-left: 0.055em; }

/* ---------- Masthead: right-anchored, asymmetric panel ---------- */

.masthead {
  position: relative;
  padding: max(40px, calc(env(safe-area-inset-top) + 24px)) 0 34px;
  isolation: isolate;
}

.mast-panel {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  right: 0;
  width: 66.667%;
  border-radius: 0 0 0 76px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cg fill='none' stroke='%23C17A4A' stroke-opacity='.34' stroke-width='1.2'%3E%3Cpath d='M28 2l26 15v30L28 62 2 47V17zM28 62v33M54 47l0 0M2 47l0 0'/%3E%3Cpath d='M28 96L2 81M28 96l26-15'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 56px 97px,
    radial-gradient(90% 70% at 100% 0%, rgba(255, 244, 230, 0.75), transparent 70%),
    linear-gradient(165deg, #E6C4A3 0%, #EDD2B7 52%, #E2B995 100%);
  box-shadow: -14px 24px 40px -26px rgba(143, 84, 48, 0.55);
  animation: panel-in 780ms var(--ease-out) both;
}

.mast-panel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  border-radius: 0 0 0 76px;
  background: linear-gradient(90deg, var(--emerald) 0 62%, var(--copper) 62% 100%);
}

.mast-inner {
  position: relative;
  padding: 0 16px 10px 0;
  text-align: right;
  animation: mast-in 800ms 140ms var(--ease-out) both;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--emerald);
}

.wordmark {
  --fs: calc(var(--app-w) * 0.151);
  display: flex;
  justify-content: flex-end;
  margin: 0;
  font-size: var(--fs);
  line-height: 1.02;
  letter-spacing: -0.045em;
  white-space: nowrap;
  filter: drop-shadow(0 6px 10px rgba(143, 84, 48, 0.22));
}

.tagline {
  margin: 16px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald-deep);
}

.tagline b { color: var(--copper-deep); padding: 0 3px; }

/* ---------- Feed ---------- */

.feed { padding: 30px 0 8px; }

.section { margin: 0 0 34px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter);
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald);
  white-space: nowrap;
}

.section-head .hex {
  width: 20px;
  height: 22px;
  flex: none;
  background: var(--emerald);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.section-head .rule {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--emerald), rgba(27, 94, 74, 0));
}

.section--economie .section-head h2 { color: var(--copper-deep); }
.section--economie .section-head .hex { background: var(--copper); }
.section--economie .section-head .rule { background: linear-gradient(90deg, var(--copper), rgba(193, 122, 74, 0)); }

.story h3 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.005em;
}

.story p { margin: 0; }

.story { cursor: pointer; -webkit-tap-highlight-color: transparent; }

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 0;
  border: 0;
  background: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--emerald);
  cursor: pointer;
}

.more .arrow { transition: transform var(--duration-fast) var(--ease-out); }
.story:hover .more .arrow,
.more:focus-visible .arrow { transform: translateX(5px); }
.more:focus-visible { outline: 3px solid var(--copper); outline-offset: 3px; border-radius: 4px; }

/* Politique: portrait crop on the right, emerald rule beneath each story */

.story--portrait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34%;
  gap: 16px;
  margin: 0 var(--gutter);
  padding: 0 0 22px;
  border-bottom: 1.5px solid var(--line);
}

.story--portrait + .story--portrait { padding-top: 22px; }
.story--portrait:last-child { border-bottom: 0; }

.story--portrait h3 { font-size: 20px; }
.story--portrait p { margin-top: 10px; font-size: 15.5px; color: var(--ink-soft); }

.story-photo {
  position: relative;
  min-height: 210px;
  border-radius: 14px 14px 46px 14px;
  overflow: hidden;
  background: var(--copper-soft);
  box-shadow: 8px 10px 0 -2px rgba(193, 122, 74, 0.28);
}

.story-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Economie/Business: full-bleed image, semi-transparent copper panel on top */

.story--overlay {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 500px;
  margin: 0 0 4px;
  overflow: hidden;
  background: var(--copper-deep);
}

.story--overlay .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-out);
}

.story--overlay:hover .bg { transform: scale(1.03); }

.story--overlay .veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(40, 22, 10, 0.05) 0%, rgba(40, 22, 10, 0.45) 100%);
}

.story--overlay .panel {
  position: relative;
  width: calc(100% - 28px);
  margin: 0 14px 16px;
  padding: 22px 20px 16px;
  border-top: 3px solid var(--copper);
  border-radius: 4px 4px 22px 4px;
  background: linear-gradient(180deg, rgba(150, 88, 48, 0.8), rgba(88, 46, 22, 0.88));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  color: #FFF6EC;
  box-shadow: 0 18px 34px -14px rgba(30, 14, 4, 0.6);
}

.story--overlay h3 { font-size: 21px; color: #FFFFFF; }
.story--overlay p { margin-top: 10px; font-size: 15.5px; color: rgba(255, 246, 236, 0.92); }
.story--overlay .more { color: #FFE2C4; }
.story--overlay .more:focus-visible { outline-color: #FFE2C4; }

/* Finance: centered compact thumbnail on a soft copper circle */

.fin-list { padding: 0 var(--gutter); }

.story--center {
  position: relative;
  padding: 4px 6px 34px;
  text-align: center;
}

.story--center::after {
  content: "";
  display: block;
  width: 14px;
  height: 16px;
  margin: 26px auto 0;
  background: rgba(27, 94, 74, 0.5);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.story--center:last-child { padding-bottom: 8px; }
.story--center:last-child::after { display: none; }

.halo {
  position: relative;
  width: 164px;
  height: 164px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 240, 224, 0.95), rgba(224, 178, 138, 0.62) 62%, rgba(193, 122, 74, 0.32));
  box-shadow: inset 0 0 0 1px rgba(193, 122, 74, 0.28);
}

.halo img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 104px;
  height: 104px;
  border-radius: 14px;
  object-fit: cover;
  transform: translate(-50%, -50%);
  box-shadow: 0 10px 20px -8px rgba(90, 46, 20, 0.6);
}

.story--center h3 { font-size: 20px; }
.story--center p { margin-top: 10px; font-size: 15.5px; color: var(--ink-soft); }

/* ---------- Footer ---------- */

.foot {
  margin-top: 16px;
  padding: 34px var(--gutter) max(38px, env(safe-area-inset-bottom));
  text-align: right;
  background: linear-gradient(180deg, rgba(226, 185, 149, 0) 0%, rgba(226, 185, 149, 0.4) 100%);
  border-top: 6px solid transparent;
  border-image: linear-gradient(90deg, transparent 0 34%, var(--emerald) 34% 78%, var(--copper) 78% 100%) 1;
}

.foot-mark {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.foot-line {
  margin: 10px 0 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald-deep);
}

/* ---------- Pills ---------- */

.pill {
  display: inline-block;
  padding: 5px 12px 4px;
  border-radius: 999px;
  background: var(--emerald);
  color: #F3EDE4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pill--copper { background: var(--copper-deep); }

/* ---------- 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;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
  background: var(--bg);
  border-bottom: 2px solid var(--emerald);
}

.reader-brand {
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.045em;
}

.reader-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--emerald);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--duration-fast), transform var(--duration-fast);
}

.reader-close:hover { background: var(--emerald-deep); }
.reader-close:active { transform: scale(0.96); }
.reader-close:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

.reader-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.reader-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  margin: 0 auto;
  background: var(--copper-soft);
}

.reader-body {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px var(--gutter) max(44px, env(safe-area-inset-bottom));
}

.reader-title {
  margin: 14px 0 20px;
  font-family: var(--font-head);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.reader-text p {
  margin: 0 0 1.05em;
  font-size: 17.5px;
  line-height: 1.68;
}

.reader-text p:first-child {
  font-weight: 500;
  font-size: 18.5px;
  color: var(--emerald-deep);
}

.reader-close--foot {
  margin-top: 14px;
  padding: 12px 22px;
  background: var(--copper-deep);
}

.reader-close--foot:hover { background: #79451f; }

.reader:focus { outline: none; }

/* ---------- Motion ---------- */

@keyframes panel-in {
  from { opacity: 0; transform: translateX(46px); }
  to { opacity: 1; transform: none; }
}

@keyframes mast-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 340px) {
  .story--portrait { grid-template-columns: minmax(0, 1fr) 30%; gap: 12px; }
  .tagline { letter-spacing: 0.08em; font-size: 10.5px; }
}
