/**
 * DomEmpleos Core CSS v1.0
 * =========================
 * Foundation visual compartida para todos los templates de DomEmpleos.
 * 
 * Este archivo NO reemplaza style.css (que maneja header/footer globales).
 * En su lugar, provee componentes base que los templates pueden usar
 * para evitar repetir CSS inline en cada página.
 * 
 * Variables disponibles desde style.css:
 *   --de-primary, --de-accent, --de-font, --de-shadow-*, etc.
 */

/* ============================================================
   1. RESET BASE PARA TEMPLATES
   ============================================================ */
html {
    font-size: 16px;
}

/* Override del padding que Superio aplica al main content */
#apus-main-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================================
   2. VARIABLES ADICIONALES (complemento a style.css)
   ============================================================ */
:root {
    /* Alias de colores para compatibilidad con templates legacy */
    --primary: var(--de-primary, #1B4F8A);
    --primary-hover: var(--de-primary-hover, #153F6E);
    --primary-light: var(--de-primary-light, #2D7DD2);
    --accent: var(--de-accent, #E63946);
    --accent-hover: var(--de-accent-hover, #C1272D);

    --text: var(--de-text, #111827);
    --text-secondary: var(--de-text-secondary, #4B5563);
    --text-muted: var(--de-text-muted, #9CA3AF);
    --text-inverse: var(--de-text-inverse, #FFFFFF);

    --bg: var(--de-bg, #FFFFFF);
    --bg-page: var(--de-bg-page, #F9FAFB);
    --bg-subtle: var(--de-bg-subtle, #F3F4F6);

    --border: var(--de-border, #E5E7EB);
    --border-light: var(--de-border-light, #F3F4F6);

    --shadow-sm: var(--de-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    --shadow-md: var(--de-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.07));
    --shadow-lg: var(--de-shadow-lg, 0 8px 30px rgba(0, 0, 0, 0.1));
    --shadow-xl: var(--de-shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.12));

    --radius-sm: var(--de-radius-sm, 8px);
    --radius: var(--de-radius, 12px);
    --radius-lg: var(--de-radius-lg, 16px);
    --radius-xl: var(--de-radius-xl, 24px);
    --radius-full: 9999px;

    --font: var(--de-font, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    --transition: var(--de-transition, 0.2s cubic-bezier(0.4, 0, 0.2, 1));
    --max-w: var(--de-max-w, 1280px);
}

/* ============================================================
   3. LAYOUT BASE
   ============================================================ */

/* Contenedor principal responsive */
.de-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 768px) {
    .de-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1024px) {
    .de-container {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

/* Sección con padding vertical estándar */
.de-section {
    padding: 4.5rem 0;
}

.de-section--alt {
    background: var(--bg-page);
}

.de-section__header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.de-section__label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(27, 79, 138, 0.07);
    color: var(--primary);
    padding: 5px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.de-section__title {
    font-family: var(--font);
    font-size: clamp(1.5rem, 3vw, 2.375rem);
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.75rem;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.de-section__desc {
    font-family: var(--font);
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.de-section__cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ============================================================
   4. BOTONES
   ============================================================ */
.de-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.9375rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.de-btn--primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.de-btn--primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.de-btn--accent {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

.de-btn--accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.de-btn--ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.de-btn--ghost:hover {
    background: var(--primary);
    color: var(--text-inverse);
}

.de-btn--lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.de-btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================================
   5. CARDS BASE
   ============================================================ */
.de-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.de-card:hover {
    border-color: rgba(27, 79, 138, 0.2);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.de-card__title {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.de-card__subtitle {
    font-family: var(--font);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    font-weight: 500;
}

.de-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: auto;
}

.de-card__meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.de-card__badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(27, 79, 138, 0.07);
    color: var(--primary);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.de-card--relative {
    position: relative;
}

/* ============================================================
   6. GRIDS
   ============================================================ */
.de-grid {
    display: grid;
    gap: 1rem;
}

.de-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.de-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.de-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .de-grid--4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .de-grid--2,
    .de-grid--3,
    .de-grid--4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .de-grid--3,
    .de-grid--4 { grid-template-columns: 1fr; }
}

/* ============================================================
   7. HERO BASE
   ============================================================ */
.de-hero {
    position: relative;
    min-height: 480px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0F2645 0%, #1B4F8A 60%, #2563C7 100%);
    overflow: hidden;
    padding: 100px 0 80px;
}

.de-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.de-hero__title {
    font-family: var(--font);
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin: 0 0 1rem;
    letter-spacing: -1px;
}

.de-hero__title span {
    color: #63A0FF;
}

.de-hero__sub {
    font-family: var(--font);
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 0 2.5rem;
    line-height: 1.6;
}

.de-hero__stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.de-hero__stat-number {
    font-family: var(--font);
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    display: block;
}

.de-hero__stat-label {
    font-family: var(--font);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* ============================================================
   8. SEARCH BAR BASE
   ============================================================ */
.de-search {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.de-search__field {
    flex: 1;
    position: relative;
}

.de-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.de-search__input,
.de-search__select {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg);
    transition: all var(--transition);
    appearance: none;
}

.de-search__input:focus,
.de-search__select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(27, 79, 138, 0.1);
}

.de-search__input::placeholder {
    color: var(--text-muted);
}

.de-search__select {
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.de-search__btn {
    padding: 0 1.75rem;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.de-search__btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   9. BADGES & CHIPS
   ============================================================ */
.de-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: rgba(27, 79, 138, 0.07);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}

.de-badge--accent {
    background: rgba(230, 57, 70, 0.08);
    color: var(--accent);
}

.de-badge--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.de-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.de-chip__remove {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
    padding: 0;
}

.de-chip__remove:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   10. PAGINATION
   ============================================================ */
.de-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.de-pagination__link,
.de-pagination__current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}

.de-pagination__link {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.de-pagination__link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

/* ============================================================
   11. UTILIDADES
   ============================================================ */
.de-no-results {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.9375rem;
    padding: 3rem 0;
}

.de-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Layout con sidebar */
.de-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    padding: 2.5rem 0 4rem;
}

.de-layout--reverse {
    grid-template-columns: 1fr 280px;
}

@media (max-width: 1024px) {
    .de-layout,
    .de-layout--reverse {
        grid-template-columns: 1fr;
    }
}

/* Sidebar sticky */
.de-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.de-sidebar__card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

/* ============================================================
   12. JOB SINGLE (detalle de empleo)
   ============================================================ */
.de-job-header {
    background: linear-gradient(135deg, #0F2645 0%, #1B4F8A 60%, #2563C7 100%);
    padding: 80px 0 60px;
    color: #fff;
}

.de-job-header__title {
    font-family: var(--font);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.de-job-header__company {
    font-family: var(--font);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

.de-job-header__company a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.de-job-header__company a:hover {
    color: #fff;
}

.de-job-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.de-job-main {
    min-width: 0;
}

.de-job-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.de-job-content h2,
.de-job-content h3 {
    font-family: var(--font);
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.de-job-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.de-job-content ul,
.de-job-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.de-job-content li {
    margin-bottom: 0.375rem;
}

.de-job-apply {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

/* Sobreescribir botones del plugin dentro de .de-job-apply */
.de-job-apply .btn-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
}

.de-job-apply .btn-apply:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.de-job-apply .btn-applied-job-internal {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: default;
}

.de-job-apply .deadline-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.de-job-apply .deadline-closed {
    font-size: 0.9375rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Formularios del plugin dentro de nuestro layout */
.de-job-apply .job-apply-internal-form-wrapper,
.de-job-apply .job-apply-email-form-wrapper {
    text-align: left;
    margin-top: 1.5rem;
}

/* ============================================================
   13. SIDEBAR COMPONENTS
   ============================================================ */
.de-sidebar__title {
    font-family: var(--font);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 1.25rem;
}

.de-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.de-sidebar-list li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-light);
}

.de-sidebar-list li:last-child {
    border-bottom: none;
}

.de-sidebar-list__label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.de-sidebar-list__value {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

.de-company-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.de-company-card__logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 1px solid var(--border-light);
    background: var(--bg-subtle);
    flex-shrink: 0;
}

.de-company-card__name {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.25rem;
}

.de-company-card__meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================================
   14. EMPLOYER ARCHIVE / SINGLE
   ============================================================ */
.de-employer-hero {
    background: linear-gradient(135deg, #0F2645 0%, #1B4F8A 60%, #2563C7 100%);
    padding: 80px 0 60px;
    color: #fff;
    text-align: center;
}

.de-employer-hero__logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: #fff;
    margin: 0 auto 1rem;
}

.de-employer-hero__name {
    font-family: var(--font);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
}

.de-employer-hero__industry {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* ============================================================
   15. ANIMACIONES
   ============================================================ */
@keyframes de-blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(20px, -30px) scale(1.05); }
    50%  { transform: translate(-10px, 20px) scale(0.95); }
    75%  { transform: translate(-20px, -10px) scale(1.02); }
}

@keyframes de-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.de-animate-fade-in-up {
    animation: de-fade-in-up 0.6s ease-out forwards;
}


/* ============================================================
   FIXES PARA TEMA PADRE SUPERIO
   ============================================================ */

/* --- Mapa fijo en half-map layouts (employers-2, job-list) --- */
.half-map #jobs-google-maps,
.layout-type-half-map #jobs-google-maps {
    z-index: 0 !important;
}

/* Asegurar que header y overlays queden por encima del mapa */
.de-header,
#de-mobile-menu,
#de-mobile-overlay,
.mfp-wrap,
.modal,
.dropdown-menu,
.select2-container--open {
    z-index: 1001 !important;
}

/* --- Paginación del tema padre --- */
.jobs-pagination-wrapper .pagination,
.main-pagination-wrapper .pagination,
.employers-pagination-wrapper .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-left: 0;
    list-style: none;
}

.jobs-pagination-wrapper .pagination li,
.main-pagination-wrapper .pagination li,
.employers-pagination-wrapper .pagination li {
    display: inline-flex;
    margin: 0;
}

.jobs-pagination-wrapper .pagination .next.page-numbers,
.main-pagination-wrapper .pagination .next.page-numbers,
.employers-pagination-wrapper .pagination .next.page-numbers,
.jobs-pagination-wrapper .pagination .prev.page-numbers,
.main-pagination-wrapper .pagination .prev.page-numbers,
.employers-pagination-wrapper .pagination .prev.page-numbers {
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.75rem;
}
