/* ============================================================
   instrukcja-wms.css | Studio VSS.net - dokumentacja on-line
   SoftwareStudio Sp. z o.o. | Wersja 1.1 | 2026-05
   ============================================================ */

/* --- Reset i podstawy --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #222;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Nagłówek --- */
header {
  background: #3a4554;
  color: #fff;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

header img.logo {
  height: 36px;
  width: auto;
}

header a {
  color: #fff;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  opacity: .95;
}

header a:hover { opacity: 1; text-decoration: underline; }

/* --- Wrapper główny --- */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- Sidebar nawigacyjny --- */
nav.sidebar {
  width: 268px;
  min-width: 268px;
  background: #f5f6f8;
  border-right: 1px solid #dde1e7;
  padding: 20px 0 40px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  overflow-x: hidden;
}

nav.sidebar::-webkit-scrollbar { width: 4px; }
nav.sidebar::-webkit-scrollbar-thumb { background: #c5c9d1; border-radius: 2px; }

nav.sidebar .nav-section {
  margin-top: 20px;
  padding: 0 16px 4px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a9099;
}

nav.sidebar ul {
  list-style: none;
}

nav.sidebar ul li a {
  display: block;
  padding: 6px 20px 6px 20px;
  font-size: .875rem;
  color: #3a4554;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.4;
}

nav.sidebar ul li a:hover {
  background: #eaecf0;
  color: #ff6a13;
  border-left-color: #ff6a13;
}

nav.sidebar ul li a[aria-current="page"] {
  background: #fff3ec;
  color: #ff6a13;
  border-left-color: #ff6a13;
  font-weight: 600;
}

/* Podrzędne pozycje menu (poziom 2) */
nav.sidebar ul ul li a {
  padding-left: 36px;
  font-size: .84rem;
  color: #555;
}

/* Poziom 3 */
nav.sidebar ul ul ul li a {
  padding-left: 52px;
  font-size: .82rem;
  color: #666;
}

/* --- Obszar treści --- */
main {
  flex: 1;
  min-width: 0;
  padding: 32px 48px 60px;
  max-width: 900px;
}

/* --- Breadcrumbs --- */
nav.breadcrumb {
  margin-bottom: 24px;
}

nav.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: .8rem;
  color: #8a9099;
}

nav.breadcrumb ol li { display: flex; align-items: center; gap: 4px; }

nav.breadcrumb ol li + li::before {
  content: '›';
  color: #bbb;
  font-size: .9rem;
}

nav.breadcrumb ol li a {
  color: #ff6a13;
  text-decoration: none;
}

nav.breadcrumb ol li a:hover { text-decoration: underline; }

nav.breadcrumb ol li[aria-current="page"] { color: #555; font-weight: 500; }

/* --- Artykuł --- */
article h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1f2b;
  margin-bottom: 20px;
  line-height: 1.25;
  border-bottom: 2px solid #ff6a13;
  padding-bottom: 12px;
}

article h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #3a4554;
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 4px solid #ff6a13;
}

article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #3a4554;
  margin: 24px 0 8px;
}

article h4 {
  font-size: .95rem;
  font-weight: 600;
  color: #555;
  margin: 18px 0 6px;
}

article p {
  margin-bottom: 14px;
  color: #333;
}

article ul, article ol {
  margin: 0 0 14px 22px;
  color: #333;
}

article ul li, article ol li { margin-bottom: 6px; }

