/* WWT Blog – clean, fast, SEO-friendly layout */

.wwt-blog,
.wwt-post { padding: 24px 0; }

.wwt-blog__container,
.wwt-post__container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.wwt-blog__header{ margin: 12px 0 22px; }
.wwt-blog__title{
  margin: 0 0 6px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.1;
}
.wwt-blog__subtitle{
  margin: 0;
  opacity: .75;
  font-size: 15px;
  line-height: 1.6;
}

.wwt-blog__grid{
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, 1fr);
}

.wwt-blog-card{
  grid-column: span 12;
  border: 1px solid rgba(16,21,24,.10);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16,21,24,.06);
}

.wwt-blog-card__media{
  display: block;
  position: relative;
  background: rgba(16,21,24,.04);
}
.wwt-blog-card__media img{
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.wwt-blog-card__placeholder{ height: 220px; }

.wwt-blog-card__body{ padding: 16px 16px 18px; }
.wwt-blog-card__meta{
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  opacity: .75;
}
.wwt-blog-card__dot{ opacity: .55; }
.wwt-blog-card__cat{ text-decoration: none; }

.wwt-blog-card__title{
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}
.wwt-blog-card__title a{ text-decoration: none; }

.wwt-blog-card__excerpt{
  margin: 0 0 12px;
  opacity: .82;
  line-height: 1.7;
}
.wwt-blog-card__more{
  text-decoration: none;
  font-weight: 700;
}

.wwt-blog__pagination{
  margin-top: 22px;
}
.wwt-blog__pagination .page-numbers{
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.wwt-blog__pagination a,
.wwt-blog__pagination span{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(16,21,24,.12);
  text-decoration: none;
}
.wwt-blog__pagination .current{
  font-weight: 800;
}

/* Single post */
.wwt-post__breadcrumbs{
  margin: 8px 0 14px;
  font-size: 13px;
  opacity: .75;
}
.wwt-post__header{ margin-bottom: 18px; }
.wwt-post__title{
  margin: 0 0 10px;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.08;
}
.wwt-post__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  opacity: .75;
}
.wwt-post__dot{ opacity: .55; }
.wwt-post__cat{ text-decoration: none; }

.wwt-post__hero{
  margin: 16px 0 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(16,21,24,.10);
  background: rgba(16,21,24,.03);
}
.wwt-post__hero img{
  width: 100%;
  height: auto;
  display: block;
}

.wwt-post__content{
  line-height: 1.85;
  font-size: 16px;
}
.wwt-post__content h2,
.wwt-post__content h3{
  margin-top: 28px;
  line-height: 1.25;
}

.wwt-post__cta{
  margin-top: 28px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(16,21,24,.10);
  background: rgba(68,209,207,.10);
}
.wwt-post__cta-title{ margin: 0 0 8px; font-size: 18px; }
.wwt-post__cta-text{ margin: 0 0 14px; opacity: .85; line-height: 1.7; }

.wwt-post__cta-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wwt-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(16,21,24,.14);
}
.wwt-btn--primary{
  background: #44d1cf;
  color: #fff;
  border-color: transparent;
}
.wwt-btn--ghost{
  background: #fff;
  color: inherit;
}

.wwt-post__section-title{
  margin: 24px 0 12px;
  font-size: 18px;
}

