/**
 * list-recruit.css
 * Style cho trang danh sách tin tuyển dụng (archive-yola_recruit.php).
 * BEM prefix: "yrl-" (Yola Recruit List)
 * Không dùng Tailwind, tránh conflict Bootstrap 3.
 *
 * @package YolaTheme\RecruitSystem
 *
 * CHANGELOG:
 * - Font size card item tăng (title 19px, excerpt 15px, meta 13px, badges 11px)
 * - UI card cải tiến: border-top màu accent, budget pill nổi bật hơn,
 *   shadow sâu hơn, body padding rộng hơn, gap lớn hơn
 * - Address (meta-item location) hiển thị 1 dòng với text-overflow: ellipsis
 */

/* =========================================================
   VARIABLES
========================================================= */
:root {
    --yrl-primary:        #1E40AF;
    --yrl-primary-light:  #EFF6FF;
    --yrl-primary-hover:  #1d3891;
    --yrl-accent:         #2563EB;

    --yrl-urgent-bg:      #FEF2F2;
    --yrl-urgent-color:   #DC2626;
    --yrl-high-bg:        #FFF7ED;
    --yrl-high-color:     #EA580C;
    --yrl-normal-bg:      #F0FDF4;
    --yrl-normal-color:   #16A34A;
    --yrl-low-bg:         #F1F5F9;
    --yrl-low-color:      #64748B;

    --yrl-whatsapp:       #25D366;
    --yrl-whatsapp-hover: #1fba58;

    --yrl-bg:             #F1F5F9;
    --yrl-white:          #FFFFFF;
    --yrl-border:         #E2E8F0;
    --yrl-text:           #0F172A;
    --yrl-text-muted:     #64748B;
    --yrl-text-light:     #94A3B8;

    --yrl-radius:         16px;
    --yrl-radius-sm:      8px;
    --yrl-radius-full:    9999px;
    --yrl-shadow:         0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
    --yrl-shadow-md:      0 6px 24px rgba(0,0,0,.10);
    --yrl-shadow-lg:      0 12px 40px rgba(0,0,0,.14);

    --yrl-font:           'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --yrl-font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* =========================================================
   PAGE WRAPPER
========================================================= */
.yrl-page {
    background: var(--yrl-bg);
    min-height: 100vh;
    font-family: var(--yrl-font-body);
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   CONTAINER
========================================================= */
.yrl-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* =========================================================
   HERO
========================================================= */
.yrl-hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 60%, #1d4ed8 100%);
    padding: 56px 20px 52px;
    position: relative;
    overflow: hidden;
}

.yrl-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(96, 165, 250, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 20% 80%, rgba(37, 99, 235, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.yrl-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--yrl-bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.yrl-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.yrl-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #93C5FD;
    margin: 0 0 12px;
    font-family: var(--yrl-font);
}

.yrl-hero__eyebrow .material-symbols-outlined {
    font-size: 16px !important;
}

.yrl-hero__title {
    font-family: var(--yrl-font);
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 0 12px;
}

.yrl-hero__title-accent {
    color: #60A5FA;
}

.yrl-hero__subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.65);
    margin: 0;
    max-width: 480px;
    line-height: 1.6;
}

/* =========================================================
   POST NEW BUTTON
========================================================= */
.yrl-btn-post {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #fff;
    color: var(--yrl-primary);
    border-radius: var(--yrl-radius-sm);
    font-family: var(--yrl-font);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: .02em;
    transition: transform .15s, box-shadow .15s, background .15s;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    white-space: nowrap;
}

