/* --- VARIABLES --- */

:root {
    --bg-color: #FDFBF7;
    --text-color: #2D2D2D;
    --accent-color: #D9534F;
    --border-color: #E0E0E0;
    --code-bg: #F0EFEB;
    --font-header: 'Courier New', Courier, monospace;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

a:hover {
    color: var(--accent-color);
    text-decoration-thickness: 2px;
}

/* --- LAYOUT CONTAINER --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
}

/* --- HEADER (Vertical Layout) --- */
header {
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 2rem;
}

.site-title {
    font-family: var(--font-header);
    font-size: 2rem;
    margin: 0;
    text-decoration: none;
    font-weight: 700;
    color: var(--text-color);
    display: block;
}

.tagline {
    font-family: var(--font-header);
    font-size: 1rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

/* --- HOMEPAGE GRID --- */
.section-label {
    font-family: var(--font-header);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.stacks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.category h2 {
    font-size: 1.3rem;
    margin-top: 0;
    border-left: 4px solid var(--accent-color);
    padding-left: 10px;
}

.category p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
}

.course-list {
    list-style: none;
    padding: 0;
}

.course-list li {
    margin-bottom: 0.6rem;
}

/* --- SYLLABUS PAGE STYLES --- */
.course-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.course-meta {
    font-family: var(--font-header);
    background: var(--code-bg);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.syllabus-content h2 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-top: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.syllabus-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: #444;
}

blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 1.5rem 0;
    padding-left: 1rem;
    font-style: italic;
    color: #555;
    background: rgba(0, 0, 0, 0.02);
    padding: 1rem;
}

/* --- FOOTER --- */
footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 600px) {
    .site-title {
        font-size: 1.8rem;
    }

    .course-header h1 {
        font-size: 2rem;
    }

    .stacks-grid {
        gap: 2rem;
    }

    .featured-grid {
        gap: 1rem;
    }
}

/* --- HOMEPAGE SPECIFIC OVERRIDES --- */
.home-header {
    border-bottom: none;
    margin-bottom: 2rem;
    padding-bottom: 0;
}

/* --- FEATURED SECTION (Cards) --- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.featured-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: #fff;
}

.featured-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-image {
    width: 100%;
    height: 200px;
    background-color: #eee;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.card-content {
    padding: 1rem;
}

.card-title {
    font-family: var(--font-header);
    font-size: 1rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.card-blurb {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    font-family: var(--font-body);
}


/* ---  MENU --- */

.hamburger-btn {
    position: absolute;
    top: 2rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    z-index: 100;
    padding: 0;
    line-height: 1;
}

.hamburger-btn:hover {
    color: var(--accent-color);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-color: var(--bg-color);
    border-left: 2px solid var(--text-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    padding: 3rem 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.menu-overlay.open .menu-drawer {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
}

.menu-links a {
    font-family: var(--font-header);
    font-size: 1.4rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid transparent;
    padding-bottom: 0.2rem;
}

.menu-links a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

@media (max-width: 450px) {
    .menu-drawer {
        width: 100%;
        border-left: none;
    }
}

/* --- IMAGES --- */

figure {
    margin: 2.5rem 0;
    padding: 0;
    display: block;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

figcaption {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
    line-height: 1.4;
}

/* --- IMAGE ALIGNMENT CLASSES --- */

/* 1. Full Width */
.img-full {
    width: 100%;
}

.img-full img {
    width: 100%;
}

/* 2. Centered (Good for diagrams) */
.img-center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* 3. Right Aligned (Text wraps around left) */
.img-right {
    float: right;
    max-width: 45%;
    /* Don't take up more than half the page */
    margin-left: 2rem;
    margin-bottom: 1rem;
}

/* 4. Left Aligned (Text wraps around right) */
.img-left {
    float: left;
    max-width: 45%;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 650px) {

    .img-right,
    .img-left {
        float: none;
        max-width: 100%;
        margin: 2rem 0;
        text-align: center;
    }
}

/* --- RESOURCE LISTS (Books, Articles) --- */
.resource-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
}

.resource-item {
    border-left: 1px solid var(--border-color);
    padding-left: 1.2rem;
    transition: transform 0.2s ease;
}

.resource-item:hover {
    transform: translateX(5px);
}

.resource-title {
    font-size: 1.1rem;
    margin: 0 0 0.3rem 0;
    font-weight: bold;
}

.resource-title a {
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.resource-title a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.resource-meta {
    margin-bottom: 0.5rem;
    font-family: var(--font-header);
    font-size: 0.8rem;
    color: #666;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- THE LECTURE HALL (Media) --- */

.media-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 1. EMBEDDED VIDEO CONTAINER (Responsive 16:9) */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

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

/* 2. EXTERNAL MEDIA CARD (For Netflix/Hulu links) */
.media-card-link {
    display: block;
    text-decoration: none;
}

.media-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: #333;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    position: relative;
}

.media-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-family: var(--font-header);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.media-info h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.media-info h3 a {
    text-decoration: none;
}

.media-info h3 a:hover {
    color: var(--accent-color);
}

.media-meta {
    font-family: var(--font-header);
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.8rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.media-desc {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

/* BUTTON STYLES */
.button-wrapper {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: transparent;
    color: #222;
    border: 1px solid #222;
    text-decoration: none;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #222;
    color: #fff;
}

.coming-soon-badge {
    font-family: var(--font-header);
    background: var(--code-bg);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-top: 1rem;
}