/* lyra-bt-social-feeds.css — frontend styles for the 3 social media feed
 * blocks (Instagram / X / Facebook). The per-instance scoped styles
 * (color, gap, columns, padding) are emitted inline by the renderer's
 * <style> tag. THIS file holds the structural rules + responsive
 * breakpoints that apply to every instance.
 *
 * Organization (in source order):
 *   1. .lyra-bt-sf root           — outer container
 *   2. .lyra-bt-sf__inner         — width / centering wrapper
 *   3. .lyra-bt-sf__header        — heading + subheading block
 *   4. .lyra-bt-sf__cols          — layout switcher (grid/masonry/list/carousel)
 *   5. .lyra-bt-sf__card          — per-post card wrapper
 *   6. .lyra-bt-sf__embed         — inner embed slot (SDK target)
 *   7. .lyra-bt-sf__follow        — Follow-us CTA button
 *   8. .lyra-bt-sf__nav           — carousel arrows
 *   9. .lyra-bt-sf--empty         — empty-state styling
 *  10. Responsive breakpoints
 */

/* 1. Root container — typography baseline + safe defaults. The bg/pad/
 * color CSS-vars are set inline by the renderer per instance. */
.lyra-bt-sf {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
}
.lyra-bt-sf *, .lyra-bt-sf *::before, .lyra-bt-sf *::after { box-sizing: inherit; }

/* 2. Inner — width cap + horizontal alignment (margin set inline). */
.lyra-bt-sf__inner {
    width: 100%;
}

/* 3. Section header */
.lyra-bt-sf__header {
    text-align: center;
    margin: 0 0 28px;
}
.lyra-bt-sf--align-left  .lyra-bt-sf__header { text-align: left; }
.lyra-bt-sf--align-right .lyra-bt-sf__header { text-align: right; }
.lyra-bt-sf__heading {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
    color: inherit;
}
.lyra-bt-sf__subheading {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    opacity: 0.78;
}

/* 4. Layouts ───────────────────────────────────────────────────────── */
/* Grid — equal-width columns, equal-height rows (cards naturally fill). */
.lyra-bt-sf__cols--grid {
    display: grid;
    grid-template-columns: repeat(var(--lyra-bt-sf-cols, 3), minmax(0, 1fr));
    gap: var(--lyra-bt-sf-gap, 24px);
    align-items: start;
}
/* Masonry — uses the CSS columns property. Items cascade vertically
 * within columns. break-inside:avoid keeps a card from being split
 * across two columns. */
.lyra-bt-sf__cols--masonry {
    column-count: var(--lyra-bt-sf-cols, 3);
    column-gap: var(--lyra-bt-sf-gap, 24px);
}
.lyra-bt-sf__cols--masonry .lyra-bt-sf__card {
    break-inside: avoid;
    page-break-inside: avoid; /* legacy fallback */
    -webkit-column-break-inside: avoid;
    margin-bottom: var(--lyra-bt-sf-gap, 24px);
    display: inline-block;
    width: 100%;
}
/* List — single column, full width regardless of columns_* settings. */
.lyra-bt-sf__cols--list {
    display: flex;
    flex-direction: column;
    gap: var(--lyra-bt-sf-gap, 24px);
}
.lyra-bt-sf__cols--list .lyra-bt-sf__card {
    max-width: 100%;
}
/* Carousel — horizontal scroll-snap track with prev/next buttons. The
 * track is the actual scroller; the buttons are absolutely positioned
 * relative to .lyra-bt-sf__cols--carousel. */
.lyra-bt-sf__cols--carousel {
    position: relative;
    /* Padding keeps the arrow buttons from overlapping the first/last
     * card's content. */
    padding: 0 48px;
}
.lyra-bt-sf__cols--carousel .lyra-bt-sf__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(min(320px, 100%), calc((100% - (var(--lyra-bt-sf-cols, 3) - 1) * var(--lyra-bt-sf-gap, 24px)) / var(--lyra-bt-sf-cols, 3)));
    gap: var(--lyra-bt-sf-gap, 24px);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px; /* breathing room for any visible scrollbar */
}
.lyra-bt-sf__cols--carousel .lyra-bt-sf__card {
    scroll-snap-align: start;
}

