/* ==========================================================
   careerpathatlas — Company Profile Page
   File: assets/css/company_view.css
   Scope: Company hero, profile details, job cards and layout
   ========================================================== */

/* -------------------- DESIGN TOKENS -------------------- */
:root {
    --company-primary: #1d4ed8;
    --company-primary-dark: #1e40af;
    --company-accent: #3b82f6;
    --company-background: #f8fafc;
    --company-surface: #ffffff;
    --company-text: #1e293b;
    --company-muted: #64748b;
    --company-border: #e2e8f0;
    --company-soft-blue: #eff6ff;
    --company-radius: 16px;
    --company-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
    --company-shadow-hover: 0 14px 32px rgba(15, 23, 42, 0.13);
    --company-content-width: 1200px;
}

/* -------------------- PAGE BASE -------------------- */
.company-hero,
.company-layout,
.company-hero *,
.company-layout *,
.company-hero *::before,
.company-layout *::before,
.company-hero *::after,
.company-layout *::after {
    box-sizing: border-box;
}

.company-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(42px, 7vw, 76px) 20px;
    color: #ffffff;
    background: linear-gradient(
        120deg,
        var(--company-primary-dark),
        var(--company-primary) 58%,
        var(--company-accent)
    );
}

.company-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(255, 255, 255, 0.15),
            transparent 35%
        );
    pointer-events: none;
}

.company-hero img,
.company-layout img {
    display: block;
    max-width: 100%;
}

.company-layout {
    width: min(
        var(--company-content-width),
        calc(100% - 40px)
    );
    margin: 42px auto 64px;
    display: grid;
    grid-template-columns: minmax(270px, 0.85fr) minmax(0, 2fr);
    align-items: start;
    gap: 32px;
}

