/*
 * Supabase Blog — style.css
 * Layout, transitions, and animations only.
 * Fonts and text colours are intentionally inherited from the active theme.
 */

/* ── Staggered page-load fade-up ───────────────────────────── */
@keyframes sb-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sb-header { animation: sb-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.sb-hero   { animation: sb-fade-up 0.5s  0.07s cubic-bezier(0.22, 1, 0.36, 1) both; }

.sb-grid .sb-card:nth-child(1) { animation: sb-fade-up 0.5s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
.sb-grid .sb-card:nth-child(2) { animation: sb-fade-up 0.5s 0.21s cubic-bezier(0.22, 1, 0.36, 1) both; }
.sb-grid .sb-card:nth-child(3) { animation: sb-fade-up 0.5s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.sb-grid .sb-card:nth-child(n+4) { animation: sb-fade-up 0.5s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ── Hero hover ─────────────────────────────────────────────── */
.sb-hero {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s ease;
}
.sb-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.28) !important;
}

/* ── Card hover ─────────────────────────────────────────────── */
.sb-card {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease;
}
.sb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.1) !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sb-grid { grid-template-columns: 1fr !important; }

    .sb-hero  { padding: 2rem 1.5rem !important; }
}

/* ── Single article — content typography ────────────────────── */

/* Fade-in for the article wrapper */
.sb-single-wrap {
    animation: sb-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Body content — spacing and readability only, no colour/font overrides */
.sb-article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.sb-article-content > * + * {
    margin-top: 1.4rem;
}

.sb-article-content h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    margin: 2.5rem 0 1.25rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px solid #e2e8f0 !important;
}

.sb-article-content h3 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin: 2rem 0 0.5rem !important;
}

.sb-article-content h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin: 1.5rem 0 0.4rem !important;
}

.sb-article-content p {
    margin: 0 0 1.4rem !important;
}

.sb-article-content ul,
.sb-article-content ol {
    margin: 0.5rem 0 1.4rem !important;
    padding-left: 1.5rem !important;
}

.sb-article-content li {
    margin-bottom: 0.45rem !important;
    line-height: 1.7 !important;
}

.sb-article-content blockquote {
    border-left: 3px solid #2563eb !important;
    padding: 0.85rem 1.25rem !important;
    margin: 2rem 0 !important;
    background: #f8faff !important;
    border-radius: 0 8px 8px 0 !important;
    font-style: italic !important;
    opacity: 0.85 !important;
}

.sb-article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    margin: 1.75rem 0 !important;
    display: block !important;
}

.sb-article-content pre {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    font-size: 0.875rem !important;
    margin: 1.75rem 0 !important;
}

.sb-article-content code:not(pre code) {
    background: #f1f5f9 !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 4px !important;
    font-size: 0.88em !important;
}

.sb-article-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.75rem 0 !important;
    font-size: 0.9rem !important;
}

.sb-article-content th,
.sb-article-content td {
    padding: 0.65rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
    text-align: left !important;
}

.sb-article-content th {
    background: #f8fafc !important;
    font-weight: 600 !important;
}

/* ── Single page two-column layout ─────────────────────────── */
.sb-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

.sb-sidebar {
    min-width: 0;
}

.blog #content {
    background: #fff;
    padding-top: 5%;
}

/* Sidebar card hover handled via inline onmouseover — no CSS needed */

/* ── Responsive single ──────────────────────────────────────── */
@media (max-width: 900px) {
    .sb-single-layout {
        grid-template-columns: 1fr;
    }

    .sb-sidebar-inner {
        position: static !important;
    }
}

@media (max-width: 640px) {
    .sb-single-wrap {
        padding: 1.5rem 1rem 4rem !important;
    }
}
