/* Main Colors */
:root {
    --primary-color: #4CAF50;
    --accent-color: #2196F3;
    --background-color: #f8f9fa;
}

body {
    margin: 0;
    padding: 0;
    font-family: monospace;
    background-color: var(--background-color);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1em;
    display: flex;
    justify-content: flex-end; /* Changed from space-between */
    align-items: center;
}

/* DESKTOP PIPE STYLES */
nav a:not(:last-child)::after {
    content: " | ";
    margin: 0 5px;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
}

.menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    background: url('../images/cover.jpg') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 24em 1em;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); /* 50% transparency */
    z-index: 1;
}

.hero h1, .hero p {
    position: relative;
    z-index: 2;
}

/* Add font sizes for desktop */
.hero h1 {
    font-size: 48px; /* Increased from default (~32px) */
}

.hero p {
    font-size: 24px; /* Increased from default (~16px) */
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: 20px;
    padding: 2em;
    position: relative; /* Added */
    z-index: 4; /* Above hero and its overlay */
    margin-top: -160px; /* Adjust to ~1/4 of card height for overlap */
}

.card {
    background: white;
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative; /* Ensure cards respect z-index */
}

.card p {
    line-height: 1.4; /* More spacing on desktop */
}

.card li {
    line-height: 1.4; /* For text within each bullet */
    margin-bottom: 10px; /* For spacing between bullets */
}

.card-image {
    display: block; /* Makes the image a block element for centering */
    margin: 0 auto; /* Centers the image horizontally */
    max-width: 50%; /* Set your desired width */
    height: auto; /* Maintains aspect ratio */
    margin-top: 20px; /* Adds space above the image */
}


/* MOBILE HEADER */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* UPDATED nav STYLES */
    nav {
        display: none; /* NEW - hides menu by default */
        flex-direction: column; /* NEW - stacks links vertically */
        width: 100%;
        margin-top: 10px;
        background: rgba(0,0,0,0.2); /* NEW - subtle background */
        padding: 0; /* NEW - removes default padding */
    }

    /* REMOVE PIPES ON MOBILE */
    nav a:not(:last-child)::after {
    content: none;
}
    
    /* EXISTING nav a STYLES (keep these) */
    nav a {
        display: block;
        padding: 10px;
        background: rgba(255,255,255,0.1);
        margin: 5px 0;
        text-align: center;
    }
    
    .logo {
        font-size: 24px;
        padding: 10px;
    }
    
    .content-grid {
        padding: 1em;
        margin-top: 0; /* Remove overlap on mobile */
    }
    
    .hero {
        padding: 2em 1em;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    /* ✨ NEW STYLES FOR MOBILE MENU ✨ */
    .menu-toggle {
        display: block; /* shows the ☰ button */
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        margin-left: auto; /* pushes button to the right */
    }

    /* ACTIVE STATE FOR MOBILE MENU */
    nav.active {
        display: flex; /* shows the menu when active */
    }

    .blog-grid {
        padding: 1em;
    }

    .blog-card img {
        height: 150px;
    }

    .blog-hero {
        padding: 3em 1em;
    }

    .blog-hero h1 {
        font-size: 24px;
    }

    .blog-hero p {
        font-size: 16px;
    }
}
    
}

a, button {
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
}

/* BLOG HERO */
.blog-hero {
    color: white;
    text-align: center;
    padding: 4em 1em;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.blog-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 50% transparency */
    z-index: 1;
}

.blog-hero h1, 
.blog-hero p {
    position: relative;
    z-index: 2;
}

.blog-hero h1 {
    font-size: 48px;
    margin-bottom: 0.5em;
}

.blog-hero p {
    font-size: 18px;
}

/* BLOG CARDS */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    padding: 2em 1em;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card h3 {
    font-size: 1.2em;
    margin: 1em;
    color: #333;
}

.blog-card a {
    color: #333;
    text-decoration: none;
}

.blog-card a:hover {
    text-decoration: underline;
}

.blog-card .date {
    font-size: 0.9em;
    color: #666;
    margin: 0 1em 1em;
}


/* Blog Content */
.blog-content {
    padding: 2em 1em;
    max-width: 1200px;
    margin: 0 auto;
}

/* Increase line spacing for blog content */
.blog-content p,
.blog-content ul,
.blog-content li {
    line-height: 1.6; /* Slightly increased from typical default (~1.2) or card’s 1.4 */
}

/* Optional: Adjust headings if desired */
.blog-content h1,
.blog-content h2,
.blog-content h3 {
    line-height: 1.4; /* Moderate increase for headings */
}

/* Blog Images */
.blog-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    max-height: 500px; /* Limit image height on desktop */
    object-fit: contain; /* Ensure image scales properly within max-height */
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .blog-content {
        padding: 1em 1em;
    }

    /* Keep same line-height for consistency, or adjust if needed */
    .blog-content p,
    .blog-content ul,
    .blog-content li {
        line-height: 1.6;
    }

    .blog-content h1,
    .blog-content h2,
    .blog-content h3 {
        line-height: 1.4;
    }

    .blog-image {
        margin: 1.5em auto;
        max-height: none; /* Remove height restriction on mobile */
    }

}


/* ACCOUNTING JOKES */

/* Jokes Hero (Book Showcase) */
.jokes-hero {
    background-color: var(--primary-color); /* Matches header color for theme consistency */
    color: white;
    text-align: center;
    padding: 4em 1em;
    position: relative;
}

.jokes-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Lighter overlay for readability */
    z-index: 1;
}

.jokes-hero .book-container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.jokes-hero h1 {
    font-size: 36px;
    margin-bottom: 0.5em;
}

.jokes-hero p {
    font-size: 18px;
    margin-bottom: 1em;
}

.book-image {
    display: block;
    max-width: 300px;
    height: auto;
    margin: 0 auto 1em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.buy-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.buy-button:hover {
    background-color: darken(var(--accent-color), 10%);
}

/* Define new variable for punchline color */
:root {
    --punchline-color: #2F4F4F; /* Dark slate green */
}

/* Jokes Content */
.jokes-content {
    padding: 2em 1em;
    max-width: 1200px;
    margin: 0 auto;
}

.jokes-content h2 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 1em;
}

.jokes-list {
    list-style-type: decimal;
    padding-left: 2em;
    line-height: 1.6;
}

.jokes-list li {
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
    font-size: 16px;
}

.jokes-list .punchline {
    display: block;
    margin-top: 0.5em;
    padding-left: 1.5em;
    color: var(--punchline-color); /* Changed from --accent-color to dark green */
    font-style: italic; /* Adds a playful tone */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .jokes-hero {
        padding: 3em 1em;
    }

    .jokes-hero h1 {
        font-size: 24px;
    }

    .jokes-hero p {
        font-size: 16px;
    }

    .book-image {
        max-width: 200px;
    }

    .jokes-content {
        padding: 1em;
    }

    .jokes-content h2 {
        font-size: 22px;
    }

    .jokes-list {
        padding-left: 1em;
    }

    .jokes-list li {
        font-size: 14px;
    }

    .jokes-list .punchline {
        padding-left: 1em;
    }
}
