/* ============================================================
   Backtrader Documentation – Custom Styles
   ============================================================ */

/* -- Language switcher (announcement bar) --------------------------------- */
.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.lang-switcher .lang-label {
    opacity: 0.85;
}

.lang-switcher .lang-active {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-switcher .lang-link {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.lang-switcher .lang-link:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lang-switcher .lang-sep {
    opacity: 0.5;
}

/* -- Code blocks ---------------------------------------------------------- */
.highlight pre {
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Copy button tweaks */
button.copybtn {
    border-radius: 4px !important;
}

/* -- Tables --------------------------------------------------------------- */
table.docutils {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

table.docutils th,
table.docutils td {
    padding: 10px 14px;
    border: 1px solid var(--color-table-border);
}

table.docutils th {
    font-weight: 600;
}

/* -- Admonitions ---------------------------------------------------------- */
.admonition {
    border-radius: 6px;
    margin: 1.2em 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.admonition > .admonition-title {
    font-weight: 600;
}

/* -- API styling ---------------------------------------------------------- */
.py.class > dt,
.py.function > dt,
.py.method > dt {
    background-color: var(--color-api-background);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.92rem;
}

/* -- sphinx-design cards -------------------------------------------------- */
.sd-card {
    border-radius: 8px !important;
    transition: box-shadow 0.2s, transform 0.2s;
}

.sd-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.sd-card .sd-card-header {
    font-weight: 600;
}

/* -- Badges in hero section ----------------------------------------------- */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 20px;
}

.badges img {
    height: 22px;
}

/* -- Feature grid --------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 1.5em 0;
}

/* -- Quick-links bar ------------------------------------------------------ */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.2em 0;
}

.quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-brand-primary);
    color: var(--color-brand-primary);
    transition: background 0.2s, color 0.2s;
}

.quick-links a:hover {
    background: var(--color-brand-primary);
    color: #fff;
}

/* -- Sidebar polish ------------------------------------------------------- */
.sidebar-brand {
    padding: 12px 16px;
}

/* -- Responsive tweaks ---------------------------------------------------- */
@media (max-width: 768px) {
    .lang-switcher {
        font-size: 0.8rem;
        gap: 6px;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Smooth scrolling ----------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

/* -- Back-to-top visual cue (Furo handles natively, just polish) ---------- */
.page-content {
    scroll-margin-top: 60px;
}

/* -- Print tweaks --------------------------------------------------------- */
@media print {
    .announcement,
    .sidebar-drawer,
    .page-toc,
    button.copybtn {
        display: none !important;
    }
}
