/* Mon carnet: the PDF builder. */

.cb-wrap{max-width:1180px;margin:0 auto;padding:34px 20px 20px}

.cb__head{margin:0 0 24px;max-width:640px}
.cb__title{font-size:clamp(1.8rem,4vw,2.7rem);margin:0 0 8px;line-height:1.1}
.cb__lead{margin:0;color:var(--col-muted);line-height:1.7}

.cb__status{color:var(--col-muted)}

.cb__empty{
  background:var(--col-white);border:1px solid var(--col-border);
  border-radius:var(--radius-card);padding:34px 28px;text-align:center;
  box-shadow:var(--shadow-card);max-width:560px
}
.cb__empty p{margin:0 0 10px;font-weight:700;color:var(--col-heading)}
.cb__hint{font-weight:400!important;color:var(--col-muted);margin-bottom:20px!important}

/* An author `display` rule outranks the browser's [hidden]{display:none},
   so hiding these with the attribute needs to be stated explicitly. */
.cb__body[hidden],.cb__empty[hidden],.cb__status[hidden]{display:none}
.cb__body{display:flex;gap:28px;align-items:flex-start;flex-wrap:wrap}
.cb__list{flex:1 1 460px;min-width:280px;display:flex;flex-direction:column;gap:8px}

.cb-item{
  display:flex;align-items:center;gap:12px;
  background:var(--col-white);border:1px solid var(--col-border);
  border-radius:14px;padding:9px 12px 9px 9px
}
.cb-item__n{
  flex:0 0 auto;width:24px;height:24px;border-radius:50%;
  background:var(--col-band);color:var(--col-muted);
  display:inline-flex;align-items:center;justify-content:center;
  font-size:.74rem;font-weight:800
}
.cb-item__img{
  flex:0 0 auto;width:44px;height:58px;object-fit:cover;
  border-radius:7px;border:1px solid var(--col-border);background:#fff
}
.cb-item__title{
  flex:1 1 auto;min-width:0;font-weight:700;color:var(--col-heading);
  font-size:.94rem;line-height:1.3
}
.cb-item__tools{flex:0 0 auto;display:flex;gap:5px}
.cb-item__btn{
  /* Flex-centred rather than relying on button text metrics: the arrow and
     multiplication glyphs have different baselines and sat off-centre. */
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;padding:0;border-radius:9px;cursor:pointer;
  background:var(--col-band);border:1px solid var(--col-border);
  color:var(--col-heading);font-size:1rem;line-height:1;
  font-family:inherit;
  transition:background .14s var(--ease)
}
.cb-item__btn:hover:not(:disabled){background:var(--col-cream)}
.cb-item__btn:disabled{opacity:.35;cursor:default}
.cb-item__btn--x{color:var(--col-accent-deep)}

/* cover panel */
.cb__panel{
  flex:0 1 330px;min-width:270px;position:sticky;top:96px;
  background:var(--col-white);border:1px solid var(--col-border);
  border-radius:var(--radius-card);padding:20px;box-shadow:var(--shadow-card)
}
.cb__panel-title{font-size:1.12rem;margin:0 0 16px}
.cb__field{display:block;margin:0 0 14px}
.cb__field span{
  display:block;font-size:.78rem;font-weight:700;color:var(--col-muted);
  margin:0 0 6px;letter-spacing:.02em
}
/* Filled cream fields on a white card read as disabled rather than editable
   - the panel looked unfinished. White with a drawn edge is the usual signal,
   and the focus ring is the only place colour appears. */
.cb__field input{
  width:100%;box-sizing:border-box;font:inherit;font-size:.93rem;
  padding:10px 13px;border-radius:11px;
  border:1.5px solid var(--col-border);background:var(--col-white);color:var(--col-text);
  transition:border-color .14s var(--ease),box-shadow .14s var(--ease)
}
/* No extra opacity here: --col-muted at .75 over white lands at 3.58:1, and
   the placeholder is still distinct from the value, which uses --col-text. */
