/* ----------------------------------------------------
   GLOBAL VARIABLES - NEW "PROFESSIONAL BLUE" THEME
----------------------------------------------------- */
:root {
    /* Main Brand Colors - Royal Blue / Slate */
    --primary: #2563eb; /* Vivid Royal Blue */
    --primary-hover: #1d4ed8; /* Darker Blue */
    /* Neutrals */
    --dark: #0f172a; /* Deep Navy/Slate (Almost Black) */
    --text: #334155; /* Slate 700 for body text */
    --light: #f8fafc; /* Very light blue-grey background */
    --white: #ffffff;
    /* UI Elements */
    --radius: 8px; /* Tighter, cleaner radius for professional look */
    --small-radius: 4px;
    /* Modern, diffused shadows */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --max-width: 1240px;
}

/* ----------------------------------------------------
   GLOBAL RESET
----------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif; /* Modern Sans */
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    border-radius: var(--small-radius);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

    a:hover {
        color: var(--primary-hover);
    }

/* ----------------------------------------------------
   MAIN LAYOUT
----------------------------------------------------- */
main {
    max-width: var(--max-width);
    margin: 40px auto;
    padding: 0 24px;
}

/* ----------------------------------------------------
   HEADER
----------------------------------------------------- */
header {
    background: var(--white); /* Clean white header */
    color: var(--dark);
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0; /* Subtle divider */
    box-shadow: none; /* Flat look */
    position: sticky;
    top: 0;
    z-index: 50;
}

    header .inner {
        max-width: var(--max-width);
        margin: 0 auto;
        padding: 0 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

/* Logo Badge */
.logo-wrap {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

.logo-badge {
    background: var(--primary); /* Brand colored badge */
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 32px; /* Slightly smaller for pro look */
    width: auto;
    filter: brightness(0) invert(1); /* Force icon white */
}

.site-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

/* Navigation */
header nav a {
    color: var(--text);
    margin: 0 16px;
    font-weight: 500;
    font-size: 0.95rem;
}

    header nav a:hover {
        color: var(--primary);
    }

@media (max-width: 800px) {
    header .inner {
        flex-direction: column;
        gap: 16px;
    }
}

/* ----------------------------------------------------
   FOOTER
----------------------------------------------------- */
footer {
    background: var(--dark);
    color: #94a3b8; /* Muted slate */
    padding: 60px 24px;
    text-align: center;
    margin-top: 80px;
    border-top: 4px solid var(--primary);
}

    footer nav a {
        color: #cbd5e1;
        margin: 0 12px;
        font-size: 0.9rem;
    }

        footer nav a:hover {
            color: var(--white);
        }

/* ----------------------------------------------------
   GRID & CARDS
----------------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0; /* Border instead of shadow */
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: 0.2s;
}

    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow);
        border-color: #cbd5e1;
    }

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 24px;
}

    .card-body h3 {
        margin-top: 0;
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--dark);
        line-height: 1.4;
    }

/* ----------------------------------------------------
   SINGLE PAGES (general)
----------------------------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0 40px 0;
}

    .gallery img {
        border-radius: var(--radius);
    }

h1 {
    color: var(--dark);
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    color: var(--dark);
    margin-top: 48px;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ----------------------------------------------------
   FORMS
----------------------------------------------------- */
form input,
form textarea,
form select {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
    background: #fff;
}

    form input:focus,
    form textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); /* Focus ring */
    }

