/*
  Page-specific stylesheet for Sheet Metal Service Page
  Version: 3.5 - Geometric Perfection Achieved
*/

/* --- Shell Module Consistency --- */
.page-hero,
.final-cta-section {
    background-image: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url(../images/backgrounds/hero-bg-sheet-metal.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- Universal Section Spacing & Titles --- */
.capabilities-sm-section,
.materials-section-sm,
.related-cases-section {
    padding: var(--section-padding);
}

.details-content-sm h2,
.materials-section-sm h2,
.related-cases-section h2 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 4rem;
    text-align: center;
}

/* --- Section 1: "Folded-Panel" Capabilities Grid --- */
.details-grid-sm {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1024px;
    margin: 0 auto;
}

.details-content-sm p {
    color: var(--color-secondary);
    line-height: 1.7;
    max-width: 650px;
    margin: -2rem auto 0 auto;
    text-align: center;
}

.capabilities-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

@media (min-width: 1200px) {
    .capabilities-grid-sm {
        grid-template-columns: repeat(4, 1fr);
    }
}

.capability-panel {
    background-color: var(--color-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.capability-panel:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.07);
}

.capability-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(to top right,
            rgba(0, 0, 0, 0) 50%,
            rgba(0, 0, 0, 0.05) 50%);
    border-top-right-radius: 12px;
    border-bottom-left-radius: 20px;
}

.capability-panel img {
    height: 40px;
    margin: 0 auto 1.5rem auto;
}

.capability-panel h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.capability-panel p {
    color: var(--color-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* --- Section 2: "Interactive Folding Blueprint" (GEOMETRY PERFECTED) --- */
.folding-blueprint-section {
    background-color: var(--color-light-grey);
    position: relative;
}

.blueprint-sticky-wrapper {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.blueprint-intro-content {
    text-align: center;
    max-width: 600px;
}

.blueprint-intro-content h2 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.blueprint-intro-content p {
    color: var(--color-secondary);
    margin-bottom: 3rem;
}

.blueprint-container {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: var(--container-width);
    padding: 0 2rem;
}

@media(min-width: 992px) {
    .blueprint-container {
        grid-template-columns: 2fr 3fr;
        gap: 5rem;
    }
}

.step-content {
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.step-content.is-active {
    opacity: 1;
}

.step-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: var(--color-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.blueprint-scene {
    perspective: 2500px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
}

.blueprint-model {
    position: relative;
    width: 200px;
    height: 150px;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(40deg);
    transition: transform 1s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.blueprint-panel {
    position: absolute;
    top: 0;
    left: 0;
    background-color: transparent;
    border: 1.5px solid var(--color-primary);
    box-sizing: border-box;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- STEP 1: The TRUE FLAT LAYOUT --- */
.panel-base {
    width: 200px;
    height: 150px;
}

.panel-front {
    width: 200px;
    height: 75px;
    transform-origin: top;
    transform: translateY(150px);
}

/* ★ CORRECTED DIMENSIONS & POSITION */
.panel-side-left {
    width: 75px;
    height: 150px;
    transform-origin: right;
    transform: translateX(-75px);
}

/* ★ CORRECTED DIMENSIONS */
.panel-side-right {
    width: 75px;
    height: 150px;
    transform-origin: left;
    transform: translateX(200px);
}

.panel-top {
    width: 200px;
    height: 75px;
    transform-origin: bottom;
    transform: translateY(-75px);
}


/* --- THE CORRECTED FOLDING ANIMATIONS --- */

/* Step 2: Fold Front Panel up */
.is-step-2 .panel-front,
.is-step-3 .panel-front,
.is-step-4 .panel-front {
    transform: translateY(150px) rotateX(-90deg);
}

/* Step 3: Fold Side Panels inward */
.is-step-3 .panel-side-left,
.is-step-4 .panel-side-left {
    /* ★ CORRECTED POSITION & ROTATION */
    transform: translateX(-75px) rotateY(-90deg);
}

.is-step-3 .panel-side-right,
.is-step-4 .panel-side-right {
    /* ★ CORRECTED ROTATION */
    transform: translateX(200px) rotateY(90deg);
}

/* Step 4: Fold Back Panel up */
.is-step-4 .panel-top {
    transform: translateY(-75px) rotateX(90deg);
}


/* --- Section 3: "Metallic Sheen" Materials (Final Polished Version) --- */
.materials-section-sm {
    background-color: var(--color-dark);
}

.materials-section-sm h2 {
    color: var(--color-light);
}

.materials-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    /* Increased gap to give text space */
}

@media (min-width: 1200px) {
    .materials-grid-sm {
        grid-template-columns: repeat(4, 1fr);
    }
}

.material-item-sm {
    text-align: center;
}

.material-card-sm {
    position: relative;
    display: block;
    /* Changed to block */
    height: 180px;
    /* Gave the card a fixed height */
    border-radius: 12px;
    /* Increased radius for a softer look */
    background-color: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-size: cover;
    background-position: center;
    margin-bottom: 1.25rem;
    /* Space between card and text */
}


.material-item-sm h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.material-item-sm h3 a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.material-item-sm h3 a:hover {
    color: var(--color-light);
}

/* The sheen effect remains the same, but now applies to a pure image card */
.material-card-sm::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 75%;
    height: 200%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            /* Slightly brighter sheen */
            transparent);
    transform: rotate(25deg);
    transition: left 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    /* Smoother transition */
}

.material-card-sm:hover::before {
    left: 150%;
}


/* --- Section 4: Retained & Polished Case Study --- */
.related-cases-section {
    background-color: var(--color-light-grey);
}