/* ==========================================================================
   blog.css — blog listing page
   Alternating image/text rows with full-row sketch backgrounds and torn-edge photos
   ========================================================================== */

:root {
    --blog-teal: #02b1e5;
    --blog-teal-dark: #009bc7;
    --blog-body: #333333;
}

/* ---- listing container -------------------------------------------------- */
.blog-listing {
    background: #ffffff;
    padding: 48px 0 72px;
}

.blog-listing__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- row layout — sketch background spans full row -------------------- */
.blog-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    margin-bottom: 56px;
    background-color: #f7f7f7;
    background-image: url('../images-home/blog/sketch-bg.png');
    background-repeat: no-repeat;
    background-position: 70% center;
    background-size: cover;
    overflow: hidden;
}

.blog-row:last-child {
    margin-bottom: 0;
}

.blog-row--reverse {
    flex-direction: row-reverse;
    position: relative;
    background-image: none;
}

/* Flip sketch so building (right in source) sits behind left text column */
.blog-row--reverse::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #f7f7f7;
    background-image: url('../images-home/blog/sketch-bg.png');
    background-repeat: no-repeat;
    background-position: 70% center;
    background-size: cover;
    transform: scaleX(-1);
    z-index: 0;
    pointer-events: none;
}

.blog-row--reverse > * {
    position: relative;
    z-index: 1;
}

/* ---- image column with organic / torn edge ---------------------------- */
.blog-row__media {
    flex: 0 0 46%;
    position: relative;
    min-height: 380px;
    overflow: visible;
    background: transparent;
}

.blog-row__media img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.12));
}

/* Irregular brushed edge — image left rows */
.blog-row:not(.blog-row--reverse) .blog-row__media img {
    clip-path: polygon(
        0% 6%, 3% 1%, 8% 5%, 14% 0%, 22% 4%, 30% 1%, 38% 5%, 46% 0%, 54% 4%, 62% 1%, 70% 5%, 78% 0%, 86% 4%, 94% 1%, 100% 5%,
        100% 94%, 96% 99%, 88% 95%, 80% 100%, 72% 96%, 64% 99%, 56% 95%, 48% 99%, 40% 95%, 32% 99%, 24% 95%, 16% 99%, 8% 94%, 2% 98%, 0% 93%
    );
    -webkit-mask-image:
        radial-gradient(ellipse 120% 100% at 100% 50%, transparent 0%, transparent 8%, black 22%),
        linear-gradient(to bottom, black 88%, transparent 100%);
    mask-image:
        radial-gradient(ellipse 120% 100% at 100% 50%, transparent 0%, transparent 8%, black 22%),
        linear-gradient(to bottom, black 88%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

/* Mirrored torn edge — image right rows */
.blog-row--reverse .blog-row__media img {
    clip-path: polygon(
        0% 5%, 4% 0%, 10% 4%, 18% 1%, 26% 5%, 34% 0%, 42% 4%, 50% 1%, 58% 5%, 66% 0%, 74% 4%, 82% 1%, 90% 5%, 96% 0%, 100% 4%,
        100% 95%, 95% 99%, 87% 94%, 79% 99%, 71% 95%, 63% 99%, 55% 94%, 47% 99%, 39% 95%, 31% 99%, 23% 94%, 15% 99%, 7% 94%, 1% 98%, 0% 92%
    );
    -webkit-mask-image:
        radial-gradient(ellipse 120% 100% at 0% 50%, transparent 0%, transparent 8%, black 22%),
        linear-gradient(to bottom, black 88%, transparent 100%);
    mask-image:
        radial-gradient(ellipse 120% 100% at 0% 50%, transparent 0%, transparent 8%, black 22%),
        linear-gradient(to bottom, black 88%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}

/* ---- text column — transparent, sketch shows through ------------------ */
.blog-row__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
    background: transparent;
}

.blog-row__content h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--blog-teal);
    margin: 0 0 16px;
    line-height: 1.25;
}

.blog-row__content p {
    font-size: 15px;
    color: var(--blog-body);
    line-height: 1.7;
    margin: 0 0 24px;
}

.blog-row__content a {
    font-size: 16px;
    font-weight: 600;
    color: var(--blog-teal);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
    margin-top: auto;
}

.blog-row__content a:hover {
    color: var(--blog-teal-dark);
}

.blog-row__content a i {
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.blog-row__content a:hover i {
    transform: translateX(4px);
}

/* ---- tablet ----------------------------------------------------------- */
@media (max-width: 991px) {
    .blog-row__media {
        flex: 0 0 42%;
        min-height: 320px;
    }

    .blog-row__media img {
        min-height: 320px;
    }

    .blog-row__content {
        padding: 36px 32px;
    }

    .blog-row__content h3 {
        font-size: 24px;
    }
}

/* ---- mobile: stack image above text, sketch still visible ------------- */
@media (max-width: 767px) {
    .blog-listing {
        padding: 32px 0 48px;
    }

    .blog-row,
    .blog-row--reverse {
        flex-direction: column;
        margin-bottom: 40px;
        background-size: cover;
    }

    .blog-row:not(.blog-row--reverse) {
        background-position: 70% center;
    }

    .blog-row__media {
        order: -1;
        flex: none;
        width: 100%;
        min-height: 260px;
    }

    .blog-row__media img {
        min-height: 260px;
    }

    .blog-row__content {
        flex: none;
        width: 100%;
        padding: 28px 24px;
    }

    .blog-row__content h3 {
        font-size: 22px;
    }
}
