/* assets/consent.css
   Bandeau "Nature morte aux cookies" : un tableau dans son cadre dore,
   accompagne de son cartel. cf. includes/consent-banner.php */

.consent{
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(640px, calc(100% - 32px));
  opacity: 0;
  transform: translateY(24px) rotate(-1.2deg);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.9,.3,1.3);
}
.consent.is-visible{
  opacity: 1;
  transform: translateY(0) rotate(0);
}
.consent.is-leaving{
  transform: translateY(30px) rotate(1.5deg);
}
.consent[hidden]{ display: none; }

/* Cadre dore a moulures : plusieurs bordures et ombres superposees */
.consent__frame{
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--surface);
  border: 10px solid #b08a3a;
  border-image: linear-gradient(135deg, #e8cf8a, #9a742c 30%, #f2dc9c 50%, #8a6420 75%, #d9b866) 1;
  box-shadow:
    inset 0 0 0 2px #6d5118,
    0 0 0 2px #5a4212,
    0 24px 50px rgba(0,0,0,.28);
}

.consent__painting{
  margin: 0;
  display: flex;
  align-items: flex-end;
  /* Le mur n'est pas dans le SVG : ce fond le peint sur toute la hauteur,
     le SVG (cale en bas, xMidYMax) n'apporte que la table et les objets.
     Lumiere rasante a la Chardin, venue du haut a gauche. */
  background: radial-gradient(ellipse at 30% 55%, #574330, #120d09 80%);
  box-shadow: inset 0 0 18px rgba(0,0,0,.6);
  transition: filter .8s ease;
}
.consent__painting svg{
  display: block;
  width: 100%;
  height: auto;
}

/* Le cookie croque respire un peu, comme s'il hesitait */
.consent__cookie--bitten{
  transform-origin: 182px 128px;
  animation: consent-wobble 3.2s ease-in-out infinite;
}
@keyframes consent-wobble{
  0%, 100%{ transform: rotate(0); }
  50%{ transform: rotate(-3deg); }
}

/* Cartel de musee */
.consent__cartel{
  padding: 18px 20px 16px;
  background:
    linear-gradient(rgba(255,255,255,.92), rgba(255,255,255,.92)),
    var(--bg);
}
.consent__kicker{
  margin: 0;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.consent__title{
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
  color: var(--navy);
}
.consent__meta{
  margin: 2px 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.consent__text{
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

/* Palette : chaque categorie est une touche de peinture */
.consent__palette{
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 40px 18px 34px 22px / 26px 30px 20px 34px;
  background: #efe3cc;
}
.consent__palette[hidden]{ display: none; }
.consent__palette-title{
  padding: 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 13px;
  color: var(--navy);
}
.consent__pigment{
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
}
.consent__pigment input{
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.consent__pigment--gesso{ cursor: default; }
.consent__blob{
  --pigment: #ccc;
  width: 34px;
  height: 30px;
  border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%;
  background: #fff;
  border: 2px dashed #b9ad96;
  transition: background .3s ease, border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.consent__pigment--gesso{ --pigment: #f3efe6; }
.consent__pigment--outremer{ --pigment: #2a3f9e; }
.consent__pigment input:checked + .consent__blob{
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 45%), var(--pigment);
  border: 2px solid rgba(0,0,0,.18);
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 3px 6px rgba(0,0,0,.18);
}
.consent__pigment input:focus-visible + .consent__blob{
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.consent__pigment-body{ display: grid; gap: 1px; }
.consent__pigment-name{
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}
.consent__pigment-desc{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Boutons : "Tout refuser" et "Tout accepter" ont la meme taille */
.consent__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.consent__actions .consent-btn--primary{ margin-left: auto; }
.consent-btn{
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--navy);
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.consent-btn:hover{ transform: translateY(-1px); }
.consent-btn:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }
.consent-btn[hidden]{ display: none; }
.consent-btn--primary{
  background: var(--navy);
  color: #fff;
}
.consent-btn--outline{
  background: transparent;
  color: var(--navy);
}
.consent-btn--ghost{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.55);
  color: #fff;
}
.consent-btn--link{
  border-color: transparent;
  background: none;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding-inline: 6px;
}

/* Refus : le tableau redevient une esquisse au fusain */
.consent.is-charcoal .consent__painting{
  filter: grayscale(1) contrast(1.35) brightness(1.15) sepia(.15);
}
.consent.is-charcoal .consent__title::after{
  content: " (esquisse au fusain)";
  font-size: 14px;
  color: var(--muted);
}

/* Accord : les couleurs eclatent */
.consent.is-vivid .consent__painting{
  filter: saturate(1.8) brightness(1.15);
}
.consent.is-vivid .consent__title::after{
  content: " (version restaur\E9 e)";
  font-size: 14px;
  color: var(--gold);
}

.consent-splash{
  position: fixed;
  z-index: 61;
  pointer-events: none;
  border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%;
  transform: translate(-50%, -50%);
  animation: consent-splash .9s cubic-bezier(.15,.7,.3,1) forwards;
}
@keyframes consent-splash{
  to{
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(180deg);
    opacity: 0;
  }
}

/* Video bloquee : une toile vierge sur chassis, en attente d'accord */
.consent-canvas{
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 6px),
    radial-gradient(circle at 30% 25%, #3a4f8f, var(--navy) 70%);
  box-shadow: inset 0 0 0 6px #d9c9a6, inset 0 0 0 7px rgba(0,0,0,.2);
}
.consent-canvas__inner{ max-width: 340px; }
.consent-canvas__title{
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 18px;
}
.consent-canvas__text{
  margin: 0 0 12px;
  font-size: 13px;
  opacity: .85;
}
.consent-canvas__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.consent-canvas .consent-btn--primary{
  background: #fff;
  color: var(--navy);
  border-color: #fff;
}

/* Lien "Cookies" du footer : un bouton qui se fond dans les liens */
.footer__links .footer__consent{
  font: inherit;
  font-size: 13px;
  color: #333;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.footer__links .footer__consent:hover{ text-decoration: underline; }

@media (max-width: 620px){
  .consent{
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
  }
  .consent__frame{
    grid-template-columns: 1fr;
    border-width: 7px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
  }
  .consent__painting{ height: 110px; overflow: hidden; align-items: center; }
  .consent__actions .consent-btn--primary{ margin-left: 0; }
  .consent__actions .consent-btn--outline,
  .consent__actions .consent-btn--primary{ flex: 1 1 40%; }
}

@media (prefers-reduced-motion: reduce){
  .consent, .consent__painting, .consent__blob{ transition: none; }
  .consent__cookie--bitten{ animation: none; }
}
