/* Le Journal National: Mini App
   White background, vibrant confident triad, left-anchored masthead. */

@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Karla:wght@400;500;600;700;800&display=swap');

:root {
  --white: #FFFFFF;
  --ink: #1A1A1A;
  --ink-soft: #4A4A4A;
  --hairline: #ECECEC;

  --pol: #1E7A5F;      /* emerald - Politique */
  --pol-dark: #145E48;
  --pol-tint: #E7F4EF;

  --bus: #E85D4E;      /* coral/salmon - Économie & Business */
  --bus-dark: #C6402F;
  --bus-tint: #FDECE9;

  --fin: #5B2C6F;      /* deep plum/violet - Finance */
  --fin-dark: #431F53;
  --fin-tint: #F1E8F5;

  --gold: linear-gradient(180deg, #C99A4B 0%, #96691E 100%);

  --font-head: 'Libre Baskerville', Georgia, serif;
  --font-body: 'Karla', 'Mulish', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body { padding-bottom: 48px; }

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

a { color: inherit; text-decoration: none; }

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- MASTHEAD: left-anchored, asymmetric ---------- */

.masthead {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 28px 0 22px;
  border-bottom: 3px solid var(--ink);
  flex-wrap: wrap;
}

.masthead-mark {
  flex: 0 0 auto;
  text-align: left;
  line-height: 0.92;
}

.masthead-mark .le {
  display: block;
  font-family: var(--font-head);
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  letter-spacing: 0.02em;
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 2px;
}

.masthead-mark .journal {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 44px;
  background: linear-gradient(180deg, #0E4A4E 0%, #01383E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.masthead-mark .rule {
  height: 2px;
  background: var(--gold);
  margin: 6px 0;
  width: 100%;
}

.masthead-mark .national {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 44px;
  background: linear-gradient(180deg, #14346B 0%, #0A2140 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.masthead-intro {
  flex: 1 1 240px;
  min-width: 220px;
  padding-top: 8px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.masthead-intro strong {
  color: var(--ink);
}

@media (max-width: 480px) {
  .masthead { flex-direction: column; gap: 14px; }
  .masthead-mark .journal,
  .masthead-mark .national { font-size: 34px; }
}

/* ---------- Section dividers: bold color-block bars ---------- */

.section-divider {
  margin: 40px -20px 24px;
  padding: 16px 20px;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.section-divider.pol { background: var(--pol); }
.section-divider.bus { background: var(--bus); }
.section-divider.fin { background: var(--fin); }

.section-divider .label-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
  margin-bottom: 2px;
}

/* ---------- Story cards ---------- */

.story {
  cursor: pointer;
  margin-bottom: 28px;
}

.story-image-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,0.28);
}

.story-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.story-image-wrap.loaded img {
  opacity: 1;
}

.duotone {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.story-image-wrap.loaded .duotone,
.article-hero.loaded .duotone {
  opacity: 0.28;
}

.duotone.pol { background: linear-gradient(160deg, var(--pol) 0%, #0d4535 100%); }
.duotone.bus { background: linear-gradient(160deg, var(--bus) 0%, #a83322 100%); }
.duotone.fin { background: linear-gradient(160deg, var(--fin) 0%, #2f1739 100%); }

.story-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.story-kicker.pol { background: var(--pol-tint); color: var(--pol-dark); }
.story-kicker.bus { background: var(--bus-tint); color: var(--bus-dark); }
.story-kicker.fin { background: var(--fin-tint); color: var(--fin-dark); }

.story-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.story-preview {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* Feature layout: full-bleed dramatic */
.story.feature .story-image-wrap {
  aspect-ratio: 16 / 10;
  margin-bottom: 16px;
  border-radius: 18px;
  box-shadow: 0 16px 34px -14px rgba(0,0,0,0.34);
}

.story.feature .story-title {
  font-size: 27px;
  line-height: 1.22;
}

.story.feature .story-preview { font-size: 15.5px; }

/* Compact layout: image beside text, smaller scale */
.story.compact {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.story.compact .story-image-wrap {
  flex: 0 0 112px;
  width: 112px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
}

.story.compact .story-body {
  flex: 1 1 auto;
  min-width: 0;
}

.story.compact .story-title {
  font-size: 16.5px;
  line-height: 1.28;
}

.story.compact .story-preview {
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 400px) {
  .story.compact .story-image-wrap { flex-basis: 88px; width: 88px; }
}

/* ---------- Article (full) view ---------- */

.article-view { display: none; }
.article-view.active { display: block; }
.list-view.hidden { display: none; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 20px 0 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-body);
}

.back-btn svg { width: 16px; height: 16px; }

.article-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 34px -14px rgba(0,0,0,0.32);
  margin-bottom: 20px;
  aspect-ratio: 16 / 11;
}

.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.article-hero.loaded img {
  opacity: 1;
}

.article-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.article-kicker.pol { background: var(--pol-tint); color: var(--pol-dark); }
.article-kicker.bus { background: var(--bus-tint); color: var(--bus-dark); }
.article-kicker.fin { background: var(--fin-tint); color: var(--fin-dark); }

.article-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.24;
  margin: 0 0 22px;
  color: var(--ink);
}

.article-body {
  font-size: 16.5px;
  line-height: 1.78;
  text-align: justify;
  hyphens: auto;
  color: var(--ink);
}

.article-body p {
  margin: 0 0 20px;
}

.article-body p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 64px;
  line-height: 0.82;
  padding: 4px 8px 0 0;
}

.article-body.pol p:first-of-type::first-letter { color: var(--pol); }
.article-body.bus p:first-of-type::first-letter { color: var(--bus); }
.article-body.fin p:first-of-type::first-letter { color: var(--fin); }

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

.app-footer {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 12px;
  color: #999;
}
