/* Kontener główny */
#gallery-container {
  margin: 30px auto;
  max-width: 100%;
}



#gallery-container .vin-row {
  display: flex;
  gap: 10px;              /* odstęp między elementami */
  align-items: center;     /* wyrównanie w pionie */
  flex-wrap: nowrap;       /* NIE pozwalamy na łamanie */
  margin-top: 10px;
}

/* Label — stała szerokość lub proporcja */
#gallery-container .vin-row label {
  flex: 0 0 15%;          /* 25% szerokości kontenera */
  white-space: nowrap;
}

/* Input — rośnie do dostępnej szerokości */
#gallery-container .vin-row input[type="text"] {
  flex: 1 1 auto;         /* zajmuje pozostałą przestrzeń */
  min-width: 150px;       /* minimalna szerokość */
  box-sizing: border-box;
  padding: 10px;
  font-size: 1rem;
}

/* Button — dopasowany do treści */
#gallery-container .vin-row button {
  flex: 0 0 auto;         /* szerokość wg zawartości */
}
#gallery-container .button {
  background: #000;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border:0;
  padding: 10px 16px;
  font-size: clamp(0.9rem, 2vw, 1rem);
  box-sizing: border-box;
  border-radius: 6px;
  white-space: nowrap;
}



#gallery-container .vin-row button:hover, #gallery-container button:hover {
  background: #e60015;
  transition: 0.3s ease;
  color: #fff;
}

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 600px) {
  #gallery-container .vin-row {
    flex-wrap: wrap;        /* na mobile elementy mogą łamać się w dół */
  }

  #gallery-container .vin-row label,
  #gallery-container .vin-row input,
  #gallery-container .vin-row button {
    flex: 0 0 100%;        /* każdy element zajmuje całą szerokość */
    margin-bottom: 10px;
  }
}


/* Komunikat błędu */
#gallery-container #error {
  color: red;
  margin-top: 10px;
}
#gallery-container #error.no-photos {
  color: #666;
  font-style: italic;
  margin-top: 20px;
  background-color: #f9f9f9;
  padding: 10px;
  border-left: 4px solid #ccc;
  border-radius: 4px;
}

/* Layout: infobox + timelinebox */
/*
#gallery-container .info-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}
@media (max-width: 768px) {
  #gallery-container .info-layout {
    flex-direction: column;
  }
}
#gallery-container .info-column {
  flex: 1 1 300px;
  min-width: 280px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background: transparent;
  border: none;
}
*/
/* Kompaktowa tabela informacji */

#gallery-container .info-column h3{text-align:left;margin:10px 0;}

#gallery-container .info-layout {
  display: flex;
  gap: 2%; /* odstęp między boxami */
  flex-wrap: wrap;
}

#gallery-container #infobox,
#gallery-container #timelinebox {
  flex: 0 0 calc(50% - 1%);   /* dwa boxy dokładnie po równo */
  max-width: calc(50% - 1%);
  min-width: 0;   
}

#gallery-container #infobox .info-table {
  width: 50%;
  display: grid;
  grid-template-columns: 27% 67% 27% 67%;
  column-gap: 3%;
  row-gap: 6px;
  font-size: 1em;
  line-height: 1.5em;
  background: #fff;
}

/* "Rozklejamy" struktury tabeli aby th/td były bezpośrednimi elementami grid */
#gallery-container #infobox .info-table tbody,
#gallery-container #infobox .info-table thead,
#gallery-container #infobox .info-table tr {
  display: contents;
}

/* wygląd komórek */
#gallery-container #infobox .info-table th {
  text-align: left;
  font-weight: 600;
  padding: 6px 5px;
  align-self: start;
   display: flex;
  align-items: start;  /* pionowe wyrównanie */
  height: 100%;
  border:0px;
    border-bottom: 1px solid #ddd;
		background:#f9f9f9;
}

#gallery-container #infobox .info-table td {
  text-align: right;
  padding: 6px 2px;
  align-self: end;
  word-break: break-word;
   display: flex;
  align-items: start;  /* pionowe wyrównanie */
  justify-content: flex-end;
  height: 100%;
   border:0px;
    border-bottom: 1px solid #ddd;
		background:#f9f9f9;
}
#gallery-container #timelinebox .info-table td,
#gallery-container #timelinebox .info-table th{border:0px;border-bottom: 1px solid #ddd;}
#gallery-container #timelinebox .info-table td:nth-child(even), #gallery-container #timelinebox .info-table th:nth-child(even) {
  text-align: right;
  padding: 6px 2px;
  align-self: end;
  word-break: break-word;
   display: flex;
  align-items: start;  /* pionowe wyrównanie */
  justify-content: flex-end;
  height: 100%;
   border:0px;
    border-bottom: 1px solid #ddd;
}

/* Fallback dla przeglądarek, które ignorują display: contents:
   jeśli display:contents nie działa, przełączymy się na klasyczną 2-kolumnową tabelę
   (th/td w parach). */
@supports not (display: contents) {
  #gallery-container #infobox .info-table {
    display: table;
    table-layout: fixed;
  }
  #gallery-container #infobox .info-table tr { display: table-row; }
  #gallery-container #infobox .info-table th,
  #gallery-container #infobox .info-table td {
    display: table-cell;
    width: auto;
    padding: 6px 8px;
  }
  /* wymuszenie proporcji w fallbackie: używamy procentów na komórkach */
  #gallery-container #infobox .info-table th { width: 30%; }
  #gallery-container #infobox .info-table td { width: 70%; }
}