button {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

    button:hover {
        background: var(--primary-hover);
    }

/* alerts */
.alert {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius);
    display: none;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Spinner */
.spinner {
    margin-top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    border-top: 3px solid var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ----------------------------------------------------
   HOME SECTIONS & FEATURED CARDS
----------------------------------------------------- */
.home-section {
    margin: 4rem 0;
}

.home-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
}

    .home-section-header h2 {
        font-size: 1.75rem;
        margin: 0;
    }

    .home-section-header p {
        color: #64748b;
        font-size: 1rem;
        margin: 0;
    }

.featured-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card--featured {
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card--featured .card-link {
        display: flex;
        flex-direction: column;
        text-decoration: none;
        color: inherit;
        height: 100%;
    }

.card-image-wrapper {
    position: relative;
    overflow: hidden;
}

    .card-image-wrapper img {
        width: 100%;
        height: 240px;
        object-fit: cover;
        display: block;
    }

.card-badge {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    background: rgba(15, 23, 42, 0.85); /* Dark slate background */
    color: #fff;
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.card--featured .card-body {
    padding: 1.5rem;
}

.card--featured h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.card-excerpt {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

.card--featured:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

/* ----------------------------------------------------
   BROWSE PAGE
----------------------------------------------------- */
.browse-search {
    margin: 1rem 0 3rem;
    display: flex;
    gap: 12px;
    background: #fff;
    padding: 12px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-light);
}

    .browse-search input[type="text"] {
        flex: 1;
        padding: 0 12px;
        border: none;
        font-size: 1.1rem;
    }

        .browse-search input[type="text"]:focus {
            box-shadow: none;
        }

    .browse-search button {
        padding: 0 24px;
    }

/* Hero card */
.browse-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: stretch;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.browse-hero__link {
    display: contents;
    text-decoration: none;
    color: inherit;
}

.browse-hero__image {
    order: 2; /* Image on right for modern look */
}

    .browse-hero__image img {
        width: 100%;
        height: 100%;
        min-height: 300px;
        object-fit: cover;
    }

.browse-hero__content {
    order: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

    .browse-hero__content h2 {
        font-size: 2rem;
        margin: 0;
        line-height: 1.2;
    }

.browse-hero__meta {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    font-weight: 700;
}

/* Pagination */
.pagination {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

.page-link {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    font-weight: 500;
}

    .page-link:hover {
        border-color: var(--primary);
        color: var(--primary);
        background: #eff6ff;
    }

@media (max-width: 768px) {
    .browse-hero {
        grid-template-columns: 1fr;
    }

    .browse-hero__image {
        order: 1;
    }

    .browse-hero__content {
        order: 2;
        padding: 1.5rem;
    }
}

/* Two-column hero for jobs */
.browse-hero--job {
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.browse-hero__content--job {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    transition: 0.2s;
}

    .browse-hero__content--job:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow);
    }

.browse-hero__content--job-secondary {
    background: #f8fafc; /* Slightly different bg */
}

.browse-hero__eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.browse-hero__job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
    color: #64748b;
}

    .browse-hero__job-meta span {
        display: inline-flex;
        align-items: center;
        background: #f1f5f9;
        padding: 4px 10px;
        border-radius: 4px;
    }

@media (max-width: 768px) {
    .browse-hero--job {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------
   GENERIC BUTTONS
----------------------------------------------------- */
a.btn-primary,
a.btn-ghost {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    text-align: center;
    transition: 0.2s;
}

a.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}

    a.btn-primary:hover {
        background: var(--primary-hover);
        border-color: var(--primary-hover);
    }

a.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary); /* Thicker border for visibility */
}

    a.btn-ghost:hover {
        background: #eff6ff;
    }

/* Light variants used on dark backgrounds */
.btn-primary--light {
    background: #fff;
    color: var(--dark);
    border-color: #fff;
}

    .btn-primary--light:hover {
        background: #f1f5f9;
    }

.btn-ghost--light {
    border-color: #fff;
    color: #fff;
}

    .btn-ghost--light:hover {
        background: rgba(255,255,255,0.15);
    }

/* ----------------------------------------------------
   HOME HERO (Overlay)
----------------------------------------------------- */
.home-hero {
    position: relative;
    margin-bottom: 3rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--dark);
}

.home-hero__bg {
    position: relative;
    height: 400px;
    width: 100%;
}

    .home-hero__bg img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.7; /* Darken image directly */
    }

.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.8));
}

.home-hero__inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
}

.home-hero__content {
    max-width: 800px;
    text-align: center;
    color: #fff;
    position: relative; /* To sit above overlay */
    z-index: 10;
}

    .home-hero__content h1 {
        font-size: 3rem;
        line-height: 1.1;
        margin-bottom: 1rem;
        color: #fff;
        font-weight: 800;
    }

.home-hero__desc {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    font-weight: 300;
}

.home-hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

@media (max-width: 600px) {
    .home-hero__bg {
        height: 320px;
    }

    .home-hero__content h1 {
        font-size: 2rem;
    }

    .home-hero__actions {
        flex-direction: column;
        width: 100%;
    }

        .home-hero__actions a {
            width: 100%;
        }
}

/* -----------------------------------------
   JOB SINGLE PAGE
------------------------------------------ */

.job-page {
    margin-top: 20px;
}

.job-hero {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

    .job-hero::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: var(--primary);
        border-radius: var(--radius) 0 0 var(--radius);
    }

.job-hero-content {
    flex: 1;
}

.job-hero-image img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    border: 1px solid #e2e8f0;
}

.job-title {
    font-size: 2.2rem;
    margin: 0 0 1rem;
    color: var(--dark);
}

.job-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.job-meta-pill {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

.job-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.job-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.job-tag {
    padding: 4px 10px;
    border-radius: 99px;
    background: #eff6ff;
    font-size: 0.8rem;
    color: var(--primary);
    border: 1px solid #dbeafe;
}

/* Job Layout */
.job-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
}