.wwt-post__related-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.wwt-related-card{
  grid-column: span 12;
  border: 1px solid rgba(16,21,24,.10);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.wwt-related-card__media img{
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.wwt-related-card__placeholder{ height: 160px; background: rgba(16,21,24,.04); }
.wwt-related-card__title{
  margin: 10px 12px 12px;
  font-size: 15px;
  line-height: 1.35;
}
.wwt-related-card__title a{ text-decoration: none; }

/* Responsive */
@media (min-width: 720px){
  .wwt-blog-card{ grid-column: span 6; }
  .wwt-related-card{ grid-column: span 4; }
  .wwt-blog-card__media img,
  .wwt-blog-card__placeholder{ height: 240px; }
}
@media (min-width: 1024px){
  .wwt-blog-card{ grid-column: span 4; }
}

/* TOC layout */
.wwt-post__content-wrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.wwt-toc{
  border: 1px solid rgba(16,21,24,.10);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16,21,24,.06);
  padding: 14px 14px 12px;
}

.wwt-toc__title{
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 10px;
}

.wwt-toc__list{
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  font-size: 14px;
}

.wwt-toc__item{ margin: 6px 0; }
.wwt-toc__item--h3{ margin-left: 10px; opacity: .9; }
.wwt-toc__link{ text-decoration: none; }

/* Tours block */
.wwt-post__tours-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.wwt-tour-card{
  grid-column: span 12;
  border: 1px solid rgba(16,21,24,.10);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.wwt-tour-card__media img{
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}
.wwt-tour-card__placeholder{
  height: 170px;
  background: rgba(16,21,24,.04);
}

.wwt-tour-card__title{
  margin: 10px 12px 6px;
  font-size: 15px;
  line-height: 1.35;
}
.wwt-tour-card__title a{ text-decoration: none; }

.wwt-tour-card__more{
  display: inline-block;
  margin: 0 12px 12px;
  text-decoration: none;
  font-weight: 800;
}

@media (min-width: 720px){
  .wwt-tour-card{ grid-column: span 4; }
}

.wwt-toc__link.is-active{
  font-weight: 900;
  background: rgba(68,209,207,.14);
}

.wwt-post__readtime,
.wwt-post__updated{
  white-space: nowrap;
}

/* Takeaways box */
.wwt-takeaways{
  margin: 22px 0 26px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(16,21,24,.10);
  background: rgba(68,209,207,.10);
}

.wwt-takeaways h2,
.wwt-takeaways h3{
  margin: 0 0 10px;
}

.wwt-takeaways ul{
  margin: 0;
  padding-left: 18px;
}

.wwt-takeaways li{
  margin: 6px 0;
}

.wwt-toc{ align-self: start; }

/* Mobile first: TOC full width on top */
.wwt-post__content-wrap--has-toc{
  grid-template-columns: 1fr;
}

.wwt-post__content-wrap--has-toc .wwt-toc{
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  left: auto !important;
}

/* Desktop: 2 columns + fixed width TOC */
@media (min-width: 980px){
  .wwt-post__content-wrap--has-toc{
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }

  .wwt-post__content-wrap--has-toc .wwt-toc{
    max-width: 320px;
  }
}


.wwt-post__content h2,
.wwt-post__content h3{
  scroll-margin-top: 120px;
}

@media (max-width: 979px){
  .wwt-toc{
    padding: 12px 14px;
  }
  .wwt-toc__list{
    column-count: 1;
  }
}

/* ===== FINAL TOC LAYOUT (keep at end) ===== */

.wwt-post__content-wrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* Mobile: TOC on top, full width */
.wwt-post__content-wrap--has-toc{
  grid-template-columns: 1fr;
}

@media (max-width: 979px){
  .wwt-post__content-wrap--has-toc .wwt-toc{
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    position: static !important;
    left: auto !important;
  }
}

/* Desktop: 2 columns */
@media (min-width: 980px){
  .wwt-post__content-wrap--has-toc{
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }

  .wwt-post__content-wrap--has-toc .wwt-toc{
    max-width: 320px;
    position: sticky;
    top: 110px;
    align-self: start;
  }
}

html{
  scroll-behavior: smooth;
}

/* Fix for JS sticky spacer in CSS grid */
@media (min-width: 980px){
  .wwt-post__content-wrap--has-toc .wwt-toc{
    grid-column: 1;
  }

  .wwt-post__content-wrap--has-toc .wwt-post__content{
    grid-column: 2;
    min-width: 0; /* ważne w gridzie */
  }

  .wwt-post__content-wrap--has-toc .wwt-toc-spacer{
    grid-column: 1; /* spacer ma siedzieć w tej samej kolumnie co TOC */
  }
}

/* ===== TOC: mobile vs desktop (final, keep at very end) ===== */

/* Desktop layout */
@media (min-width: 980px){
  .wwt-post__content-wrap--has-toc{
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }

  .wwt-post__content-wrap--has-toc .wwt-toc{
    max-width: 320px;
    position: sticky;
    top: 110px;
    align-self: start;
    grid-column: 1;
    grid-row: 1;
  }

  .wwt-post__content-wrap--has-toc .wwt-post__content{
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  /* IMPORTANT: spacer must NOT create a new grid row */
  .wwt-post__content-wrap--has-toc .wwt-toc-spacer{
    grid-column: 1;
    grid-row: 1;          /* same cell as TOC -> no layout jump */
    pointer-events: none;
    visibility: hidden;
  }
}

/* Mobile: TOC on top, full width */
@media (max-width: 979px){
  .wwt-post__content-wrap--has-toc{
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .wwt-post__content-wrap--has-toc .wwt-toc{
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: static;
    left: auto;
  }
}

/* Blog archive: bridge to tours (per-post related tours preview) */

.wwt-blog-card__bridge{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(16,21,24,.10);
  font-size: 13px;
  line-height: 1.5;
}

.wwt-blog-card__bridge-label{
  font-weight: 900;
  opacity: .78;
}

.wwt-blog-card__bridge-link{
  text-decoration: none;
  font-weight: 900;
  color: #44d1cf;
}

.wwt-blog-card__bridge-link:hover{
  text-decoration: underline;
}

/* Blog archive: related tours list inside post card */

.wwt-blog-card__bridge{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(16,21,24,.10);
}

.wwt-blog-card__bridge-label{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  text-transform: uppercase;
  opacity: .72;
  margin-bottom: 8px;
}

.wwt-blog-card__tours{
  display: grid;
  gap: 8px;
}

.wwt-mini-tourlink{
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 10px;

  text-decoration: none;
  border: 1px solid rgba(16,21,24,.10);
  border-radius: 12px;
  background: rgba(68,209,207,.08);
  padding: 8px 10px;
}

.wwt-mini-tourlink:hover{
  background: rgba(68,209,207,.12);
}

.wwt-mini-tourlink__img{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.wwt-mini-tourlink__ph{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16,21,24,.10);
  display: block;
}

.wwt-mini-tourlink__title{
  font-weight: 900;
  font-size: 13px;
  line-height: 1.25;
  color: #101518;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Make blog cards behave like equal components (CTA pinned at bottom) */
.wwt-blog-card__body{
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Compact related tours inside card */
.wwt-blog-card__bridge{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(16,21,24,.10);
}

.wwt-blog-card__bridge-label{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .25px;
  text-transform: uppercase;
  opacity: .65;
  margin: 0 0 8px;
}

/* 2-column compact grid so it doesn't create a huge block */
.wwt-blog-card__tours{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin-bottom: 10px;
}

/* Compact link: no big pill, no heavy background */
.wwt-mini-tourlink{
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;

  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
}

.wwt-mini-tourlink__img{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.wwt-mini-tourlink__ph{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(16,21,24,.10);
  display: block;
}

.wwt-mini-tourlink__title{
  font-weight: 800;
  font-size: 12px;
  line-height: 1.25;
  color: inherit;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .92;
}

.wwt-mini-tourlink:hover .wwt-mini-tourlink__title{
  text-decoration: underline;
}

/* On very narrow screens use 1 column for readability */
@media (max-width: 420px){
  .wwt-blog-card__tours{
    grid-template-columns: 1fr;
  }
}

.wwt-blog-card__more{
  margin-top: 12px;
}

.wwt-blog-card__bridge{
  margin-top: 12px; /* zostaje */
}

/* Blog card: make "Czytaj więcej" look like a theme button (safe override) */

.wwt-blog-card__more.wwt-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin-top: 12px;
}

/* If SetSail button styles exist, prefer them */
.wwt-theme-btn{
  /* Intentionally empty – acts as a hook */
}

/* Fallback button look (if theme styles are not applied) */
.wwt-blog-card__more.wwt-btn.wwt-btn--primary{
  background: #44d1cf;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(16,21,24,.08);
}

.wwt-blog-card__more.wwt-btn.wwt-btn--primary:hover{
  filter: brightness(.98);
  transform: translateY(-1px);
}

.wwt-blog-card__more.wwt-btn.wwt-btn--primary:active{
  transform: translateY(0);
}