.yrl-btn-post:hover {
    background: var(--yrl-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    text-decoration: none;
    color: var(--yrl-primary-hover);
}

.yrl-btn-post .material-symbols-outlined {
    font-size: 18px !important;
}

.yrl-btn-post--outline {
    background: transparent;
    color: var(--yrl-primary);
    border: 2px solid var(--yrl-primary);
    box-shadow: none;
    margin-top: 16px;
}

.yrl-btn-post--outline:hover {
    background: var(--yrl-primary-light);
    transform: none;
}

/* =========================================================
   FILTER BAR
========================================================= */
.yrl-filter-bar {
    background: var(--yrl-white);
    border-bottom: 1px solid var(--yrl-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Search */
.yrl-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.yrl-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px !important;
    color: var(--yrl-text-light);
    pointer-events: none;
}

.yrl-search-input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 46px;
    background: var(--yrl-bg);
    border: 1.5px solid var(--yrl-border);
    border-radius: var(--yrl-radius-sm);
    font-family: var(--yrl-font-body);
    font-size: 15px;
    color: var(--yrl-text);
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.yrl-search-input:focus {
    border-color: var(--yrl-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    background: var(--yrl-white);
}

.yrl-search-input::placeholder {
    color: var(--yrl-text-light);
}

/* Filters Row */
.yrl-filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.yrl-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.yrl-filter-group--sort {
    margin-left: auto;
    flex: 0 0 180px;
}

.yrl-filter-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--yrl-text-muted);
}

.yrl-filter-select {
    height: 40px;
    padding: 0 30px 0 12px;
    background: var(--yrl-bg);
    border: 1.5px solid var(--yrl-border);
    border-radius: var(--yrl-radius-sm);
    font-family: var(--yrl-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--yrl-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.5 5L8 11.5 14.5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.yrl-filter-select:focus {
    border-color: var(--yrl-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    background-color: var(--yrl-white);
}

/* Filter Status */
.yrl-filter-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 28px;
}

.yrl-result-count {
    font-size: 13px;
    color: var(--yrl-text-muted);
}

.yrl-result-count strong {
    color: var(--yrl-primary);
    font-weight: 700;
}

.yrl-active-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.yrl-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 12px;
    background: var(--yrl-primary-light);
    color: var(--yrl-primary);
    border-radius: var(--yrl-radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
    border: none;
}

.yrl-active-filter-tag:hover {
    background: #DBEAFE;
}

.yrl-active-filter-tag .material-symbols-outlined {
    font-size: 13px !important;
}

.yrl-clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: none;
    border: 1.5px solid var(--yrl-border);
    border-radius: var(--yrl-radius-full);
    font-family: var(--yrl-font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--yrl-text-muted);
    cursor: pointer;
    transition: border-color .12s, color .12s;
    margin-left: auto;
}

.yrl-clear-filters:hover {
    border-color: #DC2626;
    color: #DC2626;
}

.yrl-clear-filters .material-symbols-outlined {
    font-size: 14px !important;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.yrl-main {
    padding: 36px 0 60px;
}

/* =========================================================
   CARDS GRID
========================================================= */
.yrl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

@media (min-width: 640px) {
    .yrl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .yrl-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================================
   CARD — cải tiến UI
========================================================= */
.yrl-card {
    background: var(--yrl-white);
    border: 1px solid var(--yrl-border);
    border-radius: var(--yrl-radius);
    overflow: hidden;
    box-shadow: var(--yrl-shadow);
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease;

    /* Accent line trên cùng — tạo điểm nhấn visual */
    border-top: 3px solid var(--yrl-accent);
}

.yrl-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--yrl-shadow-lg);
}

/* Card Image */
.yrl-card__img-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    /* Khi hover, độ sáng ảnh tăng nhẹ */
    position: relative;
}

.yrl-card__img-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(15, 23, 42, 0.18) 100%);
    pointer-events: none;
    transition: opacity .3s;
}

.yrl-card:hover .yrl-card__img-link::after {
    opacity: 0;
}

.yrl-card__img-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.yrl-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.yrl-card:hover .yrl-card__img {
    transform: scale(1.06);
}

/* Card Body — padding và gap rộng hơn cho cảm giác thoáng */
.yrl-card__body {
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* =========================================================
   BADGES — font size tăng lên 11px
========================================================= */
.yrl-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.yrl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: var(--yrl-radius-full);
    /* [UPDATED] tăng từ 10px → 11px */
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    line-height: 1;
    font-family: var(--yrl-font);
}

