@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  body {
    margin: unset;
  }

  button,
  input,
  textarea,
  select {
    font: inherit;
  }

  img,
  picture,
  svg,
  canvas {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer default {
  body {
    font-family: Raleway, sans-serif;
    font-size: 12pt;
    color: #444;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  header {
    top: 0px;
    --height: 128px;
    --min-height: calc(var(--height) * 0.33);
    --distance: 100px;
    --animation-range: entry 100cqh entry calc(100cqh + var(--distance));
    height: var(--height);

    @supports (animation-timeline: view()) {
      position: sticky;
      z-index: 10;
      isolation: isolate;
      animation: auto linear shrink-text both;
      animation-timeline: view();
      animation-range: var(--animation-range);
    }
    background-color: #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 16px max(16px, calc(50vw - 490px));

    & > img {
      max-width: 40vw;
      max-height: 100%;
    }
  }
  footer {
    background-color: #181818;
    color: #f8f8f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 16px max(16px, calc(50vw - 490px));
    margin-top: auto;
    font-size: 14px;

    & > .links {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;

      & > ul {
        display: contents;
        list-style: none;
        padding: 0px;
        margin: 0px;
        li {
          display: inline-block;
          margin-right: 8px;
          overflow: hidden;
        }
      }
    }
    a {
      color: yellow;
      border: 1px solid #fff;
      border-radius: 50%;
      box-sizing: border-box;
      display: block;
      font-size: 16px;
      width: 36px;
      height: 36px;
      margin:  0 auto;
      position: relative;
      text-indent: -9999px;
      transition: background-color 0.3s ease-in-out;
    }

    a::before {
      inset: 6px;
      content: '';
      position: absolute;
      display: block;
      mask-size: 16px 16px;
      mask-position: 50% 50%;
      mask-repeat: no-repeat;
      background-color: white;
      color: white;
      transition: background-color 0.3s ease-in-out;
    }
    a:hover::before {
      background-color: red;
    }
    a[data-icon=wheelchair]::before {
      mask-image: url(/_gfx/icon-wheelchair.svg);
    }

    a[data-icon=x]::before {
      mask-image: url(/_gfx/icon-x.svg);
    }

    a[data-icon=instagram]::before {
      mask-image: url(/_gfx/icon-instagram.svg);
      mask-size: 18px 18px;
    }

    a[data-icon=facebook]::before {
      mask-image: url(/_gfx/icon-facebook.svg);
    }
    a:hover {
      background-color: white;
    }
  }
  main {
    margin: 0px max(32px, calc(50vw - 490px));
    line-height: 1.8em;
    padding: 2em 0;
    position: relative;
    a {
      color: #205;
    }
  }

  h1 {
    text-transform: uppercase;
    font-size: 1.8em;
  }
  h2 {
    font-size: 1.5em;
  }

  /*
   * Hide only visually, but have it available for screen readers: h5bp.com/v
   */
  .visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

  /*
   * Extends the .visuallyhidden class to allow the element to be focusable
   * when navigated to via the keyboard: h5bp.com/p
   */
  .visuallyhidden.focusable:active,
  .visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
  }

  section.banner {
    padding: 16px max(16px, calc(50vw - 490px));
    --banner-height: max(200px, 50vh);
    height: var(--banner-height);
    background-size: cover;
    background-position: 50% 50%;
    overflow: hidden;
    position: relative;

    color: #eb1d24;
    font-size: clamp(20px, calc(100vw / 30), 30px);
    font-weight: bolder;
    -webkit-text-stroke: 1px #f3d403;

    p {
      text-shadow: 4px 4px 20px black, 4px 4px 16px black;
      display: block;
      padding: 0px;
      padding-left: 30px;
      margin: 0px;

      &:first-child {
        padding-top: clamp(6px, calc(25vh - 100px), 80px);
        padding-top: max(2px, calc(var(--banner-height) / 3 - 70px));
        text-shadow: 0 0 40px black,0 0 16px black;
        font-size: 55px;
        font-size: 1.85em;
        -webkit-text-stroke: 2px #f3d403;
      }
    }
    &.banner-stadler {
      background-image: url(/_gfx/banner-main-stadler.jpg);
    }
    &.banner-impuls2 {
      background-image: url(/_gfx/banner-main-impuls2.jpg);
    }
    &.banner-voivodeship {
      background-image: url(/_gfx/banner-main-voivodeship.jpg);
    }
  }
  nav > ul {
    list-style: none;
    padding: 0px;
    margin: 0px;
    display: flex;
    flex-wrap: wrap;
    column-gap: 10px;
    row-gap: 30px;
    justify-content: space-around;

    li {
      flex-basis:min-content;
      flex-grow: 1;
      display: flex;
      padding-top: 80px;
      font-size: 14px;
      text-align: center;
      margin-right: 8px;
      overflow: hidden;
      flex-direction: column;
      max-width: 220px;
      position: relative;
      > p {
        padding: 10px 0px;
        margin: 0px;
        line-height: 1.2;
      }
      >  a:last-child {
        margin: auto auto 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-width: 1px;
        border-style: solid;
        border-color: #333;
        border-radius: 4px;
        width: 120px;
        height: 60px;
        transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; text-shadow: 0.2 ease-in-out;
        &:hover {
          background-color: #f3d403;
          box-shadow: 1px 1px 3px #0002 inset;
          text-shadow: 0 0 1px black;
        }
      }
      &:before {
        content: '';
        display: block;
        position: absolute;
        inset: 0;
        height: 70px;
        mask-repeat: no-repeat;
        mask-position: 50% 0;
        mask-size: contain;
        background-color: #f3d403;
      }
      &[data-icon=lka-website-link]:before {
        mask-image: url(/_gfx/fa-train-subway.svg);
      }
      &[data-icon=partner-link]:before {
        mask-image: url(/_gfx/fa-industry.svg);
      }
      &[data-icon=infoportal-link]:before {
        mask-image: url(/_gfx/fa-location-pin.svg);
      }
      &[data-icon=pkp-schedule-link]:before {
        mask-image: url(/_gfx/fa-train.svg);
      }
      &[data-icon=buy-ticket-link]:before {
        mask-image: url(/_gfx/fa-cart-shopping.svg);
      }
    }
  }
}
@keyframes shrink-text {
  from {
    height: var(--height);
    margin-bottom: 0px;
    padding-top: 16px;
    padding-bottom: 16px;
    box-shadow: 0 0 0 #0000;
  }
  to {
    height: var(--min-height);
    margin-bottom: calc(var(--height) - var(--min-height));
    padding-top: 4px;
    padding-bottom: 4px;
    box-shadow: 0 0 10px #0008;
    background-color: #e8e8e8;
  }
}
