/* --- Global Styles & Variables --- */
:root {
    --primary-color: #2c3e50;    /* A dark, modern blue */
    --secondary-color: #3498db;  /* A brighter blue for buttons */
    --secondary-hover: #2980b9; /* Darker blue for button hover */
    --background-color: #ecf0f1; /* Light grey background */
    --text-color: #34495e;       /* Dark grey for text */
    --header-text-color: #ffffff; /* White text for headers */
    --card-background: #ffffff;   /* White for content cards */
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header & Footer --- */
header, footer {
    background-color: var(--primary-color);
    color: var(--header-text-color);
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

footer {
    margin-top: 2rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* --- Intro Section (Logo & Links) --- */
.intro-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.logo img {
    height: 70px;
    display: block;
}

/* --- The "Nice Buttons" --- */
.links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Styling for icons inside buttons */
.btn img, .btn .icon {
    height: 20px;
    width: auto;
}
.btn .icon {
    width: 28px; /* specific for bluesky svg */
}

.btn .yt-icon {
    height: 24px; /* Slightly taller to match visual weight */
}

/* --- Main Content Grid (Iframes) --- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.content-item {
    background: var(--card-background);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* This wrapper makes the iframe responsive */
.iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.iframe-wrapper.soundcloud {
    padding-bottom: 100%; /* Adjust for soundcloud player height */
    height: 640px; /* You can fix height if preferred */
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.caption {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.caption a {
    color: var(--secondary-color);
    text-decoration: none;
}
.caption a:hover {
    text-decoration: underline;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr; /* Stack content items on smaller screens */
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    .intro-section {
        flex-direction: column; /* Stack logo and links */
        align-items: center;
    }
}
/* --- Styles for Circula Page --- */

.page-intro {
    padding: 1.5rem;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.page-intro h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.page-intro p {
    margin-bottom: 1.5rem;
    max-width: 70ch; /* Limit line length for readability */
    margin-left: auto;
    margin-right: auto;
}

/* Secondary button style for "Back" link */
.btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    background-color: #bdc3c7;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #95a5a6;
}


/* --- Responsive Table Styling --- */

.table-container {
    overflow-x: auto; /* This enables horizontal scrolling! */
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px; /* Keeping font small as requested */
}

th, td {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap; /* Prevents text from wrapping */
    border-bottom: 1px solid #ddd;
}

thead th {
    background-color: var(--primary-color);
    color: var(--header-text-color);
    position: sticky; /* Makes the header stick to the top on scroll */
    top: 0;
    z-index: 10;
}

tbody tr:nth-child(even) {
    background-color: #f8f9fa; /* Zebra striping for readability */
}

tbody tr:hover {
    background-color: #e9ecef; /* Highlight row on hover */
}


/* --- Modernized Color-coded Cells --- */
/* Replacing the old colors with a more subtle palette */

td.num { text-align: right; }
td.num sup { font-size: 0.8em; } /* For exponents in polynomials */

/* Original: #BEF -> Light Blue */
td.nonsin,
td.numnz {
    background: #e7f5ff;
}

/* Original: #FB9 -> Light Orange */
td.num0 {
    text-align: right;
    background: #fff4e6;
}

/* Original: #9AF -> Medium Blue */
td.num1,
td.num2,
td.num3,
td.num4,
td.num6,
td.num12 {
    text-align: right;
    background: #dbe4ff;
}
