.layout-container [id="body"] {
  max-width: 2000px;
  width: 96%;
  padding-top: calc(20px + 1vw);
}
table thead {
  position: sticky;
  /*top: 0; !* Don't forget this, required for the stickiness *!*/
  top: calc(var(--drupal-displace-offset-top, 0px));
  /*top: calc(var(--drupal-displace-offset-top, 0px) + var(--page-tab-height));*/
  z-index: 20;
}
table td,
table th {
  padding: 0.3em 0.4em;
}
table td.empty {
  padding: 0;
}

button.flat {
  margin: 0;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

.cols-2 {
  gap: 3%;
  align-items: flex-start;
}

div.outlined {
  border: 1px solid #8a8a8a;
  border-radius: 4px;
  padding: 0.5em 0.5em;

  h2 {
    margin-top: 0;
    margin-bottom: 0;
  }
}

.path-curriculum-maps,
article[data-view-mode="full"] {
  [role="tablist"] {
    margin-bottom: 0.5em;
    display: flex;
    gap: 1em;
    background: #d8ead8; /*#2d912d21;*/
    border: none;
    border-radius: 100px;
    text-wrap: wrap;
  }
  [role="tablist"] > * {
    flex: 1 1 auto;
    margin: 0;
  }
  [role="tablist"] [role="tab"] {
    border-radius: 100px !important;
    border: none !important;
    padding: var(--pointer_target-padding) !important;
    color: inherit !important;
    font-size: 0.9em !important;
    height: auto;
    /*height: var(--page-tab-height);*/
  }
  [role="tablist"] [role="tab"]:hover,
  [role="tablist"] [role="tab"][aria-selected="true"] {
    background: rgba(45, 145, 45, 0.38) !important;
  }
}

[data-path="/curriculum-maps/secondary"] {
  --page-tab-height: 34px;

  [role="tablist"] {
    position: sticky;
    top: var(--drupal-displace-offset-top, 0);
    z-index: 20;
  }
  table thead {
    position: sticky;
    /*top: 0; !* Don't forget this, required for the stickiness *!*/
    top: calc(var(--drupal-displace-offset-top, 0px) + var(--page-tab-height));
  }
}
.ck-widget {
  table thead {
    position: static !important;
  }
}

table#curriculum-map {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
table#curriculum-map th,
table#curriculum-map td {
  border: solid 1px #dbdbdb;
  vertical-align: top;
}
table#curriculum-map th {
  background: #efefef;
  border: solid 1px hsl(180, 16.3%, 68.6%);
  /*text-align: center;*/
  font-weight: normal;
}
table#curriculum-map thead th {
  background: hsl(180, 32.1%, 89%);
}
table#curriculum-map h2,
table#curriculum-map h3 {
  margin: 0.3em 0;
}
td[style*="background-color:pink;"] {
  background: hsla(300, 100%, 25.1%, 0.14) !important;
}
td[style*="background-color:lightblue;"] {
  background: hsla(210.8, 81.8%, 54.7%, 0.14) !important;
}
.cell-label {
  border-bottom: solid 1px #dadada;
  padding-bottom: 0.8em;
  margin-bottom: 0.8em;
  font-size: 0.8em;
}

/* Problems */
table#curriculum-map .problem {
  line-height: 1.1;
  position: relative;
  font-size: 1rem;
}
table#curriculum-map .problem + .problem {
  margin-top: 0.4em;
}
table#curriculum-map a:hover {
  text-decoration: underline;
}

table#curriculum-map .difficulty {
  display: inline-block;
  position: relative;
  top: -0.1em;
}
p img[src*="star_filled.svg"],
table#curriculum-map .difficulty img {
  width: 1em;
}
table#curriculum-map .type {
  font-weight: bold;
}

/* Problem dialog */
table#curriculum-map .problem dialog {
  z-index: 30;
  position: absolute;
  left: 2em;
  top: 100%;
  border: solid 1px #bdbdbd;
  box-shadow: 1px 1px 5px #00000017;
  border-radius: 3px;
  width: 300px;
  max-width: 100%;
}
table#curriculum-map .problem .title:hover dialog,
table#curriculum-map .problem .title:hover ~ dialog {
  display: block;
}

/* Tags list */
[id="tags-list"] label {
  font-weight: initial;
  font-size: 1em;
}
[id="tags-list"] input[type="radio"] {
  margin-right: 0.6em;
}
[id="tags-list"] input[type="radio"]:checked + span {
  color: #2343b3;
}
table#curriculum-map .problem {
  /*-moz-outline-radius: 3px;*/
}
table#curriculum-map .problem.active {
  /*outline: solid 1px red;*/
}
table#curriculum-map .problem.inactive {
  opacity: 25%;
}

/* Custom pages */
body[data-path*="/custom-curriculum-map"],
.page-node-type-curriculum-map {
  [id="body"] {
    max-width: 2000px;
    width: 96%;
  }
  .table-container {
    overflow: visible;
  }
  /*td:not([colspan]) {*/
  td:not([style*="background"]) {
    font-size: 0.8em;
  }
  .problem,
  td > a {
    /*font-size: 0.9rem;*/
  }
  .problem {
    margin-top: 0.4em;

    &:first-of-type {
      /*margin-top: 0.8em;*/
    }
  }
}

[data-highlighted="1"] {
  border: solid 2px #2ec62e;
  padding: 4px;
  border-radius: 5px;
}

div.grouped,
div.ordered {
  background-color: #CCE0F030;
  padding: 0.5em 0.5em;
  border-radius: 5px;
  border: solid 1px #9CBFDB;
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  position: relative;

  .problem {
    & ~ .problem {
      margin-top: 0.5em;
    }
    & + br {
      display: none;
    }
    &:first-of-type {
      margin-top: 0;
    }
  }
}
div.grouped {
}
div.ordered {
  padding-left: 1.5em;

  a {
    /*display: inline-block;*/
    position: relative;
  }
  a ~ a::before,
  .problem ~ .problem::before {
    content: '';
    /*background-image: url('/modules/custom/curriculum_maps/arrow_down_icon.svg'); !* ↓ *!*/
    background-image: url('/modules/custom/curriculum_maps/curved-arrow.svg');
    transform: scaleY(-1); /* Flip it vertically (to point down) */
    font-weight: bold;
    position: absolute;
    /*left: initial;*/
    right: 100%;
    bottom: calc(100% + -5px);
    width: 16px;
    height: 16px;
    background-size: contain;
  }
}

.field--name-body {
  max-width: var(--text-max-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.8vw;
}
