/* =========================================
   PRODUCTS & SERVICES ECOSYSTEM STYLES
   ========================================= */

/* -----------------------------------------
   1. UNIVERSAL CATEGORY GRID SYSTEM
   ----------------------------------------- */
.custom-grid-wrap {
    max-width: 1170px;
    width: 95%;
    margin: 0 auto;
    padding: 50px 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

.custom-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px 20px;
    width: 100%;
}

.custom-card {
    width: calc(33.3333% - 15px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin-bottom: 30px;
}

.custom-card-img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 250px;
    margin-bottom: 20px;
    text-decoration: none;
    background: transparent;
    border: none;
    box-sizing: border-box;
}

.custom-card-img img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border: none;
}

.custom-card h2 {
    margin: 0 0 10px 0;
    padding: 0;
    text-align: left;
    position: static;
}

.custom-card h2 a {
    font-weight: 600;
    color: #2b2f74;
    line-height: 1.3;
    font-size: 19px;
    text-decoration: none;
    transition: all .3s ease-out;
}

.custom-card h2 a:hover {
    text-decoration: underline;
}

.custom-card h2:after,
.custom-card h2 a:after {
    display: none;
}

.custom-card p {
    font-weight: 400;
    color: #40464a;
    line-height: 1.4;
    text-align: left;
    font-size: 16px;
    margin: 0;
    flex-grow: 1;
}

/* -----------------------------------------
   2. PRODUCT & UTILITY DETAIL CONTAINER & HEADINGS
   ----------------------------------------- */
.content-page.hardware-detail-page,
.content-page.optoc-detail-page,
.content-page.utility-detail-page {
    width: 100%;
    padding: 40px 0 60px 0;
    font-family: 'Roboto', sans-serif;
    color: #40464a;
    box-sizing: border-box;
}

.hardware-detail-page .wrap,
.optoc-detail-page .wrap,
.utility-detail-page .wrap {
    max-width: 1170px;
    width: 95%;
    margin: 0 auto;
    box-sizing: border-box;
}

.content-page .structure-content-block {
    width: 100%;
    margin-bottom: 25px;
    display: block;
}

.content-page .structure-content-block::after,
.content-page .clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Section Headings with Blue Bottom Line */
.content-page h2.h4 {
    font-size: 24px;
    font-weight: bold;
    color: #40464a;
    margin: 30px 0 35px 0;
    position: relative;
    line-height: 1.3;
    text-transform: uppercase;
}

.content-page h2.h4::after {
    content: '';
    width: 160px;
    height: 5px;
    border-bottom: 3px solid #21256d;
    position: absolute;
    bottom: -15px;
    left: 0;
}

/* Paragraphs & Text Lists */
.content-page p {
    color: #40464a;
    font-size: 19px;
    font-weight: 400;
    line-height: 25px;
    text-align: justify;
    margin: 0 0 20px 0;
}

.content-page p em {
    font-size: 16px;
    color: #747f86;
    font-style: italic;
}

.content-page ul,
.content-page ul.text-wrap-list,
.content-page ol.text-wrap-list {
    float: none !important;
    width: auto !important;
    clear: none !important;
    display: block !important;
    overflow: visible !important;
    padding: 0;
    margin: 15px 0 25px 0;
    list-style: none;
    box-sizing: border-box;
}

/* Fix Ordered Lists with Bold Blue Numbers */
.content-page ol.text-wrap-list {
    list-style-type: decimal !important;
    padding-left: 25px !important;
    margin-bottom: 30px;
    float: none !important;
    width: auto !important;
}

.content-page ol.text-wrap-list li {
    font-size: 19px;
    line-height: 25px;
    color: #40464a;
    margin-bottom: 10px;
    padding-left: 5px;
    float: none !important;
    width: auto !important;
}

/* Style the numbers in bold brand blue color */
.content-page ol.text-wrap-list li::marker {
    font-weight: bold;
    color: #21256d;
}

.content-page ul li,
.content-page ul.text-wrap-list li {
    float: none !important;
    width: auto !important;
    clear: none !important;
    font-size: 19px;
    line-height: 25px;
    color: #40464a;
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
    text-align: left;
}

.content-page ul li::before,
.content-page ul.text-wrap-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8.5px;
    width: 8px;
    height: 8px;
    background: #21256d;
}

