/* ========================================
   Statistikk under header
======================================== */
.stat-item {
    opacity: 1;
    transform: translateY(12px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.stat-item.show {
    opacity: 1;
    transform: translateY(0);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;

    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;


    min-height: 75px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 12px 22px;

    border-right: 1px solid #e5e5e5;

    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item.show {
    opacity: 1;
    transform: translateY(0);
}

.stat-label {
    color: #d71920;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.stat-item h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1c1c1c;
}



/* Overskrift */
/* ========================================
   STM GRUPPEN – VÅRE SELSKAPER
======================================== */

.stm-companies {
    --stm-red: #d71920;
    --stm-dark: #171a1d;
    --stm-body: #50565b;
    --stm-muted: #7d858c;
    --stm-border: #d8dde1;
    --stm-section-bg: #f4f5f5;

    padding: 0 24px 100px;
    background: var(--stm-section-bg);
}

.stm-companies__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


/* ========================================
   INTRO – VÅRE SELSKAPER
======================================== */

.companies-intro {
    padding: 70px 24px 35px;
    background: #f4f5f5;
}

.companies-intro__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.companies-intro__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 18px;

    color: #d71920;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.companies-intro__eyebrow::before {
    content: "";
    width: 30px;
    height: 2px;
    background: #d71920;
}

.companies-intro__grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 45px;
    align-items: end;
}

.companies-intro h2 {
    margin: 0;

    color: #171a1d;
    font-size: clamp(40px,4vw,56px);
    font-weight: 650;
    line-height: .98;
    letter-spacing: -.05em;
}

.companies-intro p {
    margin: 0;

    max-width: 470px;

    color: #50565b;
    font-size: 16px;
    line-height: 1.7;
}

@media (max-width:900px){

    .companies-intro{
        padding:60px 20px 30px;
    }

    .companies-intro__grid{
        grid-template-columns:1fr;
        gap:18px;
    }

}

/* Rutenett */

.stm-companies__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}


/* Kort */

.stm-company-card {
    position: relative;

    display: flex;
    min-width: 0;
    min-height: 405px;
    padding: 28px;

    flex-direction: column;

    background: #ffffff;
    border: 1px solid var(--stm-border);

    text-decoration: none;
    color: inherit;
    cursor: pointer;

    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.stm-company-card::before {
    content: "";

    position: absolute;
    top: -1px;
    left: -1px;

    width: 0;
    height: 3px;

    background: var(--stm-red);

    transition: width 240ms ease;
}

.stm-company-card:hover {
    z-index: 2;

    transform: translateY(-4px);
    border-color: #c6ccd1;

    box-shadow: 0 16px 35px rgba(22, 29, 34, 0.07);
}

.stm-company-card:hover::before {
    width: calc(100% + 2px);
}


/* Nummer */

.stm-company-card__number {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 25px;
    padding-bottom: 8px;

    color: var(--stm-red);
    border-bottom: 1px solid var(--stm-red);

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;
}


/* Tittel og illustrasjon */

.stm-company-card__title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 16px;
    align-items: center;

    min-height: 64px;
    margin-bottom: 17px;
}

.stm-company-card__title-row h3 {
    margin: 0;

    color: var(--stm-dark);
    font-size: 24px;
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.stm-company-card__illustration {
    width: 70px;
    justify-self: end;

    color: #aeb6bc;
    pointer-events: none;

    transition:
        color 220ms ease,
        transform 220ms ease;
}

.stm-company-card__illustration svg {
    display: block;
    width: 100%;
    height: auto;
}

.stm-svg-line {
    fill: none;
    stroke: #b9c0c5;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.stm-company-card:hover .stm-company-card__illustration {
    color: #8e989f;
    transform: translateY(-2px);
}


/* Beskrivelse */

.stm-company-card__description {
    max-width: 100%;
    margin: 0;

    color: var(--stm-body);
    font-size: 14px;
    line-height: 1.68;
}


/* Nederste del */

.stm-company-card__bottom {
    margin-top: auto;
    padding-top: 22px;
}

.stm-company-card__facts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;

    min-height: 34px;
    padding-top: 16px;
    margin-bottom: 19px;

    border-top: 1px solid var(--stm-border);
}

.stm-company-card__year,
.stm-company-card__location {
    color: var(--stm-muted);
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    white-space: nowrap;
}

.stm-company-card__location {
    text-align: right;
}

