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

.cm-section {
    background: #edf2f2;
    padding: 20px 40px 60px;
}

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

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

/* 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: 500;
    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: left;
}

/* ── 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: 900px) {
    .cm-section {
        padding: 16px 20px 48px;
    }
    .cm-svg-title {
        font-size: 36px;
    }
    .cm-label--lg {
        font-size: 16px;
    }
    .cm-label--md {
        font-size: 14px;
    }
    .cm-body-fo {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .cm-section {
        padding: 12px 12px 36px;
    }
    .cm-svg-title {
        font-size: 26px;
    }
    .cm-label--lg {
        font-size: 13px;
    }
    .cm-label--md {
        font-size: 11px;
    }
}
