/* ============================================
   MOBILE PORTRAIT (bazowe style)
   0 - 540px
   ============================================ */

html {
  scroll-behavior: smooth
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--page-bg, #2c2c2c);
  color: var(--text-color, #222);
  font-family: var(--font-main, sans-serif)
}

input,
textarea,
select,
button {
  font-family: var(--font-main, sans-serif)
}


.toc-section .btn-group {
  background: #f3f3f3;
  padding: 2vw;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.12);
  border-radius: 0.4rem;
  margin-bottom: 5vw;
}


/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  font-family: var(--font-main, sans-serif);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.12)
}

.btn-primary {
  background-color: #3498db;
  color: #fff;
  border: 1px solid #3498db;
  transition: background 0.3s
}

.btn-primary:hover {
  background-color: #2980b9
}

.btn-ghost {
  background: transparent;
  color: #3498db;
  border: 1px solid #3498db
}

.btn-ghost:hover {
  background: #3498db;
  color: white
}

.btn-text-link {
  background: none;
  border: none;
  color: #3498db;
  padding: 10px 0;
  font-weight: 600
}

.btn-text-link:hover {
  text-decoration: underline
}

.btn:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  filter: brightness(1.1)
}

.btn.primary {
  background: var(--accent-color, #df5400);
  color: #fff
}

.btn.ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit
}

/* --- MAIN CONTENT LAYOUT --- */
main.page-main {
  flex: 1;
  /* Padding-top uwzględnia wysokość header'a z menu.css */
  padding-top: var(--site-header-height, 70px)
}

/* --- STICKY SECTIONS --- */
.sticky-section {
  position: relative;
  padding-block: 0;
  overflow: visible;
  scroll-margin-top: var(--site-header-height, 70px)
}

.sticky-section__inner {
  display: grid;
  position: relative;
  align-items: start;
  width: var(--section-max-width);
  background: rgba(255, 0, 0, 10%);
  margin-inline: auto;
}

.sticky-section--left .sticky-section__inner,
.sticky-section--right .sticky-section__inner {
  grid-template-columns: 1fr;
  background: rgba(255, 255, 255, 1);
}

.sticky-section__title {
  top: var(--site-header-height, 70px);
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  gap: var(--space-md);
  z-index: 10;
  padding: 6.5cqw;
  /* color: var(--ui-contrast-color, #fff); */
  background: var(--section-title-bg, #eee);
  transition: color 0.3s ease;
  align-items: center;
}

.sticky-section__num span {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: rgb(255 255 255 / 25%);
  font-family: var(--font-heading, sans-serif)
}

.sticky-section__content {
  padding: 13cqw;
  background: rgba(255, 255, 255, 0.5);
}

/* .sticky-section__heading {
  font-family: var(--font-heading, sans-serif);
  font-size: var(--fs-h2);
  border-left: 3px solid rgb(255 255 255 / 25%);
  padding-left: var(--space-md);
  color: rgb(255 255 255 / 1);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  margin: auto 0 auto;
} */


.site-footer__inner {
    text-align: center;
    color: #fff;
    margin: 1vw;
}


/* ============================================
   TELEFONY LANDSCAPE (specjalny case)
   ============================================ */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 550px) {

  /* Telefony w poziomie */
  main.page-main {
    padding-top: 60px;
    /* Może wymagać korekty jeśli header jest wyższy */
  }

  .sticky-section {
    scroll-margin-top: 60px;
  }
}

/* ============================================
   TABLET PORTRAIT
   541px - 1023px
   ============================================ */
@media (min-width: 541px) and (max-width: 1023px) {
  .sticky-section__heading {
    font-size: var(--fs-h2);
    margin: unset;
  }
}

/* ============================================
   DESKTOP / LAPTOP
   1024px+
   ============================================ */
@media (min-width: 1024px) and (orientation: landscape) {

  .sticky-section--left .sticky-section__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    padding: unset;
  }

  .sticky-section--left .sticky-section__title {
    grid-column: 1;
    grid-row: 1;
  }

  .sticky-section--left .sticky-section__content {
    grid-column: 2;
    grid-row: 2;
  }

  .sticky-section--right .sticky-section__inner {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    padding: unset;
  }

  .sticky-section--right .sticky-section__title {
    grid-column: 2;
    grid-row: 1
  }

  .sticky-section--right .sticky-section__content {
    grid-column: 1;
    grid-row: 2;
  }

  .sticky-section__heading {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
    border-left: unset;
    padding-left: var(--section-spacing);
    padding: 0 var(--section-spacing);
    font-weight: var(--fw-bold);
    /* color: var(--ui-contrast-color); */
    color: #fff;
  }

  .sticky-section__num span {
    font-size: calc(var(--fs-h2) * 4.5);
    font-weight: var(--fw-bold);
    /* color: rgb(255 255 255 / 25%); */
    font-family: var(--font-heading, sans-serif);
    /* animation-timeline: scroll(root); */
    /* animation-range: 0px 300px; */
    margin-left: -0.5ch;
    /* animation-name: fadeOutSlide; */
    /* animation-duration: 1ms; */
    /* Czas jest ignorowany przy scroll(), ale musi być zdefiniowany */
    /* animation-timing-function: linear; */
    /* animation-fill-mode: both; */
  }

  @keyframes fadeOutSlide {
    0% {
      opacity: 0;
      /* W pełni widoczny */
      margin-left: -100px;
      /* Pozycja wyjściowa */
    }

    100% {
      opacity: 1;
      /* Niewidoczny */
      margin-left: 0px;
      /* Przesunięcie w lewo */
    }
  }

  .sticky-section__inner.has-bg {
    background-image: var(--section-bg-image);
    background-size: 100%;
    background-position: 0 0;
    background-repeat: no-repeat
  }

  .sticky-section__title {
    top: var(--site-header-height, 70px);
    position: sticky;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: start;
    z-index: 10;
    padding: var(--space-xl);
    overflow-y: auto;
    background: var(--section-title-bg, #eee);
    aspect-ratio: 1/1;
    overflow: hidden;
    align-items: flex-start;
  }

  .sticky-section__content {
    position: relative;
    padding: 6vw;
    z-index: 1;
    min-height: 120vh;
    background: var(--section-content-bg, #fff);
    line-height: 1.6;
  }
}