/* Portail ressources gratuites — pilule email, bibliothèque, lecteur. Theme-aware. */

/* ── Pilule email (2 états) ──────────────────────────────────────────────── */
.res-pill { margin: 0 auto; max-width: 440px; }
.res-pill-row { display: flex; gap: 8px; }
.res-pill-input {
  flex: 1; min-width: 0; height: 50px; padding: 0 18px;
  border: 1px solid var(--card-border); border-radius: 99px;
  background: var(--bg-soft); color: var(--text); font: inherit; font-size: 15px;
  outline: none; transition: border-color .2s;
}
.res-pill-input:focus { border-color: var(--text); }
.res-pill-btn {
  height: 50px; padding: 0 24px; white-space: nowrap; cursor: pointer;
  border: none; border-radius: 99px; background: var(--text); color: var(--bg);
  font: inherit; font-size: 15px; font-weight: 600; transition: opacity .2s, transform .08s;
}
.res-pill-btn:hover { opacity: .88; }
.res-pill-btn:active { transform: translateY(1px); }
.res-pill-btn.is-loading { opacity: .55; pointer-events: none; }
.res-pill-note { margin: 12px 2px 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); text-align: center; }
.res-pill-note a { color: var(--text-dim); }
.res-pill-msg { margin: 10px 0 0; min-height: 16px; font-size: 13px; text-align: center; color: var(--text-dim); }
.res-pill-msg.is-err { color: #e87b7b; }
.res-pill-access {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px;
  border-radius: 99px; background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 15px; text-decoration: none; transition: opacity .2s, transform .08s;
}
.res-pill-access:hover { opacity: .88; }
.res-pill-access:active { transform: translateY(1px); }

/* ── Pilule FLOTTANTE (home uniquement) ──────────────────────────────────── */
.res-float {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 900; width: max-content; max-width: calc(100vw - 24px);
  animation: resFloatIn .45s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes resFloatIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* État replié : la pastille déclencheur */
.res-float-trigger {
  display: inline-flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 11px 20px 11px 16px; border-radius: 99px;
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 12px 38px -10px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.18);
  color: var(--text); font: inherit; transition: transform .14s ease, box-shadow .2s ease, border-color .2s;
}
.res-float-trigger:hover { transform: translateY(-2px); border-color: var(--text-dim);
  box-shadow: 0 18px 46px -10px rgba(0,0,0,.55), 0 3px 10px rgba(0,0,0,.2); }
.res-float-trigger:active { transform: translateY(0); }
.res-float-icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.res-float-trigger-txt { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.res-float-trigger-txt b { font-size: 14px; font-weight: 700; }
.res-float-trigger-txt i { font-size: 11.5px; font-style: normal; color: var(--text-muted); }

/* État déplié : la carte (monte au-dessus du déclencheur) */
.res-float-card {
  position: relative; width: min(380px, calc(100vw - 24px));
  padding: 22px 22px 20px; border-radius: 20px;
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 26px 70px -16px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.22);
  animation: resFloatCard .26s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes resFloatCard { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.res-float-collapse {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--bg-soft); color: var(--text-dim);
  cursor: pointer; font-size: 12px; line-height: 1; transition: color .15s, border-color .15s;
}
.res-float-collapse:hover { color: var(--text); border-color: var(--text); }
.res-float-kicker {
  margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
}
.res-float-why { margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.res-float-form { display: flex; gap: 8px; }
.res-float-input {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px;
  border: 1px solid var(--card-border); border-radius: 99px;
  background: var(--bg-soft); color: var(--text); font: inherit; font-size: 14px;
  outline: none; transition: border-color .2s;
}
.res-float-input:focus { border-color: var(--text); }
.res-float-submit {
  height: 46px; padding: 0 20px; white-space: nowrap; cursor: pointer;
  border: none; border-radius: 99px; background: var(--text); color: var(--bg);
  font: inherit; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .08s;
}
.res-float-submit:hover { opacity: .88; }
.res-float-submit:active { transform: translateY(1px); }
.res-float-submit.is-loading { opacity: .55; pointer-events: none; }
.res-float-msg { margin: 10px 2px 0; min-height: 14px; font-size: 12.5px; color: var(--text-dim); }
.res-float-msg.is-err { color: #e87b7b; }
.res-float-done { margin: 2px 0; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--text); }
.res-float-done span[aria-hidden] { color: #34c465; }
.res-float-done-sub { font-size: 13px; font-weight: 400; color: var(--text-dim); }

/* État accès débloqué */
.res-float-access {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; text-decoration: none;
  box-shadow: 0 12px 38px -10px rgba(0,0,0,.5); transition: opacity .2s, transform .12s;
}
.res-float-access:hover { opacity: .9; transform: translateY(-2px); }
.res-float-access:active { transform: translateY(0); }
.res-float-done .res-float-icon { width: 20px; height: 20px; }

@media (max-width: 480px) {
  .res-float { bottom: 12px; }
  .res-float-trigger-txt i { display: none; }
}

/* ── Bibliothèque (cartes) ───────────────────────────────────────────────── */
.res-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 28px;
}
.res-card {
  text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 16px;
  color: var(--text); font: inherit; transition: border-color .2s, transform .15s;
}
.res-card:hover { border-color: var(--text); transform: translateY(-2px); }
.res-card-body { padding: 20px 22px; }
.res-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.res-card-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 99px;
  background: var(--accent-soft); color: var(--text-dim);
}
.res-card-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; line-height: 1.25; }
.res-card-excerpt { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-dim); }

.res-loading { padding: 40px 0; text-align: center; color: var(--text-dim); font-size: 14px; }
.res-loading.is-err { color: #e87b7b; }

/* ── Lecteur (modal) ─────────────────────────────────────────────────────── */
.res-reader-ov {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 20px; overflow-y: auto; background: rgba(0,0,0,.62); backdrop-filter: blur(4px);
  animation: resFade .18s ease;
}
@keyframes resFade { from { opacity: 0; } to { opacity: 1; } }
.res-reader {
  position: relative; width: min(720px, 100%); margin: auto;
  background: var(--bg); border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); padding: 44px 48px; animation: resUp .2s ease;
}
@keyframes resUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.res-reader-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--card-border); background: var(--bg-soft); color: var(--text-dim);
  cursor: pointer; font-size: 14px; line-height: 1; transition: color .15s, border-color .15s;
}
.res-reader-close:hover { color: var(--text); border-color: var(--text); }
.res-article { color: var(--text); font-size: 16px; line-height: 1.7; font-weight: 300; }
.res-article h1 { font-size: 28px; font-weight: 700; margin: 0 0 18px; line-height: 1.2; }
.res-article h2 { font-size: 21px; font-weight: 600; margin: 28px 0 10px; }
.res-article h3 { font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.res-article p { margin: 0 0 16px; }
.res-article ul, .res-article ol { margin: 0 0 16px; padding-left: 22px; }
.res-article li { margin: 0 0 6px; }
.res-article img, .res-article video { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.res-article a { color: var(--text); text-decoration: underline; }
@media (max-width: 600px) { .res-reader { padding: 36px 24px; } }
