/** GENERAL **/

/* typography */
html {
  font-size: 14px;
}
p {
  line-height: 1.4em;
  padding-bottom: 12px;
}
a {
  color: inherit;
}
strong {
  font-weight: 700;
}
h1 {
  font-size: calc(0.6vw + 1rem);
  line-height: 1.4em;
}
h2 {
  color: #c7e0ef;
  font-size: 1.6rem;
  line-height: 1.4em;
}
h5 {
  line-height: 1.4em;
}

/* colors */
.red,
span.anbieterin > p {
  color: #c53010;
}
div.angebot.begleitung {
  background-color: #c7e0ef;
}
div.angebot.teilintegration {
  background-color: #d7de98;
}
div.angebot.sonderschule {
  background-color: #ffe453;
}
p.angebot {
  color: #1d1d1b;
}

/* page layout */
body {
  display: flex;
  flex-wrap: wrap;
  background: #f9f9f9;
  color: #5d88a4;
  font-family: Helvetica, sans-serif;
}

/** Header **/

header {
  width: 100%;
  padding: 2rem 4rem;
  font-weight: 700;
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(3, auto);
  grid-gap: 2rem;
}
header .title {
  max-width: 720px;
  text-transform: uppercase;
}

/* Legende Feldfarben */
.legende.feldfarben {
  display: -ms-grid;
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-gap: 8px;
}
.legende.feldfarben h3 {
  grid-column: span 2;
  border-bottom: 3px solid;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.legende p {
  font-weight: 500;
  padding-bottom: 0;
  padding-right: 12px;
}
.legende.feldfarben label.blau {
  background: #c7e0ef;
}
.legende.feldfarben label.gruen {
  background: #d7de98;
}
.legende.feldfarben label.gelb {
  background: #ffe453;
}

/* Legende Schriftfarben */
.legende.schriftfarben {
  display: -ms-grid;
  display: grid;
  grid-template-columns: min-content 1fr;
  grid-gap: 8px 16px;
  height: min-content;
}
.legende.schriftfarben h3 {
  border-bottom: 3px solid;
  grid-column: span 2;
  height: min-content;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.legende.schriftfarben label {
  line-height: 1.4em;
}
.legende.schriftfarben label.schwarz {
  color: #1d1d1b;
}
.legende.schriftfarben label.rot {
  color: #c53010;
  text-align: right;
}

/** MAIN (grid) **/

main {
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(23, auto);
  grid-template-rows: repeat(8, auto);
  grid-gap: 6px;
  padding: 0 4rem;
  margin-bottom: 125px;
}

/* schulstufe */
main div.schulstufe {
  grid-column: 1 / 4;
  border-bottom: 3px solid;
  padding: 24px 6px 0 6px;
}
.schulstufe.tertiaer {
  grid-area: 1 / 1 / 3 / 4;
}
.schulstufe.sek-2 {
  grid-area: 3 / 1 / 4 / 4;
}
.schulstufe.sek-1 {
  grid-area: 4 / 1 / 6 / 4;
}

/* betreuung */
div.betreuung {
  writing-mode: vertical-rl;
  width: min-content;
  padding: 14px 8px;
  transform: rotate(180deg);
}
div.betreuung.sekundaer-1 {
  grid-row: span 6;
  background-image: linear-gradient(0deg, rgba(199, 224, 239, 0.25), #c7e0ef);
}
div.betreuung.sekundaer-2 {
  grid-area: 3 / 23 / 9 / 24;
  background-image: linear-gradient(0deg, rgba(220, 219, 213, 0.25), #dcdbd5);
}
div.betreuung.tertiaer {
  grid-row: 1 / 3;
  background: #c7e0ef;
}

/******************** TERTIÄR *********************/
.angebot.begleitung.hochschulen {
  grid-area: 1 / 5 / 3 / 14;
}
.angebot.gray.berufsmatur {
  grid-area: 1 / 14 / 3 / 17;
  background: #dcdbd5;
}
.empty.tertiaer {
  grid-area: 1 / 17 / 3 / 23;
  background: #ffe453;
  opacity: 0.25;
}

/******************** SEK 2 *********************/
.angebot.begleitung.gymnasium {
  grid-area: 3 / 5 / 6 / 8;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: space-between;
}
.angebot.begleitung.gymiplus {
  grid-area: 3 / 8 / 6 / 11;
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  justify-content: space-between;
}
.angebot.begleitung.fachmittelschule {
  grid-area: 3 / 11 / 4 / 14;
}
.angebot.begleitung.teilintegration.berufslehre {
  grid-area: 3 / 14 / 4 / 17;
}
.angebot.begleitung.teilintegration {
  background-image: linear-gradient(90deg, #c7e0ef 50%, #d7de98 50%);
}
.angebot.sonderschule.berufslehre {
  grid-area: 3 / 17 / 4 / 20;
}
.angebot.sonderschule.plus-15 {
  grid-area: 3 / 20 / 4 / 23;
}

/******************** SEK 1 *********************/
.angebot.begleitung.schuljahr-10 {
  grid-area: 4 / 11 / 5 / 15;
  margin-right: -3px;
}
.angebot.begleitung.sek {
  grid-area: 5 / 11 / 6 / 15;
  margin-right: -3px;
}
.angebot.teilintegration.schuljahr-10 {
  grid-area: 4 / 16 / 5 / 20;
  margin-left: -3px;
}
.angebot.teilintegration.sek {
  grid-area: 5 / 16 / 6 / 20;
  margin-left: -3px;
}
.empty.begleitung.teilintegration.schuljahr-10 {
  grid-area: 4 / 15 / 6 / 16;
  background-image: linear-gradient(90deg, #c7e0ef 50%, #d7de98 50%);
  opacity: 0.5;
}
.empty.sonderschule.schuljahr-10 {
  grid-area: 4 / 20 / 5 / 23;
  background: #ffe453;
  opacity: 0.25;
}
.angebot.sonderschule.sek {
  grid-area: 5 / 20 / 6 / 23;
}

/******************** PRIMARSCHULE *********************/
.angebot.begleitung.primarschule {
  grid-area: 6 / 5 / 7 / 11;
}
.angebot.teilintegration.primarschule {
  grid-area: 6 / 11 / 7 / 17;
}
.angebot.sonderschule.primarschule {
  grid-area: 6 / 17 / 7 / 23;
}

/******************** KINDERGARTEN *********************/
.angebot.begleitung.kindergarten {
  grid-area: 7 / 5 / 8 / 14;
}
.angebot.sonderschule.kindergarten {
  grid-area: 7 / 14 / 8 / 23;
}

/******************** FRÜHFÖRDERUNG *********************/
.angebot.begleitung.fruehfoerderung {
  grid-area: 8 / 5 / 9 / 14;
}
.angebot.sonderschule.fruehfoerderung {
  grid-area: 8 / 14 / 9 / 23;
}

/** TOOLTIPS INSTITUTIONEN (POPUP'S) **/
div.angebot span.anbieterin {
  position: relative;
  display: inline-block;
}
div.tooltip-institution {
  display: none;
  width: 400px;
  background: #fff;
  padding: 2rem;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translate3d(-50%, -100%, 0px);
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.24);
  z-index: 1;
}
div.tooltip-institution:not(.no-link) {
  padding-bottom: 50px;
}
span.anbieterin.up div.tooltip-institution {
  top: auto;
  bottom: -24px;
}
span.anbieterin.right div.tooltip-institution {
  transform: translate3d(-75%, -100%, 0px);
}
span.anbieterin.right.up div.tooltip-institution {
  transform: translate3d(-75%, 100%, 0px);
}
span.anbieterin.left div.tooltip-institution {
  transform: translate3d(-25%, -100%, 0px);
}
div.angebot.highlight.tooltip-open {
  z-index: 1;
}
div.angebot.highlight.tooltip-open
  span.anbieterin.tooltip-open
  div.tooltip-institution {
  display: block;
  cursor: initial;
}
div.tooltip-institution::after {
  position: absolute;
  content: "";
  width: 16px;
  height: 16px;
  left: 50%;
  bottom: -32px;
  border-width: 16px;
  border-style: solid;
  border-color: #c7e0ef transparent transparent transparent;
  background: transparent;
  transform: translateX(-50%);
}
span.anbieterin.up div.tooltip-institution::after {
  bottom: auto;
  top: -32px;
  border-color: transparent transparent #ffffff transparent;
}
span.anbieterin.right div.tooltip-institution::after {
  left: 75%;
}
span.anbieterin.left div.tooltip-institution::after {
  left: 25%;
}
div.tooltip-institution h5.tooltip-title {
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 1.2rem;
}
div.tooltip-institution a.tooltip-link {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 16px 32px;
  width: 100%;
  background: #c7e0ef;
  text-align: center;
  text-decoration: none;
  color: #1d1d1b;
  font-size: 1.2rem;
}
div.tooltip-institution a.tooltip-link span.link-span {
  font-size: 0.75em;
}
div.tooltip-institution a.tooltip-link:hover {
  text-decoration: underline;
}
a.tooltip-link::after {
  content: "⟩";
  right: 0;
  top: 50%;
  position: absolute;
  font-size: 2rem;
  transform: translateY(-50%);
  opacity: 0;
  transition: 0.3s ease-in-out;
}
a.tooltip-link:hover::after {
  right: 1.4rem;
  opacity: 1;
}
div.tooltip-institution .tooltip-close {
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: url("./icons/x.svg") no-repeat center;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s linear;
}
.tooltip-close:hover {
  transform: scale(1.25);
}

/** DIVERSES **/

/* Label (Wohnen, Wohngruppe, Internat) */
div.angebot {
  padding: 1rem;
}
div.angebot.label {
  position: relative;
  padding-bottom: 32px;
}
p.label {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  margin: 6px;
  background-color: rgba(255, 255, 255, 0.75);
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 0.8rem;
}

/* Face Icon */
div.angebot.highlight {
  position: relative;
}
div.angebot.highlight::after {
  content: url("./icons/bxs-face.svg");
  position: absolute;
  right: 6px;
  bottom: 6px;
}

/** INTERAKTIVITÄT **/

/* hover */
div.angebot,
div.betreuung {
  transition: background 0.4s ease-in-out;
}
div.angebot:hover,
div.betreuung:hover {
  cursor: pointer;
}
div.angebot.begleitung:hover,
div.betreuung.tertiaer:hover {
  box-shadow: 0 0 16px rgb(32 74 99 / 12%);
  background-color: #d2e8f5;
}
div.angebot.teilintegration:hover {
  box-shadow: 0 0 16px rgb(96 103 37 / 12%);
  background-color: #e1e99d;
}
div.angebot.sonderschule:hover {
  box-shadow: 0 0 16px rgb(185 156 0 / 24%);
  background-color: #fbe987;
}
div.angebot.gray.berufsmatur:hover {
  background-color: #e7e6e1;
}
div.angebot.begleitung.teilintegration:hover {
  background-image: linear-gradient(90deg, #d2e8f5 50%, #e1e99d 50%);
}
div.betreuung.sekundaer-1:hover {
  background-image: linear-gradient(0deg, rgba(199, 224, 239, 0.25), #d2e8f5);
}
div.betreuung.sekundaer-2:hover {
  background-image: linear-gradient(0deg, rgba(220, 219, 213, 0.25), #e7e6e1);
}
div.angebot.highlight span.anbieterin > p:hover {
  text-decoration: underline;
}
body.highlight-mode div.angebot:not(.highlight),
body.highlight-mode div.betreuung:not(.highlight),
body.highlight-mode div.empty {
  filter: grayscale(0.5);
  opacity: 0.5;
}

/** ACCESSABILITY **/

/* focus */
div.angebot:focus-visible,
div.betreuung:focus-visible {
  outline: auto;
  filter: brightness(1.05);
}

/** MEDIA QUERIES **/

@media screen and (max-width: 1020px) {
  main {
    padding: 0 1rem;
  }
  header {
    padding: 2rem 1rem;
  }
}

@media screen and (max-width: 940px) {
  div.angebot {
    padding: 0.5rem;
  }
}
