/* === critical-metals.css === */

.cm-section {
    background: #edf2f2;
    padding: 0 61px 40px;
}

.cm-card {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #0d3d49;
}

.cm-svg {
    display: block;
    width: 100%;
    height: auto;
}

/* phone-only alternate layout (see @media max-width:767px) */
.cm-mobile { display: none; }

/* Title */
.cm-svg-title {
    font-size: 60px;
    line-height: 60px;
    font-weight: 700;
    fill: #fff4ed;
    text-anchor: middle;
    dominant-baseline: auto;
}

/* ── Mineral group ────────────────────────────────────────── */
.cm-mineral-g {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.3s ease;
}

.cm-mineral-g:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.cm-mineral-g {
    cursor: pointer;
}

/* scale the mineral image only */
.cm-mineral-g image {
    transition: transform 0.35s ease;
    transform-box: fill-box;
    transform-origin: center;
}

.cm-mineral-g:hover image {
    transform: scale(1.18);
}

/* shadow effect */
.cm-mineral-g:hover {
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.55));
}

/* dim background */
.cm-card:hover .cm-bg-img {
    opacity: 0.35;
    filter: blur(1.5px);
}

/* Circle stroke brightens on hover */
.cm-mineral-g .cm-circle-el {
    transition:
        stroke 0.3s ease,
        fill 0.3s ease;
}

.cm-mineral-g:hover .cm-circle-el {
    stroke: rgba(255, 255, 255, 0.7);
    fill: rgba(255, 255, 255, 0.18);
}

/* Placeholder */
.cm-img-placeholder {
    opacity: 0;
    pointer-events: none;
}
.cm-mineral-g.img-failed .cm-img-placeholder {
    opacity: 1;
}

/* ── Labels — low opacity default, full on hover ─────────── */
.cm-label {
    font-weight: 700;
    fill: rgba(255, 255, 255, 0.38);
    text-anchor: middle;
    pointer-events: none;
    transition: fill 0.3s ease;
}

.cm-label--lg {
    font-size: 22px;
}
.cm-label--md {
    font-size: 20px;
}

/* Labels brighten when sibling mineral-g is hovered
   We use JS to toggle a class on the text element */
.cm-label.is-hovered {
    fill: #fff4ed;
}

/* ── Body text ────────────────────────────────────────────── */
.cm-body-fo {
    font-size: 20px;
    font-weight: 400;
    line-height: 28px;
    color: #fff4ed;
    text-align: center;
}

/* ── Button ───────────────────────────────────────────────── */
.cm-btn-fo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.cm-btn {
    display: inline-block;
    background: #074158;
    color: #fff4ed;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 44px;
    border-radius: 40px;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    transition: background 0.25s;
    white-space: nowrap;
    transform: translate(0, 0) !important;
}

.cm-btn:hover {
    background: #e8521a;
    border-color: #e8521a;
}

/* Responsive */
@media (max-width: 767px) {
    .cm-section {
        padding: 16px 20px 24px;
    }

    /* Swap the fixed SVG composition for a horizontal metals slider with the
       heading, copy and CTA stacked below it. Desktop is untouched. */
    .cm-svg { display: none; }
    .cm-mobile {
        display: block;
        padding: 13px 0 28px;
        background: linear-gradient(rgba(80, 121, 137, 0.9), rgba(80, 121, 137, 0.9)),
            url("/dist/images/home/critical-metals-bg.jpg") center / cover no-repeat;
    }
    /* All five metals in a 2-2-1 grid (last one centred across both columns)
       instead of a horizontal slider, so nothing scrolls off-screen. */
    .cm-mobile__slider {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 22px 16px;
        list-style: none;
        margin: 0 0 22px;
        padding: 0 20px;
        justify-items: center;
    }
    .cm-mobile__item {
        width: 100px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .cm-mobile__item:last-child {
        grid-column: 1 / -1;
    }
    .cm-mobile__circle {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        border: 1.5px solid rgba(255, 255, 255, 0.3);
        display: grid;
        place-items: center;
        overflow: hidden;
    }
    .cm-mobile__circle img {
        width: 92px;
        height: 92px;
        border-radius: 50%;
        object-fit: cover;
    }
    .cm-mobile__label {
        color: #f2f2f2;
        font-size: 14px;
        line-height: 18px;
        text-align: center;
    }
    .cm-mobile__body {
        margin: 0 20px 22px;
        color: rgba(242, 242, 242, 0.92);
        font-size: 14px;
        line-height: 21px;
        text-align: center;
    }
    .cm-mobile__btn {
        display: table;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .cm-section {
        padding: 12px 12px 18px;
    }
}
