
html {
    background-color: #D3D3D3;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* Every size below is in rem, so the whole page keeps its proportions and grows with
       the window beyond the reference screen (MacBook, ~1440 x 800 px of page): 14px up
       to that, then the largest size that fits both the width and the height. Tablets
       (1080 px viewport, base.html) and smaller windows stay at 14px. */
    font-size: max(14px, min(0.9722vw, 1.75vh));
    font-weight: 800;
    color: #4B4B4B;
    letter-spacing: 0.1rem;
    line-height: 1.1rem;
}

footer { 
    display: block;
    position: absolute;
    margin: 5rem -2rem;
    max-width: 85.7143rem;
    height: 10.7143rem;
    width: 100%;
    font-size: 0.8rem;
    background-color: #D3D3D3;
    text-align: center;
    font-weight: light;
    line-height: 1.4rem;
    letter-spacing: 0.00rem;
}

body {
    margin: 1.7857rem auto;
    padding: 2rem 2rem 4rem;
    max-width: 85.7143rem;
    color: #4B4B4B;
    background-color: #F5F5F5;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.06);
}



header {
    text-align: right;
    padding: 0 1.4286rem;
}



content {
    font-size: 1rem;
    display:block;
    font-weight: normal;
    max-width: 71.4286rem;
    margin: auto;
    text-align: justify;
}

h1{
    display: block;
    color: #4B4B4B;
    font-size: 1.8rem;
    font-weight: light;
    line-height: 1.2; /* was 1.1rem, less than the font size: a wrapped title overlapped itself */
    letter-spacing: 0.1rem;
}


h2 {
    display: inline-block;
    width: 90%;
    margin-top: 0rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: lighter;
    line-height: 1.2;
    letter-spacing: 0.08rem;
}



h3, h4, h5, h6 {
    font-weight: lighter;
    line-height: 1.5rem;
    letter-spacing: 0.08rem;
}

h3 {
    color: #156470;
    display:inline;
    text-align: right;
    font-size: 1.1rem;
    line-height: 1.5rem;
    margin-right:3rem;
    margin-top: 0rem;
    margin-bottom: 0rem;
    font-weight: normal;
}

h4 {
    margin-top: 0;
    margin-bottom: 0.2rem;
    font-weight: lighter;
    line-height: 1.4rem;
    font-size: 1rem;
    letter-spacing: 0.06rem;
}
h5 {
    color: #156470;
    margin-top: 0;
    margin-bottom: 0.2rem;
    font-weight: light;
    line-height: 1.5rem;
    letter-spacing: 0.06rem;
    text-align: left;
}

a {
    color: #156470;
}

p {
  margin-top: 0;
  margin-bottom: 0;
    font-weight: bold;
    line-height: 1.5em;
    letter-spacing: 0.06rem;
}

.center {
    width : 95%;
    text-align: center;
}

.middle {
    display: table-cell;
        width: 100%;
        height: 100%;
        vertical-align: middle;
}

.metrics {
    /* In the flow, sized in rem: it scales with the page and sits beside the exam grid
       on every screen (it used to be absolutely positioned with window-relative widths,
       and ran over the cards on tablets and on large screens). */
    background-color: black;
    border-style: ridge;
    border-width: 1.0714rem;
    border-color: rgb(235, 235, 235);
    padding: 0.7143rem 1.4286rem;
    /* wide enough for « 1xx \ xx (xx) mmHg » on one line (initial PAS 37-115,
       PAD/PAM two digits in the scenarios); a longer value wraps tightly */
    width: 23.5rem;
    font-weight: bolder;
    font-size: 2.15rem;
    /* Two spacings: tight inside one vital sign (a wrapped unit such as « mmHg » stays
       close to its value), a clear gap between two vital signs. */
    line-height: 1.1;
}
.metrics > div + div {
    margin-top: 0.45em;
}

.metrics p {
    display: inline;
    font-weight: bolder;
    font-size: 2.6rem;
    line-height: inherit; /* the 1.1 factor of .metrics, not the 1.5em of p */
}

.middle description {
  line-height: 1.5;
  display: inline-block;
  vertical-align: middle;
    padding: 5rem 0;
}

grade {
    width : 100%;
  display: block;
  text-align: right;
}

input[type=text] {
    padding: 0.3571rem;
    border:2px solid #ccc; 
    -webkit-border-radius: 5px;
    border-radius: 5px;
}

