/*
Theme Name: OtakuTechie
Description: Custom responsive theme for anime and tech reviews website
Version: 2.0
Author: OtakuTechie
*/

/* Basic Styles & Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif; /* Using 'Inter' as enqueued in functions.php */
    line-height: 1.6;
    color: #333;
    background: #fff;
    padding-top: 80px; /* Space for fixed header */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Prevent scrolling when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Header Styles */
.site-header {
    background: rgba(0, 0, 0, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out; /* For header-hidden class */
}

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

.site-logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    z-index: 1001; /* Ensure logo is above toggle */
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none; /* Hidden by default, shown in media queries */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001; /* Ensure toggle is above navigation */
    padding: 0.5rem; /* Add padding for easier tapping */
}

/* Navigation Styles */
.main-navigation {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: block;
}

.main-navigation a:hover {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    transform: translateY(-2px);
}

/* Active navigation link styling */
.main-navigation .nav-menu .current-menu-item > a,
.main-navigation .nav-menu .current_page_item > a {
    background: rgba(78, 205, 196, 0.3); /* Slightly different highlight */
    color: #4ecdc4;
    font-weight: bold;
}

/* Header Search Styles */
.header-search {
    position: relative;
    margin-left: 2rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(78, 205, 196, 0.5);
}

.search-field {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    width: 200px;
    font-size: 0.9rem;
    outline: none;
}

.search-field::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-submit {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-submit:hover {
    color: #4ecdc4;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 100;
}

.search-results-dropdown li {
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-results-dropdown li:last-child {
    border-bottom: none;
}

.search-results-dropdown a {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s ease;
}

.search-results-dropdown a:hover {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 2rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: fadeInUp 1s ease;
}

.hero-content p {
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 2rem;
    max-width: 600px;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease 0.4s both;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 3rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: fit-content;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.post-thumbnail {
    height: 200px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 1.5rem;
}

.post-category {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 1rem;
    text-decoration: none;
}

.post-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #4ecdc4;
}

.post-excerpt {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.read-more {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    margin-top: 1rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Single Post / Page Styles */
.single-post {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.single-post .post-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    text-align: center;
    color: #333;
}

.single-post .post-meta {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 2rem;
}

.single-post .post-meta span {
    margin: 0 0.5rem;
}

.post-content-single {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.post-content-single img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.5rem 0;
    display: block;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-content-single h2,
.post-content-single h3,
.post-content-single h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.post-content-single ul,
.post-content-single ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.post-content-single li {
    margin-bottom: 0.5rem;
}

/* Ad Space */
.ad-space {
    background: #f0f0f0;
    padding: 2rem;
    text-align: center;
    margin: 3rem auto;
    border-radius: 10px;
    border: 1px dashed #ccc;
    color: #777;
    font-style: italic;
}

.ad-space small {
    display: block;
    margin-top: 0.5rem;
}

/* Footer Styles */
.site-footer {
    background: #222;
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: left;
}

.footer-section h3 {
    color: #4ecdc4;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p,
.footer-section ul {
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #4ecdc4;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

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

/* Scroll effects */
.site-header.scrolled {
    background: rgba(0, 0, 0, 0.8); /* Slightly more opaque when scrolled */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}


/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 9999;
    font-size: 1rem;
}

.skip-link:focus {
    top: 0;
    left: 0;
    text-decoration: none;
}

/* Screen reader text for accessibility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block; /* Show the toggle button */
    }

    .main-navigation {
        position: absolute;
        top: 100%; /* Position below the header */
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        transform: translateY(-100%); /* Hidden by default */
        transition: transform 0.3s ease-in-out;
        opacity: 0;
        pointer-events: none; /* Prevent interaction when hidden */
    }

    .main-navigation.active {
        transform: translateY(0); /* Slide in */
        opacity: 1;
        pointer-events: auto; /* Enable interaction */
    }

    .main-navigation ul {
        flex-direction: column;
        text-align: center;
        gap: 0; /* Remove gap for vertical menu */
    }

    .main-navigation li {
        width: 100%;
    }

    .main-navigation a {
        padding: 1rem 2rem;
        border-radius: 0; /* Remove border-radius for full-width items */
    }

    .header-container {
        padding: 0 1rem; /* Adjust header padding */
        flex-wrap: wrap;
    }

    .header-search {
        display: none; /* Hide search on mobile - can be toggled if needed */
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .btn {
        display: block;
        margin: 0.5rem auto;
        max-width: 200px;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    body {
        padding-top: 60px; /* Adjust for smaller header */
    }

    .site-logo {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .post-title {
        font-size: 1.2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .single-post {
        padding: 1.5rem;
    }
}