/* 5. Card wrapper — bg/border/shadow set per-instance inline. */
.lyra-bt-sf__card {
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.lyra-bt-sf__card:hover {
    transform: translateY(-2px);
}

/* 6. Embed slot — the platform's SDK / iframe lives here. */
.lyra-bt-sf__embed {
    width: 100%;
    /* The blockquote/iframe inside has its own min-height; we just
     * make sure the slot doesn't constrain it. */
}
.lyra-bt-sf__embed iframe,
.lyra-bt-sf__embed blockquote {
    max-width: 100%;
    margin: 0 auto;
}
/* While the SDK is still loading, the placeholder blockquote shows the
 * raw post URL as a styled link. Make it look intentional, not broken. */
.lyra-bt-sf__embed .twitter-tweet a,
.lyra-bt-sf__embed .instagram-media a {
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}

/* 7. Follow CTA */
.lyra-bt-sf__follow-wrap {
    text-align: center;
    margin: 28px 0 0;
}
.lyra-bt-sf--align-left  .lyra-bt-sf__follow-wrap { text-align: left; }
.lyra-bt-sf--align-right .lyra-bt-sf__follow-wrap { text-align: right; }
/* When positioned at the top, flip the margin so it spaces from the
 * header below instead of from the cards above. */
.lyra-bt-sf__inner > .lyra-bt-sf__follow-wrap:first-of-type {
    margin: 0 0 28px;
}
.lyra-bt-sf__follow {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.05s;
}
.lyra-bt-sf__follow--solid {
    background: var(--lyra-bt-sf-accent, #3b82f6);
    color: #ffffff;
    border: 2px solid var(--lyra-bt-sf-accent, #3b82f6);
}
.lyra-bt-sf__follow--solid:hover {
    background: color-mix(in srgb, var(--lyra-bt-sf-accent, #3b82f6) 88%, #000000);
    border-color: color-mix(in srgb, var(--lyra-bt-sf-accent, #3b82f6) 88%, #000000);
}
.lyra-bt-sf__follow--outline {
    background: transparent;
    color: var(--lyra-bt-sf-accent, #3b82f6);
    border: 2px solid var(--lyra-bt-sf-accent, #3b82f6);
}
.lyra-bt-sf__follow--outline:hover {
    background: var(--lyra-bt-sf-accent, #3b82f6);
    color: #ffffff;
}
.lyra-bt-sf__follow:active { transform: translateY(1px); }

/* 8. Carousel arrows */
.lyra-bt-sf__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s, transform 0.05s;
}
.lyra-bt-sf__nav:hover { background: #f1f5f9; }
.lyra-bt-sf__nav:active { transform: translateY(-50%) scale(0.96); }
.lyra-bt-sf__nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.lyra-bt-sf__nav--prev { left: 4px; }
.lyra-bt-sf__nav--next { right: 4px; }

/* 9. Empty state */
.lyra-bt-sf--empty {
    padding: 32px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    background: #f8fafc;
    color: #475569;
}
.lyra-bt-sf--empty p { margin: 0 0 8px; }
.lyra-bt-sf--empty p:last-child { margin-bottom: 0; }
.lyra-bt-sf-empty__hint {
    font-size: 12px;
    opacity: 0.7;
}

/* 10. Responsive breakpoints — switch the column-count CSS var to the
 * tablet/mobile values. Using the var (set inline on .lyra-bt-sf__cols)
 * means we don't need per-block media queries. */
@media (max-width: 1024px) {
    .lyra-bt-sf__cols--grid    { grid-template-columns: repeat(var(--lyra-bt-sf-cols-t, 2), minmax(0, 1fr)); }
    .lyra-bt-sf__cols--masonry { column-count: var(--lyra-bt-sf-cols-t, 2); }
    .lyra-bt-sf__cols--carousel .lyra-bt-sf__track {
        grid-auto-columns: minmax(min(280px, 100%), calc((100% - (var(--lyra-bt-sf-cols-t, 2) - 1) * var(--lyra-bt-sf-gap, 24px)) / var(--lyra-bt-sf-cols-t, 2)));
    }
}
@media (max-width: 640px) {
    .lyra-bt-sf__cols--grid    { grid-template-columns: repeat(var(--lyra-bt-sf-cols-m, 1), minmax(0, 1fr)); }
    .lyra-bt-sf__cols--masonry { column-count: var(--lyra-bt-sf-cols-m, 1); }
    .lyra-bt-sf__cols--carousel {
        padding: 0 0;
    }
    .lyra-bt-sf__cols--carousel .lyra-bt-sf__nav {
        /* Move nav arrows to bottom on narrow screens — overlapping
         * arrows on tiny cards looks crowded. */
        position: static;
        transform: none;
        display: inline-flex;
        margin: 12px 4px 0;
    }
    .lyra-bt-sf__cols--carousel .lyra-bt-sf__track {
        grid-auto-columns: minmax(min(260px, 100%), calc((100% - (var(--lyra-bt-sf-cols-m, 1) - 1) * var(--lyra-bt-sf-gap, 24px)) / var(--lyra-bt-sf-cols-m, 1)));
    }
    .lyra-bt-sf__heading    { font-size: 24px; }
    .lyra-bt-sf__subheading { font-size: 15px; }
}

/* prefers-reduced-motion — honor user preference */
@media (prefers-reduced-motion: reduce) {
    .lyra-bt-sf__card { transition: none; }
    .lyra-bt-sf__card:hover { transform: none; }
    .lyra-bt-sf__cols--carousel .lyra-bt-sf__track { scroll-behavior: auto; }
    .lyra-bt-sf__follow { transition: none; }
}