/* Responsywność: na wąskich ekranach 2 kolumny (th / td) */
@media (max-width: 768px) {
  #gallery-container #infobox,
  #gallery-container #timelinebox {
    flex: 1 1 100%; /* wypełnia całą szerokość kontenera */
    max-width: 100%;
  }

@media (max-width: 768px) {
  #gallery-container #infobox .info-table {
    width: 100%;
    grid-template-columns: 50% 50%; /* jedna para na wiersz */
    column-gap: 0%;                 /* lekki odstęp między TH a TD */
  }
}

}

/* --- PRAWA TABELA: klasyczna, responsywna --- */
#gallery-container #timelinebox .info-table {
  width: 100%;
 
  table-layout: auto; /* AUTO — pełna responsywność */
    font-size:1.0em;
}

#gallery-container #timelinebox th{
  padding: 6px 2px;
  border-bottom: 1px solid #eee;
    background:#fff;
  
}
#gallery-container #timelinebox td {
  padding: 6px 2px;
  border-bottom: 1px solid #eee;
  word-break: break-word;
}



/*
#gallery-container .info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  margin-top: 10px;
}
#gallery-container .info-table th,
#gallery-container .info-table td {
  padding: 6px 10px;
  border-bottom: 0.5px solid #e0e0e079;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  
}
#gallery-container .info-table th {
  font-weight: 600;
  color: #333;
  width: 160px;
  background:#eeeeee;
}
@media (max-width: 768px) {
 #gallery-container .info-table th,
 #gallery-container .info-table td {
    display: block;
    width: 100%;
    padding: 4px 0;
  }
 #gallery-container .info-table tr {
    margin-bottom: 10px;
    display: block;
  }
}

*/

/* Galeria zdjęć */
#gallery-container #gallery {
  margin-top: 30px; 
}
#gallery-container .category {
  margin-bottom: 40px;
}
#gallery-container .category h4 {
  margin-bottom: 10px;
  font-size: 1rem;
}
#gallery-container .category-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 5px 10px;
   margin-bottom: 20px;
}
#gallery-container .image-wrapper {
  display: block;
  position: relative;
  
}
#gallery-container .image-wrapper img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#gallery-container .image-wrapper img:hover {
  transform: scale(1.02);
}

/* Lightbox */
#gallery-container .lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
z-index: 2147483647;
  overflow:visible;
  flex-direction: column;
  padding: 20px;
}
#gallery-container .lightbox.hidden {
  display: none;
}

/* Wrapper dla obrazka w lightboxie */
#gallery-container .lightbox-img-wrapper {
  position: relative;
  display: inline-block;
}

/* Obrazek w lightboxie – zmniejszona skala */
#gallery-container .lightbox-img {
  max-width: 70vw;
  max-height: 65vh;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  touch-action: pan-y;
}

/* Nawigacja */
#gallery-container .lightbox-nav {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  justify-content: center;
}
#gallery-container .prev-btn, #gallery-container .next-btn {
  font-size: 2rem;
  color: white !important;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  color:#fff !important;
}
#gallery-container .prev-btn:hover, #gallery-container .next-btn:hover {
  transform: scale(1.2);
}

/* Przycisk zamykania X – w obrysie zdjęcia */
#gallery-container .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  background:#e60015;
  padding:0px 10px 10px;
  border-radius:6px;
}
#gallery-container .close-btn:hover {
  transform: scale(1.2);
}

/* Zakładki galerii – wyśrodkowane i elastyczne */
#gallery-container .tab-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  text-align: center;
}
#gallery-container .tab-button {
flex: 1 1 50%;           /* każdy przycisk zajmuje 50% */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  font-size: clamp(0.85rem, 2vw, 1rem);
  border-radius: 4px;
  white-space: nowrap;
  margin: 4px;
}
#gallery-container .tab-button.active {
  font-weight: bold;
   background:#e60015;
}
#gallery-container .tab-button.active:hover {
  font-weight: bold;
   background:#000;
}
#gallery-container .tab-content {
  margin-top: 20px;
}

/* Przycisk pobierania pod zdjęciem */
#gallery-container .image-wrapper .button-secondary {
  font-size: clamp(1rem, 2vw, 1.2rem);
  padding: 6px 10px;
  width: auto;
  min-width: 40px;
  margin-left: auto;
  margin-right: auto;
  display: inline-flex;
  justify-content: center;
}




/* Dodatkowe skalowanie na bardzo małych ekranach */
@media (max-width: 480px) {
 #gallery-container button,
  #gallery-container .button,
 #gallery-container .tab-button {
    font-size: 0.85rem;
    padding: 8px 12px;
  }

}
@media (max-width: 768px) {
#gallery-container .download {
  display: inline-flex;        /* lub flex, jeśli wolisz */
  justify-content: center;     /* wyśrodkowanie tekstu w przycisku */
  align-items: center;         /* wyrównanie pionowe */
  width: 100%;                 /* pełna szerokość kontenera */
  box-sizing: border-box;      /* padding wliczony w szerokość */
  padding: 10px 16px;          /* opcjonalny padding */
  font-size: clamp(1rem, 2vw, 1.2rem);
  border-radius: 6px;          /* opcjonalnie */
  background: #000;
  color: #fff;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
}

/* Wyśrodkowanie przycisku VIN */
#gallery-container {
  text-align: center;
}

/* Wyśrodkowanie przycisku ZIP w zakładce */
#gallery-container .category {
  text-align: center;
}

/* Bezpieczne resetowanie float/position */
#gallery-container button,
#gallery-container .button {
  float: none;
  position: static;
}
