/* ============================================================
   three-axis-cards.css
   Machine card styles — mirrors the trade-show event-card pattern
   ============================================================ */

/* Page title */
.main-page-title {
    font-size: 32px;
    margin-bottom: 10px;
    margin-top: 40px;
    color: #333;
}

/* Decorative separator line under title */
.title-separator {
    width: 80px;
    height: 4px;
    background-color: #a00;
    margin: 15px auto 25px;
    border-radius: 2px;
}

/* ============================================================
   GRID — equal-height rows in Bootstrap 3 float layout
   ============================================================ */

.machine-card-grid {
    margin-bottom: 20px;
}

/* Each column stretches to full row height via flex */
.machine-card-grid .col-md-4,
.machine-card-grid .col-sm-6 {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

/* Clear floats after every 3rd card on desktop */
.machine-card-grid .col-md-4:nth-child(3n+1) {
    clear: left;
}

/* Anchor wrapping the whole card */
a.machine-card-link {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

a.machine-card-link:hover,
a.machine-card-link:focus {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   THE CARD — fixed minimum height so all cards are uniform
   ============================================================ */

.machine-card {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;           /* stretches to fill column height */
    min-height: 520px;        /* tall enough for the largest card */
    background: #fff;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.machine-card-link:hover .machine-card {
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    transform: translateY(-3px);
}

/* ============================================================
   IMAGE AREA — white background, proportional scaling
   ============================================================ */

.machine-img-wrapper {
    width: 100%;
    height: 220px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #c8c8c8;
}

.machine-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ============================================================
   CARD BODY
   ============================================================ */

.machine-title {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    padding: 16px 16px 4px;
    line-height: 1.2;
}

.machine-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #a00;
    padding: 0 16px 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-height: 28px;
}

/* Description grows to fill remaining card space */
.machine-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    padding: 0 16px 16px;
    flex-grow: 1;
}

/* ============================================================
   CARD FOOTER LINK BAR — always pinned to bottom
   ============================================================ */

.machine-footer-link {
    background-color: #a00;
    color: #fff;
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    margin-top: auto;
}

a.machine-card-link:hover .machine-footer-link {
    background-color: #800;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {
    .machine-img-wrapper {
        height: 190px;
    }
    /* 2-per-row on tablet — reset 3-col clear, apply 2-col clear */
    .machine-card-grid .col-md-4:nth-child(3n+1) {
        clear: none;
    }
    .machine-card-grid .col-sm-6:nth-child(2n+1) {
        clear: left;
    }
    .machine-card {
        min-height: 480px;
    }
}

@media (max-width: 767px) {
    .machine-img-wrapper {
        height: 170px;
    }
    .main-page-title {
        font-size: 24px;
    }
    .machine-card {
        min-height: 460px;
    }
}

@media (max-width: 480px) {
    .machine-card-grid .col-sm-6 {
        width: 100%;
        float: none;
        clear: none;
    }
    .machine-img-wrapper {
        height: 200px;
    }
    /* Single column — no min-height needed, cards size naturally */
    .machine-card {
        min-height: 0;
    }
}
