/* ============================================================
   Shorts Embed – Front-end Styles
   ============================================================ */

/* Grid container */
.shorts-embed-grid {
    display: grid;
    grid-template-columns: repeat(var(--seg-cols, 3), 1fr);
    gap: var(--seg-gap, 12px);
    width: 100%;
    box-sizing: border-box;
}

/* Each card */
.seg-item {
    position: relative;
    overflow: hidden;
    background: #111;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.seg-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Rounded variant */
.seg-item.seg-rounded {
    border-radius: 16px;
}

/* Aspect-ratio box (padding-bottom trick) */
.seg-ratio-box {
    position: relative;
    width: 100%;
    padding-bottom: var(--seg-pb, 177.78%);  /* default 9:16 */
    height: 0;
    overflow: hidden;
}

/* Iframe fills the box */
.seg-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Instagram needs a little extra height to hide its chrome */
.seg-instagram {
    top: -60px;
    height: calc(100% + 60px);
}

/* Invalid URL placeholder */
.seg-invalid {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #aaa;
    font-size: 13px;
    font-family: sans-serif;
}

/* ── Responsive breakpoints ───────────────────────────────── */
@media (max-width: 1024px) {
    .shorts-embed-grid {
        grid-template-columns: repeat(
            min(var(--seg-cols, 3), 2),
            1fr
        );
    }
}

@media (max-width: 600px) {
    .shorts-embed-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

@media (max-width: 380px) {
    .shorts-embed-grid {
        grid-template-columns: 1fr;
    }
}
