/* =========================
   Tomiline AI Content – Front CSS (strong overrides)
   ========================= */

/* -------------------------
   Bus gallery – FORCE GRID
   ------------------------- */

/* mocniejsze selektory: działają nawet jeśli motyw ma własne reguły */
.entry-content .tomiline-bus-gallery,
#content .tomiline-bus-gallery,
.tomiline-bus-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 18px 0 60px !important; /* większy odstęp pod galerią */
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  clear: both !important;
}

/* elementy galerii */
.entry-content .tomiline-bus-gallery a,
#content .tomiline-bus-gallery a,
.tomiline-bus-gallery a {
  display: block !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.05) !important;
  background: #fff !important;
  line-height: 0 !important;
}

/* miniatury – WYMUSZENIE rozmiaru */
.entry-content .tomiline-bus-gallery img,
#content .tomiline-bus-gallery img,
.tomiline-bus-gallery img {
  width: 100% !important;
  max-width: 100% !important;
  height: 190px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  cursor: zoom-in !important;
  transition: transform .25s ease, filter .25s ease !important;
}

/* ikonka lupy */
.entry-content .tomiline-bus-gallery a::after,
#content .tomiline-bus-gallery a::after,
.tomiline-bus-gallery a::after {
  content: "🔍";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.entry-content .tomiline-bus-gallery a:hover img,
#content .tomiline-bus-gallery a:hover img,
.tomiline-bus-gallery a:hover img {
  transform: scale(1.03);
  filter: saturate(1.05);
}

.entry-content .tomiline-bus-gallery a:hover::after,
#content .tomiline-bus-gallery a:hover::after,
.tomiline-bus-gallery a:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* tablet */
@media (max-width: 1024px) {
  .entry-content .tomiline-bus-gallery,
  #content .tomiline-bus-gallery,
  .tomiline-bus-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* mobile */
@media (max-width: 620px) {
  .entry-content .tomiline-bus-gallery,
  #content .tomiline-bus-gallery,
  .tomiline-bus-gallery {
    grid-template-columns: 1fr !important;
    margin-bottom: 50px !important;
  }

  .entry-content .tomiline-bus-gallery img,
  #content .tomiline-bus-gallery img,
  .tomiline-bus-gallery img {
    height: 210px !important;
  }
}

/* -------------------------
   Lightbox overlay (optional)
   ------------------------- */
.tomiline-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tomiline-lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}

/* -------------------------
   FAQ accordion
   ------------------------- */
.entry-content .tomiline-faq,
.tomiline-faq {
  margin: 34px 0 50px;
  padding: 22px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

.tomiline-faq h2 {
  margin: 0 0 14px;
  font-weight: 900;
  font-size: 24px;
}

.tomiline-faq__list {
  display: grid;
  gap: 10px;
}

.tomiline-faq__item {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.tomiline-faq__q {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  position: relative;
}

.tomiline-faq__q::-webkit-details-marker {
  display: none;
}

.tomiline-faq__q::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.06);
  font-weight: 900;
}

.tomiline-faq__item[open] .tomiline-faq__q::after {
  content: "–";
}

.tomiline-faq__a {
  padding: 0 16px 14px;
  color: rgba(0,0,0,.8);
}

.tomiline-faq__a p {
  margin: 8px 0 0;
  line-height: 1.55;
}

/* -------------------------
   Departures box (shortcode)
   ------------------------- */
.tomiline-departures {
  margin: 26px 0 40px;
  padding: 22px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

.tomiline-departures__title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 14px;
}

.tomiline-departures__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.tomiline-departures__card {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.tomiline-departures__card h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 10px;
}

.tomiline-departures__days {
  margin: 0;
  padding-left: 18px;
}

.tomiline-departures__days li {
  margin: 6px 0;
}

.tomiline-departures__next {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.18);
}

.tomiline-departures__next p {
  margin: 8px 0;
}

@media (max-width: 900px) {
  .tomiline-departures__grid {
    grid-template-columns: 1fr;
  }
}
/* === FIX: gallery alignment / pyramid issue === */
.entry-content .tomiline-bus-gallery,
#content .tomiline-bus-gallery,
.tomiline-bus-gallery {
  justify-items: stretch !important;
  align-items: stretch !important;
  text-align: left !important; /* zabija centrowanie inline */
}

