
/* https://stackoverflow.com/questions/3215553/make-a-div-fill-an-entire-table-cell */

#stt  {margin:60px 0 70px;height:fit-content;font-size:.9em;background:#FFFFFF;border-width:1px;border-style:solid;border-color:#000000}
#stt tr {height:100%}  /* required to set heights in table cells */
#stt th,
#stt td {position:relative;padding:4px;vertical-align:top;border-width:0;border-style:solid;border-right-color:#000000;border-bottom-color:#C0C0C0}
#stt th,
#stt td {border-right-width:1px;border-bottom-width:1px}
#stt tr th:last-child,
#stt tr td:last-child {border-right-width:0}
#stt tr:last-child td,
#stt tr td.bbn {border-bottom-width:0}  /* no bottom border - for double lessons on the bottom row */
#stt tr td:nth-child(1) {height:84px}
#stt tr td:nth-child(2),
#stt tr td:nth-child(3),
#stt tr td:nth-child(4),
#stt tr td:nth-child(5),
#stt tr td:nth-child(6) {width:20%}
#stt tr th:nth-child(1),#stt tr td:nth-child(1),
#stt tr th:nth-child(3),#stt tr td:nth-child(3),
#stt tr th:nth-child(5),#stt tr td:nth-child(5) {background-color:#F0F0F0}
#stt tr th:nth-child(2),#stt tr td:nth-child(2),
#stt tr th:nth-child(4),#stt tr td:nth-child(4),
#stt tr th:nth-child(6),#stt tr td:nth-child(6) {background-color:#D0D0D0}
#stt tr td.bdg {background-color:#D0D0D0}  /* dark grey bg for cells out of sync due to a rowspan */
#stt tr td.blg {background-color:#F0F0F0}  /* light grey bg for cells out of sync due to a rowspan */
#stt td.brw {border-right-width:1px !important} /* replace right border for last column of row due to a rowspan to the right */
#stt tr th:first-child {color:#C0C0C0;text-align:center;vertical-align:middle;font-size:.8em}
#stt tr td:first-child {color:#808080;text-align:center;line-height:.8em;font-size:.8em}
#stt tr td:first-child b {display:inline-block;margin-top:5px}
#stt tr td:first-child img {position:relative;top:-1px;width:6px}

#stt tr.brb td:nth-child(1),               /* break */
#stt tr.brl td:nth-child(1) {height:auto}  /* lunch */
#stt tr.brb td:nth-child(2),
#stt tr.brl td:nth-child(2) {padding-right:0}
#stt tr.brb td:nth-child(3),#stt tr.brb td:nth-child(4),#stt tr.brb td:nth-child(5),
#stt tr.brl td:nth-child(3),#stt tr.brl td:nth-child(4),#stt tr.brl td:nth-child(5) {padding-right:0;padding-left:0}
#stt tr.brb td:nth-child(6),
#stt tr.brl td:nth-child(6) {padding-left:0}
#stt tr.brb td div,
#stt tr.brl td div {position:relative;left:-1px;width:calc(100% - 14px);padding-left:12px;color:#808080;background-color:RGBA(248,248,248,.6)}  /* shifting the divs to overlap the vertical cell borders */
#stt tr.brb td:nth-child(2) div,
#stt tr.brl td:nth-child(2) div {left:0;width:calc(100% - 16px)}
#stt tr.brb td:nth-child(6) div,
#stt tr.brl td:nth-child(6) div {width:calc(100% - 16px)}
#stt tr.brb td div {height:34px;line-height:34px}  /* same line-height as height vertically aligns (single line of) text in the middle */
#stt tr.brl td div {height:101px;line-height:101px}
#stt tr.brl td div span {display:inline-block;vertical-align:middle;line-height:.9em}  /* needed for multiple lines of text */
#stt tr.brb td:nth-child(2) div,
#stt tr.brl td:nth-child(2) div {border-right:0;border-radius:3px 0 0 3px}
#stt tr.brb td:nth-child(3) div,#stt tr.brb td:nth-child(4) div,#stt tr.brb td:nth-child(5) div,
#stt tr.brl td:nth-child(3) div,#stt tr.brl td:nth-child(4) div,#stt tr.brl td:nth-child(5) div {border-right:0;border-left:0;border-radius:0}
#stt tr.brb td:nth-child(6) div,
#stt tr.brl td:nth-child(6) div {border-left:0;border-radius:0 3px 3px 0}