article strong { color: #1a1f2b; }
article em { color: #555; }

article a {
  color: #ff6a13;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,106,19,.3);
  transition: border-color .15s, color .15s;
}

article a:hover {
  color: #cc5510;
  border-bottom-color: #cc5510;
}

/* --- Tabele ogólne --- */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: .9rem;
}

article table th {
  background: #3a4554;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

article table td {
  padding: 9px 14px;
  border-bottom: 1px solid #e0e3e8;
  color: #333;
  vertical-align: top;
}

article table tr:nth-child(even) td { background: #f9fafb; }
article table tr:hover td { background: #fff3ec; }

/* --- Tabela WMS (.wms-table) --- */
table.wms-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 28px;
  font-size: .875rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  border: 1px solid #dde1e7;
}

table.wms-table thead tr {
  background: linear-gradient(135deg, #3a4554 0%, #2d3748 100%);
}

table.wms-table thead th {
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.1);
}

table.wms-table thead th:last-child { border-right: none; }

table.wms-table tbody tr {
  border-bottom: 1px solid #e8ebf0;
  transition: background .12s;
}

table.wms-table tbody tr:last-child { border-bottom: none; }

table.wms-table tbody tr:nth-child(even) {
  background: #f7f8fa;
}

table.wms-table tbody tr:hover {
  background: #fff7f2;
}

table.wms-table tbody td {
  padding: 11px 16px;
  color: #333;
  vertical-align: top;
  line-height: 1.55;
  border-right: 1px solid #eaecf0;
}

table.wms-table tbody td:last-child { border-right: none; }

/* Pierwsza kolumna - etykieta/nazwa pola */
table.wms-table tbody td:first-child {
  font-weight: 600;
  color: #1a1f2b;
  white-space: nowrap;
  width: 28%;
  background: inherit;
}

/* Pasek kolorowy lewej krawędzi przy hover */
table.wms-table tbody tr:hover td:first-child {
  border-left: 3px solid #ff6a13;
  padding-left: 13px;
}

/* Responsywność tabeli */
@media (max-width: 768px) {
  table.wms-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table.wms-table tbody td:first-child {
    white-space: normal;
    width: auto;
  }
}

/* --- Obrazki --- */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
  border: 1px solid #dde1e7;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* --- Nawigacja między stronami --- */
nav.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #e0e3e8;
  gap: 16px;
}

nav.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #f5f6f8;
  border: 1px solid #dde1e7;
  border-radius: 6px;
  color: #3a4554;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
  max-width: 48%;
}

nav.page-nav a:hover {
  background: #fff3ec;
  border-color: #ff6a13;
  color: #ff6a13;
}

nav.page-nav a.prev::before { content: '←'; }
nav.page-nav a.next::after  { content: '→'; }

/* --- Stopka --- */
footer {
  background: #3a4554;
  color: #c8cdd6;
  text-align: center;
  padding: 16px 24px;
  font-size: .8rem;
}

footer a { color: #ff6a13; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============================================================
   Hamburger button (widoczny tylko mobile)
   ============================================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-right: 14px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ============================================================
   Media query - widok mobilny (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  .layout { flex-direction: column; }

  /* Pokaż przycisk hamburgera */
  .nav-toggle {
    display: flex;
  }

  /* Sidebar jako rozwijany overlay od góry */
  nav.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: calc(100vh - 60px);
    border-right: none;
    border-bottom: 3px solid #ff6a13;
    z-index: 99;
    overflow-y: auto;
    /* Stan zamknięty: wysunięty ponad ekran */
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .26s ease, opacity .22s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
  }

  nav.sidebar.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  main {
    padding: 20px 16px 40px;
  }

  article h1 { font-size: 1.35rem; }
  article h2 { font-size: 1.05rem; }

  nav.page-nav { flex-direction: column; gap: 10px; }
  nav.page-nav a { max-width: 100%; width: 100%; justify-content: center; }
}

/* ============================================================
   Alfabetyczny spis treści — kontrolki i lista
   ============================================================ */

.index-controls {
  margin: 24px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Pole wyszukiwania */
.index-search-wrap {
  position: relative;
  max-width: 480px;
}

.index-search-input {
  width: 100%;
  padding: 10px 40px 10px 14px;
  font-size: .95rem;
  font-family: inherit;
  border: 1.5px solid #dde1e7;
  border-radius: 6px;
  color: #222;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}

.index-search-input:focus {
  border-color: #ff6a13;
  box-shadow: 0 0 0 3px rgba(255,106,19,.12);
}

.index-search-input::placeholder { color: #aab0b8; }

/* Przycisk czyszczący X */
.index-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: .85rem;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 50%;
  transition: color .12s, background .12s;
}
.index-search-clear:hover { color: #ff6a13; background: #fff3ec; }

/* Pasek liter */
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.alpha-btn {
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 700;
  font-family: inherit;
  color: #3a4554;
  background: #f5f6f8;
  border: 1.5px solid #dde1e7;
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  letter-spacing: .04em;
  line-height: 1.6;
}

.alpha-btn:hover {
  background: #fff3ec;
  border-color: #ff6a13;
  color: #ff6a13;
}

.alpha-btn.active {
  background: #ff6a13;
  border-color: #ff6a13;
  color: #fff;
}

/* Sekcja grupy liter */
.index-list {
  margin-top: 8px;
}

.alpha-group {
  margin-bottom: 32px;
}

.alpha-heading {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #3a4554 0%, #2d3748 100%);
  padding: 4px 16px;
  border-radius: 4px;
  margin: 0 0 12px;
  min-width: 40px;
  text-align: center;
  letter-spacing: .06em;
  border-left: none;
}

/* Grid wpisów */
.index-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

/* Pojedynczy wpis */
.index-entry {
  background: #f9fafb;
  border: 1px solid #e8ebf0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: 10px 14px;
  transition: background .12s, border-color .12s;
}

.index-entry:hover {
  background: #fff7f2;
  border-left-color: #ff6a13;
  border-color: #ffdcc9;
}

.index-entry a {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: #1a1f2b;
  border: none;
  margin-bottom: 4px;
  line-height: 1.3;
  text-decoration: none;
  transition: color .12s;
}

.index-entry a:hover { color: #ff6a13; }

.index-entry-title {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: #6a737d;
  margin-bottom: 4px;
  line-height: 1.3;
}

.index-entry-desc {
  display: block;
  font-size: .78rem;
  color: #6a737d;
  line-height: 1.5;
}

/* Brak wyników */
.index-no-results {
  padding: 24px 20px;
  text-align: center;
  color: #888;
  font-size: .9rem;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px dashed #dde1e7;
  margin: 8px 0 20px;
}

/* Ukrycie elementów przez JS */
.alpha-group[hidden],
.index-entry[hidden] { display: none; }

/* Mobile */
@media (max-width: 768px) {
  .index-search-wrap { max-width: 100%; }
  .index-entries { grid-template-columns: 1fr; }
  .alpha-btn { padding: 4px 10px; font-size: .75rem; }
}