.job-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.job-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

    .job-section h2 {
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 1.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #f1f5f9;
    }

    .job-section ul {
        padding-left: 1.2rem;
    }

    .job-section li {
        margin-bottom: 0.5rem;
    }

/* Sidebar */
.job-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.job-facts li {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 0.75rem;
}

    .job-facts li:last-child {
        border-bottom: none;
    }

.job-apply-button {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    padding: 14px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}

    .job-apply-button:hover {
        background: var(--primary-hover);
        transform: translateY(-2px);
    }

/* Suggested Jobs */
.job-section--suggested {
    margin-top: 3rem;
}

.job-suggested-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.job-suggested-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

    .job-suggested-card:hover {
        border-color: var(--primary);
        box-shadow: var(--shadow-light);
    }

    .job-suggested-card h3 a {
        color: var(--dark);
        font-weight: 600;
    }

        .job-suggested-card h3 a:hover {
            color: var(--primary);
        }

@media (max-width: 900px) {
    .job-layout {
        grid-template-columns: 1fr;
    }

    .job-hero {
        flex-direction: column-reverse;
        align-items: flex-start;
    }
}


/* ----------------------------------------------------
   SEARCH BAR SECTION (Fix)
----------------------------------------------------- */
.search-bar-section {
    background: var(--white);
    padding: 3rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 3rem;
}

.main-search-form {
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #f8fafc;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
}

.input-icon {
    font-size: 1.2rem;
    padding-left: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
}

.main-search-form input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 1.1rem;
    box-shadow: none; /* Reset existing form styles */
}

    .main-search-form input[type="text"]:focus {
        outline: none;
        box-shadow: none;
    }

.main-search-form button {
    padding: 12px 32px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 6px; /* Slightly tighter radius for button inside group */
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
        gap: 8px;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .input-icon {
        display: none;
    }
    /* Hide icon on mobile for cleaner look */

    .main-search-form input[type="text"] {
        background: #fff;
        border: 1px solid #cbd5e1;
        width: 100%;
        border-radius: var(--radius);
    }

    .main-search-form button {
        width: 100%;
    }
}

/* ----------------------------------------------------
   ARTICLE SINGLE PAGE HERO FIX
----------------------------------------------------- */
.article-hero {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}

.article-hero-image {
    width: 100%;
    margin-bottom: 2rem;
}

    /* This constrains the image height */
    .article-hero-image img {
        width: 100%;
        height: 400px; /* Fixed height for banner look */
        object-fit: cover; /* Crops image nicely to fill area */
        object-position: center;
        border-radius: var(--radius);
        box-shadow: var(--shadow-light);
    }

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-intro {
    font-size: 1.1rem;
    color: #475569; /* Slate 600 */
    line-height: 1.7;
    max-width: 800px;
}

/* Mobile adjustment */
@media (max-width: 768px) {
    .article-hero-image img {
        height: 250px;
    }

    .article-title {
        font-size: 2rem;
    }
}

/* ----------------------------------------------------
   ARTICLE BODY CONTENT & IMAGES
----------------------------------------------------- */

/* 1. Constrain Article Body Images */
.article-section-image img,
.article-section-image--full img {
    width: 100%;
    height: auto;
    max-height: 350px; /* Prevents them from being massive */
    object-fit: cover; /* Crops neatly */
    border-radius: var(--radius);
    box-shadow: var(--shadow-light);
    border: 1px solid #e2e8f0;
    display: block;
}

/* 2. Handle Side-by-Side Layouts (Grid) */
.article-section {
    margin: 3rem 0;
}

.article-section-inner {
    display: grid;
    gap: 2rem;
    align-items: center; /* Vertically center text with image */
}

/* Desktop: Split columns */
@media (min-width: 768px) {
    /* Image Left */
    .article-section--image-left .article-section-inner {
        grid-template-columns: 1fr 1.5fr; /* Image takes approx 40% */
    }

    .article-section--image-left .article-section-image {
        order: -1; /* Moves image to left */
    }

    /* Image Right */
    .article-section--image-right .article-section-inner {
        grid-template-columns: 1.5fr 1fr; /* Text takes approx 60% */
    }

    .article-section--image-right .article-section-image {
        order: 2; /* Moves image to right */
    }
}

/* Mobile: Stack everything */
@media (max-width: 767px) {
    .article-section-inner {
        grid-template-columns: 1fr; /* Stack vertically */
    }

    /* Ensure image is always on top on mobile */
    .article-section-image {
        order: -1;
        margin-bottom: 1rem;
    }
}

/* 3. Typography within sections */
.article-section-body h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
    font-weight: 700;
}

.article-section-body p {
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 1.05rem;
}

.article-section-body ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.article-section-body li {
    margin-bottom: 0.5rem;
}