/*
Theme Name: Educational App Share Theme
Theme URI: https://biasbreak.com/
Author: BiasBreak
Author URI: https://biasbreak.com/
Description: A custom WordPress theme designed for sharing free educational Android applications.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-post-type, educational, app-directory, responsive
Text Domain: appshare
*/

/* --- GLOBAL RESET & OVERFLOW FIXES --- */

/* Ensures padding and border are included within the element's defined width/height */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal scrolling entirely */
html, body {
    overflow-x: hidden; 
    width: 100%;
    margin: 0;
    padding: 0;
}
/* --- Content Container Centering and Readability --- */
.content-area {
    /* Set a maximum width for optimal reading (e.g., 1200px) */
    max-width: 1200px; 
    
    /* Center the container on the screen */
    margin-left: auto;
    margin-right: auto;
    
    /* Add essential padding on the sides for smaller screens */
    padding: 0 20px; 
}

/* Ensure the main content block doesn't inherit full width unnecessarily */
#primary, #main {
    width: 100%;
    margin-bottom: 30px;
}








/* --- HOMEPAGE FULL-WIDTH OVERRIDE --- */

/* Targets the content area only on the static front page (home) */
.home .content-area {
    /* Resets the centering rules applied globally */
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Ensure sections inside are also full width, if they have their own max-widths */
.home .hero-section,
.home .featured-apps-section,
.home .category-browse-section {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* Re-apply side padding ONLY to the grid/cards inside the sections, 
   to stop the inner content from touching the screen edges */
.home .app-directory-grid,
.home .subject-list-grid {
    padding-left: 20px;
    padding-right: 20px;
}













/* --- 6.1 GENERAL STYLES & BRANDING --- */

/* Educational Color Palette */
:root {
    --color-primary: #3DDC84; /* Deep Blue - Trust and Authority */
    --color-accent: #073042;  /* Vibrant Orange - Call-to-Action */
    --color-text: #202124;
    --color-light-gray: #f9f9f9;  
    --color-border: #eeeeee;
}

body {
    background-color: #ffffff;
    color: var(--color-text);
    font-family: 'Roboto', Arial, sans-serif;
}

/* Improve Headings */
h1, h2, h3, h4 {
    color: var(--color-primary);
    line-height: 1.2;
}

/* Base Link Styling */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--color-accent);
}

/* Custom Download Button (Primary CTA) */
.download-button {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--color-accent);
    color: #ffffff !important; 
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 174, 66, 0.4);
    transition: background-color 0.2s, transform 0.1s;
}

.download-button:hover {
    background-color: #ff9900; 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 174, 66, 0.5);
}


/* --- 6.2 SINGLE APP PAGE STYLING --- */

.single-app-page {
    padding: 20px 0;
}

/* App Hero Section (Image/Icon) */
.app-hero {
    margin-bottom: 30px;
    text-align: center;
}
.app-thumbnail img {
    max-width: 250px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* CTA Bar and Specs */
.app-cta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 30px auto; /* Centered */
    max-width: 1200px; /* Optional max width */
    padding: 20px;
    background-color: var(--color-light-gray);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

/* Technical Specs Box */
.app-specs {
    flex-basis: 50%;
    min-width: 300px; 
    padding-left: 30px;
    border-left: 2px solid var(--color-border);
}
.app-specs h4 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--color-text);
}
.app-specs ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.app-specs li {
    padding: 5px 0;
    font-size: 0.95rem;
}
.spec-label {
    font-weight: normal;
    color: #666;
    margin-right: 5px;
}

/* Warning Message */
.download-warning {
    background-color: #fff3cd; 
    color: #856404;
    padding: 15px;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 20px auto;
    max-width: 1200px; /* Optional max width */
}

/* Mobile adjustments for CTA Bar (Single App Page Button Fix) */
@media (max-width: 768px) {
    .app-cta-bar {
        flex-direction: column;
        align-items: stretch;
        padding-left: 15px; /* Add some side padding on mobile */
        padding-right: 15px;
    }
    
    /* FIX: Force button to 100% width within the container */
    .app-cta-bar .download-button {
        width: 100%; 
        display: block;
        margin-bottom: 20px;
    }
    
    .app-specs {
        flex-basis: 100%;
        min-width: auto; /* Allow shrinking */
        margin-top: 20px;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-top: 20px;
    }
}


/* --- 6.3 APP DIRECTORY STYLING --- */

.page-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 20px;
}
.app-count {
    font-size: 1rem;
    color: #666;
    margin-top: 10px;
}

