/* Plots – Shared Site Styles */

:root {
    --color-bg: #fafafa;
    --color-surface: white;
    --color-text: #333;
    --color-text-muted: #666;
    --color-link: #2563eb;
    --color-border: #ddd;
    --color-highlight-bg: #fef3c7;
    --color-highlight-border: #fcd34d;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Navigation */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.nav-bar a {
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-bar a:hover {
    text-decoration: underline;
}

/* Typography */
h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Main image/plot */
.main-image {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 1.5rem 0;
}

/* Links row */
.links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--color-surface);
    border-radius: var(--radius);
}

.links a {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 500;
}

.links a:hover {
    text-decoration: underline;
}

/* Highlight box */
.highlight {
    background: linear-gradient(135deg, var(--color-highlight-bg), #fde68a);
    border: 1px solid var(--color-highlight-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

/* Companion box */
.companion {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

/* Description sections */
.description {
    background: var(--color-surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.description h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

th, td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding: 1rem;
    border-top: 1px solid var(--color-border);
}

footer a {
    color: var(--color-link);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Cards (for homepage) */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.card {
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card-content {
    padding: 1.25rem;
}

.card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.card p {
    margin: 0 0 1rem 0;
    color: #555;
    font-size: 0.9rem;
}

.card .links {
    padding: 0;
    background: none;
    margin: 0;
}

.card .links a {
    font-size: 0.85rem;
}

/* NEW badge */
.card.new {
    position: relative;
}

.card.new::before {
    content: "NEW";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 1;
}

/* Quick links box */
.quick-links {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.quick-links a {
    color: var(--color-link);
    text-decoration: none;
    margin-left: 0.5rem;
}

/* Why section */
.why-section {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.why-section h2 {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .links {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Mobile tables: scroll horizontally, tighter spacing */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    thead {
        position: sticky;
        top: 0;
    }
}