.cb__field input::placeholder{color:var(--col-muted);opacity:1}
.cb__field input:hover{border-color:#D4C6A8}
.cb__field input:focus{
  outline:0;border-color:var(--col-accent-solid);
  box-shadow:0 0 0 3px rgba(201,48,98,.15)
}

.cb__check{
  display:flex;align-items:center;gap:10px;margin:0 0 16px;cursor:pointer;
  font-size:.88rem;line-height:1.35;color:var(--col-text);
  background:var(--col-cream);border-radius:12px;padding:10px 12px
}
.cb__check input{width:17px;height:17px;flex:0 0 auto;accent-color:var(--col-accent-solid)}

.cb__actions{display:grid;gap:9px}
.cb__make{width:100%;justify-content:center;padding-inline:16px}
.cb__ico{width:18px;height:18px;flex:0 0 auto}
.cb__act-t{white-space:nowrap}
/* The page count rides inside the button instead of extending its label, so
   the button keeps one width whether the carnet holds 1 page or 40. */
.cb__count{
  font-size:.74rem;font-weight:700;padding:2px 8px;border-radius:var(--radius-pill);
  /* Darkened, not lightened: white on a 20%-white veil over --col-accent-solid
     measures 3.79:1, under AA for 11.8px bold. Black at .18 gives 6.99:1. */
  background:rgba(0,0,0,.18)
}
.cb__count:empty{display:none}
.cb__make[aria-busy="true"]{opacity:.72}
.cb__make:disabled{cursor:progress;transform:none;box-shadow:none}

.cb__note{
  margin:12px auto 0;max-width:30ch;
  font-size:.78rem;color:var(--col-muted);line-height:1.5;text-align:center
}

/* ---------------- apercu ---------------- */
/* Above the header (80) so the sticky bar cannot sit on top of the dialog. */
.cb-prev{
  position:fixed;inset:0;z-index:120;
  display:flex;align-items:center;justify-content:center;padding:16px;
  background:rgba(46,33,84,.62);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)
}
.cb-prev[hidden]{display:none}
body.cb-locked{overflow:hidden}

.cb-prev__box{
  display:flex;flex-direction:column;width:min(880px,100%);height:min(92vh,100%);
  background:var(--col-white);border-radius:var(--radius-card);
  box-shadow:var(--shadow-raised);overflow:hidden
}
.cb-prev__head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 16px;border-bottom:1px solid var(--col-border)
}
.cb-prev__title{
  margin:0;font-family:var(--font-display);font-weight:700;
  color:var(--col-heading);font-size:1.05rem;line-height:1.2
}
.cb-prev__x{
  display:inline-flex;align-items:center;justify-content:center;
  width:36px;height:36px;flex:0 0 auto;padding:0;
  border:1px solid var(--col-border);border-radius:10px;cursor:pointer;
  background:var(--col-cream);color:var(--col-heading);
  font-family:inherit;font-size:1.3rem;line-height:1
}
/* Hello Elementor's button:hover (0,1,1) paints bare buttons pink on white;
   every hover here restates both colours or it loses the cascade. */
.cb-prev__x:hover,.cb-prev__x:focus{background:var(--col-band);color:var(--col-heading)}

.cb-prev__view{
  flex:1 1 auto;min-height:0;position:relative;
  background:var(--col-band);
  display:flex;align-items:center;justify-content:center
}
.cb-prev__frame{width:100%;height:100%;border:0;display:block}
.cb-prev__wait{margin:0;color:var(--col-muted);font-size:.9rem}
.cb-prev__wait[hidden]{display:none}

.cb-prev__foot{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:12px 16px;border-top:1px solid var(--col-border)
}
/* iOS shows a framed PDF as page one with no scroll. Rather than guess the
   device, everyone gets this escape hatch to the browser's own viewer. */
.cb-prev__tab{
  margin-right:auto;font-size:.83rem;font-weight:700;
  color:var(--col-heading);text-decoration:underline;text-underline-offset:3px
}
.cb-prev__tab:hover,.cb-prev__tab:focus{color:var(--col-accent-text)}
.cb-prev__tab[hidden]{display:none}

/* The print copy carries its own OpenAction; the frame only has to exist. */
.cb-print-frame{position:fixed;right:0;bottom:0;width:1px;height:1px;border:0;opacity:0}

@media (max-width:860px){
  .cb__panel{position:static;flex:1 1 100%}
}
@media (max-width:640px){
  .cb-wrap{padding:22px 16px 16px}
  .cb-prev{padding:0}
  .cb-prev__box{width:100%;height:100%;border-radius:0}
  .cb-prev__foot .c-btn{flex:1 1 0;justify-content:center}
  .cb-prev__tab{flex:1 1 100%;margin:0 0 2px;text-align:center}
  .cb__body{gap:20px}
  .cb-item{gap:9px;padding:8px 9px 8px 8px}
  .cb-item__title{font-size:.88rem}
  .cb-item__btn{width:36px;height:36px}
}
/* Hello Elementor's reset also styles bare buttons:
   `button:hover{background-color:#c36;color:#fff}` at (0,1,1), which outranks
   every single-class rule here. Any <button> of ours whose hover changed only
   a transform inherited Hello's pink background AND white text - the Imprimer
   button measured 1.85:1, the carnet arrows 1.23:1. Each restates both. */
.cb-item__btn:hover:not(:disabled),.cb-item__btn:focus:not(:disabled){
  background:var(--col-cream);color:var(--col-heading)
}
.cb-item__btn--x:hover:not(:disabled),.cb-item__btn--x:focus:not(:disabled){
  background:var(--col-cream);color:var(--col-accent-deep)
}