/* Grid Layout */
.app-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    margin: 0 auto 40px; /* Center the grid */
    max-width: 1200px; /* Optional max width */
    padding: 0 20px; /* Add padding to prevent edges from touching viewport */
}

.app-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.app-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.app-card-thumb-link {
    display: block;
    height: 200px; 
    overflow: hidden;
}
.app-card-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-card-content {
    padding: 15px;
    text-align: center;
}

.app-card-title {
    font-size: 1.2rem;
    margin: 5px 0 10px 0;
    height: 2.4em; 
    overflow: hidden;
}

/* Tags/Taxonomies */


.app-meta {
    margin-bottom: 10px;
    font-size: 0.85rem;
}
/* Change the Category Cell Background and Text Color */
.subject-tag, .level-tag {
    background-color: #3ddc84 !important; /* Change this hex code for the cell color */
    color: #ffffff !important;            /* Change this for the text color */
}

/* Ensure the links inside the tags also match the text color */
.subject-tag a, .level-tag a {
    color: #ffffff !important;
    text-decoration: none;
}

.app-card-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    min-height: 40px; 
}

.app-card-cta {
    display: block;
    padding: 8px 15px;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.app-card-cta:hover {
    background-color: var(--color-accent);
    color: #ffffff !important;
}

/* Responsive Grid Adjustments */
@media (max-width: 1024px) {
    .app-directory-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}
@media (max-width: 600px) {
    .app-directory-grid {
        grid-template-columns: 1fr; 
        padding: 0 15px; /* Slightly tighter padding on small screens */
    }
}


/* --- 7.1 HOMEPAGE STYLING (FRONT-PAGE.PHP) --- */

/* Hero Section */
.hero-section {
    background-color: var(--color-primary);
    color: #ffffff;
    text-align: center;
    padding: 60px 20px 80px;
    margin-bottom: 40px;
}
.hero-section h1 {
    color: #ffffff;
    font-size: 2.5rem;
    margin-bottom: 10px;
}
.hero-section .tagline {
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}
.hero-cta {
    background-color: #ffffff; 
    color: var(--color-primary) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.hero-cta:hover {
    background-color: var(--color-accent);
    color: #ffffff !important;
}

/* FIX: Responsive Homepage Button (Browse All Apps) */
@media (max-width: 600px) {
    .hero-section {
        padding: 40px 15px 50px;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-cta { 
        display: block;
        width: 90%;
        max-width: 350px; /* Prevents button from getting too wide on tablets */
        margin: 20px auto; 
        padding: 12px 10px; 
        font-size: 1.1rem; 
        text-align: center;
    }
}

/* Featured Apps Section */
.featured-apps-section {
    padding: 40px 0;
    text-align: center;
}
.featured-apps-section h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Category Browse Section */
.category-browse-section {
    padding: 40px 0 60px;
    text-align: center;
    background-color: var(--color-light-gray);
}
.category-browse-section h2 {
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Subject Card Grid */
.subject-list-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.subject-card {
    display: block;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.3s, transform 0.3s;
}

.subject-card:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    text-decoration: none;
}

.subject-card h3 {
    margin: 10px 0 5px;
    font-size: 1.1rem;
}

.subject-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.subject-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

/* Responsive adjustments for category grid */
@media (max-width: 1024px) {
    .subject-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 600px) {
    .subject-list-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 15px;
    }
}


/* --- 8.2 HEADER & NAVIGATION STYLING --- */

/* Fix the mobile menu padding collision on flex container */
@media screen and (max-width: 900px) {
    .site-header {
        padding: 10px 20px; /* Reduced padding for mobile header */
    }
}

.site-header {
    /* Use flexbox to align branding (left) and nav (right) */
    display: flex;  
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; 
    
    position: relative;
    width: 100%;
    
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    padding: 10px 40px; /* Default desktop padding */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.site-branding {
    display: inline-block;
    padding: 10px 0; /* Removed padding to rely on site-header padding */
    float: none; 
    clear: none;
}
.site-branding .site-title a {
    color: var(--color-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Primary Navigation Menu */
.main-navigation {
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    padding-right: 0; /* Rely on site-header padding */
    float: none;
    clear: none;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    display: inline-block;
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--color-text);
    text-transform: uppercase;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.main-navigation a:hover {
    background-color: var(--color-light-gray);
    color: var(--color-primary);
}

/* Highlight the link to the main app directory */
.menu-item-type-post_type_archive a[href*="app"] {
    font-weight: 700;
    color: var(--color-primary);
    border-bottom: 3px solid var(--color-accent);
}

/* Hide the Underscores default toggle button on desktop */
.menu-toggle {
    display: none;  
}

/* Mobile adjustments (show toggle, stack items) */
@media screen and (max-width: 900px) {
    .site-header {
        /* This rule is now redundant due to the general site-header flex rule above */
    }
    .main-navigation {
        padding-right: 0;
    }
    .main-navigation ul {
        display: none; 
        position: absolute;
        top: 100%;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid var(--color-border);
        z-index: 100;
    }
    .main-navigation.toggled ul {
        display: block; 
    }
    .main-navigation li {
        display: block;
        border-bottom: 1px solid var(--color-light-gray);
    }
    .menu-toggle {
        display: block; 
    }
}




/* Mobile adjustments (show toggle, stack items) */
@media screen and (max-width: 900px) {
    /* ... existing rules ... */
    .menu-toggle {
        display: block; 
        font-size: 1.5rem; /* Makes the icon larger and more visible */
        line-height: 1; 
        padding: 5px 10px; /* Adjust padding if needed */
    }
    /* ... existing rules ... */
}











/* --- 9.2 FOOTER STYLING --- */

.site-footer {
    background-color: #3DDC84;
    color: #000000;
    padding: 30px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.site-info {
    text-align: center;
}

/* Footer Menu Styling (Secondary Navigation) */
.footer-menu-area ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px;
}
.footer-menu-area li {
    display: inline-block;
    padding: 0 10px;
    border-right: 1px solid #666;
}
.footer-menu-area li:last-child {
    border-right: none;
}
.footer-menu-area a {
    color: #cccccc;
}
.footer-menu-area a:hover {
    color: var(--color-accent);
}

.copyright-info {
    margin-top: 15px;
}



/* --- APK Installation Guide Page Styling --- */
.guide-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.guide-page .entry-content ol {
    counter-reset: item;
    list-style: none;
    padding-left: 0;
}

.guide-page .entry-content ol li {
    margin-bottom: 25px;
    border-left: 4px solid var(--color-accent);
    padding-left: 15px;
}

.guide-page .entry-content ol li h3 {
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-top: 0;
}

.sub-steps {
    list-style: disc;
    margin-top: 10px;
    padding-left: 20px;
}

.note-box {
    background-color: var(--color-light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid var(--color-border);
}
.security-note {
    background-color: #fff3cd; 
    border-color: #ffeeba;
    color: #856404;
}



/* Container for alignment */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Post Hero Section */
.post-hero {
    background-color: #f8f9fa;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.post-hero .entry-title {
    font-size: 2.5rem;
    color: #1a1a1a;
    line-height: 1.2;
    margin: 10px 0 20px;
}

.post-categories a {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #0073aa;
    text-decoration: none;
}

.entry-meta {
    font-size: 0.9rem;
    color: #666;
}

/* Featured Image */
.post-featured-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* Content Typography */
.entry-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

.entry-content p {
    margin-bottom: 1.5em;
}

/* Navigation Links */
.post-navigation {
    border-top: 1px solid #eee;
    margin-top: 50px;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
}

.nav-label {
    display: block;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
}

.nav-title {
    font-weight: bold;
    color: #0073aa;
    text-decoration: none;
}

/* Comments Section */
.comments-area {
    margin-top: 60px;
    padding: 40px;
    background: #fff;
    border-top: 2px solid #f0f0f0;
}
/* Layout Wrapper */
.archive-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding-top: 50px;
    padding-bottom: 50px;
}

#primary {
    flex: 1;
    min-width: 0; /* Fixes grid overflow */
}

/* Header */
.archive-header {
    margin-bottom: 40px;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 20px;
}

.archive-header .page-title {
    font-size: 2rem;
    color: #1a1a1a;
    text-transform: capitalize;
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.grid-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.grid-item .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.grid-item .entry-title {
    font-size: 1.25rem;
    margin: 10px 0;
}

.grid-item .entry-title a {
    color: #333;
    text-decoration: none;
}

.grid-item .entry-title a:hover {
    color: #0073aa;
}

.entry-summary {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Buttons */
.read-more .button {
    font-size: 0.85rem;
    font-weight: bold;
    color: #0073aa;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 50px;
    text-align: center;
}

.pagination-wrapper .nav-links {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pagination-wrapper a, .pagination-wrapper span {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
}

.pagination-wrapper .current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Sidebar sizing */
#secondary {
    width: 300px;
}

@media (max-width: 900px) {
    #secondary {
        width: 100%;
    }
}