.content-page ul li ul {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* -----------------------------------------
   3. RIGHT FLOATED IMAGES (SPECIFIC SECTION SIZES)
   ----------------------------------------- */

/* Shared Floated Image Settings */
.content-page .gallery-item.right-img,
.content-page .pic-with-desc.right,
.content-page .pic-with-desc.align.right {
    float: right;
    margin-left: 30px;
    margin-bottom: 20px;
    margin-top: 5px;
    display: block;
    position: relative;
    z-index: 5; /* Ensures clickable link overlay */
}

.content-page .gallery-item.right-img img,
.content-page .pic-with-desc.right img {
    width: 100%;
    height: auto;
    display: block;
}

/* Hardware Subpages (Portrait Machine Images) */
.hardware-detail-page .gallery-item.right-img,
.optoc-detail-page .gallery-item.right-img {
    width: 38%;
    max-width: 380px;
}

/* Utility & MES/OEE/SPC Subpages (Horizontal Diagrams) */
.utility-detail-page .pic-with-desc.right,
.hardware-detail-page .pic-with-desc.right {
    width: 45%;
    max-width: 500px;
}

/* Centered Schematics & Image Captions */
.content-page .gallery-item.center-img,
.content-page .pic-with-desc.center {
    display: block;
    margin: 30px auto;
    text-align: center;
    max-width: 100%;
    float: none;
}

.content-page .gallery-item.center-img img,
.content-page .pic-with-desc.center img {
    display: inline-block;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
}

.content-page .img-caption,
.content-page .img-desc,
.content-page .img-desc p,
.content-page .img-desc span {
    font-size: 16px;
    line-height: 23px;
    color: #747f86;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 20px;
    font-weight: 400;
    display: block;
}

/* -----------------------------------------
   4. TABLES (CLASSIC & 2-COLUMN GRID)
   ----------------------------------------- */

.content-page .table-responsive {
    clear: both !important;
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
    margin-bottom: 20px;
}

.content-page table.clasic {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    border: 1px solid #21256d;
}

.content-page table.clasic thead tr th {
    background: #21256d !important;
    height: 55px;
    text-align: left;
    vertical-align: middle;
    font-size: 18px;
    color: #ffffff !important;
    font-weight: 600;
    padding: 12px 20px;
    border: none;
}

.content-page table.clasic tbody tr {
    background: #ffffff !important;
}

.content-page table.clasic tbody tr:nth-of-type(odd) td {
    background: #f2f2f2 !important;
    border-bottom: 1px solid #e0e0e0;
    border-top: 1px solid #e0e0e0;
}

.content-page table.clasic tbody tr td {
    padding: 12px 20px;
    text-align: left;
    vertical-align: middle;
    font-size: 16px;
    color: #40464a;
    line-height: 24px;
    border-top: 1px solid #e0e0e0;
}

/* 2-Column Side-by-Side Tables Grid (Hardware/Optocoupler) */
.optoc-detail-page .table-grid-2col {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
    align-items: flex-start;
}

.optoc-detail-page .table-grid-2col .table-responsive {
    flex: 1 1 calc(50% - 10px);
    min-width: 300px;
    margin-bottom: 0 !important;
    height: auto !important;
}

.optoc-detail-page .table-grid-2col table.clasic {
    margin-bottom: 0 !important;
}

/* -----------------------------------------
   5. 3-COLUMN GALLERY GRID (MASA & CHARTS)
   ----------------------------------------- */
.gallery-grid-3col {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    margin-top: 25px;
}

.gallery-grid-3col .gallery-card {
    flex: 1 1 calc(33.3333% - 14px);
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.gallery-grid-3col .gallery-card a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 240px;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
    margin-bottom: 15px;
}

.gallery-grid-3col .gallery-card img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-grid-3col .gallery-card .img-caption {
    margin-top: auto;
}

/* -----------------------------------------
   6. WYSIWYG SAFE DOWNLOAD BLOCK
   ----------------------------------------- */
.download-block,
.content-page .download {
    float: left;
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
    background: #f2f2f2 !important;
}

.download-top,
.content-page .download .top {
    float: left;
    width: 100%;
    height: 8px;
    background: #21256d !important;
    position: relative;
}

.download-top:after,
.content-page .download .top:after {
    top: 100%;
    left: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
    border-top-color: #21256d;
    border-width: 25px;
    margin-left: -25px;
}

.download-inner,
.content-page .download .inner {
    float: left;
    width: 100%;
    padding: 55px 0 35px;
}

.download-link,
.content-page .download .a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: auto;
    width: 70%;
    background: #f9f9f9 !important;
    border: 1px dotted #777777 !important;
    padding: 20px 15px;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: all .3s ease-out;
}

.download-link:hover,
.content-page .download .a:hover {
    border-color: #21256d !important;
    background: #edeeff !important;
    border-style: solid !important;
}

span.download-ico,
.content-page .download .a span.ico {
    width: 30%;
    text-align: center;
    display: block;
}

span.download-ico img,
.content-page .download .a span.ico img {
    display: inline-block;
    height: 55px;
    margin-bottom: 10px;
}

span.download-ico em,
.content-page .download .a span.ico em {
    display: block;
    width: 100%;
    font-weight: 400;
    font-size: 16px;
    color: #40464a;
    line-height: 25px;
    font-style: normal;
}

span.download-text,
.content-page .download .a span.text {
    width: 70%;
    text-align: center;
    color: #21256d;
    font-size: 19px;
    font-weight: 600;
    line-height: 25px;
    display: block;
    margin: 0;
}

/* -----------------------------------------
   7. MOBILE RESPONSIVE ADAPTATIONS
   ----------------------------------------- */
@media (max-width: 900px) {
    .custom-card { 
        width: calc(50% - 10px); 
    }
}

@media (max-width: 768px) {
    .custom-card { 
        width: 100%; 
    }

    .custom-card-img { 
        height: auto; 
        min-height: 200px; 
    }

    .content-page .gallery-item.right-img,
    .content-page .pic-with-desc.right {
        width: 100%;
        float: none;
        margin-left: 0;
    }

    .content-page table.clasic thead tr th,
    .content-page table.clasic tbody tr td {
        padding: 10px 12px;
        font-size: 16px;
    }

    .optoc-detail-page .table-grid-2col .table-responsive,
    .gallery-grid-3col .gallery-card {
        flex: 1 1 100%;
    }
}

@media (max-width: 560px) {
    .download-link,
    .content-page .download .a {
        flex-wrap: wrap;
        width: 90%;
    }

    span.download-ico,
    .content-page .download .a span.ico {
        width: 100%;
        margin-bottom: 15px;
    }

    span.download-text,
    .content-page .download .a span.text {
        width: 100%;
    }
}