/* divs */
#stt td     div:first-child {position:relative;padding:4px 4px 4px 8px;height:calc(100% - 10px);background-color:#FFFFFF;border-width:1px;border-style:solid;border-color:#808080;border-radius:3px}
#stt td     div div {out_line:1px solid #FF0000}
#stt td     div div:first-child {position:absolute;top:0;left:0;padding:0 !important;width:6px;height:100%;border:none !important;border-radius:2px 0 0 2px !important}
#stt td     div div:nth-child(2) {position:absolute;padding-right:4px;line-height:.9em;font-size:.75em;color:#A0A0A0}
#stt td     div div:nth-child(3) {margin:22px 0 0;font-weight:bold}
#stt td     div div:nth-child(4) {position:absolute;bottom:4px;padding-right:2px;line-height:.95em;font-size:.75em;font-weight:bold;color:#A0A0A0}

/* current time bar */
div.bar {display:none;position:absolute;left:20px;top:-10px;width:100px;opacity:.6;z-index:1}
div.bar div:nth-child(1),
div.bar div:nth-child(2) {position:absolute;bottom:-4px;width:11px;height:11px;background-image:url('imgs/dot-b.png');background-size:11px 11px;z-index:-1}
div.bar div:nth-child(1) {left:-6px;background-image:url('imgs/dot-r.png')}
div.bar div:nth-child(2) {right:-5px;background-image:url('imgs/dot-v.png')}
div.bar div:nth-child(3) {position:relative;width:100%;height:3px;background:linear-gradient(to right,red,orange,yellow,green,blue,indigo,violet)}

#ws   {margin:0;padding:0}

/* screens <= 895px */
@media only screen AND (max-width:895px){
  #c0   {margin:0 8%}
  #stt td div div:nth-child(3) {min-height:0}
}

/* screens <= 720px */
@media only screen AND (max-width:720px){
  #c0   {margin:0 2%}
  #stt  {margin:15px 0;font-size:.8em}
}

/* screens <= 561px */
@media only screen AND (max-width:561px){
  #d0   {padding:10px 0}
  #c0   {margin:0 2%}
  #stt  {font-size:.7em}
  #stt th,
  #stt td {padding:2px}
  #stt tr td:nth-child(1) {height:64px}
  #stt tr td:first-child img {top:0}
  #stt tr.brb td div {height:32px;line-height:32px}
  #stt tr.brl td div {height:83px;line-height:83px}
  #stt td div div:first-child {width:5px}
  #stt td div div:nth-child(3) {margin:16px 0 0}
  #ws   {padding-bottom:30px}
}

/* screens <= 350px */
@media only screen AND (max-width:350px){
  #d0   {padding:10px 0}
  #c0   {margin:0 2%}
  #stt  {font-size:.75em}
  #stt tr:nth-child(1),
  #stt tr th:nth-child(1),
  #stt tr td:nth-child(1) {display:none}
  #stt tr td.nbb {border-bottom-width:0}  /* no bottom border - for lessons on the row above a break on the compact timetable */
  #stt tr td.tdh {height:25px}  /*  */
  #stt td {padding:0;background-color:#FFFFFF !important}  /* blank cells are white */
  #stt td div:first-child {padding:0.1px 2px;height:calc(100% - 0.2px);border-style:none;border-radius:0}
  #stt td div div:nth-child(3) {margin:0 0 11px}
  #stt td div div:nth-child(4) {right:2px;bottom:2px;color:#808080}
  #stt tr.brb td,
  #stt tr.brl td {padding:0;height:0;border-bottom-width:2px;border-bottom-style:solid;border-bottom-color:#000000}
  #stt tr.brb td div,
  #stt tr.brl td div {display:none}
  #ws   {padding-bottom:30px}
}

/* print (A4 - margins:10mm )*/
@media print{
  body  {min-height:0}
  div.sh,
  div.bl,div.bl2,div.bl3,div.bl4,div.bl5,
  div.bu,div.bu2,div.bu3,div.bu4,div.bu5,
  div.lv,div.lv2,div.lv3,div.sn,div.sn2,
  #logo {display:none}
  #d0   {padding:0;background:none;background-color:#FFFFFF !important}
  #c0   {margin:0 1% 0}
  #stt td div div:nth-child(3) {min-height:0}
  #stt tr th:first-child {color:RGBA(0,0,0,0)}
  p.print-space {padding-top:160px}
  h1 {display:none}
  #ws   {padding:0}
}