/* Home-page shorten: submit teaser, swipe rows, 2-col explore, chat teaser.
   Loaded only on the home page. No-JS: form and chat widgets stay visible. */

/* ========== Share / Submit teaser ========== */
.fd-submit-teaser {
    display: none;
    max-width: 760px;
    margin: 0 auto;
}
html.fd-home-js .fd-submit-teaser { display: block; }

.fd-submit-teaser-card {
    position: relative;
    text-align: center;
    padding: 32px 32px 28px;
    border-radius: 20px;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(0, 168, 255, 0.10) 0%, rgba(0, 168, 255, 0) 60%),
        linear-gradient(180deg, #16161b 0%, #111115 100%);
    border: 1px solid rgba(0, 168, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(0, 168, 255, 0.06), 0 0 40px rgba(0, 168, 255, 0.10), 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.fd-submit-teaser-card::before {
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00a8ff 30%, #4dc3ff 50%, #00a8ff 70%, transparent);
    box-shadow: 0 0 18px rgba(0, 168, 255, 0.8);
}
.fd-submit-teaser-lead {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}
.fd-submit-teaser-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 22px;
    list-style: none;
    padding: 0;
}
.fd-submit-teaser-pills .badge-pill {
    background: rgba(0, 168, 255, 0.10);
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.18);
}
.fd-submit-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 240px;
    padding: 16px 32px;
    font-size: 1.05rem;
    box-shadow: 0 8px 28px rgba(0, 168, 255, 0.28);
}
.fd-submit-teaser-note {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.fd-submit-close-btn {
    display: none;
    margin: 0 auto 16px;
    padding: 6px 12px;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font: 600 0.88rem/1.3 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.fd-submit-close-btn:hover,
.fd-submit-close-btn:focus-visible,
.fd-chat-close-btn:hover,
.fd-chat-close-btn:focus-visible,
.fd-chat-open-btn:hover,
.fd-chat-open-btn:focus-visible {
    color: var(--accent);
}
.fd-submit-close-btn:focus-visible,
.fd-chat-close-btn:focus-visible,
.fd-chat-open-btn:focus-visible,
.fd-submit-open-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Only hide the form when JS is running (class is set in <head> before CSS). */
html.fd-home-js body:not(.fd-submit-open) #submit .fd-submit-card { display: none; }
html.fd-home-js body.fd-submit-open .fd-submit-teaser-card { display: none; }
html.fd-home-js body.fd-submit-open .fd-submit-close-btn { display: block; }
html.fd-home-js body:not(.fd-submit-open) #submit .section-intro { display: none; }

/* ========== Community chat teaser (phones + JS only) ========== */
.fd-chat-teaser { display: none; }
.fd-chat-teaser-card {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    padding: 24px 22px 22px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}
.fd-chat-teaser-lead {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}
.fd-chat-teaser-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}
.fd-chat-teaser-actions .btn {
    width: auto;
    max-width: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.95rem;
}
.fd-chat-open-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 6px 10px;
    background: transparent;
    border: 0;
    color: var(--accent);
    font: 600 0.92rem/1.3 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
}
.fd-chat-close-btn {
    display: none;
    margin: 0 auto 16px;
    padding: 6px 12px;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font: 600 0.88rem/1.3 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.fd-swipe-hint { display: none; }

/* Empty Discord iframe (src set later) shouldn't leave a blank box */
iframe#fdDiscordWidget:not([src]) { display: none; }

@media (max-width: 768px) {
    /* --- Explore: all tiles two per row --- */
    .explore-featured {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }
    .explore-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .explore-card-lg .explore-body {
        position: static;
        padding: 10px 12px 12px;
        background: none;
    }
    .explore-card-lg .explore-body h3 { font-size: 1.02rem; }
    .explore-card-lg .explore-body p { display: none; }
    .explore-card-lg .explore-cta {
        padding: 7px 10px;
        font-size: 0.8rem;
        margin-top: 4px;
        border-radius: 7px;
    }
    .explore-card-lg .explore-tag {
        font-size: 0.62rem;
        padding: 1px 8px;
        letter-spacing: 0.8px;
    }
    .explore-card-wip { grid-column: auto; }
    .explore-grid .explore-card-wip .explore-body p { display: none; }
    .explore-card-wide { grid-column: 1 / -1; }

    /* --- Horizontal swipe rows --- */
    .fd-swipe-hint {
        display: block;
        margin: -16px auto 16px;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.82rem;
        letter-spacing: 0.02em;
    }
    #past-crash-of-the-month .cotm-past-grid,
    #gallery .gallery-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 24px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        margin-inline: -24px;
        padding: 4px 24px 14px;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 168, 255, 0.55) transparent;
    }
    #past-crash-of-the-month .cotm-past-grid::-webkit-scrollbar,
    #gallery .gallery-grid::-webkit-scrollbar {
        height: 6px;
    }
    #past-crash-of-the-month .cotm-past-grid::-webkit-scrollbar-thumb,
    #gallery .gallery-grid::-webkit-scrollbar-thumb {
        background: rgba(0, 168, 255, 0.55);
        border-radius: 99px;
    }
    #past-crash-of-the-month .cotm-past-card,
    #gallery .gallery-item {
        flex: 0 0 85%;
        width: 85%;
        max-width: 85%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
    #past-crash-of-the-month .cotm-past-body > p:not(.cotm-kicker):not(.cotm-credit) {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
    }
    #gallery .gallery-overlay {
        padding: 24px 14px 12px;
        background: linear-gradient(transparent, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.88) 100%);
    }
    #gallery .gallery-overlay h3 { font-size: 1.1rem; }
    #gallery .gallery-overlay p { font-size: 0.85rem; }

    html.fd-home-js #chat .section-intro { display: none; }
    html.fd-home-js .fd-chat-teaser { display: block; }
    html.fd-home-js body:not(.fd-chat-open) #chat .chat-grid { display: none; }
    html.fd-home-js body.fd-chat-open .fd-chat-teaser-lead,
    html.fd-home-js body.fd-chat-open .fd-chat-teaser-actions { display: none; }
    html.fd-home-js body.fd-chat-open .fd-chat-open-btn { display: none; }
    html.fd-home-js body.fd-chat-open .fd-chat-close-btn { display: block; }
    html.fd-home-js body.fd-chat-open .fd-chat-teaser-card {
        padding: 8px 0 0;
        background: transparent;
        border: 0;
    }
    .fd-chat-teaser-actions {
        flex-direction: column;
        align-items: center;
    }
    .fd-chat-teaser-actions .btn {
        width: 100%;
        max-width: 280px;
    }

    .fd-submit-teaser-card {
        padding: 26px 20px 22px;
        border-radius: 16px;
    }
    .fd-submit-teaser-lead { font-size: 0.98rem; }
    .fd-submit-open-btn {
        width: 100%;
        max-width: 320px;
        min-width: 0;
    }

    #submit, #chat, #past-crash-of-the-month, #gallery {
        scroll-margin-top: 80px;
    }
}

@media (min-width: 769px) {
    .fd-chat-teaser { display: none !important; }
    .fd-swipe-hint { display: none !important; }
}

/* Section dividers only (no spacing changes). Home page sections. */
#explore,#past-crash-of-the-month,#gallery,#chat,#submit,#about{position:relative}
#explore::before,#past-crash-of-the-month::before,#gallery::before,#chat::before,#submit::before,#about::before{
 content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);
 width:calc(100% - 48px);max-width:1100px;height:2px;border-radius:2px;
 background:linear-gradient(90deg,transparent 0%,rgba(0,168,255,.55) 20%,rgba(0,168,255,.95) 50%,rgba(0,168,255,.55) 80%,transparent 100%);
 box-shadow:0 0 10px rgba(0,168,255,.35);pointer-events:none}
@media (max-width:768px){#explore::before,#past-crash-of-the-month::before,#gallery::before,#chat::before,#submit::before,#about::before{width:calc(100% - 32px)}}
