/* --- 1. GLOBAL STYLES & 1950s PULP THEME --- */
:root {
    --primary-noir: #111111;      /* Ink Black */
    --secondary-noir: #8a0303;    /* Dried Blood Red */
    --paper-bg: #f4f1ea;          /* Aged Manila Folder */
    --paper-texture: #e6e2d8;     /* Slightly darker for contrast */
    --white: #ffffff;
    --font-headline: 'Playfair Display', serif;
    /* Courier Prime is the ultimate typewriter font */
    --font-body: 'Courier Prime', 'Courier New', monospace; 
}

/* Import the Typewriter Font */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Playfair+Display:wght@700;900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--primary-noir);
    background-color: var(--paper-bg);
    line-height: 1.6;
    /* High contrast selection color */
    background-image: radial-gradient(#e6e2d8 15%, transparent 16%), radial-gradient(#e6e2d8 15%, transparent 16%);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
}

::selection {
    background: var(--primary-noir);
    color: var(--paper-bg);
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

h1, h2, h3, h4 {
    font-family: var(--font-headline);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--primary-noir);
}

h1 { 
    font-size: 3.5rem; 
    text-shadow: 3px 3px 0 var(--paper-texture); 
    font-weight: 900;
}

h2 { 
    font-size: 2rem; 
    border-bottom: 4px solid var(--primary-noir); 
    display: inline-block; 
    padding-bottom: 5px;
    margin-top: 1rem;
}

p { margin-bottom: 1.2rem; font-size: 1.1rem; }

a { 
    color: var(--secondary-noir); 
    text-decoration: underline; 
    text-decoration-thickness: 2px;
    font-weight: 700; 
}
a:hover { background-color: var(--primary-noir); color: var(--paper-bg); text-decoration: none; }

/* --- 2. NAVIGATION BAR (Stamped Look) --- */
.navbar {
    padding: 1.5rem 0;
    background: var(--primary-noir);
    border-bottom: 1px solid var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-headline);
    font-weight: 900;
    font-size: 2rem;
    color: var(--paper-bg);
    text-decoration: none;
    letter-spacing: 2px;
    border: 2px solid var(--paper-bg);
    padding: 5px 15px;
    transform: rotate(-2deg); /* Slight stamp tilt */
}
.logo:hover { background: none; color: var(--paper-bg); }

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li { margin-left: 2rem; }

.nav-links a {
    font-family: var(--font-body);
    text-decoration: none;
    color: var(--paper-bg);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--paper-bg);
    color: var(--primary-noir);
    padding: 2px 5px;
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--paper-bg);
}

/* --- 3. HERO SECTION (Newspaper Style) --- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 85vh;
    color: var(--paper-bg);
    background-position: center;
    background-size: cover;
    background-blend-mode: multiply;
    background-color: #555; /* Fallback */
    position: relative;
    border-bottom: 10px solid var(--primary-noir);
}

/* Add a Vignette (dark corners) */
.hero::after {
    content: "";
    position: absolute;
    top:0; left:0; width:100%; height:100%;
    box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    padding: 2rem;
    border: 2px solid var(--paper-bg);
    /* Slight rotation for drama */
    transform: rotate(1deg); 
    max-width: 800px;
}

.hero h1 {
    color: var(--paper-bg);
    text-shadow: 4px 4px 0 #000;
    font-size: 4rem;
    line-height: 0.9;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.4rem;
    font-family: var(--font-headline);
    font-style: italic;
    color: #ddd;
}

.cta-button {
    display: inline-block;
    background: var(--secondary-noir);
    color: var(--paper-bg);
    padding: 1rem 2rem;
    font-family: var(--font-headline);
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    border: 3px solid var(--primary-noir);
    /* Hard Shadow */
    box-shadow: 6px 6px 0 var(--primary-noir); 
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--primary-noir);
    background: var(--primary-noir);
    color: var(--white);
}

/* --- 4. CONTENT SECTIONS (The Case Files) --- */
.content-section {
    padding: 4rem 0;
    background: var(--paper-bg);
    margin: 0;
    border-bottom: 1px solid #ccc;
}

/* --- 5. BOOKS GRID (Polaroid Style) --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.book-card {
    background: var(--white);
    border: 1px solid #ccc;
    padding: 1rem 1rem 2rem 1rem; /* Extra bottom padding like a Polaroid */
    /* Hard Shadow Effect */
    box-shadow: 8px 8px 0 rgba(0,0,0,0.15);
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.book-card:nth-child(even) {
    transform: rotate(1deg); /* Vary the tilt */
}

.book-card:hover {
    transform: scale(1.02) rotate(0deg);
    box-shadow: 12px 12px 0 rgba(0,0,0,0.2);
    z-index: 10;
}

