/*
Theme Name: Judd Halvern True Crime
Description: Custom WordPress theme for true crime author Judd Halvern. Dark, atmospheric design inspired by investigative journalism and noir aesthetics.
Author: Claude AI
Version: 1.0
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #f5f5f5;
    background: #0d0d0d;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.5rem;
}

.subtitle {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #8b0000;
    font-size: 0.9rem;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.site-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-logo:hover {
    color: #8b0000;
    transition: color 0.3s ease;
}

.tagline {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 0.25rem;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: #f5f5f5;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: relative;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #8b0000;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav a:hover::before {
    width: 100%;
}

.main-nav a:hover {
    color: #8b0000;
}

/* Main Content */
.main-content {
    margin-top: 100px;
    min-height: calc(100vh - 100px);
}

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

/* Hero Section */
.hero {
    min-height: 70vh;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(26,26,26,0.6) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="0.5" fill="%23333" opacity="0.1"/><circle cx="80" cy="40" r="0.3" fill="%23333" opacity="0.1"/><circle cx="40" cy="80" r="0.4" fill="%23333" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><path d="M100,100 Q500,50 900,100 Q850,500 900,900 Q500,850 100,900 Q150,500 100,100" fill="none" stroke="rgba(139,0,0,0.05)" stroke-width="2"/></svg>');
    background-size: 100% 100%;
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    animation: fadeInUp 1s ease-out;
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-description {
    font-size: 1.3rem;
    color: #cccccc;
    margin-bottom: 3rem;
    line-height: 1.8;
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #8b0000, #660000);
    color: #ffffff;
    padding: 1rem 2.5rem;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.9s both;
}

.cta-button:hover {
    background: linear-gradient(45deg, #a50000, #8b0000);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Books Section */
.books-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a1a 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.section-subtitle {
    color: #8b0000;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

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

.book-item {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    border: 1px solid rgba(139, 0, 0, 0.2);
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 0, 0, 0.3);
    border-color: rgba(139, 0, 0, 0.4);
}

.book-cover {
    width: 100%;
    height: 450px;
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Background image approach - much more reliable */
.book-cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.book-cover:hover .book-cover-bg {
    transform: scale(1.05);
}

/* Hide the img tags when using background approach */
.book-cover img {
    display: none;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect width="100" height="100" fill="url(%23bookTexture)"/><defs><pattern id="bookTexture" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><rect width="20" height="20" fill="%23222"/><rect x="0" y="0" width="1" height="20" fill="%23333"/></pattern></defs></svg>');
    opacity: 0.3;
}

.book-cover-placeholder {
    color: #666;
    font-size: 1rem;
    text-align: center;
    z-index: 2;
    position: relative;
}

.book-content {
    padding: 2rem;
}

.book-title {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.book-description {
    color: #cccccc;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.book-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.book-link {
    background: linear-gradient(45deg, #8b0000, #660000);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.book-link:hover {
    background: linear-gradient(45deg, #a50000, #8b0000);
    transform: translateY(-1px);
}

.coming-soon {
    background: rgba(139, 0, 0, 0.2);
    border-color: rgba(139, 0, 0, 0.5);
}

.coming-soon .book-link {
    background: linear-gradient(45deg, #666, #444);
    cursor: not-allowed;
}

.coming-soon .book-link:hover {
    background: linear-gradient(45deg, #666, #444);
    transform: none;
}

/* About Section */
.about-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    margin-bottom: 2rem;
}

.about-text p {
    color: #cccccc;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-text .subtitle {
    margin-bottom: 1rem;
}

/* Newsletter Section */
.newsletter-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(139,0,0,0.1) 0%, rgba(0,0,0,0.9) 100%);
    text-align: center;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-input {
    background: rgba(26, 26, 26, 0.8);
    border: 2px solid rgba(139, 0, 0, 0.3);
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

.newsletter-input:focus {
    outline: none;
    border-color: #8b0000;
}

.newsletter-input::placeholder {
    color: #666;
}

.newsletter-submit {
    background: linear-gradient(45deg, #8b0000, #660000);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-submit:hover {
    background: linear-gradient(45deg, #a50000, #8b0000);
}

/* Footer */
.site-footer {
    background: #000000;
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(139, 0, 0, 0.3);
}

.footer-content {
    text-align: center;
    color: #666;
}

.footer-content p {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: #8b0000;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.footer-links a:hover {
    color: #ffffff;
}

/* Affiliate Disclosure */
.affiliate-disclosure {
    background: rgba(139, 0, 0, 0.1);
    border: 1px solid rgba(139, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 3rem 0;
    color: #cccccc;
    font-size: 0.9rem;
    line-height: 1.6;
}

.affiliate-disclosure h4 {
    color: #8b0000;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Toggle Button - Hidden on Desktop */
.site-header .mobile-menu-toggle {
    display: none;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    /* Header layout for mobile */
    .site-header .header-container {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
    
    /* Show hamburger on mobile */
    .site-header .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1002;
        position: relative;
    }
    
    .site-header .mobile-menu-toggle .hamburger-line {
        display: block;
        width: 30px;
        height: 3px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* Hamburger animation when open */
    .site-header .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .site-header .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .site-header .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hide nav by default on mobile */
    .site-header .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1001;
    }
    
    /* Show nav when menu is open */
    .site-header .main-nav.is-open {
        display: flex;
    }
    
    .site-header .main-nav ul {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .site-header .main-nav a {
        font-size: 1.5rem;
        padding: 1rem 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-input {
        min-width: auto;
        width: 100%;
        max-width: 400px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .book-content {
        padding: 1.5rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        text-align: center;
    }
}

/* WordPress Specific Styles */
.wp-block-group,
.wp-block-columns {
    max-width: none;
}

.aligncenter {
    text-align: center;
}

.alignleft {
    float: left;
    margin: 0 2rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 2rem;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-red { color: #8b0000; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none; }

/* Custom Fonts - Google Fonts will be enqueued in functions.php */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+Pro:wght@300;400;600&family=Oswald:wght@300;400;600&display=swap');
