/* =========================================================
   MARELYA — Lecture : lecteur, bibliothèque, notes
   Mêmes tokens que le thème (le plugin reste autonome même
   si le thème change un jour).
   ========================================================= */
:root{
  --ml-ink:#1C1A16;
  --ml-cream:#F7F4EC;
  --ml-cream-soft:#F0EEE3;
  --ml-taupe:#8C8369;
  --ml-border:#E6E0D2;
  --ml-border-strong:#D9D2BC;
  --ml-accent:#C1693F;
  --ml-green:#1F3D2E;
}

/* ---------- Ma bibliothèque ---------- */
.marelya-library-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:40px 32px;
}
.marelya-library-item{display:flex; flex-direction:column; min-width:0;}
.marelya-library-cover{margin-bottom:12px;}
.marelya-library-cover img{display:block; width:100%; height:auto;}
.marelya-library-info{display:flex; flex-direction:column; gap:6px;}
.marelya-library-info .marelya-card-title{font-size:14px; line-height:1.3; margin:0;}
@media (max-width:900px){ .marelya-library-grid{grid-template-columns:repeat(2, minmax(0,1fr)); gap:32px 20px;} }
@media (max-width:420px){ .marelya-library-grid{gap:28px 14px;} }
.marelya-progress-track{
  width:100%; height:5px; border-radius:999px; background:var(--ml-border); overflow:hidden; margin-top:4px;
}
.marelya-progress-fill{height:100%; background:var(--ml-accent); border-radius:999px; transition:width .3s ease;}
.marelya-library-actions{display:flex; flex-direction:column; gap:8px; margin-top:8px; align-items:flex-start;}
.marelya-library-actions .marelya-btn-fill{font-size:12px; padding:9px 14px;}
.marelya-library-actions .marelya-link-u{font-size:12px;}

/* ---------- Lecteur ---------- */
.marelya-reader{
  display:flex; flex-direction:column; background:var(--ml-cream);
  border:1px solid var(--ml-border); border-radius:4px; overflow:hidden;
  min-height:70vh;
}
.marelya-reader-toolbar{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
  padding:16px 20px; border-bottom:1px solid var(--ml-border); background:var(--ml-cream-soft);
}
.marelya-reader-title{display:flex; flex-direction:column; gap:2px; font-size:13.5px; font-weight:600; color:var(--ml-ink);}
.marelya-reader-title .marelya-eyebrow{font-size:10px;}
.marelya-reader-controls{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.marelya-reader-btn{
  background:var(--ml-cream); border:1px solid var(--ml-border-strong); border-radius:3px;
  width:32px; height:32px; font-size:15px; line-height:1; cursor:pointer; color:var(--ml-ink);
  display:inline-flex; align-items:center; justify-content:center;
}
.marelya-reader-btn:hover{background:var(--ml-cream-soft);}
.marelya-reader-btn--accent{width:auto; padding:0 14px; font-size:12px; font-weight:600; background:var(--ml-ink); color:var(--ml-cream); border-color:var(--ml-ink);}
.marelya-reader-page{font-size:13px; color:var(--ml-taupe); min-width:64px; text-align:center;}

.marelya-reader-body{display:flex; flex:1; min-height:0;}
.marelya-reader-canvas-wrap{
  flex:1; display:flex; align-items:flex-start; justify-content:center;
  padding:28px; overflow:auto; background:#EAE5D7; position:relative;
}
.marelya-reader-canvas-wrap canvas{box-shadow:0 12px 28px -12px rgba(28,26,22,.35); background:#fff;}
.marelya-reader-loading{position:absolute; top:40%; font-size:13px; color:var(--ml-taupe);}

.marelya-reader-notes{
  width:300px; flex-shrink:0; border-left:1px solid var(--ml-border); background:var(--ml-cream);
  padding:20px; display:flex; flex-direction:column; gap:16px; overflow-y:auto;
}
.marelya-reader-notes[hidden]{display:none;}
.marelya-reader-notes-head{display:flex; align-items:center; justify-content:space-between;}
.marelya-reader-notes-head h3{margin:0; font-family:'Fraunces',serif; font-size:17px; font-weight:460;}
.marelya-reader-note-form{display:flex; flex-direction:column; gap:10px;}
.marelya-reader-note-form textarea{
  resize:vertical; min-height:70px; border:1px solid var(--ml-border-strong); border-radius:3px;
  padding:10px 12px; font-size:13px; font-family:inherit; background:var(--ml-cream-soft);
}
.marelya-reader-note-form .marelya-btn-fill{font-size:12px; padding:10px 16px; align-self:flex-start;}

.marelya-reader-note-list{display:flex; flex-direction:column; gap:12px;}
.marelya-note-item{
  border:1px solid var(--ml-border); border-radius:3px; padding:12px; display:flex; flex-direction:column; gap:6px;
}
.marelya-note-jump{
  align-self:flex-start; background:var(--ml-cream-soft); border:none; border-radius:999px;
  padding:3px 10px; font-size:10.5px; font-weight:700; color:var(--ml-accent); cursor:pointer;
}
.marelya-note-text{margin:0; font-size:13px; line-height:1.5; color:var(--ml-ink);}
.marelya-note-delete{
  align-self:flex-end; background:none; border:none; font-size:11px; color:var(--ml-taupe); cursor:pointer; text-decoration:underline;
}

.marelya-reader-denied{padding:40px; text-align:center; display:flex; flex-direction:column; gap:14px;}

@media (max-width:780px){
  .marelya-reader-body{flex-direction:column;}
  .marelya-reader-notes{width:100%; border-left:none; border-top:1px solid var(--ml-border);}
}
