/*Theme Name: EmoAll Theme
Theme URI: https://emoall.com
Description: A WordPress theme inspired by emoall.com for meme dictionary website
Author: AI Assistant
Version: 1.0
Text Domain: emoall-theme
*/

/* 
 * This file is the main stylesheet file for the WordPress theme
 * Specific styles have been separated into corresponding files in the css/ directory
 * The system will automatically load the corresponding CSS and JS files based on the current template
 * For new layout styles, please check css/layout.css
 */

/* Basic reset styles (keeping some necessary base styles) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Link styles, excluding specific buttons */
a:not(.topic-more-link) {
    text-decoration: none;
    color: #007bff;
}

a:not(.topic-more-link):hover {
    color: #0056b3;
}

/* Container */
.container {
    max-width: 1410px; /* Also changed to 1410px for consistency */
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Main Layout */
.main-content {
    display: flex;
    gap: 30px;
    min-height: calc(100vh - 120px);
    align-items: flex-start;
    padding: 0;
    width: 100%;
}

.content-area {
    flex: 1; /* Use flex: 1 instead of fixed width for more flexibility */
    max-width: 830px; /* Set maximum width */
    min-width: 0; /* Prevent overflow */
    margin: 0 auto; /* Center content area */
    display: flex;
    flex-direction: column;
    gap: 30px; /* Add gap to control module spacing */
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

/* Module styles within content area, excluding topic pages */
.content-area > section:not(.site-intro):not([style*="background: #ffffff"]),
.content-area > .content-module,
.content-area > article {
    border-radius: 8px;
    margin: 0; /* Remove margin, use gap to control spacing */
}

/* Internal element styles within content area */
.content-area h1,
.content-area h2,
.content-area h3 {
    margin-bottom: 1rem;
    color: #333;
}

.content-area p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

/* Ensure flex layout works properly */
.standalone-menu,
.sidebar {
    flex-shrink: 0;
    align-self: flex-start; /* Ensure sidebar aligns to top */
}

/* Breadcrumb Navigation Styles */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    color: #6c757d;
}

.breadcrumb .current {
    color: #6c757d;
    font-weight: bold;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        width: 100%;
        padding: 0 15px; /* Keep left and right padding to ensure alignment */
    }
    
    .main-content {
        gap: 20px;
    }
    
    .content-area {
        max-width: calc(100% - 550px); /* Subtract width space for left and right sidebars */
        width: 100%;
    }
}

@media (max-width: 1100px) {
    .container {
        max-width: 100%;
        width: 100%;
        padding: 0 15px; /* Keep left and right padding to ensure alignment */
    }
    
    .main-content {
        flex-direction: column;
        padding: 0;
        width: 100%;
    }
    
    .content-area {
        max-width: 100%;
        width: 100%;
        margin: 0;
        gap: 30px;
    }
    
    .content-area > section,
    .content-area > .content-module,
    .content-area > article {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    .container {
        max-width: 100%;
        width: 100%;
        padding: 0; /* Remove left and right padding */
    }
    
    .main-content {
        padding: 0;
        gap: 20px;
        width: 100%;
    }
    
    .content-area {
        gap: 20px;
        width: 100%;
    }
    
    .content-area > section:not(.site-intro),
    .content-area > .content-module,
    .content-area > article {
        padding: 1rem;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    
    .breadcrumb {
        padding: 0.75rem;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0; /* Remove padding */
        max-width: 100%;
        width: 100%;
    }
    
    .main-content {
        gap: 15px;
    }
    
    .content-area {
        gap: 15px;
    }
    
    .content-area > section,
    .content-area > .content-module,
    .content-area > article {
        padding: 0.75rem;
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
}

.pagination .page-numbers:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .page-numbers.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Ensure all pages have responsive base styles */
* {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Ad Base Styles */
.emoall-ad-wrapper {
    clear: both;
    text-align: center;
    margin: 0;
    padding: 0;
}

.emoall-ad-wrapper img.emoall-ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Mobile Ad Styles */
@media (max-width: 768px) {
    .emoall-ad-wrapper {
        margin: 0;
        padding: 0;
    }
    
    .emoall-ad-wrapper img.emoall-ad-image {
        border-radius: 4px;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    }
}