/* IcoMoon font licensed under the GNU General Public License: http://www.gnu.org/licenses/gpl.html */
@font-face {
  font-family: 'icomoon-multichoice';
  src:url('../fonts/icomoon.eot');
  src:url('../fonts/icomoon.eot?#iefix') format('embedded-opentype'),
    url('../fonts/icomoon.woff') format('woff'),
    url('../fonts/icomoon.ttf') format('truetype'),
    url('../fonts/icomoon.svg#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* --- Peruslayout --- */
.h5p-multichoice .h5p-answers {
  list-style: none;
  padding: 0;
  overflow: visible;
  margin: 1em 0;
}
.h5p-multichoice .h5p-answer {
  list-style: none;
  margin: 0.5em 0;
  padding: 0;
  background: none;
  position: relative;
  cursor: pointer;
}
.h5p-multichoice .h5p-answer.h5p-has-tip .h5p-alternative-container,
.h5p-multichoice .h5p-answer.h5p-should-not .h5p-alternative-container {
  padding-right: 2em;
}
.h5p-multichoice .h5p-answer.h5p-wrong .h5p-alternative-container,
.h5p-multichoice .h5p-answer.h5p-correct .h5p-alternative-container {
  padding-right: 3em;
}
.h5p-multichoice .h5p-alternative-container {
  position: relative;
  text-align: left;
  display: block;
  padding: 0.25em 0.75em 0.25em 2.1em;
  border-radius: 0.3em;
  border: 0.1em solid transparent;
  font-weight: normal;
  background: #ddd;
  -webkit-box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.3);
  -moz-box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.3);
  box-shadow: 0 0.1em 0 rgba(0, 0, 0, 0.3);
  line-height: 1.5em;
  text-indent: -2em;
}

/* --- Vasemman laidan icomoon ennen tarkistusta (H5P oletus) --- */
.h5p-multichoice .h5p-answer .h5p-alternative-container:before {
  font-family: icomoon-multichoice;
  display: block;
  height: 1em;
  width: 1em;
  position: absolute;
  left: 2.5em;
  top: 0.25em;
  color: #494949;
}
.h5p-multichoice .h5p-answer[role="radio"] .h5p-alternative-container:before { content: "\e600"; }
.h5p-multichoice .h5p-answer[role="radio"][aria-checked="true"] .h5p-alternative-container:before { content: "\e603"; }
.h5p-multichoice .h5p-answer[role="checkbox"] .h5p-alternative-container:before { content: "\e602"; }
.h5p-multichoice .h5p-answer[role="checkbox"][aria-checked="true"] .h5p-alternative-container:before { content: "\e601"; }

/* =========================================================
   TARKISTUSVAIHEESSA: OIKEA RINKULA/NELIÖ KAIKILLE + TÄYTTÖ VALITULLE
   ========================================================= */

/* Rinkulan/kehyksen sijoittelun “ankkuri” ja tila oikealle */
.h5p-multichoice .h5p-answer[aria-disabled="true"] .h5p-alternative-container {
  /* Säädetty valmiiksi niin, että rinkula + täyttö istuvat siististi */
  padding-right: 2.40em;
  position: relative;
}

/* Tyhjä kehys (radio = ympyrä, checkbox = neliö) KAIKILLE riveille tarkistuksen jälkeen */
.h5p-multichoice .h5p-answer[aria-disabled="true"] .h5p-alternative-container::after {
  content: '';
  position: absolute;
  right: 0.85em;          /* rinkulan etäisyys oikeasta reunasta */
  top: 50%;
  transform: translateY(-50%);
  width: 1.00em;          /* rinkulan koko */
  height: 1.00em;
  box-sizing: border-box;
  border: 2px solid #000; /* viivan paksuus ja väri */
  background: transparent;
  pointer-events: none;
  z-index: 3;
}
.h5p-radio .h5p-answer[aria-disabled="true"] .h5p-alternative-container::after { border-radius: 50%; }
.h5p-check .h5p-answer[aria-disabled="true"] .h5p-alternative-container::after { border-radius: 2px; }

/* Piilota vasemman laidan valintaikoni EI-VALITUILTA tarkistuksen jälkeen */
.h5p-multichoice .h5p-answer[aria-disabled="true"]:not(.h5p-selected) .h5p-alternative-container:before {
  content: '' !important;
  display: none !important;
}

/* VALITTU: käytä :before täytön piirtämiseen ja keskity täsmälleen rinkulan sisään */

