/* style.css */

/* --- 1. VARIABLES & GLOBAL RESET --- */
:root {
    --primary-color: #0ea5e9;
    --dark-color: #0369a1;
    --light-bg: #f0f9ff;
    --white: #ffffff;
    --text-color: #334155;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- 2. NAVIGATION (Sticky) --- */
nav {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* --- 3. HOMEPAGE STYLES --- */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #64748b;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--dark-color);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--primary-color);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* --- 4. ABOUT PAGE STYLES --- */
.profile-header {
    text-align: center;
    margin-bottom: 3rem;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    border: 4px solid var(--primary-color);
    object-fit: cover;
}

.bio-text {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.bio-text h1 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.bio-text p {
    margin-bottom: 1.5rem;
}

/* --- 5. BLOG PAGE & POST STYLES --- */

.blog-post {
    display: flex;
    /* Enables side-by-side layout */
    justify-content: space-between;
    /* Pushes text left, image right */
    align-items: center;
    /* Vertically centers them */
    gap: 2rem;

    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 5px solid transparent;
    overflow: hidden;
}

.blog-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-color);
    /* Fixed variable name from primary-blue */
}

/* The container for the text */
.post-content {
    flex: 1;
    /* Tells the text to take up all remaining width */
}

/* --- UPDATED IMAGE CLASS --- */
/* Matches the class 'card-header-img' used in your HTML */
.card-header-img {
    width: 150px;
    /* Fixed width */
    height: 150px;
    /* Fixed height creates a perfect square */
    object-fit: cover;
    /* Crops the image cleanly to fill the square */
    border-radius: 8px;
    flex-shrink: 0;
    /* Crucial: prevents the image from getting squashed */
    border: 1px solid #f1f5f9;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
    .blog-post {
        flex-direction: column-reverse;
        /* Puts image on top, text below */
        align-items: flex-start;
        gap: 1rem;
    }

    .card-header-img {
        width: 100%;
        /* Full width banner on mobile */
        height: 180px;
        /* Rectangular height */
    }
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.article-container {
    max-width: 700px;
    margin: 3rem auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.article-container h1 {
    color: var(--dark-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.date {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: block;
}

.article-container p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- 6. FOOTNOTES & SPECIAL LINKS --- */
sup a {
    color: #273eec;
    text-decoration: none;
    font-weight: 700;
    padding: 0 2px;
}

.cyan-link {
    color: rgb(0, 144, 201);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.cyan-link:hover {
    opacity: 0.8;
}

/* --- 7. COURSEWORK TIMELINE --- */
.semester-group {
    margin-bottom: 3rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 2rem;
    position: relative;
}

.semester-group::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    left: -7px;
    top: 6px;
}

.semester-title {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.course-item {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.course-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.course-number {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary-color);
    background-color: #e0f2fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.course-name {
    font-weight: 600;
    color: var(--text-color);
}

.course-desc {
    font-size: 0.95rem;
    color: #64748b;
    margin-left: calc(0.9rem + 1rem + 12px);
    margin-bottom: 0;
}

@media (max-width: 500px) {
    .course-desc {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* --- 8. FOOTER --- */
footer {
    text-align: left;
    padding: 2rem;
    background-color: var(--white);
    color: #94a3b8;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* --- BLOCKQUOTE STYLING --- */
blockquote {
    background: #f8fafc;
    border-left: 5px solid var(--primary-color);
    margin: 1rem 0;
    padding: 1rem 2rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
    position: relative;
}

blockquote footer {
    margin-top: 0.1rem;
    font-size: 0.9rem;
    color: var(--dark-color);
    font-style: normal;
    font-weight: 600;
    padding: 0;
    background-color: transparent;
    border-top: none;
}

blockquote p:last-of-type {
    margin-bottom: 0;
}

/* Styles for images INSIDE actual blog posts (not thumbnails) */
.post-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

.quote-right {
    text-align: right;
    border-left: none;
    border-right: 5px solid var(--primary-color);
    border-radius: 8px 0 0 8px;
}

.quote-right footer {
    text-align: left;
    display: block;
    margin-top: 0.1rem;
}

/* Wrapper to hold logo and subtitle side-by-side */
.nav-brand {
    display: flex;
    align-items: center;
    /* Aligns them vertically */
    gap: 1rem;
    /* Space between logo and subtitle */
}

/* Styling for the subtitle text */
.blog-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    /* A nice grey that complements your theme */
    font-style: italic;
    border-left: 2px solid #cbd5e1;
    /* Optional: adds a vertical divider line */
    padding-left: 1rem;
    /* Space between line and text */
}

/* IMPORTANT: Hide the subtitle on mobile so it doesn't crush your menu */
@media (max-width: 768px) {
    .blog-subtitle {
        display: none;
    }
}

/* --- LIST STYLING INSIDE ARTICLES --- */

/* Restores bullets/numbers and indentation */
.article-container ul,
.article-container ol {
    margin: 1.5rem 0;
    /* Space above and below the list */
    padding-left: 2rem;
    /* Indentation for bullets */
    line-height: 1.7;
    /* Makes it readable */
}

/* Spaces out the individual items */
.article-container li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Optional: Make nested lists (lists inside lists) look correct */
.article-container ul ul,
.article-container ol ol {
    margin: 0.5rem 0;
}