/*
 Theme Name:   GeneratePress Child - AsahiDes
 Theme URI:    https://asahides.com
 Description:  Custom Child Theme for Job Board & E-Book Store with WCAG 2.1 Accessibility & Modern Layouts
 Author:       Usama Sulaiman
 Template:     generatepress
 Version:      1.0.2
 Text Domain:  generatepress-child
*/

/* ==========================================================================
   1. Accessibility & Screen Readers (WCAG 2.1)
   ========================================================================== */

/* Standard Accessible Hidden Class */
.screen-reader-text {
    border: 0 !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 4px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    -webkit-clip-path: none !important;
    clip-path: none !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto !important;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto !important;
    z-index: 100000;
}

/* Clear Outline Focus for Keyboard Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #1d4ed8 !important;
    outline-offset: 3px !important;
}

/* ==========================================================================
   2. Layout Container & GeneratePress Overrides
   ========================================================================== */

/* Full Width Override for Child Theme Template Pages */
.search .site-content,
.search #primary,
.page-template-front-page .site-content,
.page-template-front-page #primary,
.home .site-content,
.home #primary {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

.job-board-archive-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Page Header */
.job-archive-header {
    text-align: center;
    margin-bottom: 40px;
}

.job-archive-header h1 {
    font-size: 2.5rem;
    color: #111827;
    margin-bottom: 10px;
    font-weight: 700;
}

.job-archive-header p {
    font-size: 1.1rem;
    color: #4b5563;
}

/* ==========================================================================
   3. Filter & Search Bar Components
   ========================================================================== */

.job-filter-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 40px;
}

.job-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.field-wrapper-keyword {
    flex: 2 1 250px;
}

.field-wrapper-select {
    flex: 1 1 200px;
}

.job-filter-form input[type="text"],
.job-filter-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.job-filter-form input[type="text"]:focus,
.job-filter-form select:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.job-filter-btn {
    padding: 12px 28px;
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

a.job-filter-btn {
    text-decoration: none;
    color: #ffffff;
    display: inline-block;
}

.job-filter-btn:hover {
    background-color: #1e40af;
}

.job-filter-btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   4. Job Card Components
   ========================================================================== */

.jobs-list-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.job-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.job-card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px);
}

.job-card .job-info {
    flex: 1 1 500px;
}

.job-card .badge-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.country-badge,
.type-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.country-badge {
    background: #eff6ff;
    color: #1e40af;
}

.type-badge {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
}

.job-card h2 {
    font-size: 1.3rem;
    margin: 0 0 6px 0;
    color: #111827;
    font-weight: 600;
}

.job-card h2 a {
    text-decoration: none;
    color: inherit;
}

.job-card .job-meta {
    color: #4b5563;
    font-size: 14px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.job-card .job-meta .company-name {
    font-weight: 500;
    color: #374151;
}

.job-card .job-action a {
    display: inline-block;
    padding: 10px 20px;
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.job-card .job-action a:hover {
    background-color: #1e40af;
}

.job-card .job-action a:active {
    transform: scale(0.98);
}

/* Fix Oversized Icons & Emojis inside Cards */
.job-card img,
.job-info img,
.job-card .emoji {
    width: 1.1em !important;
    height: 1.1em !important;
    max-width: 20px !important;
    max-height: 20px !important;
    vertical-align: -0.15em !important;
    display: inline-block !important;
    object-fit: contain !important;
}

/* Empty State Box */
.no-jobs-found {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.no-jobs-found h2,
.no-jobs-found h3 {
    font-size: 1.5rem;
    color: #111827;
    margin-bottom: 8px;
}

.no-jobs-found p {
    color: #4b5563;
}

/* ==========================================================================
   5. Custom Pagination Styling
   ========================================================================== */

.job-pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.job-pagination-nav .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.job-pagination-nav .page-numbers:hover {
    border-color: #1d4ed8;
    color: #1d4ed8;
    background-color: #eff6ff;
}

.job-pagination-nav .page-numbers.current {
    background-color: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    cursor: default;
}

.job-pagination-nav .page-numbers.dots {
    border: none;
    background: transparent;
    color: #9ca3af;
}

/* ==========================================================================
   6. Site Branding Header Alignment
   ========================================================================== */

.site-header .inside-header {
    display: flex;
    align-items: center;
}

.site-branding-container {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.site-branding-container .site-logo {
    margin-right: 0.2em;
}

.site-header .header-image {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
    margin-right: 0 !important;
}

.site-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-title {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.main-title a {
    color: #111827 !important;
    text-decoration: none !important;
}

.site-description {
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    margin: 2px 0 0 0 !important;
}

/* ==========================================================================
   7. Responsive & Mobile Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .job-filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .field-wrapper-keyword,
    .field-wrapper-select,
    .job-filter-btn {
        width: 100% !important;
        flex: 1 1 100% !important;
    }

    .job-card {
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 16px !important;
        gap: 12px !important;
    }

    .job-card .job-info {
        flex: none !important;
        width: 100% !important;
    }

    .job-card .job-action {
        margin-top: 5px !important;
        width: 100% !important;
    }

    .job-card .job-action a {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 12px 16px !important;
        box-sizing: border-box;
    }

    .site-branding-container {
        gap: 10px !important;
    }
    
    .site-header .header-image {
        width: 40px !important;
        height: 40px !important;
    }
    
    .main-title {
        font-size: 1.2rem !important;
    }

    .job-pagination-nav .page-numbers {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* ==========================================================================
   8. Emoji & Flag Icon Sizing Fix
   ========================================================================== */

/* Target WordPress Twemoji Images Globally within Cards and Badges */
img.emoji,
.country-badge img,
.job-meta img,
.single-job-header img {
    width: 1em !important;
    height: 1em !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 4px 0 0 !important;
    vertical-align: -0.15em !important;
    display: inline-block !important;
    object-fit: contain !important;
}

/* Badge Layout Constraints */
.country-badge,
.type-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    white-space: nowrap;
}

.country-badge {
    background: #eff6ff;
    color: #1e40af;
}

.type-badge {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 500;
}

/* Single Job Header Fixes */
.single-job-header {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.single-job-header h1 {
    font-size: 2.2rem;
    color: #111827;
    margin: 0 0 10px 0;
    font-weight: 700;
    line-height: 1.2;
}

.single-job-meta {
    color: #4b5563;
    font-size: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.back-to-jobs-link {
    text-decoration: none;
    color: #1d4ed8;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

/* ==========================================================================
   10. Single Job Template Styling
   ========================================================================== */

.single-job-wrapper {
    max-width: 900px;
}

.single-job-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    line-height: 1.8;
    font-size: 16px;
    color: #374151;
}

.single-job-card h2 {
    font-size: 1.4rem;
    color: #111827;
    margin-bottom: 15px;
    font-weight: 600;
}

.single-job-apply-section {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.single-job-apply-section h3 {
    font-size: 1.25rem;
    color: #111827;
    margin-bottom: 15px;
    font-weight: 600;
}

.asahi-job-newsletter-wrapper {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e5e7eb;
}

/* ==========================================================================
   9. Page 404 Layout & Component Styling
   ========================================================================== */

.error-404-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-404-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    box-sizing: border-box;
}

.error-404-card {
    text-align: center;
    background: #ffffff;
    padding: 50px 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.error-404-card .error-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.error-404-card h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.error-404-card p {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 30px;
}