/* Home page: specialist fields (views/site/_specialties.php, assets/js/home-specialties.js) */
.sp {
    position: relative;
    padding: 30px;
    border-radius: 30px;
    background: #ECF1F7;
}
@media (min-width: 1024px) {
    .sp {
        margin-inline-end: 40px;
    }
}
.sp-grid {
    --mx: -999px;
    --my: -999px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

/* title card */
.sp-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 20px 28px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(240px circle at 0 100%, rgba(238, 93, 56, .3), transparent),
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px) 0 0 / 16px 16px,
        #100D2C;
    box-shadow: 0 20px 40px -22px rgba(17, 14, 45, .8);
}
[dir="ltr"] .sp-head {
    background:
        radial-gradient(240px circle at 100% 100%, rgba(238, 93, 56, .3), transparent),
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px) 0 0 / 16px 16px,
        #100D2C;
}
.sp-head-icon {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
}
.sp-head-shadow {
    position: absolute;
    top: 4px;
    inset-inline-start: 8px;
    width: 20px;
    height: 20px;
    background: #100D2C;
    box-shadow: 0 6px 14px -2px rgba(238, 93, 56, .55);
}
.sp-head-icon svg {
    position: relative;
}
.sp-head-text {
    flex: 1;
    min-width: 0;
    padding-inline-start: 16px;
    border-inline-start: 2px dashed rgba(255, 255, 255, .08);
}
.sp-title {
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.5;
}
.sp-sub {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .55);
}
.sp-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 12px;
}
.sp-count strong {
    font-size: 38px;
    line-height: 1;
    text-shadow: 0 0 22px rgba(238, 93, 56, .6);
}
.sp-count span {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .65);
}

/* industry cards: the border lights where the pointer is (per-card --x/--y set by JS) */
.sp-card {
    color: inherit;
    --x: -999px;
    --y: -999px;
    --rx: 0deg;
    --ry: 0deg;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1.5px solid transparent;
    border-radius: 22px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        radial-gradient(260px circle at var(--x) var(--y), rgba(238, 93, 56, .75), rgba(17, 14, 45, .06) 60%) border-box;
    box-shadow: 0 10px 24px -18px rgba(17, 14, 45, .4);
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
    will-change: transform;
}
.sp-card.is-hot {
    box-shadow: 0 24px 40px -22px rgba(238, 93, 56, .6);
    transition: transform .08s linear, box-shadow .3s;
}
.sp-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(220px circle at var(--x) var(--y), rgba(238, 93, 56, .09), transparent 70%);
    pointer-events: none;
}
/* the old corner notch: the number sits in it, half above the card's top edge */
.sp-notch {
    position: absolute;
    top: -1.5px;
    inset-inline-start: -1.5px;
    pointer-events: none;
}
.sp-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: -20px;
}
.sp-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    color: #fff;
    background: #110E2D;
    font-size: 21px;
    transition: background .3s;
}
.sp-card.is-hot .sp-num {
    background: #EE5D38;
}
.sp-icon {
    margin-top: 20px;
}
.sp-icon svg {
    width: 52px;
    height: 52px;
    transition: transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.sp-card.is-hot .sp-icon svg {
    transform: translateY(-4px) rotate(-8deg) scale(1.08);
}
.sp-name {
    position: relative;
    margin-top: 12px;
    font-size: 20px;
    line-height: 1.6;
    color: #110E2D;
}

/* the line under the title, swapped for examples + a link on hover / focus */
.sp-swap {
    position: relative;
    display: grid;
    margin-top: 6px;
    min-height: 92px;
}
.sp-desc,
.sp-more {
    grid-area: 1 / 1;
    transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.sp-desc {
    font-size: 13.5px;
    line-height: 2;
    color: rgba(17, 14, 45, .6);
}
.sp-more {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.sp-card:hover .sp-desc,
.sp-card:focus-within .sp-desc {
    opacity: 0;
    transform: translateY(-8px);
}
.sp-card:hover .sp-more,
.sp-card:focus-within .sp-more {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.sp .sp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sp .sp-chips li {
    padding: 4px 10px;
    border-radius: 999px;
    color: #110E2D;
    background: #F2F4F9;
    font-size: 12px;
    line-height: 1.7;
}
.sp .sp-chips li::before {
    content: none;
}
.sp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: #EE5D38;
    font-size: 12.5px;
    font-weight: 700;
}
.sp-card:hover .sp-link {
    gap: 10px;
}

/* entrance (only once JS runs) */
.sp-ready .sp-card,
.sp-ready .sp-head {
    opacity: 0;
    translate: 0 14px;
}
.sp-ready.is-in .sp-card,
.sp-ready.is-in .sp-head {
    animation: spIn .55s cubic-bezier(.2, .7, .2, 1) forwards;
    animation-delay: calc(var(--i, -1) * 70ms + 70ms);
}
@keyframes spIn {
    to { opacity: 1; translate: 0 0; }
}

/* touch screens and small widths: no hover, so show everything */
@media (hover: none), (max-width: 767px) {
    .sp-swap {
        display: block;
        min-height: 0;
    }
    .sp-desc,
    .sp-card:hover .sp-desc,
    .sp-card:focus-within .sp-desc {
        opacity: 1;
        transform: none;
    }
    .sp-more {
        margin-top: 10px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}
@media (max-width: 1279px) {
    .sp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
/* three columns: the title card takes two rows so 1 + 7 cards fill the grid */
@media (min-width: 1024px) and (max-width: 1279px) {
    .sp-head {
        grid-row: span 2;
    }
}
@media (max-width: 1023px) {
    .sp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}
@media (max-width: 640px) {
    .sp {
        padding: 34px 14px 14px;
        border-radius: 22px;
    }
    .sp-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
    .sp-card {
        padding: 16px;
    }
    .sp-name {
        font-size: 18px;
    }
    .sp-icon svg {
        width: 44px;
        height: 44px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .sp-card,
    .sp-card.is-hot {
        transform: none;
    }
    .sp-ready .sp-card,
    .sp-ready .sp-head,
    .sp-ready.is-in .sp-card,
    .sp-ready.is-in .sp-head {
        opacity: 1;
        translate: none;
        animation: none;
    }
}
