/* <taaltaal-talk>: a conversation in an inset, as in Babbeldam (taaltaal-talk.js). Without the script the lines are speech bubbles
   all the same; with it every bubble has a face and a round button, and a bar on top plays the whole conversation. Who speaks has
   the bubble outlined in lime and a mouth that moves. */
/* pressed into the page: a darker ground with little drawings on it, very light, as a chat has (taaltaal-talk-doodles.svg), a
   shadow inside along the top and the sides, a light edge below */
taaltaal-talk { display: block; margin: 14px 0 18px; padding: 12px 12px 4px; border: 1px solid #c6d0de; border-radius: 16px;
                background: #dfe6ef url(taaltaal-talk-doodles.svg) 0 0 / 280px 280px;
                box-shadow: inset 0 4px 10px rgba(20, 40, 80, .26), inset 0 1px 3px rgba(20, 40, 80, .2), inset 0 -1px 0 rgba(255, 255, 255, .55),
                            0 1px 0 #fff; }
taaltaal-talk > p, taaltaal-talk .bubble { margin: 0 0 10px; padding: 8px 12px; border-radius: 18px 18px 18px 6px; background: #fff;
                                          box-shadow: 0 1px 3px rgba(20, 40, 80, .14); line-height: 1.35; }
taaltaal-talk p b { display: block; margin: 0 0 1px; font-size: .78em; color: #5a6585; }
taaltaal-talk p i { display: block; margin: 2px 0 0; font-style: normal; font-size: .86em; color: #5a6585; }
taaltaal-talk > p[data-who="you"], taaltaal-talk .me .bubble { margin-left: auto; border-radius: 18px 18px 6px 18px; background: #e2f5d8; }
taaltaal-talk > p { max-width: 86%; }
taaltaal-talk.no-en p i { display: none; }

/* the bar on top of the inset: play the whole conversation, and a switch for the English; it lies over the inset, the shadow of
   its lower edge falls on the conversation */
taaltaal-talk .bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
                     margin: -12px -12px 14px; padding: 4px 12px 4px 8px; border-bottom: 1px solid #c9d1db; border-radius: 15px 15px 0 0;
                     background: linear-gradient(#fcfdfe, #e1e7ee); box-shadow: inset 0 1px 0 #fff, 0 4px 7px -3px rgba(20, 40, 80, .28); }
/* the button as the light buttons of the course pages ("Hele programma" in the bar Direct regelen): white to a light blue, the
   text in the blue of TaalTaal, rounded corners (10 px, no pill), a fine edge and a small shadow; while it plays the same in lime */
taaltaal-talk .play { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 10px; border: 0; border-radius: 10px;
                      background: linear-gradient(#fff, #e9eef7); color: #2b3f93; font: inherit; font-size: 13px; font-weight: bold; white-space: nowrap;
                      cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(43, 63, 147, .15); }
taaltaal-talk .play:hover { filter: brightness(1.06); }
taaltaal-talk .play:active { transform: translateY(1px); box-shadow: 0 0 1px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(43, 63, 147, .2); }
taaltaal-talk .play .icon { display: inline-grid; place-items: center; width: 14px; height: 14px; }
taaltaal-talk .play .icon svg { width: 14px; height: 14px; }
taaltaal-talk .play[aria-pressed="true"] { color: #1f1b2b; background: linear-gradient(rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%), linear-gradient(#dcf78a, #b9e33f);
                                           box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(80, 110, 20, .25); }
taaltaal-talk .switch { display: inline-flex; align-items: center; gap: 7px; padding: 2px; border: 0; background: none; color: #2b3f93;
                        font: inherit; font-weight: bold; font-size: 13px; white-space: nowrap; cursor: pointer; }
taaltaal-talk .switch .track { position: relative; width: 30px; height: 17px; border-radius: 9px; background: #b9c4d4;
                               box-shadow: inset 0 1px 3px rgba(20, 40, 80, .35); transition: background .2s; }
taaltaal-talk .switch .knob { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff;
                              box-shadow: 0 1px 3px rgba(20, 40, 80, .4); transition: transform .2s; }
taaltaal-talk .switch[aria-checked="true"] .track { background: #2b3f93; }
taaltaal-talk .switch[aria-checked="true"] .knob { transform: translateX(13px); }
taaltaal-talk .switch[aria-checked="false"] { color: #5a6585; }
@media (prefers-reduced-motion: reduce) { taaltaal-talk .switch .track, taaltaal-talk .switch .knob { transition: none; } }
taaltaal-talk button:focus-visible { outline: 2px solid #2b3f93; outline-offset: 2px; }

/* a line: the face, the bubble with its words and its round button */
taaltaal-talk .say { display: flex; align-items: center; gap: 13px; max-width: 92%; margin: 0 0 10px; }
taaltaal-talk .say.me { margin-left: auto; flex-direction: row-reverse; }
taaltaal-talk .say .bubble { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 8px 8px 8px 14px;
                             border-radius: 18px; }
taaltaal-talk .say.me .bubble { margin: 0; border-radius: 18px; }
/* the point of the bubble, to who says it: a square turned a quarter, half out of the bubble, in its colour */
taaltaal-talk .say .bubble::before { content: ""; position: absolute; top: 50%; left: -6px; width: 12px; height: 12px; margin-top: -6px;
                                     background: inherit; transform: rotate(45deg); box-shadow: -1px 1px 1px rgba(20, 40, 80, .1); }
taaltaal-talk .say.me .bubble::before { left: auto; right: -6px; box-shadow: 1px -1px 1px rgba(20, 40, 80, .1); }
taaltaal-talk .say.playing .bubble::before { box-shadow: -2px 2px 0 #c8f25a; }
taaltaal-talk .say.me.playing .bubble::before { box-shadow: 2px -2px 0 #c8f25a; }
taaltaal-talk .words { flex: 1; min-width: 0; }
taaltaal-talk .say.playing .bubble { box-shadow: 0 0 0 2px #c8f25a, 0 1px 3px rgba(20, 40, 80, .14); }
/* a face is a sticker: a white rim and a shadow under it, as the faces of the tips of Kennis */
taaltaal-talk .face { display: block; flex: none; width: 50px; height: 50px; border: 3px solid #fff; border-radius: 50%; background: #e6f0f4; overflow: hidden;
                      box-shadow: 0 2px 6px rgba(20, 40, 80, .32), 0 0 0 1px rgba(20, 40, 80, .06); }
taaltaal-talk .face svg { display: block; width: 100%; height: 100%; }
taaltaal-talk .face.me { display: grid; place-items: center; background: #2b3f93; color: #fff; font-weight: bold; font-size: 13px; line-height: 1; }
taaltaal-talk .hear { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 2px solid #dfe5ee;
                      border-radius: 50%; background: #fff; color: #2b3f93; cursor: pointer; }
taaltaal-talk .hear svg { width: 18px; height: 18px; }
taaltaal-talk .hear[aria-pressed="true"] { border-color: #9bc72c; background: #c8f25a; color: #1f1b2b; }

/* who speaks moves the mouth, as far open as the sound is loud (taaltaal-talk.js, follow) */
taaltaal-talk .person .open, taaltaal-talk .person .mouth-open { opacity: 0; transform-box: fill-box; transform-origin: center; }

/* on a phone the bubbles take the width, the faces a little smaller */
@media (max-width: 560px) {
    taaltaal-talk { padding: 10px 8px 2px; }
    taaltaal-talk .bar { margin: -10px -8px 12px; padding: 4px 8px 4px 6px; }
    taaltaal-talk .play { padding: 4px 12px 4px 9px; }
    taaltaal-talk .bar { flex-wrap: nowrap; }
    taaltaal-talk .switch { gap: 6px; }
    taaltaal-talk .say { max-width: 100%; gap: 11px; }
    taaltaal-talk .face { width: 40px; height: 40px; }
}
@media print { taaltaal-talk .bar, taaltaal-talk .hear { display: none; } taaltaal-talk { box-shadow: none; border: 1px solid #ccd; } }