/* Radio – musta piste keskelle (täsmäkeskitys suhteessa rinkulaan) */
.h5p-radio .h5p-answer.h5p-selected[aria-disabled="true"] .h5p-alternative-container:before {
  content: '';
  /* Keskitys: sama right kuin rinkulalla + (rinkula.width - piste.width)/2 */
  right: calc(0.85em + (1.00em - 0.56em) / 2);  /* 0.85 + 0.22 = 1.07em */
  top: 50%;
  transform: translateY(-50%);
  width: 0.56em;           /* pisteen koko – hiottu arvo */
  height: 0.56em;
  border-radius: 50%;
  background: #000;
  z-index: 4;              /* täyttö kehys-::after:n päällä */
  left: auto !important;   /* irti vasemman laidan oletussijoittelusta */
  color: transparent;      /* ei näytetä fonttiglyfiä */
}

/* Checkbox – musta sisäneliö keskelle */
.h5p-check .h5p-answer.h5p-selected[aria-disabled="true"] .h5p-alternative-container:before {
  content: '';
  right: calc(0.85em + (1.00em - 0.64em) / 2);  /* hiottu keskitys */
  top: 50%;
  transform: translateY(-50%);
  width: 0.64em;           /* sisäneliön koko – hiottu arvo */
  height: 0.64em;
  border-radius: 2px;
  background: #000;
  z-index: 4;
  left: auto !important;
  color: transparent;
}

/* =========================================================
   SOLUTION-SPANIT: PIILOSSA CHECK-TILASSA, NÄKYVISSÄ SHOW SOLUTION -TILASSA
   ========================================================= */

/* Check-tilassa spanit piilossa (ettei teksti vuoda) */
.h5p-multichoice .h5p-solution-icon-radio,
.h5p-multichoice .h5p-solution-icon-checkbox {
  display: none !important;
  visibility: hidden !important;
}
/* Glyfit Show Solution -tilan varalle */
.h5p-multichoice .h5p-solution-icon-radio:before { content: "\e603"; }
.h5p-multichoice .h5p-solution-icon-checkbox:before { content: "\e601"; }

/* Show Solution -tilassa H5P lisää .h5p-should / .h5p-should-not – näytetään ikonit,
   piilotetaan spanin teksti visuaalisesti ja keskitetään oikealle */
.h5p-multichoice .h5p-answer.h5p-should .h5p-solution-icon-radio,
.h5p-multichoice .h5p-answer.h5p-should-not .h5p-solution-icon-radio,
.h5p-multichoice .h5p-answer.h5p-should .h5p-solution-icon-checkbox,
.h5p-multichoice .h5p-answer.h5p-should-not .h5p-solution-icon-checkbox {
  display: inline-block !important;
  visibility: visible !important;

  position: absolute;
  right: 0.85em;
  top: 50%;
  transform: translateY(-50%);

  width: 1em;
  height: 1em;
  line-height: 1em;
  font-family: 'icomoon-multichoice';
  color: #000;
  z-index: 4;
  pointer-events: none;

  font-size: 0;  /* spanin tekstisisältö ei sotke asettelua */
}
.h5p-multichoice .h5p-answer.h5p-should .h5p-solution-icon-radio:before,
.h5p-multichoice .h5p-answer.h5p-should-not .h5p-solution-icon-radio:before,
.h5p-multichoice .h5p-answer.h5p-should .h5p-solution-icon-checkbox:before,
.h5p-multichoice .h5p-answer.h5p-should-not .h5p-solution-icon-checkbox:before {
  font-size: 1em; /* näytä vain glyfi */
}

/* =========================================================
   Oikein/väärin – EI MUUTETTU
   ========================================================= */
