/* custom styles */
:root {
    --primary-color: #007bff;
    --dark-color: #343a40; 
}

.container {
    max-width: 960;  /* or whatever width you prefer */
}
/* Default for home page cards */
.card-img-top {
    height: 350px;
    object-fit: cover;
    object-position: center top;
}

/* Taller images for category page wider cards */
.col-md-6 .card-img-top {
    height: 250px;
    object-position: center top;
}

/* Article detail featured image */
.article-featured-img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    object-position: center top;
    border-radius: 8px;
}

/* Article wrapper - center the article content */
.article-wrapper {
    max-width: 680px;
    margin: 0 auto;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.article-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Project list page */
.project-list-header {
    text-align: center;
    margin-bottom: 1rem;
}

.project-list-header .lead {
    font-family: Georgia, serif;
    color: #555;
}

/* Project detail - don't constrain width like articles */
.project-content {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

body {
    font-family: Georgia, 'Times New Roman', serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

/* Headings use Inter for clean, minimalist look */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
}

/* UI elements use Inter */
.navbar, .btn, .card-title, .card-footer, .nav-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

main {
    flex: 1;
}

.jumbotron {
    background:linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card {
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.card-title {
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 1.15rem;
}

.card-text {
    font-family: Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.card-body {
    padding: 1.5rem;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 0.85rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Project content overrides - full width, not centered */
.project-content {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Superscript/subscript - prevent line shifting */
.article-content sup,
.article-content sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.article-content sup {
    top: -0.5em;
}

.article-content sub {
    bottom: -0.25em;
}

/* Uniform paragraph spacing */
.article-content p {
    margin-bottom: 1rem;
    margin-top: 0;
}

/* Article content images - tight text wrapping */
.article-content img {
    max-width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    margin: 0.5rem 0 !important;  /* Only top/bottom margin by default */
}

/* Left-floated images: margin on right only */
.article-content img[style*="float: left"],
.article-content img[style*="float:left"] {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

/* Right-floated images: margin on left only */
.article-content img[style*="float: right"],
.article-content img[style*="float:right"] {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

/* Clear floats after content */
.article-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Full-width images when needed */
.article-content img.full-width {
    float: none;
    display: block;
    max-width: 100%;
    max-height: none;
    margin: 1.5rem auto;
}

/* Clear floats after content sections */
.article-content::after {
    content: "";
    display: table;
    clear: both;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    clear: both;  /* Headings start on new line */
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.social-links a {
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color) !important;
}

/* Code Block Styling - VS Code style */
.article-content pre[class*="language-"],
.article-content pre {
    padding: 0.5em 0.75em !important;
    margin: 0.5em 0 !important;
    border-radius: 4px;
}

.article-content pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    line-height: 1.4;
    padding: 0 !important;
}

/* Mermaid diagram styling - GitHub-like */
.article-content .mermaid-container {
    position: relative;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
}

.article-content .mermaid {
    text-align: center;
}

.mermaid-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: white;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mermaid-controls button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #57606a;
    font-size: 14px;
}

.mermaid-controls button:hover {
    background: #f3f4f6;
}

.mermaid-controls .divider {
    height: 1px;
    background: #d0d7de;
    margin: 2px 0;
}

footer {
    margin-top: auto;
}

/* Auto-generated Table of Contents */
.toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666;
    margin: 0 0 0.75rem 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid #eee;
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.toc-list a:hover {
    color: var(--primary-color);
}

/* Smooth scroll for anchor links */
html {
    scroll-behavior: smooth;
}

/* Offset for fixed headers if needed */
.article-content h2[id],
.article-content h3[id],
.article-content h4[id] {
    scroll-margin-top: 1rem;
}

/* responsive adjustments */
@media (max-width: 768px) {
    .jumbotron h1 {
        font-size: 2rem;
    }
}

/* resume page */
.resume-page h1 { font-size: 1.75rem; }
.resume-page h2 { font-size: 1.25rem; }
.resume-page h4 { font-size: .8rem; }

/* ---------- clinical copilot demo ---------- */

.demo-status {
    min-height: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 1px dashed #d0d5dd;
    border-radius: .5rem;
    background: #fbfcfd;
    text-align: center;
}

.demo-status--error {
    border-color: #f1aeb5;
    background: #fdf2f3;
    color: #b02a37;
}

/* The A2UI surface styles itself through the catalog's own CSS custom
   properties. These variables are the supported way to theme it — reaching
   into its shadow DOM is not, and would break on any renderer upgrade. */
#surface-host {
    --a2ui-color-background: #ffffff;
    --a2ui-color-on-background: #1f2933;
    --a2ui-color-border: #e3e8ef;
    --a2ui-border-radius: .5rem;
}

.demo-prose {
    color: #4a5568;
    font-size: .95rem;
    line-height: 1.6;
    border-left: 3px solid #e3e8ef;
    padding-left: .875rem;
    white-space: pre-wrap;
}

#patients .list-group-item-action.active {
    background: #eef4ff;
    border-color: #b6d0ff;
    color: inherit;
}
