/* 
 * CareerGlow - Job Detail Specific Styling (job.css)
 * Tailored layout, responsive classes, and custom components for job.php.
 */

/* Job Detail Page Grid */
.job-detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

/* Main Content Card */
.job-main-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

/* Detail Page Header Card Content */
.detail-header-wrapper {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
    margin-bottom: 30px;
}

/* Flex layout inside detail header */
.detail-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

/* Text block in header flex */
.detail-header-text {
    flex: 1 1 auto;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    color: var(--text-primary);
    word-break: break-word;
}

.job-company-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.job-company-name a:hover {
    color: var(--primary-color);
}

/* Premium Company Logo Wrapper */
.company-logo-wrapper {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.company-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.company-logo-wrapper .company-logo-placeholder {
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--primary-color);
}

/* Metadata lists */
.detail-meta-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.98rem;
    color: var(--text-secondary);
}

.detail-meta-item svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.detail-meta-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Apply button container */
.detail-apply-wrapper {
    margin-top: 30px;
}

/* Sidebar structure */
.job-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 0;
    width: 100%;
}

.sidebar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    min-width: 0;
    max-width: 100%;
}

.sidebar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--text-primary);
}

/* Responsive pre formatting inside sidebar */
.sidebar-card pre {
    font-size: 0.75rem;
    background-color: var(--bg-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    max-height: 250px;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;       /* Wrap lines instead of scrolling */
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;       /* Break very long keys/values */
    font-family: 'Courier New', Courier, monospace;
}

/* Job Description area styling */
.job-body {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.85;
    word-break: break-word;
    overflow-wrap: break-word;
}

.job-body * {
    color: inherit;
}

.job-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.job-body h2, .job-body h3, .job-body h4, .job-body h5, .job-body h6 {
    color: var(--text-primary);
    margin: 28px 0 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

.job-body h2 { font-size: 1.6rem; }
.job-body h3 { font-size: 1.4rem; }
.job-body h4 { font-size: 1.2rem; }

.job-body p {
    margin-bottom: 16px;
}

.job-body ul, .job-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.job-body li {
    margin-bottom: 8px;
}

/* Responsive Overrides */

/* Tablet (Portrait & Landscape collapse) */
@media (max-width: 992px) {
    .job-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .job-main-card {
        padding: 24px;
    }

    .detail-header-flex {
        flex-direction: column-reverse; /* Put logo above details or text flows logically */
        align-items: flex-start;
        gap: 16px;
    }

    .company-logo-wrapper {
        width: 70px;
        height: 70px;
        border-radius: var(--radius-md);
    }
    
    .company-logo-wrapper .company-logo-placeholder {
        font-size: 1.8rem;
    }

    .detail-title {
        font-size: 1.75rem;
    }

    /* Force all action buttons on mobile to be 100% width and center aligned */
    .detail-header-wrapper .btn,
    .sidebar-card .btn,
    .job-body .btn {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        padding: 14px 20px !important;
    }
    
    .detail-apply-wrapper {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .detail-title {
        font-size: 1.5rem;
    }
    
    .job-main-card {
        padding: 18px;
    }
    
    .sidebar-card {
        padding: 20px;
    }
}
