/*
Theme Name: Job Site
Description: A lightweight WordPress theme for job listings and career guides. Features custom job post types, color themes, and responsive design optimized for speed.
Version: 1.0.0
Author: Your Name
Text Domain: job-site
Domain Path: /languages
*/

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Custom Properties for Theme Colors */
:root {
    --brand-color: #3366cc;
    --text-color: #333333;
    --muted-color: #666666;
    --background-color: #ffffff;
    --border-color: #e0e0e0;
    --hover-color: #225599;
}

/* Color Theme Variations */
.theme-blue {
    --brand-color: #3366cc;
    --hover-color: #225599;
}

.theme-green {
    --brand-color: #28a745;
    --hover-color: #1e7e34;
}

.theme-orange {
    --brand-color: #fd7e14;
    --hover-color: #dc6502;
}

/* Typography */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-georgia {
    font-family: Georgia, serif;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

.content-area {
    flex: 1;
}

.sidebar {
    flex: 0 0 300px;
}

/* Header Styles */
.site-header {
    background: #ff6600; /* changed to solid orange per request */
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Navigation Styles */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation .primary-menu-list {
    list-style: none;
    display: flex;
    gap: 24px;
}

.main-navigation .primary-menu-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 8px 6px;
}

.main-navigation .primary-menu-list a:hover,
.main-navigation .primary-menu-list a:focus {
    color: white;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle .hamburger {
    width: 24px;
    height: 2px;
    background: white;
    display: block;
    position: relative;
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: white;
}

.mobile-menu-toggle .hamburger::before { top: -7px; }
.mobile-menu-toggle .hamburger::after { top: 7px; }

.site-title {
    font-size: 32px; /* increased by 4px */
    font-weight: bold;
    color: var(--background-color); /* ensure contrast on colored header */
    text-decoration: none;
}

.site-description {
    font-size: 14px;
    color: var(--muted-color);
    margin-top: 5px;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--brand-color);
}

/* Make header menu links light colored to contrast with the orange header */
.site-header .main-navigation .primary-menu-list a {
    color: var(--background-color);
}
.site-header .main-navigation .primary-menu-list a:hover {
    background: rgba(255,255,255,0.08);
}

/* Ensure major content blocks have explicit white background to avoid inheriting header/brand color */
.card,
.job-card,
.post-summary,
.widget,
.entry-content,
.page-header,
.footer-widgets,
.site-footer {
    background-color: var(--background-color);
}

/* When mobile menu opens, ensure menu items have clear background */
.primary-menu-list.mobile-menu-open {
    background: var(--background-color);
    padding: 12px;
    border-radius: 6px;
}
.posts-container { display: flex; flex-direction: column; gap: 18px; }
.post-summary.card { padding: 18px; border: 1px solid var(--border-color); border-radius: 10px; }
.post-summary .entry-header { margin-bottom: 8px; }
.post-summary .entry-content { color: var(--text-color); }

/* Read more button */
.read-more.button-ghost{ display:inline-block; padding:10px 16px; border-radius:8px; border:1px solid var(--brand-color); color:var(--brand-color); text-decoration:none; font-weight:600; margin-top:12px; }
.read-more.button-ghost:hover{ background:var(--brand-color); color:var(--background-color); }

/* Pagination styling */
.pagination-wrapper { text-align: center; margin-top: 26px; }
.pagination-wrapper .page-numbers{ display: inline-block; margin: 0 6px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); color: var(--secondary-color); text-decoration: none; }
.pagination-wrapper .page-numbers.current, .pagination-wrapper .page-numbers:hover { background: var(--brand-color); color: var(--background-color); border-color: var(--brand-color); }

@media (max-width: 480px) {
    .read-more.button-ghost{ padding:8px 12px; font-size:14px; }
    .pagination-wrapper .page-numbers{ padding:6px 10px; margin: 0 4px; }
}
.primary-menu-list.mobile-menu-open a {
    color: var(--secondary-color);
}

/* Hero Section */
.hero-header {
    background: linear-gradient(135deg, var(--brand-color), var(--hover-color));
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Job Grid */
.job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.job-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.job-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.job-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--brand-color);
    margin-bottom: 10px;
}

.job-meta {
    color: var(--muted-color);
    font-size: 14px;
    margin-bottom: 15px;
}

.job-excerpt {
    line-height: 1.6;
    margin-bottom: 20px;
}

