/* =====================================================
   HERO — REALIZACJE (inc/elementor/widget-hero-realizacje.php)
   Copy and picker on the left, the newest portfolio items on a laptop and
   a phone on the right. The caption and pause button sit under the devices.
   Place the widget in a full-width container with no padding.
   ===================================================== */

.mg-hero {
    --mg-hero-ink: #262626;
    --mg-hero-soft: #4a4e55;
    --mg-hero-red: #d9161e;
    --mg-hero-red-bright: #ed1c24;
    --mg-hero-line: #dcdcd8;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: clamp(560px, calc(100svh - 130px), 740px);
    background: linear-gradient(180deg, #f6f6f4 0%, #eeeeeb 100%);
    color: var(--mg-hero-ink);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
}
.mg-hero::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 50%;
    right: -220px;
    width: 900px;
    height: 900px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 38%, rgba(255, 255, 255, 0) 62%);
}
.mg-hero__wrap {
    display: grid;
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 56px 40px;
    box-sizing: border-box;
}
.mg-hero--empty .mg-hero__wrap { grid-template-columns: minmax(0, 720px); }

/* ---- Copy ---- */
.mg-hero .mg-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.mg-hero .mg-hero__kicker::before {
    content: '';
    width: 36px;
    height: 2px;
    background: var(--mg-hero-red-bright);
}
.mg-hero .mg-hero__title {
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.01em;
    text-align: left;
    color: var(--mg-hero-ink);
}
.mg-hero .mg-hero__lead {
    margin: 20px 0 30px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--mg-hero-soft);
}
.mg-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.mg-hero .mg-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    border: 2px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, color .2s;
}
.mg-hero .mg-hero__btn svg { flex: none; width: 18px; height: 18px; }
.mg-hero .mg-hero__btn--primary { background: var(--mg-hero-red); color: #fff; }
.mg-hero .mg-hero__btn--primary:hover { background: #c0141b; color: #fff; }
.mg-hero .mg-hero__btn--ghost { border-color: #c9cbd0; color: var(--mg-hero-ink); }
.mg-hero .mg-hero__btn--ghost:hover { border-color: var(--mg-hero-ink); color: var(--mg-hero-ink); }
.mg-hero a:focus-visible,
.mg-hero button:focus-visible {
    outline: 3px solid #01b2e3;
    outline-offset: 3px;
}

/* ---- Picker (one row per item, with the progress bar of the active one) ---- */
.mg-hero__picker {
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--mg-hero-line);
}
.mg-hero__picker li {
    margin: 0;
    border-bottom: 1px solid var(--mg-hero-line);
}
.mg-hero__picker button {
    position: relative;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 13px 0;
    border: 0;
    background: none;
    color: #6f737a;
    font: 600 16px/1.3 'Open Sans', sans-serif;
    text-align: left;
    cursor: pointer;
}
.mg-hero__picker button small {
    flex: none;
    font-size: 13px;
    font-weight: 400;
    color: #7b7f86;
}
.mg-hero__picker button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 2px;
    background: var(--mg-hero-red-bright);
}
.mg-hero__picker button:hover,
.mg-hero__picker button[aria-current="true"] { color: var(--mg-hero-ink); }
.mg-hero__picker button[aria-current="true"]::after { animation: mg-hero-progress var(--mg-hero-dur, 6s) linear forwards; }
.mg-hero:not(.is-running) .mg-hero__picker button[aria-current="true"]::after { animation-play-state: paused; }
.mg-hero.is-paused .mg-hero__picker button[aria-current="true"]::after { animation: none; width: 100%; }
@keyframes mg-hero-progress { to { width: 100%; } }

/* ---- Devices ---- */
.mg-hero__stage {
    position: relative;
    aspect-ratio: 100 / 56;
}
.mg-hero__laptop,
.mg-hero__phone { position: absolute; }
.mg-hero__laptop {
    top: 0;
    left: 0;
    width: 86%;
    aspect-ratio: 1400 / 860;
}
.mg-hero__phone {
    right: 0;
    bottom: 0;
    width: 23%;
    aspect-ratio: 426 / 880;
    filter: drop-shadow(0 22px 26px rgba(25, 27, 32, .32)) drop-shadow(0 4px 6px rgba(25, 27, 32, .18));
}
.mg-hero__frame {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.mg-hero__screen {
    position: absolute;
    overflow: hidden;
    background: #fff;
}
/* Percentages follow the screen openings in the SVG frames. */
.mg-hero__laptop .mg-hero__screen {
    left: 7.142857%;
    top: 3.953488%;
    width: 85.714286%;
    height: 87.209302%;
    border-radius: .8333% / 1.3333%;
}
.mg-hero__phone .mg-hero__screen {
    left: 4.225352%;
    top: 2.045455%;
    width: 91.549296%;
    height: 95.909091%;
    border-radius: 13.846154% / 6.398104%;
}
.mg-hero__screen img {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity .9s ease;
}
/* Below the status bar drawn by the phone frame. */
.mg-hero__phone .mg-hero__screen img {
    top: 6.398104%;
    height: 93.601896%;
}
.mg-hero__screen img.is-on { opacity: 1; }

/* ---- Caption and pause, under the devices ---- */
.mg-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 26px;
}
.mg-hero .mg-hero__caption {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 40px;
    background: #fff;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .25);
    color: var(--mg-hero-ink);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
}
.mg-hero .mg-hero__caption:hover { color: var(--mg-hero-ink); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .35); }
.mg-hero__caption b { font-weight: 700; }
.mg-hero__caption svg { flex: none; width: 16px; height: 16px; color: var(--mg-hero-red); }
.mg-hero__pause {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0;
    padding: 0 4px;
    border: 0;
    background: none;
    color: #5f636a;
    font: 600 13px/1 'Open Sans', sans-serif;
    cursor: pointer;
}
.mg-hero__pause:hover { color: var(--mg-hero-ink); }
.mg-hero__pause svg { width: 14px; height: 14px; fill: currentColor; }
.mg-hero__i-play,
.mg-hero.is-paused .mg-hero__i-pause { display: none; }
.mg-hero.is-paused .mg-hero__i-play { display: block; }

