/*
 * IranTalent homepage — ported from the Raz Salamat homepage composition.
 * Loaded only on the front page.
 */
.it-front-home {
    width: min(1400px, 100%);
    margin-inline: auto;
    padding-inline: 16px;
    padding-block: 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-x: hidden;
}
.it-front-home > section { margin: 0; }

/* Hero mosaic */
.it-front-hero { position: relative; }
.it-front-hero__slider { position: relative; }
.it-front-hero__mosaic { direction: rtl; }
.it-front-hero__tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--it-radius);
    background: var(--it-surface-2);
    border: 1px solid var(--it-border);
    padding: 8px;
    line-height: 0;
    contain: layout paint;
}
.it-front-hero__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center center;
    border-radius: calc(var(--it-radius) - 6px);
    background: var(--it-bg);
    aspect-ratio: 16 / 10;
}
.it-front-hero__image.is-placeholder {
    width: 100%;
    min-height: 188px;
    background: linear-gradient(135deg, var(--it-surface-2), color-mix(in srgb, var(--it-primary) 7%, var(--it-surface)));
}
.it-front-hero__cover { position: absolute; inset: 0; z-index: 5; display: block; }
.it-front-hero__category {
    position: absolute;
    inset-inline-start: 20px;
    inset-block-start: 20px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: var(--it-font-weight-ui);
    font-size: 12px;
    line-height: 1;
    color: var(--it-text);
    background: var(--it-surface);
    border: 1px solid var(--it-border);
    text-decoration: none;
    white-space: nowrap;
}
.it-front-hero__title {
    position: absolute;
    inset-inline-start: 16px;
    inset-inline-end: 16px;
    inset-block-end: 24px;
    z-index: 6;
    font-weight: var(--it-font-weight-body);
    font-size: 15px;
    line-height: 1.5;
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    direction: rtl;
    pointer-events: none;
}
.it-front-hero__dots { display: none; }

/* Category rail */
.it-home-categories {
    --it-home-cat-gap: 12px;
    --it-home-cat-cols: 2;
    --it-home-cat-icon: 56px;
    --it-home-dot-size: 9px;
    --it-home-dot-hit: 24px;
    --it-home-dot-gap: 6px;
    --it-home-dot-bg: color-mix(in srgb, var(--it-text) 14%, transparent);
    --it-home-dot-border: color-mix(in srgb, var(--it-text) 30%, transparent);
    --it-home-dot-active: var(--it-primary);
    padding: 16px;
    border: 1px solid var(--it-border);
    border-radius: var(--it-radius);
    background: var(--it-surface-2);
}
.it-home-categories__inner { display: flex; flex-direction: column; gap: 12px; }
.it-home-categories__track {
    direction: rtl;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--it-home-cat-cols) - 1) * var(--it-home-cat-gap)) / var(--it-home-cat-cols));
    gap: var(--it-home-cat-gap);
    align-items: stretch;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.it-home-categories__track::-webkit-scrollbar { display: none; }
.it-home-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
    border-radius: var(--it-radius);
    border: 1px solid var(--it-border);
    background: var(--it-surface);
    padding: 14px;
    color: var(--it-text);
    touch-action: pan-x pan-y;
}
.it-home-category.is-static { cursor: default; }
.it-home-category.is-static:focus { outline: none; }
.it-home-category__icon { width: var(--it-home-cat-icon); height: var(--it-home-cat-icon); display: inline-flex; }
.it-home-category__image { width: 100%; height: 100%; object-fit: contain; }
.it-home-category__title {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--it-text);
}
.it-home-categories__dots {
    display: flex;
    gap: var(--it-home-dot-gap);
    justify-content: center;
    align-items: center;
    direction: rtl;
    margin-top: 10px;
    min-height: var(--it-home-dot-hit);
}
.it-home-categories__dots button {
    position: relative;
    width: var(--it-home-dot-hit);
    height: var(--it-home-dot-hit);
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}
.it-home-categories__dots button::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--it-home-dot-size);
    height: var(--it-home-dot-size);
    transform: translate(-50%, -50%);
    border-radius: 9999px;
    background: var(--it-home-dot-bg);
    border: 1px solid var(--it-home-dot-border);
    transition: width .2s ease, height .2s ease, background-color .2s ease, border-color .2s ease, border-radius .2s ease, transform .2s ease;
}
.it-home-categories__dots button:is(:hover, :focus-visible)::after {
    transform: translate(-50%, -50%) scale(1.06);
    border-color: var(--it-primary);
}
.it-home-categories__dots button.is-active::after {
    width: 22px;
    height: var(--it-home-dot-size);
    border-radius: 9999px;
    background: var(--it-home-dot-active);
    border-color: var(--it-home-dot-active);
}