input[type=submit] {
    font-weight: normal;
    padding: 0.7143rem 3.5714rem;
    border:0 #a6a9a9;
    cursor:pointer;
    -webkit-border-radius: 5px;
    border-radius: 1.4286rem;
    font-size: 1.5rem;
    color: #4B4B4B;
    margin-top: 2rem;
   margin-bottom: 2rem;
    background: linear-gradient( #DADAD9, #B2B2B1);
    text-shadow: 0px 1px 0px rgba( 255, 255, 255, 0.4);
    box-shadow: 0 0 5px rgba( 0, 0, 0, 0.5), 0 -1px 0 rgba( 255, 255, 255, 0.4);
}


button, input[type=submit] {
    font-weight: normal;
    padding: 0.7143rem 2.1429rem;
    border:0 #a6a9a9;
    cursor:pointer;
    -webkit-border-radius: 5px;
    border-radius: 1.4286rem;
    font-size: 1.5rem;
    color: #4B4B4B;
    margin-top: 2rem;
   margin-bottom: 2rem;
    background: linear-gradient( #DADAD9, #B2B2B1);
    text-shadow: 0px 1px 0px rgba( 255, 255, 255, 0.4);
    box-shadow: 0 0 5px rgba( 0, 0, 0, 0.5), 0 -1px 0 rgba( 255, 255, 255, 0.4);
}
input[type=submit]:hover, button:hover{
     text-shadow: 0px 1px 0px rgba( 255, 255, 255, 0.2);
     background: linear-gradient( #BBB, #888);
}

button:active{
     text-shadow: 0px 1px 0px rgba( 255, 255, 255, 0.2);
     background: linear-gradient( #AAA, #999);
     box-shadow: 1px 1px 10px black inset, 
                 0 1px 0 rgba( 255, 255, 255, 0.4);
}

.listScripts ul {
    line-height: 3.2143rem;
    margin-bottom: 1em;
    font-size: 1.5rem;
    font-weight: lighter;
}

.float-container {
    /* vitals panel, then the exam grid, centred as a block */
    padding: 0.7143rem 0 3.5714rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
}

.challenge-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.1429rem;
    margin-bottom: 0.5714rem;
}

.challenge-top-row #scenario-description {
    flex: 1 1 auto;
    min-width: 0;
}

.challenge-top-row #CountDown,
.challenge-top-row #ChallengeCountDown {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

.float-child-left,
.float-child-right {
    flex: 0 0 auto;
    padding: 1.4286rem 0;
}

.exams {
    display: flex;
    background: none;
}

.matrix-board {
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(3, 18rem);
  grid-template-rows: repeat(5, 6.4286rem);
}

/* The flip box container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover  */
.flip-box {
  margin: 0px;
  padding: 0.7143rem 0.3571rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 500ms;
  transition-timing-function: ease;
    
  background-color: transparent;
  height: 5.7143rem;
  /* perspective goes on the parent of the element that rotates, not on the rotating element */
  perspective: 1000px;
}
.flip-box-inner:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 25px 0 rgba(0, 0, 0, 0.3), 0 0 1px 0 rgba(0, 0, 0, 0.25);
  transition: 500ms;
  transition-timing-function: ease;
}

/* This container is needed to position the front and back side */
.flip-box-inner {
    border: 1px solid  hsla(0, 0%, 0%, 0.1);
    box-shadow: 0 0.15em 0.175em hsla(0, 0%, 0%, 0.1);
    background-color: #bbb;
  position: relative;
  width: 100%;
  height: 90%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}


/* Do an horizontal flip when you move the mouse over the flip box container */
.flip-box.is-switched .flip-box-inner {
  transform: rotateY(180deg);
}

/* Position the front and back side */
.flip-box-front, .flip-box-back {
    position: absolute;
    margin: 0px;
    padding: 0.3571rem;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    /* No overflow on the faces themselves: in Safari/WebKit an overflow other than
       `visible` on a face disables backface-visibility, so the back (exam result) showed
       through, mirrored, before any click. Long texts scroll in .flip-box-content. */
    /* The hidden face is also hidden with `visibility`, so the result can never be
       read before the flip whatever the 3D rendering does. The switch happens half-way
       through the 0.8 s rotation, when the card is edge-on. */
    transition: visibility 0s linear 0.4s;
}

.flip-box-content {
    height: 100%;
    overflow-y: auto;
    /* vertically centred; auto margins (not justify-content) so a long result
       still scrolls from its first line */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.flip-box-content > :first-child { margin-top: auto; }
.flip-box-content > :last-child { margin-bottom: auto; }

/* Tighter headings inside a card, so a three-line name (« Pose de voie veineuse
   centrale et cathéter artériel ») and its delay fit in the card. */
.flip-box-content h2 {
    margin-bottom: 0.15rem;
    font-size: 1.1rem;
    line-height: 1.15rem;
}
.flip-box-content h4 {
    margin-bottom: 0;
    line-height: 1.2rem;
}

/* Style the front side (fallback if image is missing) */
.flip-box-front {
  color: black;
  z-index: 1;
}

/* Style the back side */
.flip-box-back {
  background-color: #156470;
  color: white;
  transform: rotateY(180deg);
  z-index: -1;
  visibility: hidden;
}

.flip-box.is-switched .flip-box-front {
    z-index: -1;
    visibility: hidden;
 }

 .flip-box.is-switched .flip-box-back {
   z-index: 1;
   visibility: visible;
 }
 
.result {
    visibility: hidden;
}

#result {
    visibility: hidden;
}

.survey {
    padding: 2.8571rem;
}

.survey .question {
    padding: 0.7143rem 2.8571rem;
    margin-block: 2.1429rem;
    
}

.survey .question * {
    margin: 0 0.7143rem;
    padding: 0;
    font-size: 1.1429rem;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #4B4B4B;
}

input[type="number"] {
    width: 4.2857rem;
    text-align: center;
}

select {
    text-align: center;
}

input[type=range] {
        width: 60%;
    }
/* Scenario screen: it must fit the window without scrolling, in both directions. Its
   root size is bounded by the window width (~88rem of content) and height (~52rem),
   so the screen is the same at every size, only scaled; on a small or short window it
   may go below 14px. The vertical whitespace is trimmed. */
html:has(#challenge-container) {
    font-size: max(10px, min(1.11vw, 1.85vh));
}
body:has(#challenge-container) {
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}
body:has(#challenge-container) > br,
body:has(#challenge-container) footer,
#challenge-container > .result {
    display: none; /* layout break, empty footer, unused hidden « réponse »/« Next » */
}
#challenge-container .float-container {
    padding-bottom: 0.7143rem;
}
#challenge-container > .center button {
    margin-top: 0.7143rem;
    margin-bottom: 0.5rem;
}