/* -------------------- COMPANY HERO -------------------- */
.company-hero .hero-inner {
    width: min(var(--company-content-width), 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.company-hero .hero-inner > img {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    object-fit: contain;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--company-radius);
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.company-hero .hero-inner > div {
    flex: 1 1 260px;
    min-width: 0;
}

.company-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.company-hero .hero-inner p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    line-height: 1.7;
}

/* -------------------- SIDEBAR AND PROFILE CARD -------------------- */
.company-sidebar,
.company-jobs {
    min-width: 0;
}

.company-card {
    padding: 26px;
    overflow-wrap: anywhere;
    text-align: center;
    background: var(--company-surface);
    border: 1px solid var(--company-border);
    border-radius: var(--company-radius);
    box-shadow: var(--company-shadow);
}

.company-card > img {
    width: 110px;
    height: 110px;
    margin: 0 auto 18px;
    padding: 6px;
    object-fit: contain;
    border: 1px solid var(--company-border);
    border-radius: 14px;
    background: #ffffff;
}

.company-card h3 {
    margin: 0 0 14px;
    color: var(--company-text);
    font-size: 1.25rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.company-card > p {
    margin: 0 0 20px;
    color: var(--company-muted);
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: left;
    overflow-wrap: anywhere;
}

/* -------------------- COMPANY INFORMATION -------------------- */
.company-layout .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    text-align: left;
}

.company-layout .info-item {
    min-width: 0;
    padding: 12px;
    background: var(--company-background);
    border: 1px solid var(--company-border);
    border-radius: 10px;
}

.company-layout .info-item label {
    display: block;
    margin-bottom: 6px;
    color: var(--company-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.4;
    text-transform: uppercase;
}

.company-layout .info-item span,
.company-layout .info-item a {
    display: block;
    color: var(--company-text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.company-layout .info-item a {
    color: var(--company-primary);
}

.company-layout .info-item a:hover {
    text-decoration: underline;
}

/* -------------------- ACTION LINKS -------------------- */
.company-layout .btn-outline {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 20px;
    padding: 12px 18px;
    border: 2px solid var(--company-primary);
    border-radius: 10px;
    color: var(--company-primary);
    background: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.company-layout .btn-outline:hover {
    color: #ffffff;
    background: var(--company-primary);
    border-color: var(--company-primary);
}

/* -------------------- JOB LISTING SECTION -------------------- */
.company-jobs {
    padding: 26px;
    background: var(--company-surface);
    border: 1px solid var(--company-border);
    border-radius: var(--company-radius);
    box-shadow: var(--company-shadow);
}

.company-jobs > h2 {
    margin: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--company-border);
    color: var(--company-text);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    line-height: 1.4;
}

/* -------------------- JOB CARDS GRID -------------------- */
.company-jobs .jobs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    margin-top: 24px;
}

.company-jobs .job-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px;
    background: #ffffff;
    border: 1px solid var(--company-border);
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.035);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.company-jobs .job-card:hover {
    transform: translateY(-3px);
    border-color: #bfdbfe;
    box-shadow: var(--company-shadow-hover);
}

.company-jobs .job-card h4 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.company-jobs .job-card h4 a {
    color: var(--company-text);
    text-decoration: none;
}

.company-jobs .job-card h4 a:hover {
    color: var(--company-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -------------------- JOB METADATA -------------------- */
.company-jobs .job-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 7px 0;
    color: var(--company-muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.company-jobs .job-meta > span,
.company-jobs .job-meta > time {
    min-width: 0;
    overflow-wrap: anywhere;
}

.company-jobs .job-meta .tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: var(--company-primary-dark);
    background: #eef2ff;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.5;
}

.company-jobs .view-job {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin-top: auto;
    padding-top: 18px;
    color: var(--company-primary);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.5;
    text-decoration: none;
}

.company-jobs .view-job:hover {
    color: var(--company-primary-dark);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* -------------------- NO OPEN JOBS -------------------- */
.company-jobs .empty-state {
    margin-top: 24px;
    padding: 30px 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: var(--company-muted);
    background: var(--company-background);
    font-size: 0.98rem;
    line-height: 1.8;
    text-align: center;
}

/* -------------------- BACK TO COMPANIES -------------------- */
.company-jobs .back-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 28px;
    padding: 13px 20px;
    border: 1px solid var(--company-primary);
    border-radius: 10px;
    color: #ffffff;
    background: var(--company-primary);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.company-jobs .back-btn:hover {
    color: #ffffff;
    background: var(--company-primary-dark);
    border-color: var(--company-primary-dark);
}

/* -------------------- KEYBOARD ACCESSIBILITY -------------------- */
.company-layout a:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 4px;
    border-radius: 5px;
}

/* -------------------- TABLET -------------------- */
@media (max-width: 1000px) {
    .company-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        margin-top: 30px;
    }

    .company-sidebar {
        width: 100%;
    }

    .company-card {
        text-align: left;
    }

    .company-card > img {
        margin-left: 0;
    }

    .company-layout .info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .company-jobs .jobs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -------------------- MOBILE -------------------- */
@media (max-width: 640px) {
    .company-hero {
        padding: 36px 18px;
    }

    .company-hero .hero-inner {
        align-items: flex-start;
        gap: 18px;
    }

    .company-hero .hero-inner > img {
        flex-basis: 88px;
        width: 88px;
        height: 88px;
        padding: 8px;
        border-radius: 12px;
    }

    .company-hero .hero-inner > div {
        flex-basis: 180px;
    }

    .company-hero h1 {
        font-size: 1.55rem;
    }

    .company-hero .hero-inner p {
        margin-top: 8px;
        font-size: 0.9rem;
    }

    .company-layout {
        width: calc(100% - 28px);
        margin: 22px auto 40px;
        gap: 20px;
    }

    .company-card,
    .company-jobs {
        padding: 20px;
        border-radius: 14px;
    }

    .company-layout .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .company-jobs .jobs-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-top: 18px;
    }

    .company-jobs .job-card {
        padding: 18px;
    }

    .company-jobs > h2 {
        padding-bottom: 14px;
    }
}

/* -------------------- SMALL MOBILE -------------------- */
@media (max-width: 380px) {
    .company-hero .hero-inner {
        flex-direction: column;
    }

    .company-hero .hero-inner > div {
        flex-basis: auto;
        width: 100%;
    }

    .company-layout {
        width: calc(100% - 20px);
    }

    .company-card,
    .company-jobs {
        padding: 15px;
    }

    .company-layout .info-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .company-jobs .job-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* -------------------- REDUCED MOTION -------------------- */
@media (prefers-reduced-motion: reduce) {
    .company-jobs .job-card,
    .company-layout .btn-outline,
    .company-jobs .back-btn {
        transition: none;
    }

    .company-jobs .job-card:hover {
        transform: none;
    }
}