/* Article rails */
.it-home-list {
    --it-home-gap: 12px;
    --it-home-count: 1;
    --it-home-peek: 40px;
    --it-home-card-pad: 12px;
    --it-home-chip-height: 26px;
    --it-home-title-height: 24px;
    --it-home-thumb-ratio: 16 / 9;
    padding: 16px;
    border: 1px solid var(--it-border);
    border-radius: var(--it-radius);
    background: var(--it-surface-2);
    overflow-anchor: none;
}
.it-home-list__inner { display: flex; flex-direction: column; gap: 12px; }
.it-home-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}
.it-home-list__title {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    line-height: 1.5;
    font-weight: var(--it-font-weight-ui);
    color: var(--it-text);
}
.it-home-list__accent {
    inline-size: 22px;
    block-size: 8px;
    border-radius: 9999px;
    background: var(--it-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--it-primary) 20%, transparent);
}
.it-home-list__view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--it-primary);
    text-decoration: none;
    font-weight: var(--it-font-weight-ui);
    font-size: 14px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
}
.it-home-list__view-all::after {
    content: "";
    inline-size: 16px;
    block-size: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z' fill='black'/></svg>") no-repeat center / contain;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z' fill='black'/></svg>") no-repeat center / contain;
}
.it-home-list__track {
    direction: rtl;
    display: flex;
    gap: var(--it-home-gap);
    align-items: stretch;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-inline-start: 1px;
    padding-inline-end: var(--it-home-peek);
}
.it-home-list__track::-webkit-scrollbar { display: none; }
.it-home-card {
    position: relative;
    flex: 0 0 calc((100% - (var(--it-home-count) - 1) * var(--it-home-gap) - var(--it-home-peek)) / var(--it-home-count));
    display: grid;
    grid-template-rows: auto auto minmax(var(--it-home-title-height), 1fr) auto;
    gap: 10px;
    min-width: 0;
    min-height: 258px;
    border: 1px solid var(--it-border);
    border-radius: 16px;
    background: var(--it-surface);
    color: var(--it-text);
    padding: var(--it-home-card-pad);
    overflow: hidden;
}
.it-home-card__thumb {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: var(--it-surface-2);
    aspect-ratio: var(--it-home-thumb-ratio);
}
.it-home-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}
.it-home-card__thumb-placeholder { width: 100%; height: 100%; display: block; }
.it-home-card__thumb-placeholder {
    background: linear-gradient(135deg, var(--it-surface-2), color-mix(in srgb, var(--it-primary) 6%, var(--it-surface)));
}
.it-home-card__category,
.it-home-card__category:visited,
.it-home-card__category:hover,
.it-home-card__category:active {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: var(--it-home-chip-height);
    max-width: 100%;
    padding-inline: 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: var(--it-font-weight-body);
    text-decoration: none;
    background: var(--it-primary);
    border: 1px solid color-mix(in srgb, var(--it-primary) 82%, #000);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.it-home-card__category:focus-visible { outline: 2px solid var(--it-primary); outline-offset: 2px; }
.it-home-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: var(--it-font-weight-ui);
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.it-home-card__title a { color: var(--it-text); text-decoration: none; }
.it-home-card__title a:hover { text-decoration: underline; text-underline-offset: 2px; }
.it-home-card__title a:focus-visible { outline: 2px solid var(--it-primary); outline-offset: 2px; border-radius: 6px; }
.it-home-card__meta {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--it-muted);
    font-size: 12px;
}
.it-home-card__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.it-home-card__meta-icon { inline-size: 16px; block-size: 16px; display: inline-flex; flex: 0 0 16px; }
.it-home-card__meta-icon svg { width: 100%; height: 100%; display: block; }

/* Collapsible homepage content box */
.it-home-content-box {
    padding: 20px;
    border-radius: var(--it-radius);
    border: 1px solid var(--it-border);
    background: var(--it-surface-2);
    color: var(--it-text);
    display: grid;
    row-gap: 16px;
}
.it-home-content-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.it-home-content-box__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.6;
    font-weight: var(--it-font-weight-ui);
    color: var(--it-primary);
}
.it-home-content-box__body {
    position: relative;
    max-height: 260px;
    overflow: hidden;
    transition: max-height .25s ease;
}
.it-home-content-box__body::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 72px;
    background: linear-gradient(to top, var(--it-surface-2), color-mix(in srgb, var(--it-surface-2) 30%, transparent));
    pointer-events: none;
    opacity: 1;
    transition: opacity .2s ease;
}
.it-home-content-box__body p { margin: 0 0 10px; text-align: justify; }
.it-home-content-box__body ul,
.it-home-content-box__body ol { margin: 0 0 10px; padding-inline-start: 1.4rem; padding-inline-end: 0; }
.it-home-content-box__body li { margin: 0 0 6px; }
.it-home-content-box__body li::marker { color: var(--it-primary); }
.it-home-content-box.is-open .it-home-content-box__body { max-height: 9999px; }
.it-home-content-box.is-open .it-home-content-box__body::after { opacity: 0; }
.it-home-content-box__toggle {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 9999px;
    border: 1px solid var(--it-border);
    background: var(--it-surface);
    color: var(--it-primary);
    font-size: 13px;
    font-weight: var(--it-font-weight-ui);
    cursor: pointer;
}
.it-home-content-box__toggle:hover { background: color-mix(in srgb, var(--it-primary) 6%, var(--it-surface)); }
.it-home-content-box__toggle:focus-visible { outline: 2px solid var(--it-primary); outline-offset: 2px; }
.it-home-content-box__toggle [data-label-less] { display: none; }
.it-home-content-box.is-open .it-home-content-box__toggle [data-label-more] { display: none; }
.it-home-content-box.is-open .it-home-content-box__toggle [data-label-less] { display: inline; }

