/* ==========================================================================
   Motomarine v3 · Instagram
   .cs-ig-grid = square photo grid of .cs-ig-item links with a navy hover
   overlay and the Instagram icon. Six columns (4 on tablets, 3 on phones);
   --full edge to edge with no gaps, --offset edge to edge with 20px gaps.
   .cs-ig-handle = @handle link.
   ========================================================================== */

.cs-ig-handle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}
.cs-ig-handle i {
    font-size: 18px;
}
.cs-ig-handle:hover {
    color: var(--primary-hover);
}
.cs-sechead .cs-ig-handle {
    margin-top: 4px;
}
.cs-ig-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.cs-ig-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 0;
    background: var(--light-bg);
}
.cs-ig-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.cs-ig-item:hover img {
    transform: scale(1.05);
}
.cs-ig-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(15, 23, 43, .6);
    opacity: 0;
    transition: var(--transition);
}
.cs-ig-item > i {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    color: var(--white);
    font-size: 28px;
    line-height: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.7);
    transition: var(--transition);
}
.cs-ig-item:hover::after {
    opacity: 1;
}
.cs-ig-item:hover > i {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- Edge to edge strip, no gaps, no radius --- */
.cs-ig-grid--full {
    gap: 0;
}
.cs-ig-grid--full .cs-ig-item {
    border-radius: 0;
}

/* --- Edge to edge with 20px gaps and edge padding --- */
.cs-ig-grid--offset {
    gap: 20px;
    padding: 0 20px;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .cs-ig-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .cs-ig-grid--full,
    .cs-ig-grid--offset {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 575px) {
    .cs-ig-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .cs-ig-grid--full {
        gap: 0;
    }
    .cs-ig-grid--offset {
        gap: 12px;
        padding: 0 12px;
    }
    .cs-ig-item > i {
        font-size: 22px;
    }
}

/* Strip with a heading above it (demo pages) */
.cs-ig-headed {
    padding-top: 70px;
}


/* ==========================================================================
   v5 · Modern Instagram
   Handle as a pill link, each tile a link with a navy wash and a round
   Instagram chip on hover.
   ========================================================================== */
.cs-ig-handle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid var(--border-light);
    border-radius: 40px;
    background: var(--white);
    transition: border-color .2s ease;
}
.cs-ig-handle:hover {
    border-color: var(--primary);
}
.cs-ig-item {
    position: relative;
    overflow: hidden;
}
.cs-ig-item img {
    transition: transform .6s ease;
}
.cs-ig-item::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(15, 23, 43, .45);
    opacity: 0;
    transition: opacity .3s ease;
}
.cs-ig-item::after {
    content: '\F437';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-family: 'bootstrap-icons';
    font-size: 18px;
    line-height: 1;
    color: var(--white);
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .25);
    opacity: 0;
    transform: translate(-50%, -50%) scale(.8);
    transition: opacity .3s ease, transform .3s var(--ease-out);
}
.cs-ig-item:hover img {
    transform: scale(1.06);
}
.cs-ig-item:hover::before,
.cs-ig-item:hover::after {
    opacity: 1;
}
.cs-ig-item:hover::after {
    transform: translate(-50%, -50%) scale(1);
}
.bg-dark .cs-ig-handle {
    border-color: rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .04);
}
