/* ==========================================================================
   Section: product-instagram — "Plastry w użyciu" (Figma 15:264)
   Curated IG tiles. ≤3 = static centered row (middle taller); >3 = homepage-
   style full-viewport-width looping slider (active tile taller). No product.
   ========================================================================== */

.sec-product-instagram {
    padding: 80px 0;
    background: #fbf7f8;
    overflow: hidden;
}

.pig__inner {
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--pad-x);
}

.pig__head {
    max-width: 768px;
    margin: 0 auto 80px;
    text-align: center;
}

.pig__title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(32px, 3.6vw, 48px);
    line-height: 1.2;
    color: var(--c-ink);
}

.pig__text {
    margin: 16px 0 0;
    font-size: 18px;
    line-height: 1.5;
    color: var(--c-ink);
}

/* Static row (≤3) */
.pig__row {
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Slider (>3) — full-viewport-width, like the homepage feed. Reserved
   height = tallest (active) tile, so the nav bar never jumps mid-transition. */
.pig__swiper {
    width: 100%;
    height: 450px;
}

.pig__swiper .swiper-wrapper {
    height: 100%;
    align-items: center;
}

/* Tile */
.pig-card {
    display: flex;
    flex-direction: column;
    width: 296px;
    max-width: 100%;
    height: auto;
}

.pig-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: #d9d9d9;
}

/* Section-prefixed so height beats WooCommerce's `.woocommerce img
   { height:auto }` (0,1,1) on product pages — otherwise tiles fall back
   to their natural aspect ratio and the active-taller effect is lost. */
.sec-product-instagram .pig-card__img {
    display: block;
    width: 100%;
    height: 355px;
    object-fit: cover;
    transition: height 0.3s ease;
}

/* Taller tile: static middle (exactly 3) or the active slide */
.pig__row--3 .pig-card:nth-child(2) .pig-card__img,
.pig-card--tall .pig-card__img,
.pig-card.swiper-slide-active .pig-card__img {
    height: 450px;
}

/* Play badge for VIDEO posts */
.pig-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    background: rgba(23, 23, 23, 0.4);
    border-radius: 50%;
    pointer-events: none;
}

.pig-card__play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}

/* Controls bar (slider only) */
.pig__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 48px;
}

.pig__dots {
    display: flex;
    gap: 8px;
}

.pig__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: #000;
    opacity: 0.2;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pig__dot.is-active {
    opacity: 1;
}

.pig__nav {
    display: flex;
    gap: 16px;
}

.pig__arrow {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: var(--c-white);
    border: 1px solid var(--c-black);
    border-radius: 50%;
    color: var(--c-black);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.pig__arrow:hover,
.pig__arrow:focus-visible {
    background: var(--c-black);
    color: var(--c-white);
}

.pig__arrow.swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .sec-product-instagram {
        padding: 56px 0;
    }
    .pig__head {
        margin-bottom: 40px;
    }
}

@media (max-width: 767px) {
    .pig__text {
        font-size: 16px;
    }
    .pig__bar {
        margin-top: 32px;
    }
    /* Uniform tile height once the static row wraps */
    .pig__row--3 .pig-card:nth-child(2) .pig-card__img {
        height: 355px;
    }
}
