* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  width: 100vw;
  background-color: #fffefa;
  margin: 0;
  font-family: "League Spartan", sans-serif;
  overflow-x: hidden;
}

/* --- Navigace --- */
nav {
  position: fixed;
  width: 7vw;
  height: 100vh;
  background-color: #1f1f1f;
  display: grid;
  transition: width 0.3s ease;
  z-index: 1;
}
nav.opened{
  width: 25vw;
}

#toggle-btn {
  position: absolute;
  width: 50px;
  height: 50px;
  background-color: #fadd9a;
  border-radius: 50%;
  right: -25px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

#toggle-btn .bar {
  position: absolute;
  width: 50%;
  height: 4.5px;
  background-color: #000;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

#toggle-btn .top {
  transform: translateX(2px) translateY(-7px) rotate(40deg);
}

#toggle-btn .bottom {
  transform: translateX(2px) translateY(7px) rotate(-40deg);
}

#toggle-btn.open .top {
  transform: translate(0, 0) rotate(45deg);
}

#toggle-btn.open .bottom {
  transform: translate(0, 0) rotate(-45deg);
}

#lesson-list {
  list-style: none;
  padding: 60px 10px 20px 10px;
  margin: -20px 50px;
  color: white;
  background-color: transparent;

  max-height: 100vh;
  overflow-y: auto;

  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* Edge / IE */

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#lesson-list::-webkit-scrollbar {
  display: none;              /* Chrome, Safari */
}

#lesson-list li {
  margin-top: 10px;
  width: 95%;
  cursor: pointer;
}

#lesson-list li:hover {
  color: #fadd9a;
}

nav.opened #lesson-list {
  opacity: 1;
  pointer-events: auto;
}

/* --- Sekce a podlekce --- */
.section-title {
  font-weight: 700;
  font-size: 1.2em;
  margin-bottom: 10px;
  cursor: pointer;
  color: white;
  text-decoration: underline;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.section.open .section-title {
  color: #fadd9a;
  text-decoration: none;
}

.sub-lessons {
  list-style: none;
  padding-left: 15px;
  display: none;
  width: 100%;
}

.sub-lessons li {
  padding-top: 5px;
  margin-top: 0px;
  cursor: pointer;
  color: white;
  transition: color 0.3s ease;
  width: 100%;
}

.sub-lessons li.active,
.sub-lessons li:hover {
  color: #fadd9a;
}

.section.open .sub-lessons {
  display: block;
}

/* --- Hlavní obsah --- */
main {
  position: absolute;
  width: calc(100vw - 8vw);
  height: 100vh;
  display: grid;
  margin-left: 8vw;
  top: 0;
  left: 0;
  transition: margin-left 0.3s ease, width 0.3s ease;
}

#default-content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  overflow-y: auto;

  padding: 160px 10% 120px;
  box-sizing: border-box;
}


/* Nadpis lekce */
#default-content h1 {
  font-size: clamp(2.2rem, 5vw, 4.5em);
  text-align: center;
  margin-bottom: 40px;
  width: clamp(90%, 70vw, 100%);
}

/* Text lekce */
#default-content p {
  position: absolute;
  top: 330px;
  font-size: clamp(1.1rem, 2.2vw, 1.8em);
  text-align: center;
  width: 70%;
  padding-bottom: 100px;

  /* PŘIDAT TOTO PRO SPRÁVNÉ CENTROVÁNÍ: */
  left: 50%;
  transform: translateX(-50%);
  
  /* justify-self zde můžete smazat, u absolute positioning je zbytečný */
}

/* Tlačítko a obrázky */
main button {
  position: absolute;
  width: clamp(180px, 15vw, 260px);
  height: clamp(42px, 5.5%, 56px);
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 300px;
  background-color: #fadd9a;
  font-weight: 600;
  border-radius: 25px;
  border: 0;
}
#next-btn {
  display: none;          /* skryté ve výchozím stavu */
  position: fixed;        /* zůstává na místě při scrollu */
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.3s ease;
}

main .logo {
  position: fixed;
  width: clamp(32px, 4vw, 50px);
  top: 30px;    /* vzdálenost od horního okraje okna */
  right: 30px;  /* vzdálenost od pravého okraje okna */
}

main .home {
  position: fixed;
  width: clamp(28px, 3.5vw, 40px);
  top: 200px;   /* vzdálenost od horního okraje okna */
  right: 30px;  /* vzdálenost od pravého okraje okna */
}

/* Styl pro obrázky v lekcích */
.lesson-content-img {
    display: block;          /* Udělá z obrázku blok, aby fungovalo vycentrování */
    max-width: 80%;          /* Obrázek zabere maximálně 80% šířky okna (uprav podle potřeby) */
    max-height: 500px;       /* Volitelné: omezí i výšku, aby obrázek nezabral celou obrazovku */
    width: auto;             /* Zachová poměr stran */
    height: auto;            /* Zachová poměr stran */
    
    /* Vycentrování */
    margin-left: auto;
    margin-right: auto;
    
    /* Mezery kolem obrázku */
    margin-top: 30px;
    margin-bottom: 30px;

    /* Estetické doplňky */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); /* Jemný stín, aby obrázek "vystoupil" */
}


@media (min-width: 1920px){
  nav{
    font-size: 1.5em;
  }
  main {
    font-size: 1.5em;
  }
  main .logo{
    width: 80px;
  }
  main .home{
    width: 50px;
  }
  #next-btn{
    width: 90px;
    height: 90px;
  }
}

@media (max-width: 1350px){
  nav.opened{
    width: 30vw !important;
  }
}
@media (max-width: 1140px){
  nav.opened{
    width: 35vw !important;
  }
}
@media (max-width: 979px){
  nav.opened{
    width: 40vw !important;
  }
}
@media (max-width: 850px){
  nav.opened{
    width: 50vw !important;
  }
}
@media (max-width: 768px) {
    .lesson-content-img {
        max-width: 100%;     /* Na mobilu využije celou šířku */
        margin-top: 20px;
        margin-bottom: 20px;
    }
}
@media (max-width: 690px){
  nav.opened{
    width: 70vw !important;
  }
}
@media (max-width: 485px){
  nav.opened{
    width: 90vw !important;
  }
}