.yrl-badge__icon {
    /* [UPDATED] tăng từ 12px → 13px */
    font-size: 13px !important;
    line-height: 1;
}

.yrl-badge--urgent  { background: var(--yrl-urgent-bg);  color: var(--yrl-urgent-color);  }
.yrl-badge--high    { background: var(--yrl-high-bg);    color: var(--yrl-high-color);    }
.yrl-badge--normal  { background: var(--yrl-normal-bg);  color: var(--yrl-normal-color);  }
.yrl-badge--low     { background: var(--yrl-low-bg);     color: var(--yrl-low-color);     }
.yrl-badge--category {
    background: var(--yrl-primary-light);
    color:      var(--yrl-primary);
}

/* Timestamp */
.yrl-card__time {
    margin-left: auto;
    /* [UPDATED] tăng từ 11px → 12px */
    font-size: 12px;
    color: var(--yrl-text-light);
    white-space: nowrap;
    font-weight: 500;
}

/* =========================================================
   BUDGET PILL — nổi bật hơn
========================================================= */
.yrl-card__budget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* [UPDATED] font-size tăng từ 13px → 15px */
    font-size: 15px;
    font-weight: 800;
    color: var(--yrl-primary);
    font-family: var(--yrl-font);
    background: var(--yrl-primary-light);
    padding: 5px 14px;
    border-radius: var(--yrl-radius-full);
    border: 1px solid #BFDBFE;
    letter-spacing: -0.01em;
    align-self: flex-start;
}

.yrl-card__budget .material-symbols-outlined {
    font-size: 16px !important;
    color: var(--yrl-accent);
}

/* =========================================================
   TITLE — tăng font size
========================================================= */
.yrl-card__title {
    font-family: var(--yrl-font);
    /* [UPDATED] tăng từ 17px → 19px */
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--yrl-text);
    margin: 0;
}

.yrl-card__title-link {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.yrl-card__title-link:hover {
    color: var(--yrl-primary);
    text-decoration: none;
}

/* =========================================================
   EXCERPT — tăng font size
========================================================= */
.yrl-card__excerpt {
    /* [UPDATED] tăng từ 14px → 15px */
    font-size: 15px;
    color: var(--yrl-text-muted);
    margin: 0;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================================
   META ROW — tăng font size, address truncate 1 dòng
========================================================= */
.yrl-card__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.yrl-card__meta-item {
      display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--yrl-text-muted);
    min-width: 0;  
}

.yrl-card__meta-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;   /* ← giờ mới có tác dụng */
    min-width: 0;
}

.yrl-card__meta-icon {
    /* [UPDATED] tăng từ 15px → 16px */
    font-size: 16px !important;
    color: var(--yrl-accent);
    flex-shrink: 0;        /* icon không bị co lại khi text dài */
}

/* =========================================================
   FOOTER — cải tiến
========================================================= */
.yrl-card__footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--yrl-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yrl-card__email {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    /* [UPDATED] tăng từ 12px → 13px */
    font-size: 13px;
    color: var(--yrl-text-muted);
    text-decoration: none;
    transition: color .12s;
    /* truncate email dài */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.yrl-card__email:hover {
    color: var(--yrl-primary);
    text-decoration: none;
}

/* =========================================================
   CARD ACTION BUTTONS
========================================================= */
.yrl-card__actions {
    display: flex;
    gap: 8px;
}

.yrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--yrl-radius-sm);
    font-family: var(--yrl-font);
    /* [UPDATED] tăng từ 12px → 13px */
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s, opacity .15s, box-shadow .15s;
    line-height: 1;
    flex: 1;
    white-space: nowrap;
}