.h5p-multichoice .h5p-answer.h5p-correct .h5p-alternative-container,
.h5p-multichoice .h5p-answer.h5p-correct:hover .h5p-alternative-container {
  background: #b6e4ce;
  border-color: #b6e4ce;
  color: #255c41;
  box-shadow: 0 0.1em 0 #a2bdb0;
}
.h5p-multichoice .h5p-answer.h5p-wrong .h5p-alternative-container,
.h5p-multichoice .h5p-answer.h5p-wrong:hover .h5p-alternative-container {
  background: #fbd7d8;
  border-color: #fbd7d8;
  color: #b71c1c;
  box-shadow: 0 0.1em 0 #deb8b8;
}
.h5p-multichoice .h5p-answer-icon {
  font-family: 'H5PFontAwesome4';
  width: 1em;
  height: 1em;
  text-decoration: none;
  position: absolute;
  line-height: 1em;
  top: 0.54em;
  left: 0.75em;
  letter-spacing: 1em;
  overflow: hidden;
}
.h5p-multichoice .h5p-correct .h5p-answer-icon:before { content: "\f00c"; color: #255c41; }
.h5p-multichoice .h5p-wrong .h5p-answer-icon:before { content: "\f00d"; color: #b71c1c; padding: 0 0.125em; }

/* =========================================================
   Muu ulkoasu – EI MUUTETTU
   ========================================================= */
.h5p-multichoice .h5p-answer:last-child { margin-bottom: 0; }
.h5p-multichoice h2 { font-size: 1.5em; font-weight: normal; }
.h5p-multichoice .h5p-answer[aria-disabled="true"] { cursor: default; }
.h5p-multichoice .h5p-answer:not([aria-disabled="true"]):hover .h5p-alternative-container { background-color: #ececec; }
.h5p-multichoice .h5p-answer:not([aria-disabled="true"]):focus .h5p-alternative-container { outline-style: inset; outline-width: 2px; }
.h5p-multichoice .h5p-answer[aria-checked="true"] .h5p-alternative-container {
  color: #1a4473;
  background: #cee0f4;
  border: 2px solid #388EFF;
  box-shadow: none;
}
.h5p-multichoice .h5p-answer[aria-checked="true"]:not(.h5p-wrong):not(.h5p-correct):not([aria-disabled="true"]):hover .h5p-alternative-container {
  background-color: #e6effc;
  box-shadow: none;
}

.h5p-alternative-inner { margin: 0 0.75em 0 2em; }
.h5p-alternative-inner div, .h5p-alternative-inner p { display: inline; }
.h5p-clearfix { clear: both; }

.h5p-multichoice .h5p-radio-or-checkbox {
  display: block;
  height: 1em;
  width: 1em;
  font-family: icomoon-multichoice;
  color: #494949;
  pointer-events: none;
}
.h5p-multichoice .h5p-selected .h5p-radio-or-checkbox { color: #235e7c; }

.h5p-question p:last-child { margin-bottom: 0; }
.h5p-question p:first-child { margin-top: 0; }

/* Tip- ja feedback-elementit – ei muutoksia */
.h5p-multichoice .h5p-feedback-button {
  position: absolute;
  cursor: pointer;
  right: 2.125em;
  top: 0.4375em;
  line-height: 1em;
  background: #fff;
}
.h5p-multichoice .h5p-selected.h5p-should.h5p-correct .h5p-feedback-button,
.h5p-multichoice .h5p-selected.h5p-should-not.h5p-correct .h5p-feedback-button,
.h5p-multichoice .h5p-selected.h5p-should.h5p-wrong .h5p-feedback-button,
.h5p-multichoice .h5p-selected.h5p-should-not.h5p-wrong .h5p-feedback-button { right: 3.5em; }
.h5p-multichoice .h5p-feedback-button:focus { outline: none; }
.h5p-multichoice .h5p-feedback-button:before {
  font-family: 'H5PFontAwesome4';
  content: "\f075";
  color: #fbfbfb;
  text-shadow: 0 0 0.25em #2c2c2c;
}
.h5p-multichoice .h5p-feedback-button:hover:before { color: #e1e1e1; }

/* Feedback dialog */
.h5p-multichoice .h5p-feedback-dialog {
  position: relative;
  width: calc(100% - 0.5em);
  left: 0.25em;
}
.h5p-multichoice .h5p-answer .h5p-feedback-inner {
  background: #fbfbfb;
  border-bottom: 1px solid #ddd;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  padding: 0.5em 1.25em;
  text-align: left;
  position: relative;
}
.h5p-multichoice .h5p-answer.h5p-selected .h5p-feedback-inner {
  border-bottom: 1px solid #cee0f4;
  border-left: 1px solid #cee0f4;
  border-right: 1px solid #cee0f4;
}
.h5p-multichoice .h5p-feedback-inner:before {
  content: "";
  position: absolute;
  left: 0.625em;
  top: -0.3em;
  width: 0.5em;
  height: 0.5em;
  background: #fbfbfb;
  transform: rotate(45deg);
  box-shadow: inset 1px 1px 0px 0px #dcdcdc;
}
.h5p-multichoice .h5p-feedback-dialog.h5p-has-tip:before { left: auto; right: 0.85em; }
.h5p-multichoice .h5p-feedback-text {
  position: relative;
  z-index: 3;
  overflow: auto;
  overflow-x: hidden;
  overflow-y: auto;
}
.h5p-multichoice .h5p-feedback-text::-webkit-scrollbar { width: 0.4em; }
.h5p-multichoice .h5p-feedback-text::-webkit-scrollbar-thumb { border-radius: 0.2em; background: #aaa; }
