/* ---------------------------------
   Oferta szkoleń — podstrona
--------------------------------- */

.training-offer-page {
    min-height: 0;
    padding: 0;
}


/* ---------------------------------
   Hero podstrony
--------------------------------- */

.subpage-hero {
    position: relative;
    min-height: clamp(680px, 42vw, 800px);
    overflow: hidden;
    background-color: #eef0f2;
    isolation: isolate;
}

/*
 * Zdjęcie zawsze pozostaje po prawej stronie.
 * ACF odpowiada wyłącznie za wybór fotografii.
 */
.subpage-hero::before {
    position: absolute;
    z-index: -2;
    top: 0;
    right: 0;
    width: 78%;
    min-width: 1100px;
    max-width: 1760px;
    height: 100%;
    background-image: var(--subpage-hero-image, none);
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
    content: "";

    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            rgb(0 0 0 / 14%) 9%,
            rgb(0 0 0 / 62%) 23%,
            #000000 39%,
            #000000 100%
        );

    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            rgb(0 0 0 / 14%) 9%,
            rgb(0 0 0 / 62%) 23%,
            #000000 39%,
            #000000 100%
        );
}

/*
 * Jasny gradient zapewnia czytelność treści po lewej
 * i miękkie przejście w fotografię.
 */
.subpage-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            #eef0f2 0%,
            rgb(238 240 242 / 100%) 18%,
            rgb(238 240 242 / 96%) 31%,
            rgb(238 240 242 / 78%) 44%,
            rgb(238 240 242 / 42%) 57%,
            rgb(238 240 242 / 12%) 70%,
            rgb(238 240 242 / 0%) 80%
        );
    content: "";
    pointer-events: none;
}

.subpage-hero__inner {
    display: flex;
    width: 100%;
    min-height: inherit;
    align-items: center;
    padding:
        190px
        clamp(32px, 5vw, 96px)
        74px;
}

.subpage-hero__content {
    position: relative;
    z-index: 2;
    width: min(100%, 650px);
}