.book-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border: 1px solid #5c5c5c;
    /* Sepia Tone for Images */
    filter: sepia(0.3) contrast(1.2) grayscale(0.2);
    margin-bottom: 1rem;
}

.book-card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.book-card-content .cta-button {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    box-shadow: 4px 4px 0 var(--primary-noir);
    background: var(--white);
    color: var(--primary-noir);
    border: 2px solid var(--primary-noir);
}

.book-card-content .cta-button:hover {
    background: var(--primary-noir);
    color: var(--white);
}

/* --- 6. AUTHOR & IMAGES --- */
.author-intro {
    padding: 5rem 0;
    background: var(--primary-noir);
    color: var(--paper-bg);
    border-top: 5px solid var(--secondary-noir);
    border-bottom: 5px solid var(--secondary-noir);
}

.author-intro .container {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* The "Evidence Photo" Look */
.author-image img, .about-image img {
    border: 10px solid var(--white);
    box-shadow: 10px 10px 0 rgba(0,0,0,0.5);
    transform: rotate(2deg);
    filter: grayscale(100%) contrast(1.1);
    max-width: 100%;
}

.author-image {
    flex-basis: 45%; 
    max-width: 450px;
}

.author-bio {
    flex-basis: 55%;
}

/* --- 7. FORMS (Typewriter Paper) --- */
input, textarea {
    background: #fffcf5;
    border: 3px solid var(--primary-noir);
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--primary-noir);
    width: 100%;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

input:focus, textarea:focus {
    outline: none;
    background: var(--white);
    box-shadow: 4px 4px 0 var(--secondary-noir);
    border-color: var(--secondary-noir);
}

/* --- 8. FOOTER --- */
.footer {
    padding: 3rem 0;
    text-align: center;
    font-family: var(--font-body);
    background: var(--primary-noir);
    color: #666;
    border-top: 1px solid #333;
}

/* --- 9. MOBILE RESPONSIVENESS & MENU FIXES --- */
@media (max-width: 768px) {
    /* Adjust Headings */
    h1 { font-size: 2.5rem; }
    .hero h1 { font-size: 2.8rem; margin-bottom: 0.5rem; }
    .hero p { font-size: 1.1rem; }
    
    /* 1. Make Hamburger Visible */
    .hamburger {
        display: block;
        z-index: 200;
    }

    /* 2. Mobile Menu Styles (Hidden by default) */
    .nav-links {
        display: none; /* Hide links normally */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-noir);
        border-top: 2px solid var(--secondary-noir);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        z-index: 99;
    }

    /* 3. Show Menu when 'show' class is added by main.js */
    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        margin: 0;
        text-align: center;
        padding: 0.8rem 0;
        border-bottom: 1px solid #333;
    }

    /* 4. Stack Content Vertically */
    .author-intro .container, 
    .about-content,
    .book-detail-grid,
    .contact-content {
        flex-direction: column;
    }
    
    /* Ensure single column for grids */
    .books-grid, .news-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Adjust margins for stacked layout */
    .author-image, .about-image {
        max-width: 200px; 
        margin: 0 auto 2rem auto; /* Center image, add bottom margin */
    }
    
    .book-cover-area {
        margin-bottom: 2rem;
    }
    
    /* Reset rotation on mobile for cleaner look */
    .book-card { transform: rotate(0deg) !important; }
}

/* --- 10. BOOK DETAIL PAGE STYLES --- */

.book-cover-area img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.book-synopsis-area {
    flex: 2; 
}

.book-metadata {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    border-top: 2px dashed #666;
    padding-top: 1rem;
}

.book-metadata li {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}


.book-detail-grid {
    display: flex;
    gap: 4rem;
    padding: 3rem 0;
}

.book-cover-area {
    flex: 1; /* Photo area takes 1/3 of space */
    text-align: center;
}

.book-synopsis-area {
    flex: 2; /* Text area takes 2/3 of space */
}

.book-metadata {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    border-top: 2px dashed #666; /* Dashed line for a printed receipt look */
    padding-top: 1rem;
}

.book-metadata li {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    .book-detail-grid {
        flex-direction: column;
    }
}

/* --- 11. BLOG / NEWS WIRE STYLES --- */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.news-card {
    background-color: #ffffff;
    border: 2px solid var(--primary-noir); /* Thick black border */
    padding: 1.5rem;
    position: relative;
    /* Hard shadow for that "stack of paper" look */
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2); 
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--secondary-noir);
    text-transform: uppercase;
    border-bottom: 2px dashed #ccc; /* Perforated line look */
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.news-headline {
    font-family: var(--font-headline);
    font-size: 1.6rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.news-excerpt {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.read-more-link {
    display: inline-block;
    background: var(--primary-noir);
    color: #fff; /* White text */
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
}

.read-more-link:hover {
    background: var(--secondary-noir);
    color: #fff;
}