.stm-company-card__tags {
    display: flex;
    min-width: 0;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.stm-company-card__tags span {
    display: inline-flex;
    min-height: 23px;
    padding: 5px 7px;

    align-items: center;

    color: #626a70;
    background: #ffffff;
    border: 1px solid #d5dade;

    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}


/* Welding har lengre tekst i taggen */

.stm-company-card:nth-child(3) .stm-company-card__tags span {
    padding-right: 6px;
    padding-left: 6px;
    font-size: 8.3px;
    letter-spacing: 0.035em;
}


/* Lenke */

.stm-company-card__link {
    display: flex;
    width: 100%;

    align-items: center;
    justify-content: space-between;

    color: var(--stm-red);
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: 0.07em;
    text-decoration: none;
    text-transform: uppercase;
}

.stm-company-card__arrow {
    font-size: 21px;
    font-weight: 400;
    line-height: 1;

    transition: transform 180ms ease;
}

.stm-company-card:hover .stm-company-card__arrow {
    transform: translateX(5px);
}

.stm-company-card__link:focus-visible {
    outline: 2px solid var(--stm-red);
    outline-offset: 6px;
}


/* Kontaktruten */

.stm-company-card--contact {
    background:
        linear-gradient(
            135deg,
            rgba(215, 25, 32, 0.025),
            transparent 55%
        ),
        #ffffff;
}

.stm-company-card--contact .stm-company-card__bottom {
    border-top: 1px solid var(--stm-border);
}






/* Nettbrett */

@media (max-width: 1050px) {
    .stm-companies__heading-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .stm-companies__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stm-company-card {
        min-height: 390px;
    }
}


/* Mobil */

@media (max-width: 700px) {

    .companies-intro {
    padding: 50px 18px 28px;
}

.companies-intro h2 {
    font-size: 36px;
    line-height: 1.05;
}

.companies-intro p {
    font-size: 15px;
}
    .stm-companies {
        padding: 0px 18px 70px;
    }

    .stm-companies__heading {
        margin-bottom: 30px;
    }

    .stm-companies__heading h2 {
        font-size: 42px;
    }

    .stm-companies__heading p {
        font-size: 15px;
    }

    .stm-companies__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .stm-company-card {
        min-height: 375px;
        padding: 24px;
    }

    .stm-company-card__number {
        margin-bottom: 21px;
    }

    .stm-company-card__title-row {
        grid-template-columns: minmax(0, 1fr) 72px;
        min-height: 58px;
    }

    .stm-company-card__title-row h3 {
        font-size: 22px;
    }

    .stm-company-card__illustration {
        width: 72px;
    }

    .stm-company-card__facts {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .stm-company-card__location {
        grid-column: 1 / -1;
        text-align: left;
    }
}


/* Små mobiler */

@media (max-width: 410px) {
    .stm-company-card__facts {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-direction: column;
    }

    .stm-company-card__location {
        text-align: left;
    }
}

/* ========================================
   STATISTIKK – RESPONSIV
======================================== */

@media (max-width: 600px) {

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: hidden;
    }

    .stat-item {
        min-width: 0;
        min-height: 74px;
        padding: 12px 14px;
        border-right: 1px solid #e5e5e5;
        border-bottom: 1px solid #e5e5e5;
    }

    .stat-item:nth-child(2n) {
        border-right: none;
    }

    .stat-item:nth-last-child(-n + 2) {
        border-bottom: none;
    }

    .stat-label {
        font-size: 8px;
        letter-spacing: 1px;
        white-space: normal;
    }

    .stat-item h3 {
        font-size: 17px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
}
/* Redusert animasjon */

@media (prefers-reduced-motion: reduce) {
    .stm-company-card,
    .stm-company-card::before,
    .stm-company-card__illustration,
    .stm-company-card__arrow {
        transition: none;
    }

    .stm-company-card:hover {
        transform: none;
    }
}

@media (max-width: 600px) {

    .companies-intro {
        padding: 42px 18px 24px;
    }

    .companies-intro h2 {
        font-size: 31px;
        line-height: 1.05;
    }

    .companies-intro p {
        font-size: 14px;
        line-height: 1.6;
    }

    .stm-company-card {
        min-height: 0;
        padding: 22px 20px;
    }

    .stm-company-card__title-row h3 {
        font-size: 20px;
    }

    .stm-company-card__illustration {
        width: 58px;
    }

    .stm-company-card__description {
        font-size: 13px;
        line-height: 1.6;
    }
}