.yrl-btn--whatsapp {
    background: var(--yrl-whatsapp);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 211, 102, .25);
}
.yrl-btn--whatsapp:hover {
    background: var(--yrl-whatsapp-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
}

.yrl-btn__wa-icon {
    flex-shrink: 0;
}

.yrl-btn--detail {
    background: var(--yrl-primary-light);
    color: var(--yrl-primary);
    border: 1.5px solid #BFDBFE;
}
.yrl-btn--detail:hover {
    background: #DBEAFE;
    color: var(--yrl-primary-hover);
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .15);
}

/* =========================================================
   EMPTY STATE
========================================================= */
.yrl-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.yrl-empty__icon {
    font-size: 64px !important;
    color: var(--yrl-text-light);
    margin-bottom: 16px;
}

.yrl-empty__title {
    font-family: var(--yrl-font);
    font-size: 20px;
    font-weight: 800;
    color: var(--yrl-text);
    margin: 0 0 8px;
}

.yrl-empty__sub {
    font-size: 14px;
    color: var(--yrl-text-muted);
    margin: 0;
    max-width: 360px;
}

/* =========================================================
   LOADING SPINNER
========================================================= */
.yrl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 0;
    color: var(--yrl-text-muted);
    font-size: 14px;
}

.yrl-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--yrl-border);
    border-top-color: var(--yrl-primary);
    border-radius: 50%;
    animation: yrl-spin .7s linear infinite;
}

@keyframes yrl-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   PAGINATION / LOAD MORE
========================================================= */
.yrl-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 48px;
}

.yrl-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: var(--yrl-white);
    color: var(--yrl-text);
    border: 2px solid var(--yrl-border);
    border-radius: var(--yrl-radius-full);
    font-family: var(--yrl-font);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
    box-shadow: var(--yrl-shadow);
}

.yrl-load-more:hover {
    border-color: var(--yrl-primary);
    color: var(--yrl-primary);
    background: var(--yrl-primary-light);
    transform: translateY(-1px);
}

.yrl-load-more:disabled,
.yrl-load-more.is-loading {
    opacity: .6;
    pointer-events: none;
}

.yrl-load-more .material-symbols-outlined {
    font-size: 20px !important;
    transition: transform .2s;
}

.yrl-load-more:hover .material-symbols-outlined {
    transform: translateY(2px);
}

.yrl-page-indicator {
    font-size: 13px;
    color: var(--yrl-text-light);
}

.yrl-page-indicator #yrl-page-current {
    font-weight: 700;
    color: var(--yrl-primary);
}

/* =========================================================
   CARD ANIMATION (appear on load)
========================================================= */
.yrl-card {
    animation: yrl-card-in .35s ease both;
}

@keyframes yrl-card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger delay per card */
.yrl-card:nth-child(1) { animation-delay: .03s; }
.yrl-card:nth-child(2) { animation-delay: .07s; }
.yrl-card:nth-child(3) { animation-delay: .11s; }
.yrl-card:nth-child(4) { animation-delay: .15s; }
.yrl-card:nth-child(5) { animation-delay: .19s; }
.yrl-card:nth-child(6) { animation-delay: .23s; }
.yrl-card:nth-child(7) { animation-delay: .27s; }
.yrl-card:nth-child(8) { animation-delay: .31s; }
.yrl-card:nth-child(9) { animation-delay: .35s; }

/* Cards appended via AJAX — no stagger delay */
.yrl-card.is-appended {
    animation-delay: 0s !important;
    animation-duration: .25s;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 640px) {
    .yrl-hero {
        padding: 40px 20px 44px;
    }

    .yrl-hero__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .yrl-filter-bar {
        position: static;
    }

    .yrl-filters-row {
        gap: 8px;
    }

    .yrl-filter-group {
        min-width: calc(50% - 4px);
        flex: 0 0 calc(50% - 4px);
    }

    .yrl-filter-group--sort {
        flex: 1;
        min-width: 100%;
    }

    .yrl-card__actions {
        flex-direction: column;
    }

    .yrl-card__body {
        padding: 18px 18px 16px;
    }
}

/* =========================================================
   MATERIAL SYMBOLS FIX
========================================================= */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    user-select: none;
    line-height: 1;
}
