/* Kleuren met Brikki. Bouwt voort op home.css. */
.kleuren-main{gap:var(--between)}
.kleuren-main>*{min-width:0}
.kleuren-nav{display:flex;justify-content:flex-end;align-items:center;min-height:58px}
.home-link{position:relative;display:block;width:62px;height:58px;-webkit-tap-highlight-color:transparent}
.home-icon{position:absolute;right:6px;bottom:3px;width:42px;height:34px;background:var(--blue);transition:transform .2s ease}
.home-icon::before{content:'';position:absolute;left:-7px;top:-22px;border-right:28px solid transparent;border-bottom:24px solid var(--blue);border-left:28px solid transparent}
.home-link:hover .home-icon{transform:scale(1.06)}

/* Kleurplaten: klik om de PDF te downloaden */
.kleurplaat a{display:block;cursor:pointer;-webkit-tap-highlight-color:transparent}
.kleurplaat img{width:100%;height:auto;transition:transform .35s ease}
.kleurplaat a:hover img{transform:scale(1.02)}
.kleurplaat a:focus-visible{outline:4px solid var(--blue);outline-offset:6px}

@media (hover:none){.home-link:hover .home-icon,.kleurplaat a:hover img{transform:none}}

/* Online kleuren: tik in een vlak om het te kleuren */
.kleur-online[hidden]{display:none}
.kleur-online p{margin:0 0 18px}
.kleur-online canvas{display:block;width:100%;height:auto;aspect-ratio:1;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.kleuren-rij{display:flex;flex-wrap:wrap;justify-content:center;gap:14px;margin:0 auto;padding-top:22px}
.kleur{flex:none;width:48px;height:48px;border:0;border-radius:50%;padding:0;cursor:pointer;box-shadow:inset 0 0 0 2px rgb(0 0 0 / .12);transition:transform .15s ease;-webkit-tap-highlight-color:transparent}
.kleur[aria-pressed="true"]{transform:scale(1.12);outline:3px solid var(--black);outline-offset:3px}
/* Bewaren, een nieuwe kleurplaat en volledig scherm vormen samen één gecentreerde rij. */
.kleur-knoppen{display:flex;justify-content:center;align-items:flex-start;gap:22px;margin-top:70px}
.kleur-pijl{position:relative;width:64px;height:64px;border:0;border-radius:50%;background:var(--yellow);cursor:pointer;box-shadow:0 10px 28px -6px rgb(0 0 0 / .28);transition:transform .2s ease;-webkit-tap-highlight-color:transparent}
.kleur-pijl:hover{transform:scale(1.08)}
.kleur-pijl:active{transform:scale(.96)}
.kleur-pijl::before{content:'';position:absolute;top:50%;left:50%;border-top:13px solid transparent;border-bottom:13px solid transparent}
.kleur-pijl.volgende::before{border-left:18px solid var(--black);transform:translate(-38%,-50%)}
.kleur-pijl.bewaar{background:var(--blue)}
.kleur-pijl.bewaar::before{content:none}
.kleur-pijl.bewaar svg{display:block;width:30px;height:30px;margin:auto}
@container (max-width:600px){.kleuren-rij{display:grid;grid-template-columns:repeat(5,48px);gap:16px 12px}}
@media (hover:none){.kleur-pijl:hover{transform:none}}
.kleurplaat p{margin:0 0 24px}
/* Handje als muisaanwijzer op de online kleurplaat (scherp op retinaschermen) */
.kleur-online canvas,.kleur-online .kleuren-rij,.kleur-online .kleur{cursor:url(img/cursor-handje.png?v=2) 20 3,pointer;cursor:-webkit-image-set(url(img/cursor-handje.png?v=2) 1x,url(img/cursor-handje-2x.png?v=2) 2x) 20 3,pointer;cursor:image-set(url(img/cursor-handje.png?v=2) 1x,url(img/cursor-handje-2x.png?v=2) 2x) 20 3,pointer}
.kleuren-rij.wiebel .kleur{animation:kleur-wiebel .5s ease-in-out}
@keyframes kleur-wiebel{25%{transform:translateY(-6px)}50%{transform:translateY(0)}75%{transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.kleuren-rij.wiebel .kleur{animation:none}}

/* Volledig scherm */
/* Groot scherm: de knop is 44px, met 10px erboven en eronder staat hij midden naast de knoppen van 64px; het woord
   eronder is "Groot scherm", in groot scherm "Sluiten" (onder het kruisje) */
.kk-vol .tekst-sluiten,.is-volscherm .kk-vol .tekst-groot{display:none}
.is-volscherm .kk-vol .tekst-sluiten{display:inline}
.kleur-volscherm{margin:10px 0;width:44px;height:44px;padding:0;border:0;background:none;cursor:pointer;transition:transform .2s ease;-webkit-tap-highlight-color:transparent}
.kleur-volscherm img{display:block;width:100%;height:100%}
.kleur-volscherm:hover{transform:scale(1.08)}
html.kleur-open{overflow:hidden}
.kleur-online.is-volscherm{--plaat:min(100%,100vh - 217px);background:var(--white);position:fixed;inset:0;z-index:100;width:auto;height:auto;max-width:none;margin:0;border-radius:0;box-shadow:none;transform:none;transition:none;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px max(16px,env(safe-area-inset-right)) 16px max(16px,env(safe-area-inset-left));overflow:auto}
/* In groot scherm staat de kleurplaat direct in body (zie kleuren.js). Hij is dan zelf de container voor de
   @container-regels, en teksten die met de kolombreedte meeschalen rekenen met dezelfde kolombreedte als op de pagina. */
.kleur-online.is-volscherm{container-type:inline-size}
.kleur-online.is-volscherm .knop-tekst{font-size:clamp(12px,min(100vw - 2 * var(--side),702px) * .0335,16px)}
@supports (height:100dvh){.kleur-online.is-volscherm{--plaat:min(100%,100dvh - 217px)}}
.kleur-online.is-volscherm>h2,.kleur-online.is-volscherm>p{display:none}
.kleur-online.is-volscherm>*{flex:none;width:var(--plaat)}
.kleur-online.is-volscherm .kleur-knoppen{margin-top:20px}
@media (hover:none){.kleur-volscherm:hover{transform:none}}
@media (max-width:479px){.kleur-knoppen{gap:12px}}

/* iPhone en iPad liggend, alleen in groot scherm: de kleuren staan in een kolom links en Bewaren, Nieuwe en Sluiten
   in een kolom rechts naast de kleurplaat. Zo krijgt de kleurplaat de volle hoogte van het scherm. De maten komen
   uit het venster zelf (cqh/cqw), zodat ze ook kloppen op de iPad, waar de pagina op 80% staat. Op een lage telefoon
   staan de kleuren in twee rijtjes van vijf, op een iPad in één rij van tien. */
@media (orientation:landscape) and (pointer:coarse){
  .kleur-online.is-volscherm{--k:clamp(34px,calc((100vh - 72px) / 5),48px);--k-gap:10px;--kolom-gap:clamp(16px,3vw,40px);display:grid;grid-template-columns:auto auto auto;grid-template-rows:minmax(0,1fr);justify-content:center;align-items:center;column-gap:var(--kolom-gap);padding:16px max(16px,env(safe-area-inset-right)) 16px max(16px,env(safe-area-inset-left))}
  .kleur-online.is-volscherm>*{width:auto}
  .kleur-online.is-volscherm .kleuren-rij{grid-column:1;grid-row:1;display:grid;grid-template-columns:repeat(2,var(--k));grid-template-rows:repeat(5,var(--k));grid-auto-flow:column;gap:var(--k-gap);margin:0;padding:0}
  .kleur-online.is-volscherm .kleur{width:var(--k);height:var(--k)}
  /* De gekozen kleur is 90% van de gewone gekozen maat (1,12): iets groter dan de andere kleuren, en de ring
     eromheen blijft vrij van de kleuren ernaast */
  .kleur-online.is-volscherm .kleur[aria-pressed="true"]{transform:scale(1.008)}
  .kleur-online.is-volscherm canvas{grid-column:2;grid-row:1;width:min(100vh - 32px,100vw - 2 * var(--k) - var(--k-gap) - 2 * var(--kolom-gap) - 140px)}
  .kleur-online.is-volscherm .kleur-knoppen{grid-column:3;grid-row:1;flex-direction:column;align-items:center;gap:12px;margin:0}
  @supports (container-type:size){
    .kleur-online.is-volscherm{container-type:size}
    .kleur-online.is-volscherm .kleuren-rij{--k:clamp(34px,calc((100cqh - 4 * var(--k-gap)) / 5),48px)}
    .kleur-online.is-volscherm canvas{width:min(100cqh,100cqw - 2 * clamp(34px,calc((100cqh - 40px) / 5),48px) - 10px - 2 * var(--kolom-gap) - 110px)}
  }
}
@media (orientation:landscape) and (pointer:coarse) and (min-height:700px){
  .kleur-online.is-volscherm{--k-gap:14px}
  .kleur-online.is-volscherm .kleuren-rij{--k:48px;grid-template-columns:var(--k);grid-template-rows:repeat(10,var(--k))}
  .kleur-online.is-volscherm canvas{width:min(100vh - 32px,100vw - 48px - 2 * var(--kolom-gap) - 140px)}
  @supports (container-type:size){.kleur-online.is-volscherm canvas{width:min(100cqh,100cqw - 48px - 2 * var(--kolom-gap) - 110px)}}
}
/* Lage telefoons: de knoppen rechts iets kleiner, zodat de drie onder elkaar passen */
@media (orientation:landscape) and (pointer:coarse) and (max-height:360px){
  .kleur-online.is-volscherm .kleur-knoppen{gap:6px}
  .kleur-online.is-volscherm .kleur-pijl{width:52px;height:52px}
  .kleur-online.is-volscherm .kleur-volscherm{width:40px;height:40px;margin:6px 0}
}

/* Groot scherm (11 november 2026): sluiten rechtsboven, Bewaren rechts in het midden, Volgende rechtsonder (eindeloos
   rond), net als bij de puzzels. De knoppen liggen los over het scherm; naast de
   kleurplaat blijft rechts (en voor het midden ook links) 176px vrij. Rechtop is die ruimte er niet: dan staat Bewaren
   linksonder, naast Volgende. Buiten groot scherm blijft alles zoals het was (Bewaren, Volgende, Groot scherm). */
.kk-wissel{display:contents}
.kleur-online.is-volscherm{--rand:max(16px,env(safe-area-inset-right));--onder:max(16px,env(safe-area-inset-bottom));--plaat:min(100% - 352px,100vh - 172px)}
@supports (height:100dvh){.kleur-online.is-volscherm{--plaat:min(100% - 352px,100dvh - 172px)}}
.kleur-online.is-volscherm .kleur-knoppen{position:absolute;inset:0;width:auto;height:auto;margin:0;pointer-events:none}
.kleur-online.is-volscherm .kleur-knoppen>*,.kleur-online.is-volscherm .kk-wissel>*{pointer-events:auto}
.kleur-online.is-volscherm .kk-vol{position:absolute;top:max(16px,env(safe-area-inset-top));right:var(--rand)}
.kleur-online.is-volscherm .kleur-volscherm{margin:0}
.kleur-online.is-volscherm .kk-bewaar{position:absolute;top:50%;right:var(--rand);transform:translateY(-50%)}
.kleur-online.is-volscherm .kk-wissel{position:absolute;right:var(--rand);bottom:var(--onder);display:flex;align-items:flex-start;gap:14px}
@media (orientation:portrait){
  .kleur-online.is-volscherm{--plaat:min(100%,100vh - 351px);padding-top:calc(max(16px,env(safe-area-inset-top)) + 80px);padding-bottom:calc(var(--onder) + 100px)}
  @supports (height:100dvh){.kleur-online.is-volscherm{--plaat:min(100%,100dvh - 351px)}}
  .kleur-online.is-volscherm .kk-bewaar{top:auto;right:auto;bottom:var(--onder);left:max(16px,env(safe-area-inset-left));transform:none}
}
/* iPhone en iPad liggend: de derde kolom (waar eerst de knoppen stonden) blijft vrij voor de losse knoppen */
@media (orientation:landscape) and (pointer:coarse){
  .kleur-online.is-volscherm{grid-template-columns:auto auto 150px}
}