@media (max-width: 767.98px) {
    .it-front-hero__tile { padding: 6px; }
    .it-front-hero__category { inset-inline-start: 14px; inset-block-start: 14px; padding: 7px 11px; font-size: 11px; }
    .it-front-hero__title { inset-inline: 12px; inset-block-end: 42px; padding: 7px 11px; font-size: 13px; }
}

@media (max-width: 1023.98px) {
    .it-front-hero__mosaic {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0;
        -webkit-overflow-scrolling: touch;
        padding-inline: 0;
        scrollbar-width: none;
    }
    .it-front-hero__mosaic::-webkit-scrollbar { display: none; }
    .it-front-hero__side { display: contents; }
    .it-front-hero__tile { flex: 0 0 100%; scroll-snap-align: start; }
    .it-front-hero__dots {
        position: absolute;
        left: 50%;
        right: auto;
        inset-block-end: 14px;
        z-index: 7;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: auto;
        min-width: 106px;
        max-width: calc(100% - 52px);
        height: 24px;
        padding: 5px 9px;
        border-radius: 9999px;
        background: rgba(15, 23, 42, .42);
        border: 1px solid rgba(255, 255, 255, .2);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .12);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        transform: translate3d(-50%, 0, 0);
        pointer-events: none;
        direction: rtl;
        overflow: hidden;
        box-sizing: border-box;
    }
    .it-front-hero__dots button {
        position: relative;
        flex: 0 0 14px;
        width: 14px;
        height: 14px;
        padding: 0;
        border: 0;
        border-radius: 9999px;
        background: transparent;
        cursor: pointer;
        touch-action: manipulation;
        pointer-events: auto;
    }
    .it-front-hero__dots button::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 5px;
        height: 5px;
        border-radius: 9999px;
        background: rgba(255, 255, 255, .74);
        box-shadow: 0 1px 4px rgba(0, 0, 0, .24);
        transform: translate3d(-50%, -50%, 0);
        transition: width .22s ease, background-color .22s ease, opacity .22s ease;
    }
    .it-front-hero__dots button.is-active::before { width: 14px; background: var(--it-primary); }
}

@media (min-width: 640px) {
    .it-home-categories { --it-home-cat-cols: 4; }
    .it-home-list { --it-home-count: 3; --it-home-peek: 60px; }
}

@media (min-width: 1024px) {
    .it-front-home { padding-inline: 24px; padding-block: 32px 56px; gap: 40px; }
    .it-front-hero__mosaic { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: stretch; }
    .it-front-hero__tile--big { grid-column: 1; display: flex; align-items: center; }
    .it-front-hero__side { grid-column: 2; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
    .it-front-hero__dots { display: none; }
    .it-home-categories { --it-home-cat-cols: 6; }
    .it-home-list { --it-home-count: 6; --it-home-peek: 0; }
    .it-home-list__track { overflow: visible; padding-inline: 0; }
    .it-home-card {
        flex: 0 0 calc((100% - (var(--it-home-count) - 1) * var(--it-home-gap)) / var(--it-home-count));
        min-height: 250px;
    }
}

@media (max-width: 639.98px) {
    .it-home-content-box { padding: 16px; }
    .it-home-content-box__body { max-height: 220px; }
    .it-home-list__title,
    .it-home-content-box__title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .it-front-hero__dots button::before,
    .it-home-categories__dots button::after,
    .it-home-content-box__body { transition: none; }
}
