/* ==========================================================
   INSTAGRAM
   ========================================================== */

.instagram-section {
    width: min(
        1280px,
        calc(100% - 3rem)
    );

    margin: 7rem auto;
}


/* ==========================================================
   HEADER
   ========================================================== */

.instagram-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3rem;

    margin-bottom: 2rem;
}


.instagram-section__header > div:first-child {
    max-width: 620px;
}


.instagram-section__header h2 {
    margin:
        .35rem
        0
        .75rem;

    font-family: var(--serif);
    font-size: clamp(
        2.4rem,
        5vw,
        4rem
    );

    font-weight: 400;
    line-height: 1;

    color: var(--ink);

    letter-spacing: -.045em;
}


.instagram-section__header p:last-child {
    max-width: 530px;

    margin: 0;

    line-height: 1.7;

    color: var(--ink-soft);
}


/* ==========================================================
   PROFILE
   ========================================================== */

.instagram-section__profile {
    display: inline-flex;
    align-items: center;
    gap: .65rem;

    flex-shrink: 0;

    padding: .7rem 1rem;

    font-size: .78rem;
    font-weight: 650;

    color: #41594a;

    background: #f3f5f2;

    border: 1px solid #dfe5df;
    border-radius: 999px;

    text-decoration: none;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.instagram-section__profile:hover {
    color: #314438;

    background: #eaf0eb;

    border-color: #c8d4ca;

    transform: translateY(-1px);
}


.instagram-section__profile svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}


.instagram-section__profile
.instagram-section__instagram-dot {
    fill: currentColor;
    stroke: none;
}


/* ==========================================================
   GRID
   ========================================================== */

.instagram-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: .65rem;
}


/* ==========================================================
   POST
   ========================================================== */

.instagram-post {
    position: relative;

    display: block;

    overflow: hidden;

    aspect-ratio: 1;

    background: #eceae4;

    border-radius: 14px;

    text-decoration: none;

    isolation: isolate;
}


.instagram-post img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform .45s
        cubic-bezier(.2, .7, .2, 1);
}


.instagram-post:hover img {
    transform: scale(1.045);
}


/* ==========================================================
   OVERLAY
   ========================================================== */

.instagram-post__overlay {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    padding: 1rem;

    color: #fff;

    background:
        linear-gradient(
            180deg,
            rgba(18, 24, 20, .05) 30%,
            rgba(18, 24, 20, .72) 100%
        );

    opacity: 0;

    transition:
        opacity .25s ease;
}


.instagram-post:hover
.instagram-post__overlay {
    opacity: 1;
}


.instagram-post__icon {
    align-self: flex-end;

    display: grid;
    place-items: center;

    width: 34px;
    height: 34px;

    background:
        rgba(255, 255, 255, .14);

    border:
        1px solid
        rgba(255, 255, 255, .18);

    border-radius: 50%;

    backdrop-filter:
        blur(6px);
}


.instagram-post__icon svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}


.instagram-post__icon path {
    fill: currentColor;
    stroke: none;
}


.instagram-post__overlay p {
    margin: 0;

    max-width: 95%;

    font-size: .76rem;
    line-height: 1.5;

    color: #fff;
}


/* ==========================================================
   FOOTER
   ========================================================== */

.instagram-section__footer {
    display: flex;
    justify-content: center;

    margin-top: 2rem;
}


.instagram-section__button {
    display: inline-flex;
    align-items: center;
    gap: .65rem;

    min-height: 46px;
    padding: 0 1.2rem;

    font-size: .76rem;
    font-weight: 700;

    color: #fff;

    background: #41594a;

    border-radius: 11px;

    text-decoration: none;

    transition:
        background .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}


.instagram-section__button:hover {
    color: #fff;

    background: #314438;

    transform: translateY(-2px);

    box-shadow:
        0 8px 20px
        rgba(41, 52, 45, .13);
}


.instagram-section__button:active {
    transform: translateY(0);
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 950px) {

    .instagram-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

}


@media (max-width: 700px) {

    .instagram-section {
        width:
            calc(100% - 2rem);

        margin:
            5rem auto;
    }


    .instagram-section__header {
        align-items: flex-start;
        flex-direction: column;

        gap: 1.25rem;
    }


    .instagram-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .45rem;
    }


    /*
     * Pas de vrai hover sur tactile.
     * L'icône reste légèrement visible.
     */
    .instagram-post__overlay {
        align-items: flex-end;

        background:
            linear-gradient(
                180deg,
                rgba(18, 24, 20, .15),
                transparent 35%
            );

        opacity: 1;
    }


    .instagram-post__overlay p {
        display: none;
    }


    .instagram-post__icon {
        width: 30px;
        height: 30px;
    }

}