.job-link {
    display: inline-block;
    background: var(--brand-color);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.job-link:hover {
    background: var(--hover-color);
}

/* Content Styles */
.entry-title {
    font-size: 26px;
    margin-bottom: 16px;
    color: var(--text-color);
    line-height: 1.2;
}

.entry-meta {
    color: var(--muted-color);
    font-size: 14px;
    margin-bottom: 20px;
}

.entry-content {
    line-height: 1.8;
    margin-bottom: 30px;
}

.entry-content h2 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: var(--brand-color);
}

.entry-content h3 {
    font-size: 20px;
    margin: 25px 0 10px;
}

.entry-content p {
    margin-bottom: 15px;
}

/* Sidebar */
.widget {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 8px;
}

.widget-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--brand-color);
    margin-bottom: 15px;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-color);
    text-decoration: none;
}

.widget a:hover {
    color: var(--brand-color);
}

/* Footer */
.site-footer {
    background: #f8f9fa;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        flex: none;
    }
    
    .hero-title {
        font-size: 30px;
    }

    /* Compact post titles on small screens */
    .entry-title {
        font-size: 20px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .job-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile navigation behavior */
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* off-canvas mobile menu: hidden to the right by default, slides in when open */
    .main-navigation .primary-menu-list {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin: 0;
        /* Off-canvas positioning */
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
    width: 86%;
    max-width: 360px;
    padding: 70px 20px 20px 20px; /* leave room for header */
    background: var(--background-color);
    box-shadow: -18px 0 36px rgba(0,0,0,0.14);
    transform: translateX(100%);
    transition: transform 0.36s cubic-bezier(.22,.9,.21,1), visibility 0.36s ease;
        z-index: 9999;
        overflow-y: auto;
    }

    .main-navigation .primary-menu-list.mobile-menu-open {
        transform: translateX(0);
    }

    /* Offcanvas overlay (dim background) */
    .offcanvas-overlay {
        position: fixed;
        inset: 0; /* top:0; right:0; bottom:0; left:0 */
        background: rgba(0,0,0,0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.36s ease, visibility 0.36s ease;
        z-index: 9998;
    }

    /* When offcanvas open, show overlay */
    body.offcanvas-open .offcanvas-overlay {
        opacity: 1;
        visibility: visible;
    }

        /* Prevent page scroll when menu is open */
        body.offcanvas-open { overflow: hidden; }

    /* Close button inside offcanvas panel */
    .offcanvas-close {
    position: absolute;
        top: 12px;
        right: 12px;
        background: transparent;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: var(--text-color);
        cursor: pointer;
        padding: 6px 10px;
    }

    /* When the close button is moved inside the panel, ensure it sits within the panel bounds */
    .main-navigation .primary-menu-list .offcanvas-close {
        right: 12px; /* distance from panel's inner right edge */
    }

/* Hide the close button on larger screens (desktop) where the menu is visible inline */
.offcanvas-close { display: none; }

@media (max-width: 768px) {
    .offcanvas-close { display: block; }
}

    /* SVG close icon animation */
    .offcanvas-close .offcanvas-close-icon { display: block; transition: transform 0.28s ease, opacity 0.28s ease; }
    .offcanvas-close:hover .offcanvas-close-icon { transform: rotate(90deg) scale(1.05); opacity: 0.95; }

    .offcanvas-close:focus { outline: 2px solid var(--brand-color); border-radius: 6px; }

    /* Utility for visually-hidden text used for accessibility */
    .screen-reader-text {
        position: absolute !important;
        height: 1px; width: 1px;
        overflow: hidden;
        clip: rect(1px, 1px, 1px, 1px);
        white-space: nowrap;
    }

    .offcanvas-close:focus { outline: 2px solid var(--brand-color); border-radius: 6px; }
}

/* Ensure featured images and card images don't overflow on small screens */
@media (max-width: 480px) {
    .post-thumbnail img,
    .post-summary img,
    .card-media img,
    .job-thumbnail img {
        width: 100%;
        max-width: 100%;
        height: auto;
        object-fit: cover;
        display: block;
        border-radius: 8px;
    }

    /* Reduce image height on very small devices */
    .card-media img,
    .post-thumbnail img {
        max-height: 200px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--muted-color); }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }

/* Hide author/publisher byline elements if still present */
.byline { display: none !important; }

/* WordPress Core Styles */
.alignleft { float: left; margin-right: 20px; }
.alignright { float: right; margin-left: 20px; }
.aligncenter { display: block; margin: 0 auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--muted-color); }

/* Button Styling */
.wp-element-button {
    border-radius: 8px;
    padding: 10px 16px;
}