/* ---- Tablet ---- */
@media (max-width: 1199px) {
    .mg-hero__wrap { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 44px; }
    .mg-hero .mg-hero__title { font-size: 38px; }
}
@media (max-width: 1023px) {
    .mg-hero { min-height: 0; }
    .mg-hero__wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 48px 40px 56px; }
    .mg-hero__copy { max-width: 640px; }
    .mg-hero__show { width: 100%; max-width: 640px; }
}

/* ---- Phone ---- */
@media (max-width: 767px) {
    .mg-hero__wrap { gap: 26px; padding: 30px 20px 36px; }
    .mg-hero .mg-hero__title { font-size: 32px; line-height: 1.16; }
    .mg-hero .mg-hero__lead { margin: 14px 0 22px; font-size: 16.5px; }
    .mg-hero .mg-hero__btn { flex: 1 1 100%; }
    .mg-hero__picker {
        display: flex;
        gap: 8px;
        margin: 24px -20px 0;
        padding: 0 20px 4px;
        overflow-x: auto;
        border: 0;
        scrollbar-width: none;
    }
    .mg-hero__picker::-webkit-scrollbar { display: none; }
    .mg-hero__picker li { flex: none; border: 0; }
    .mg-hero__picker button {
        min-height: 44px;
        padding: 9px 16px;
        border: 1px solid var(--mg-hero-line);
        border-radius: 30px;
        background: #fff;
        font-size: 14px;
    }
    .mg-hero__picker button small,
    .mg-hero__picker button::after { display: none; }
    .mg-hero__picker button[aria-current="true"] {
        border-color: var(--mg-hero-ink);
        background: var(--mg-hero-ink);
        color: #fff;
    }
    .mg-hero__meta { margin-top: 18px; gap: 8px 14px; }
    .mg-hero .mg-hero__caption { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .mg-hero__screen img { transition: none; }
    .mg-hero__picker button[aria-current="true"]::after { animation: none; width: 100%; }
}