.entry-content .tomiline-bus-gallery > a,
#content .tomiline-bus-gallery > a,
.tomiline-bus-gallery > a {
  float: none !important;
  clear: none !important;
  display: block !important;      /* grid item jako blok */
  width: 100% !important;         /* wypełnij kolumnę */
  max-width: 100% !important;
  margin: 0 !important;
}

.entry-content .tomiline-bus-gallery > a img,
#content .tomiline-bus-gallery > a img,
.tomiline-bus-gallery > a img {
  float: none !important;
}
/* === Gallery UL/LI stable grid === */
.entry-content ul.tomiline-bus-gallery,
#content ul.tomiline-bus-gallery,
ul.tomiline-bus-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 18px 0 70px !important;
  padding: 0 !important;
  list-style: none !important;
  text-align: left !important;
  justify-items: stretch !important;
  align-items: stretch !important;
}

.entry-content ul.tomiline-bus-gallery > li,
#content ul.tomiline-bus-gallery > li,
ul.tomiline-bus-gallery > li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  float: none !important;
  width: auto !important;
}

.entry-content ul.tomiline-bus-gallery a,
#content ul.tomiline-bus-gallery a,
ul.tomiline-bus-gallery a {
  display: block !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.05) !important;
  background: #fff !important;
  line-height: 0 !important;
}

.entry-content ul.tomiline-bus-gallery img,
#content ul.tomiline-bus-gallery img,
ul.tomiline-bus-gallery img {
  width: 100% !important;
  height: 190px !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

@media (max-width: 1024px) {
  ul.tomiline-bus-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 620px) {
  ul.tomiline-bus-gallery {
    grid-template-columns: 1fr !important;
  }
  ul.tomiline-bus-gallery img {
    height: 210px !important;
  }
}
.tomiline-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tomiline-lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}

.tomiline-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 34px;
  line-height: 44px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tomiline-lightbox-close:hover {
  background: rgba(255,255,255,.22);
}

/* ===== FIX: Lightbox close button always visible (desktop/mobile) ===== */
.tomiline-lightbox-overlay{
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(0,0,0,.88) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  /* kluczowe: przycisk X jest absolutny względem overlay */
  position: fixed !important;
}

.tomiline-lightbox-overlay{
  /* overlay jako kontekst dla absolute */
  position: fixed !important;
}

.tomiline-lightbox-overlay{
  /* zapewnij klik na overlay */
  cursor: zoom-out;
}

.tomiline-lightbox-overlay img{
  max-width: 92vw !important;
  max-height: 92vh !important;
  border-radius: 14px !important;
  box-shadow: 0 30px 80px rgba(0,0,0,.55) !important;
  cursor: default;
}

/* X zawsze na wierzchu */
.tomiline-lightbox-close{
  position: fixed !important;        /* fixed = zawsze w prawym górnym rogu ekranu */
  top: 16px !important;
  right: 16px !important;
  z-index: 1000000 !important;       /* ponad overlay i obraz */
  width: 48px !important;
  height: 48px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  font-size: 38px !important;
  line-height: 48px !important;
  display: grid !important;
  place-items: center !important;
  cursor: pointer !important;
  user-select: none !important;
  backdrop-filter: blur(4px);
}

.tomiline-lightbox-close:hover{
  background: rgba(255,255,255,.28) !important;
}

.tomiline-lightbox-close:focus{
  outline: 3px solid rgba(255,255,255,.35) !important;
  outline-offset: 2px !important;
}
/* ===== FIX: FAQ plus icon overlapping text ===== */
.tomiline-faq__q{
  position: relative !important;
  padding: 16px 68px 16px 16px !important; /* DUŻO miejsca z prawej na ikonę */
  line-height: 1.25 !important;
}

/* ikonka + / - zawsze w prawym rogu i wyśrodkowana */
.tomiline-faq__q::after{
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 38px !important;
  height: 38px !important;
  font-size: 20px !important;
  line-height: 38px !important;
  display: grid !important;
  place-items: center !important;
}

/* na mobile jeszcze większy padding bo tekst zawija się na 2-3 linie */
@media (max-width: 620px){
  .tomiline-faq__q{
    padding-right: 78px !important;
  }
}

