/* ============ Reader Mode (Soft + Clean) ============ */

:root{
  /* Sur PC: fond blanc, pas de blur/transparence */
  --rm-overlay-bg: #ffffff;

  /* Card */
  --rm-card-bg: #ffffff;
  --rm-card-fg: #0b0d12;
  --rm-muted: rgba(11,13,18,.62);
  --rm-border: rgba(11,13,18,.12);

  --rm-radius: 18px;
  --rm-maxw: 920px;

  /* Typo */
  --rm-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  --rm-font-serif: ui-serif, Georgia, "Times New Roman", Times, serif;

  /* Lecture */
  --rm-size: 1.06rem; /* base sans-serif */
  --rm-line: 1.85;

  /* UI soft */
  --rm-ui-bg: rgba(11,13,18,.04);
  --rm-ui-border: rgba(11,13,18,.10);
  --rm-ui-fg: rgba(11,13,18,.78);

  /* Accent category only */
  --rm-accent: #1d4ed8; /* bleu sobre */
}

/* Overlay = full screen, WHITE background (no blur, no transparency) */
.starter-reader-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: none;
  background: var(--rm-overlay-bg);
}

.starter-reader-overlay.is-open{ display:block; }

/* Centered on desktop */
.starter-reader-dialog{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

/* Card */
.starter-reader-card{
  width: min(100%, var(--rm-maxw));
  max-height: calc(100vh - 44px);
  background: var(--rm-card-bg);
  color: var(--rm-card-fg);
  border-radius: var(--rm-radius);
  border: 1px solid var(--rm-border); /* différenciation du fond blanc */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.starter-reader-topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rm-border);
  background: var(--rm-card-bg);
}

.starter-reader-controls{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Soft round buttons (icon) */
.starter-reader-iconbtn{
  width: 40px;
  height: 40px;
  border-radius: 999px; /* 100% round */
  border: 1px solid var(--rm-ui-border);
  background: var(--rm-ui-bg);
  color: var(--rm-ui-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.starter-reader-iconbtn:hover{
  background: rgba(11,13,18,.06);
}

.starter-reader-iconbtn:focus-visible{
  outline: 2px solid rgba(11,13,18,.25);
  outline-offset: 2px;
}

/* Any text controls you keep should be pill */
.starter-reader-pill{
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--rm-ui-border);
  background: var(--rm-ui-bg);
  color: var(--rm-ui-fg);
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
}

.starter-reader-pill:hover{ background: rgba(11,13,18,.06); }

/* Progress */
.starter-reader-progress{
  height: 3px;
  width: 100%;
  background: transparent;
}
.starter-reader-progress > span{
  display:block;
  height:3px;
  width:0%;
  background: rgba(11,13,18,.25);
}

/* Body scroll inside card */
.starter-reader-body{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Article layout */
.starter-reader__article{
  max-width: 800px;
  margin: 0 auto;
  padding: 26px 26px 80px;
  font-family: var(--rm-font);
}

.starter-reader__kicker{
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .82rem;
  color: var(--rm-accent); /* catégorie en bleu */
  font-weight: 700;
  margin-bottom: 10px;
}

.starter-reader__title{
  margin: 0 0 14px;
  line-height: 1.06;
  font-size: clamp(1.9rem, 3.5vw, 3.1rem);
  letter-spacing: -0.02em;
}

.starter-reader__meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  color: var(--rm-muted);
  font-size: .95rem;
  margin-bottom: 22px;
}

.starter-reader__content{
  font-size: var(--rm-size);
  line-height: var(--rm-line);
}
.starter-reader__content p{ margin: 0 0 1.15em; }
.starter-reader__content img,
.starter-reader__content video{
  max-width:100%;
  height:auto;
  border-radius: 14px;
}

.starter-reader-loading{
  padding: 26px;
  opacity: .7;
}

/* Themes */
.starter-reader-overlay[data-theme="dark"]{
  --rm-overlay-bg: #0b0d12;       /* fond plein écran sombre */
  --rm-card-bg: #0f1420;
  --rm-card-fg: #f2f4f8;
  --rm-muted: rgba(242,244,248,.70);
  --rm-border: rgba(242,244,248,.14);

  --rm-ui-bg: rgba(242,244,248,.06);
  --rm-ui-border: rgba(242,244,248,.14);
  --rm-ui-fg: rgba(242,244,248,.80);

  --rm-accent: #60a5fa; /* bleu plus soft en dark */
}

.starter-reader-overlay[data-theme="dark"] .starter-reader-progress > span{
  background: rgba(242,244,248,.28);
}

/* Serif toggle */
.starter-reader-overlay[data-font="serif"] .starter-reader__article{
  font-family: var(--rm-font-serif);
}

/* Line-height presets */
.starter-reader-overlay[data-line="normal"]{ --rm-line: 1.65; }
.starter-reader-overlay[data-line="relax"] { --rm-line: 1.85; }
.starter-reader-overlay[data-line="max"]   { --rm-line: 2.05; }

/* MOBILE: card takes full screen, no margins, no radius */
@media (max-width: 768px){
  .starter-reader-dialog{
    padding: 0;
    place-items: stretch;
  }
  .starter-reader-card{
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;      /* no rounded corners on mobile */
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 0;      /* full bleed */
  }
  .starter-reader__article{
    padding: 20px 16px 70px;
  }
}
