/*
* Layout
*/
:root {
  --tly-content-height: 0px;
  --tly-main-height: 1fr;
}

.main-2 {
  display: flex;
  flex-direction: row;
  gap: var(--tly-large-gap);
}

h2 {
  font-size: 1.4rem;
}

img {
  max-width: 100%;
  height: auto;
}

.main-2 section:nth-child(1) {
  width: 280px;
}

nav {
  box-shadow: 0 0px 2px rgba(0, 0, 0, 0.17);
}

/*
* The menu
*/

ul.menu li>p:not(.toggle) {
  background-color: #f2f2f2;
}

ul.menu, ul.submenu {
  margin:0;
  padding:0;
}

.menu  li {
  border-bottom: 1px solid #e6e6e6;
}

.submenu li {
  border-bottom: 1px solid #eee;
}

.menu  a, .menu  p {
  color: #333;
}

.menu a {
  text-decoration:  none;
}

.menu li > p {
  padding: 0 8px;
}

.menu li > p,
.menu li {
  line-height: 40px;
}

.menu, .submenu {
  width: 280px;
  list-style: none;
}

.menu > li {
  cursor: pointer;
  background-color: #f9f9f9;
}

.submenu > li {
  cursor: pointer;
  background-color: #fefefe;
}

.submenu a span {
  line-height: 25px;;
}

.submenu a {
  display: flex;
  flex-direction: row;
  padding: 8px;
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out; /* Smooth transition for the submenu */
}

/* So that the javascript get the correct target */
.toggle > a {
  pointer-events: none;
}

.toggle::after {
  font-size: 20px;
  content: "›"; /* Right-pointing arrow (initially) */
  float: right;
  transition: transform 0.3s ease-in-out; /* Smooth rotation transition */
}

.menu > li.expanded > p.toggle::after {
  transform: rotate(90deg); /* Rotates the arrow when expanded */
  content: "›"; /* Down-pointing arrow */
}

li.selected a {
  color: #8c8c8e;
}


.menu > li.expanded > ul.submenu {
  max-height: unset;
}

/* mobile */
@media only screen and (max-width: 767px) {
  .main-2 {
    flex-direction: column-reverse;
  }

  .main-2 section:nth-child(1) {
    width: 100%;
  }

  .menu, .submenu {
    width: 100%;
  }
}