.subpage-hero__eyebrow {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 5px 11px;
    margin: 0 0 18px;
    color: var(--color-primary);
    background-color: rgb(227 6 19 / 8%);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.subpage-hero__title {
    max-width: 640px;
    margin: 0;
    color: var(--color-dark);
    font-size: clamp(46px, 4vw, 68px);
    font-weight: 800;
    line-height: 0.99;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.subpage-hero__text {
    max-width: 570px;
    margin: 22px 0 0;
    color: #344154;
    font-size: clamp(16px, 1.15vw, 18px);
    font-weight: 500;
    line-height: 1.55;
}

.subpage-hero__button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    margin-top: 28px;
    color: #ffffff;
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.subpage-hero__button:hover {
    color: var(--color-primary);
    background-color: #ffffff;
    transform: translateY(-2px);
}

.subpage-hero__button:focus-visible {
    outline: 3px solid rgb(227 6 19 / 28%);
    outline-offset: 4px;
}


/* ---------------------------------
   Wyróżniki hero
--------------------------------- */

.subpage-hero__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    padding: 0;
    margin: 24px 0 0;
    list-style: none;
}

.subpage-hero__badges li {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #263448;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

/*
 * Czerwone kółko z ptaszkiem.
 * Styl dotyczy wyłącznie ikony.
 */
.subpage-hero__badge-icon {
    display: inline-flex;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background-color: var(--color-primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

/*
 * Tekst wyróżnika nie dziedziczy wymiarów ikony.
 */
.subpage-hero__badge-text {
    display: inline;
    width: auto;
    height: auto;
    min-width: 0;
    color: inherit;
    background: none;
    border-radius: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}


/* ---------------------------------
   Hero — średnie ekrany
--------------------------------- */

@media (max-width: 1200px) {
    .subpage-hero {
        min-height: 680px;
    }

    .subpage-hero::before {
        width: 84%;
        min-width: 900px;
    }

    .subpage-hero::after {
        background:
            linear-gradient(
                90deg,
                #eef0f2 0%,
                rgb(238 240 242 / 100%) 22%,
                rgb(238 240 242 / 93%) 37%,
                rgb(238 240 242 / 66%) 52%,
                rgb(238 240 242 / 22%) 67%,
                rgb(238 240 242 / 0%) 80%
            );
    }

    .subpage-hero__inner {
        padding-right: 48px;
        padding-left: 48px;
    }

    .subpage-hero__content {
        width: min(100%, 570px);
    }

    .subpage-hero__title {
        max-width: 560px;
        font-size: clamp(44px, 5.4vw, 60px);
    }

    .subpage-hero__text {
        max-width: 520px;
    }
}


/* ---------------------------------
   Hero — tablet i telefon
--------------------------------- */

@media (max-width: 767px) {
    .subpage-hero {
        min-height: 700px;
    }

    .subpage-hero::before {
        top: 0;
        right: 0;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 72%;
        background-position: right center;
        background-size: cover;

        -webkit-mask-image:
            linear-gradient(
                180deg,
                #000000 0%,
                #000000 52%,
                rgb(0 0 0 / 62%) 70%,
                transparent 100%
            );

        mask-image:
            linear-gradient(
                180deg,
                #000000 0%,
                #000000 52%,
                rgb(0 0 0 / 62%) 70%,
                transparent 100%
            );
    }

    .subpage-hero::after {
        background:
            linear-gradient(
                180deg,
                rgb(238 240 242 / 4%) 0%,
                rgb(238 240 242 / 10%) 34%,
                rgb(238 240 242 / 66%) 58%,
                rgb(238 240 242 / 96%) 72%,
                #eef0f2 100%
            ),
            linear-gradient(
                90deg,
                rgb(238 240 242 / 25%) 0%,
                rgb(238 240 242 / 5%) 70%,
                rgb(238 240 242 / 0%) 100%
            );
    }

    .subpage-hero__inner {
        align-items: flex-end;
        padding:
            110px
            24px
            42px;
    }

    .subpage-hero__content {
        width: 100%;
        max-width: 560px;
    }

    .subpage-hero__eyebrow {
        min-height: 21px;
        margin-bottom: 13px;
        font-size: 8px;
    }

    .subpage-hero__title {
        max-width: 520px;
        font-size: clamp(38px, 10.5vw, 52px);
        line-height: 1;
    }

    .subpage-hero__text {
        max-width: 500px;
        margin-top: 16px;
        font-size: 15px;
        line-height: 1.5;
    }

    .subpage-hero__button {
        min-height: 44px;
        padding: 10px 18px;
        margin-top: 21px;
        font-size: 13px;
    }

    .subpage-hero__badges {
        gap: 10px 16px;
        margin-top: 20px;
    }

    .subpage-hero__badges li {
        font-size: 12px;
    }

    .subpage-hero__badge-icon {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .subpage-hero {
        min-height: 720px;
    }

    .subpage-hero::before {
        height: 66%;
    }

    .subpage-hero__inner {
        padding-right: 20px;
        padding-bottom: 34px;
        padding-left: 20px;
    }

    .subpage-hero__title {
        font-size: 38px;
    }

    .subpage-hero__badges {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 14px;
    }

    .subpage-hero__badges li {
        min-width: 0;
        white-space: normal;
    }

    .subpage-hero__badge-text {
        overflow-wrap: anywhere;
    }
}


/* ---------------------------------
   Ograniczenie animacji
--------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .subpage-hero__button {
        transition: none;
    }
}


/* ---------------------------------
   Katalog szkoleń
--------------------------------- */

.training-catalog {
    padding:
        clamp(72px, 6vw, 100px)
        0
        clamp(88px, 8vw, 130px);
    background-color: #ffffff;
    scroll-margin-top: 96px;
}

.training-catalog__header {
    max-width: 1240px;
    margin:
        0 auto
        clamp(42px, 4vw, 60px);
    padding-inline: 20px;
    text-align: center;
}

.training-catalog__eyebrow {
    display: inline-flex;
    min-height: 20px;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    margin: 0 0 14px;
    color: var(--color-primary);
    background-color: rgb(227 6 19 / 7%);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.training-catalog__title {
    max-width: 1120px;
    margin: 0 auto;
    color: var(--color-text);
    font-size: clamp(30px, 2.55vw, 42px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.training-catalog__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    max-width: 1120px;
    margin-inline: auto;
}


/* ---------------------------------
   Karta szkolenia
--------------------------------- */

.training-card {
    min-width: 0;
}

.training-card__link {
    position: relative;
    display: block;
    min-height: 330px;
    overflow: hidden;
    color: inherit;
    background-color: #e8ebef;
    border-radius: 14px;
    box-shadow: 0 9px 26px rgb(15 23 42 / 7%);
    text-decoration: none;
    isolation: isolate;
}

.training-card__media {
    position: absolute;
    inset: 0;
}

.training-card__image,
.training-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.training-card__image {
    object-fit: cover;
    transition: transform 0.45s ease;
}

.training-card__placeholder {
    background:
        linear-gradient(
            135deg,
            #dce1e7,
            #f2f4f7
        );
}

.training-card__link::after {
    position: absolute;
    z-index: 1;
    inset: 48% 0 0;
    background:
        linear-gradient(
            180deg,
            rgb(8 39 68 / 0%),
            rgb(8 39 68 / 20%)
        );
    content: "";
    pointer-events: none;
}

.training-card__panel {
    position: absolute;
    z-index: 2;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: flex;
    min-height: 66px;
    flex-direction: column;
    justify-content: center;
    padding: 11px 15px 12px;
    color: var(--color-text);
    background-color: rgb(255 255 255 / 96%);
    border-radius: 8px;
    box-shadow: 0 7px 20px rgb(15 23 42 / 10%);
    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease;
}

.training-card--red .training-card__panel {
    color: #ffffff;
    background-color: rgb(201 19 48 / 97%);
}

.training-card__label {
    display: block;
    margin-bottom: 4px;
    color: #5f6977;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.training-card--red .training-card__label {
    color: rgb(255 255 255 / 76%);
}

.training-card__title {
    margin: 0;
    color: inherit;
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.012em;
}

.training-card__link:hover .training-card__image {
    transform: scale(1.035);
}

.training-card__link:hover .training-card__panel {
    transform: translateY(-3px);
}

.training-card__link:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

.training-catalog__empty {
    margin: 0;
    color: var(--color-muted);
    text-align: center;
}


/*
 * Jeśli w ostatnim rzędzie zostaje jedna karta,
 * ustawiamy ją w środkowej kolumnie.
 */
@media (min-width: 1101px) {
    .training-catalog__grid
        > .training-card:last-child:nth-child(3n + 1) {
        grid-column: 2;
    }
}


/* ---------------------------------
   Responsywność katalogu i kart
--------------------------------- */

@media (max-width: 1100px) {
    .training-catalog__header {
        max-width: 920px;
    }

    .training-catalog__title {
        max-width: 880px;
        font-size: clamp(29px, 3.7vw, 38px);
    }

    .training-catalog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 820px;
    }

    .training-card__link {
        min-height: 340px;
    }
}

@media (max-width: 767px) {
    .training-catalog {
        padding: 62px 0 84px;
        scroll-margin-top: 78px;
    }

    .training-catalog__header {
        margin-bottom: 36px;
        padding-inline: 0;
    }

    .training-catalog__eyebrow {
        min-height: 19px;
        margin-bottom: 12px;
        font-size: 8px;
    }

    .training-catalog__title {
        max-width: 540px;
        font-size: clamp(27px, 7.5vw, 34px);
        line-height: 1.1;
    }

    .training-catalog__grid {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .training-card__link {
        min-height: 330px;
    }

    .training-card__panel {
        right: 12px;
        bottom: 12px;
        left: 12px;
        min-height: 64px;
        padding: 10px 14px 11px;
    }

    .training-card__title {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .training-catalog__title {
        font-size: 27px;
    }

    .training-card__link {
        min-height: 300px;
    }

    .training-card__panel {
        min-height: 62px;
        padding: 10px 13px;
    }

    .training-card__label {
        font-size: 7px;
    }

    .training-card__title {
        font-size: 14px;
    }
}


/* ---------------------------------
   Ograniczenie animacji
--------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .subpage-hero__button,
    .training-card__image,
    .training-card__panel {
        transition: none;
    }
}