/* ===== Hlavní kontejner ===== */
.header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0; /* Odstraněn boční padding (přesunut níže) */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* =====  Horní řádek (loga a jazyk) ===== */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.5rem; /* Boční padding z původního .header */
  padding-bottom: 0.5rem; /* Mezera mezi obsahem a novou čárou */
  margin-bottom: 0.5rem; /*  Mezera pod čárou */
  border-bottom: 2px solid #e5e7eb; /* Samotná oddělovací čára */
}

/* Skupiny drží prvky u sebe */
.header-top-left,
.header-top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-top img {
  height: 36px;
  width: auto;
}

#logo-grita {
  height: 44px;
  flex-shrink: 0;
}

.header-text-left {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
}

.header-link-language {
  font-size: 0.9rem;
  color: var(--primary);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header-link-language:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

/* ===== Spodní řádek (Název + kapitoly) ===== */
.header-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 0 3.5rem; /*Boční padding z původního .header */
}

#tutorial-title {
  font-size: 1.8rem;
  margin: 0;
  color: #111827;
}

/* ===== Kapitoly (tvoje původní styly) ===== */
.chapters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap; 
}

.chapter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: none;
  background: transparent;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chapter-tab:hover {
  background: #f3f4f6;
  border-radius: 0.5rem;
}

.chapter-num {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary);
  font-family: ui-serif, Cambria, Georgia, "Times New Roman", serif;
}

.chapter-title {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.chapter-tab.active {
  background: #eef2ff;
  border-radius: 0.5rem;
}

.chapter-tab.active .chapter-title {
  max-width: 20rem;
  opacity: 1;
}

/* =========================================
   Responzivita (Mobilní zařízení)
========================================= */
@media (max-width: 768px) {
  .header {
    padding: 1rem 0; /*  Boční padding je 0 i na mobilu */
  }

  /* Horní řádek na mobilu */
  .header-top {
    flex-direction: column; 
    align-items: stretch;
    padding: 0 1.5rem; /* Zmenšený boční padding pro mobil */
    padding-bottom: 1.5rem; /* Udržení mezery nad čárou */
  }

  .header-top-right {
    order: 1; 
    justify-content: flex-end; 
    margin-bottom: 1rem;
  }

  .header-top-left {
    order: 2; 
    justify-content: flex-start; 
  }

  /* Spodní řádek na mobilu */
  .header-bottom {
    flex-direction: column; 
    align-items: flex-start; 
    gap: 1.5rem;
    padding: 0 1.5rem; /* Zmenšený boční padding pro mobil */
  }
}