/* Job offers - extracted plugin stylesheet */

/* --- Estilo do Formulário de Filtros --- */
.vagas-filtro-form {
    margin-bottom: 30px;
    background-color: rgba(240, 240, 240, 0.70);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.vagas-filtro-form .job-filter-select {
    /* Remove native styling so we can position a custom arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Make room on the right for the arrow and vertically center text */
    padding: 10px 44px 10px 12px;
    height: 42px;
    line-height: 1.2;

    border-radius: 8px;
    border: 1px solid #ccd6dd;
    background-color: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
    vertical-align: middle;

    /* Custom arrow (SVG) positioned to the right and centered vertically */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;

    /* Layout: side-by-side in desktop/tablet */
    max-width: 360px;
    width: auto;
}

/* Hide IE/Edge default expand icon */
.vagas-filtro-form .job-filter-select::-ms-expand { display: none; }

/* Focus state */
.vagas-filtro-form .job-filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(42,128,188,0.09);
    border-color: #2A80BC;
}

.vagas-filtro-form .job-filter-button {
    padding: 8px 15px;
    cursor: pointer;
    background: linear-gradient(90deg, #2A80BC, #00A6FF);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    transition: background-position 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
    /* Keep natural size for the button so it sits beside selects */
    flex: 0 0 auto;
}

.vagas-filtro-form .job-filter-button:hover {
    background: linear-gradient(90deg, #4CAF50, #4CAF50);
    background-position: 100%;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.vagas-filtro-form .clear-filters-link {
    align-self: center;
    margin-left: 10px;
    text-decoration: none;
    color: #666;
}

/* Make filter inputs stack and put button below selects on mobile */
@media (max-width: 768px) {
    .vagas-filtro-form {
        /* Stack children vertically so the button always sits below the selects */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .vagas-filtro-form .job-filter-select,
    .vagas-filtro-form .job-filter-button,
    .vagas-filtro-form .clear-filters-link {
        align-self: center;
        margin: 6px 0;
    }

    /* Ensure the button appears after the selects (defensive ordering) */
    .vagas-filtro-form .job-filter-select { order: 1; }
    .vagas-filtro-form .job-filter-button { order: 3; }
    .vagas-filtro-form .clear-filters-link { order: 4; }
}

/* ------------------------------------------------------------------ */
/* Remove the theme's light-blue background on single 'offres' pages so
   these posts use the normal page background (white). Also add spacing
   above the details box. */

body.post-type-offres,
body.single-offres,
body.post-type-offres .site,
body.single-offres .site,
body.post-type-offres .site-content,
body.single-offres .site-content,
body.post-type-offres .ast-container,
body.single-offres .ast-container,
body.post-type-offres .content-area,
body.single-offres .content-area,
body.post-type-offres .entry-content,
body.single-offres .entry-content {
    background: #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
}

/* Ensure the site main/content area is white */
body.post-type-offres .site-main,
body.single-offres .site-main,
body.post-type-offres .content-area,
body.single-offres .content-area {
    background-color: #ffffff !important;
}

/* Remove large paddings/margins that some themes add for single posts */
body.post-type-offres .entry-header,
body.single-offres .entry-header,
body.post-type-offres .entry-content,
body.single-offres .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* If the theme still shows a colored band, add a specific override for
   Astra-like wrappers (adjust if your theme uses different classes). */
body.post-type-offres .ast-author-box,
body.post-type-offres .ast-archive-description,
body.single-offres .ast-author-box,
body.single-offres .ast-archive-description {
    background: transparent !important;
}

/* Make sure plugin wrapper is neutral (no forced styling) */
.post-type-offres .job-offers-wrapper,
body.post-type-offres .job-offers-wrapper,
body.single-offres .job-offers-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Add top margin to the details box so it doesn't stick to the title */
.vaga-detalhes-box {
    margin-top: 22px;
    margin-bottom: 25px;
}

/* ------------------------------------------------------------------ */
/* Hide theme-provided author and date/meta on single 'offres' pages.
   We move the date into the plugin's details box so users see it next
   to type/emplacement. */
body.post-type-offres .entry-meta,
body.single-offres .entry-meta,
body.post-type-offres .posted-by,
body.single-offres .posted-by,
body.post-type-offres .posted-on,
body.single-offres .posted-on,
body.post-type-offres .author-name,
body.single-offres .author-name,
body.post-type-offres .byline,
body.single-offres .byline {
    display: none !important;
}

/* Slight styling for the moved date inside the details box */
.vaga-detalhes-box .vaga-data {
    margin-top: 8px;
    margin-bottom: 0px;
    color: #1e293b;
}

/* End overrides for offres single pages */
/* ------------------------------------------------------------------ */

/* Fade-in animation for job cards (staggered) */
@media (prefers-reduced-motion: no-preference) {
    .vagas-container .vaga-card {
        opacity: 0;
        transform: translateY(8px);
        animation: job-fade-in 0.9s ease forwards;
    }

    /* Stagger delays for the first several items */
    .vagas-container .vaga-card:nth-child(1)  { animation-delay: 0s; }
    .vagas-container .vaga-card:nth-child(2)  { animation-delay: 0.12s; }
    .vagas-container .vaga-card:nth-child(3)  { animation-delay: 0.24s; }
    .vagas-container .vaga-card:nth-child(4)  { animation-delay: 0.36s; }
    .vagas-container .vaga-card:nth-child(5)  { animation-delay: 0.48s; }
    .vagas-container .vaga-card:nth-child(6)  { animation-delay: 0.60s; }
    .vagas-container .vaga-card:nth-child(7)  { animation-delay: 0.72s; }
    .vagas-container .vaga-card:nth-child(8)  { animation-delay: 0.84s; }
    .vagas-container .vaga-card:nth-child(9)  { animation-delay: 0.96s; }
    .vagas-container .vaga-card:nth-child(10) { animation-delay: 1.08s; }
    .vagas-container .vaga-card:nth-child(11) { animation-delay: 1.20s; }
    .vagas-container .vaga-card:nth-child(12) { animation-delay: 1.32s; }

    @keyframes job-fade-in {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* If user prefers reduced motion, show cards immediately */
@media (prefers-reduced-motion: reduce) {
    .vagas-container .vaga-card { opacity: 1; transform: none; animation: none; }
}

/* Link "voir plus" usado na descrição truncada */
.voir-plus-link {
    font-weight: bold;
    text-decoration: underline;
    color: inherit;
}

/* --- Estilo da Lista de Vagas --- */
.vagas-container {
    display: flex;
    flex-direction: column;
}

/* O cartão da vaga */
.vaga-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 20px;
}

/* Efeito ao passar o rato */
.vaga-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Título da vaga */
.vaga-titulo {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.vaga-titulo a {
    text-decoration: none;
    color: #1e293b;
}

.vaga-titulo a:hover {
    color: #0274be;
}

/* Detalhes (Local e Tipo) */
.vaga-meta {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    gap: 15px;
}

/* Botão - mantém a classe usada no PHP */
.vaga-btn {
    background: linear-gradient(90deg, #2A80BC, #00A6FF);
    background-size: 200%;
    background-position: 0%;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px;
    transition: background-position 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    padding: 10px 20px;
}

.vaga-btn:hover {
    background: linear-gradient(90deg, #4CAF50, #4CAF50);
    background-size: 200%;
    text-decoration: none !important;
    background-position: 100%;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Excerpt area */
.vaga-excerpt {
    margin-bottom: 20px;
    margin-right: 20px;
    color: #000000;
}

/* Wrapper class you can add around the job description to apply a
   consistent left margin/indent on both list and single pages. */
.vaga-description-wrapper {
    margin-left: 20px !important;
    margin-right: 20px !important;
}

/* Wrapper for the entire single-offre content so we can add consistent
     padding on the job's own page without touching theme templates. */
.vaga-single-wrapper {
        padding: 24px !important;
        box-sizing: border-box;
}

/* Optionally restrict the wrapper padding to single 'offres' pages only */
body.post-type-offres .vaga-single-wrapper,
body.single-offres .vaga-single-wrapper {
        padding: 24px !important;
}

/* Box de detalhes na página singular */
.vaga-detalhes-box {
    background-color: rgba(240, 240, 240, 0.70);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 5px solid #2A80BC;
}

.vaga-info {
    width: 80%;
}

/* Wrapper e título do formulário de candidatura */
.vaga-form-wrapper {
    margin-left: 35px !important;
    margin-right: 35px !important;
    margin-bottom: 40px !important;
}

.vaga-form-title {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

/* Em tablets e computadores, limitar a largura a 60% e centrar */
@media (min-width: 769px) {
    .vaga-form-wrapper {
        width: 60%;
    }
}

/* Container that wraps the Contact Form 7 markup so we can explicitly
   align the form to the left within the .vaga-form-wrapper. */
.vaga-cf7-container {
    margin-left: 0;
    text-align: left;
}

.vaga-cf7-container .wpcf7-form {
    margin-left: 0;
}

/* Ensure main post description text is pure black on single 'offres' pages */
body.post-type-offres .entry-content,
body.single-offres .entry-content {
    color: #000000 !important;
    background-color: rgba(240, 240, 240, 0.70) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    /* Indent the post description on single offers pages */
    padding: 20px !important;
}

body.post-type-offres .entry-header, body.single-offres .entry-header, body.post-type-offres .entry-content, body.single-offres .entry-content {
    padding: 0 !important;
    margin-bottom: 45px  !important;
}

/* Mobile: Ajustar para telemóvel */
@media (max-width: 768px) {
    .vaga-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .vaga-action {
        width: 100%;
    }
    .vaga-btn {
        display: block;
        text-align: center;
    }
    .vagas-filtro-form {
        gap: 8px;
    }
    .vagas-filtro-form .job-filter-select {
        width: 100%;
    }
    .vagas-filtro-form .job-filter-button {
        width: auto;
    }
}

/* Astra-specific overrides to remove extra padding/margin */
@media (min-width: 993px) {
    .ast-separate-container #primary, .ast-separate-container.ast-left-sidebar #primary, .ast-separate-container.ast-right-sidebar #primary {
        margin: 0 !important;
    }
}

.ast-separate-container #primary {
    padding: 0 !important;
}

.single .post-navigation {
    margin-bottom: 15px !important;
}

/* Title styling for job offer pages: class added via inline JS as .vaga-title */
.vaga-title {
    font-size: 36px !important;
    color: #2A80BC !important;
    line-height: 1.1;
}
