/*
 * 2.17.4 — mobile menu (≤1024px), loaded on every page including the homepage.
 *
 * Bug fixed: the header gets `backdrop-filter` (homepage always, other pages
 * once scrolled). A backdrop-filter makes the header the containing block of
 * the fixed menu panel, so the "full screen" panel was clipped to the header
 * height (~106px) and the menu looked empty on iPhone.
 */

.gnnh-navigation__contact {
    display: none;
}

@media (max-width: 1024px) {
    body.gnnh-menu-open .gnnh-header,
    body.gnnh-menu-open .gnnh-header.is-scrolled {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        filter: none;
        transform: none;
    }

    body.gnnh-menu-open {
        overflow: hidden;
    }

    /* Panel: full viewport, scrolls on its own, cream with a soft green glow at the bottom. */
    .gnnh-header .gnnh-navigation {
        position: fixed;
        inset: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding: calc(84px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px));
        gap: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background:
            radial-gradient(120% 60% at 50% 115%, rgba(86, 151, 136, 0.22) 0%, rgba(86, 151, 136, 0) 70%),
            #fff8f1;
    }

    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-nav,
    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-header-actions,
    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-navigation__contact {
        animation: gnnh-nav-in 0.34s ease both;
    }

    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-header-actions {
        animation-delay: 0.06s;
    }

    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-navigation__contact {
        animation-delay: 0.1s;
    }

    /* Top level items: 20px, 58px tap targets, thin dividers, green chevron. */
    .gnnh-header .gnnh-navigation .gnnh-menu {
        gap: 0;
        margin: 0;
        padding: 0;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li {
        border-bottom: 1px solid rgba(86, 151, 136, 0.16);
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li:not(.gnnh-menu-academy) > a,
    .gnnh-header .gnnh-navigation .gnnh-menu-programs__trigger > a {
        display: flex;
        min-height: 58px;
        padding: 0 4px;
        align-items: center;
        justify-content: space-between;
        color: #1d1818;
        font-size: 20px;
        font-weight: 500;
        letter-spacing: -0.01em;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li:not(.gnnh-menu-academy) > a::after {
        content: "";
        width: 8px;
        height: 8px;
        margin-right: 6px;
        border-top: 1.6px solid var(--gnn-a11y-sage, #498074);
        border-right: 1.6px solid var(--gnn-a11y-sage, #498074);
        transform: rotate(45deg);
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li.current-menu-item > a,
    .gnnh-header .gnnh-navigation .gnnh-menu > li:not(.gnnh-menu-academy) > a[aria-current="page"] {
        color: var(--gnn-a11y-sage-hover, #3d7065);
    }

    .gnnh-header .gnnh-navigation .gnnh-menu-programs__trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu-programs__trigger > a {
        flex: 1 1 auto;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu-programs__trigger > button {
        display: inline-flex;
        width: 40px;
        height: 40px;
        padding: 0;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(86, 151, 136, 0.35);
        border-radius: 50%;
        background: #ffffff;
        color: var(--gnn-a11y-sage-text, #467a6e);
    }

    .gnnh-header .gnnh-navigation .gnnh-menu-programs__trigger > button svg {
        width: 18px;
        height: 18px;
        transition: transform 0.25s ease;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu-programs.is-open .gnnh-menu-programs__trigger > button svg {
        transform: rotate(180deg);
    }

    /* Cream band behind the logo and close button while the panel scrolls. */
    .gnnh-header .gnnh-navigation {
        padding-top: 0;
    }

    .gnnh-header .gnnh-navigation::before {
        content: "";
        position: sticky;
        top: 0;
        z-index: 2;
        display: block;
        flex: 0 0 calc(72px + env(safe-area-inset-top, 0px));
        margin: 0 -20px 12px;
        border-bottom: 1px solid rgba(86, 151, 136, 0.14);
        background: #fff8f1;
    }

    /* The programs list opens in full (no inner scroll box). */
    .gnnh-header .gnnh-navigation .gnnh-menu-programs.is-open .gnnh-mega {
        max-height: 760px;
    }

    /* Programs: cards with the cover image, subtitle and price. */
    .gnnh-header .gnnh-navigation .gnnh-mega__intro {
        display: none;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega__programs {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 2px 0 16px;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card {
        display: flex;
        min-height: 0;
        padding: 10px 14px 10px 10px;
        align-items: center;
        gap: 14px;
        border: 1px solid rgba(86, 151, 136, 0.3);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(45, 37, 37, 0.06);
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card > img {
        display: block;
        flex: 0 0 64px;
        width: 64px;
        height: 64px;
        border-radius: 12px;
        object-fit: cover;
        object-position: center top;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card > span {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card small {
        display: block;
        color: #6b6461;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.02em;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card strong {
        display: block;
        color: #1d1818;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.25;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card__price {
        display: flex;
        align-items: baseline;
        gap: 8px;
        font-style: normal;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card__price del {
        color: var(--gnn-a11y-muted, #776f6b);
        font-size: 12px;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card__price span {
        color: var(--gnn-a11y-sage-hover, #3d7065);
        font-size: 14px;
        font-weight: 700;
    }

    .gnnh-header .gnnh-navigation .gnnh-mega-card > i {
        flex: 0 0 auto;
        color: var(--gnn-a11y-sage-text, #467a6e);
        font-size: 14px;
        font-style: normal;
    }

    /* Buttons: Akademia full width, cart + reserve side by side, all 52px. */
    .gnnh-header .gnnh-navigation .gnnh-header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 22px;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li.gnnh-menu-academy {
        margin-top: 22px;
        border-bottom: 0;
    }

    .gnnh-header .gnnh-navigation .gnnh-menu > li.gnnh-menu-academy > a {
        display: flex;
        min-height: 52px;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        font-size: 15px;
    }

    .gnnh-header .gnnh-navigation .gnnh-cart,
    .gnnh-header .gnnh-navigation .gnnh-reserve {
        min-height: 52px;
        border-radius: 999px;
        font-size: 15px;
    }

    /* Contact block at the bottom of the panel. */
    .gnnh-header .gnnh-navigation__contact {
        display: flex;
        margin-top: auto;
        padding-top: 26px;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }

    .gnnh-header .gnnh-navigation__contact-label {
        margin-bottom: 4px;
        color: #6b6461;
        font-size: 13px;
        font-weight: 500;
    }

    .gnnh-header .gnnh-navigation__contact > a {
        color: #1d1818;
        font-size: 16px;
        font-weight: 600;
    }

    .gnnh-header .gnnh-navigation__socials {
        display: flex;
        margin-top: 10px;
        gap: 12px;
    }

    .gnnh-header .gnnh-navigation__socials a {
        display: inline-flex;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(86, 151, 136, 0.35);
        border-radius: 50%;
        background: #ffffff;
    }

    .gnnh-header .gnnh-navigation__socials img {
        width: 20px;
        height: 20px;
    }
}

@keyframes gnnh-nav-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-nav,
    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-header-actions,
    body.gnnh-menu-open .gnnh-header .gnnh-navigation .gnnh-navigation__contact {
        animation: none;
    }
}

/*
 * 2.17.10 — the floating reCAPTCHA badge covered buttons in the bottom-right corner on phones.
 * The required reCAPTCHA notice is printed under every Contact Form 7 form instead.
 */
.grecaptcha-badge {
    visibility: hidden;
}

/*
 * 2.17.12 — header cart badge: Montserrat digits sit ~1.3px high and ~0.6px left of the flex centre,
 * so the number is nudged optically (measured at 6x zoom for 1, 3, 8 and 12).
 */
.gnnh-header .gnnh-cart em.gnnh-cart__count {
    padding: 3px 0 0 1px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Woo moves focus to a notice after an error (coupon, checkout); that is not a control, so no ring. */
.woocommerce-notices-wrapper:focus,
.woocommerce-error:focus,
.woocommerce-message:focus,
.woocommerce-info:focus,
.woocommerce-NoticeGroup:focus,
[role="alert"]:focus,
.woocommerce-notices-wrapper:focus-visible,
.woocommerce-error:focus-visible,
.woocommerce-message:focus-visible,
.woocommerce-info:focus-visible,
.woocommerce-NoticeGroup:focus-visible,
.woocommerce [tabindex="-1"]:focus,
.woocommerce [tabindex="-1"]:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Headings never end on a single orphaned word (line breaks are otherwise unchanged). */
h1,
h2,
h3 {
    text-wrap: pretty;
}

/*
 * Tablets (768-900px): logo, contact and two link columns did not fit in one row and the link
 * columns ran ~240px past the screen. The links drop to their own full-width row.
 */
@media (min-width: 768px) and (max-width: 900px) {
    .gnnh-footer .gnnh-footer__main {
        flex-wrap: wrap;
        row-gap: 30px;
    }

    /* Links line up under the logo (the grid offset them by the logo column). */
    .gnnh-footer .gnnh-footer__links {
        flex: 0 0 100%;
        justify-content: flex-start;
        gap: 40px;
        margin: 0;
        padding: 0;
        grid-column: 1 / -1;
    }

    .gnnh-footer .gnnh-footer__bottom {
        flex-wrap: wrap;
        row-gap: 10px;
        column-gap: 24px;
    }

    .gnnh-footer .gnnh-footer__bottom > * {
        white-space: nowrap;
    }

    .gnnh-footer .gnnh-footer__links > div {
        flex: 0 1 220px;
        min-width: 0;
    }
}

/*
 * Homepage newsletter (its CSS bundle lacked the subpage rules): the card kept a fixed 1340:508
 * ratio, so from 768px up to ~1300px the form was cut off by the card and the photo covered the
 * heading. The card now grows with its content; tablets get photo beside the copy.
 */
@media (min-width: 768px) {
    body section.gnnh-newsletter .gnnh-newsletter__card {
        aspect-ratio: auto;
        min-height: 508px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body section.gnnh-newsletter .gnnh-newsletter__card {
        display: flex;
        min-height: 0;
        padding: 38px 32px;
        align-items: center;
        gap: 24px;
    }

    body section.gnnh-newsletter .gnnh-newsletter__content {
        width: 60%;
        min-width: 0;
        flex: 1 1 60%;
    }

    body section.gnnh-newsletter h2 {
        font-size: 34px;
    }

    body section.gnnh-newsletter .gnnh-newsletter__art {
        position: relative;
        inset: auto;
        width: 36%;
        height: auto;
        flex: 0 0 36%;
    }

    body section.gnnh-newsletter .gnnh-newsletter__art img {
        width: 100%;
        height: auto;
        border-radius: 14px;
        object-fit: contain;
    }

    body section.gnnh-newsletter .gnnh-newsletter-form__row {
        flex-wrap: wrap;
        gap: 12px;
    }

    body section.gnnh-newsletter .gnnh-newsletter-form__row input {
        border: 1px solid var(--gnnh-accent);
        border-radius: 999px;
        flex-basis: 100%;
    }

    body section.gnnh-newsletter .gnnh-newsletter-form__row button {
        border-radius: 999px;
    }
}

/*
 * Homepage reviews on tablets / small laptops (768-1100px): the intro kept 38% of the width, so
 * two cards shared ~480px and names, dates and "5/5" were squeezed or cut. Intro goes on top and
 * the cards use the full width.
 */
@media (min-width: 768px) and (max-width: 1100px) {
    body .gnnh-reviews .gnnh-reviews__layout {
        flex-direction: column;
        gap: 30px;
    }

    body .gnnh-reviews .gnnh-reviews__intro {
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
    }

    body .gnnh-reviews .gnnh-reviews__content {
        width: 100%;
    }
}

/* Phones: footer legal line and breadcrumbs were 9.5-10px; 12px is the readable minimum used elsewhere. */
@media (max-width: 767px) {
    body .gnnh-footer .gnnh-footer__bottom,
    body .gnnh-footer .gnnh-footer__bottom a,
    body .gnnh-footer .gnnh-footer__bottom span {
        font-size: 12px;
        line-height: 1.5;
    }

    body .gnnh-footer .gnnh-footer__bottom {
        row-gap: 8px;
    }

    body .gnnh-breadcrumbs,
    body .gnnh-breadcrumbs a,
    body .gnn-commerce-breadcrumbs,
    body .gnn-commerce-breadcrumbs a,
    body .gnn-commerce-breadcrumbs strong {
        font-size: 12px;
    }
}

@media (max-width: 767px) {
    /* Legal links wrap instead of running past narrow screens (360px). */
    body .gnnh-footer .gnnh-footer__bottom,
    body .gnnh-footer .gnnh-footer__bottom > div,
    body .gnnh-footer .gnnh-footer__bottom nav {
        flex-wrap: wrap;
        column-gap: 16px;
    }
}

@media (max-width: 400px) {
    .gnn-pdf-workshops .gnn-pdf-ws-revolution__box .gnn-button {
        font-size: 13px;
        white-space: nowrap;
    }
}

/*
 * Generic pages, blog posts and archives use .gnn-container, whose desktop gutter was 0: between
 * 1025px and 1560px breadcrumbs, "Wróć" and content started at the very left edge of the screen.
 * Same gutter as the header's .gnnh-shell, so everything lines up with the logo.
 */
@media (min-width: 1025px) and (max-width: 1560px) {
    :root {
        --gnn-page-padding: clamp(32px, calc((100vw - 1340px) / 2), 50px);
    }
}

/*
 * 2.18.1 — FAQ accordions on every page (homepage included).
 * 1. Clicking a question left it focused, and :focus-within moved the card 4px sideways, so the
 *    open question sat out of line with the others. Hover/focus no longer move the card.
 * 2. The arrow was a line plus a rotated square spanning 11-28px in a 44px circle (2.5px high,
 *    worse in the 39px phone circle). It is now one SVG arrow centred in the circle.
 */
body .gnnh-accordion__item:hover,
body .gnnh-accordion__item:focus-within {
    transform: none;
}

body .gnnh-accordion__icon::before {
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5v15M5.5 13l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5v15M5.5 13l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translate(-50%, -50%);
}

body .gnnh-accordion__icon::after {
    display: none;
}

/* Keyboard focus on a question: the card's border and ring show it, instead of an outline line
   drawn across the open answer. */
body .gnnh-accordion__item > button:focus-visible {
    outline: none;
}

body .gnnh-accordion__item:has(> button:focus-visible) {
    border-color: var(--gnnh-accent-dark, var(--gnn-a11y-sage-hover, #3d7065));
    box-shadow: 0 0 0 3px rgba(86, 151, 136, 0.22);
}
