/* ===== Resources Center Styles ===== */

.resource-center {
    width: 100%;
}

/* ===== Digital Platform Hub ===== */
.dph-section {
    background-color: #F7F7F7;
}

.dph-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* When 6 or more cards, show 3 per row */
.dph-grid:has(> .dph-card:nth-child(6)) {
    grid-template-columns: repeat(3, 1fr);
}

/* When fewer than 5 cards, auto-fit card width */
.dph-grid:not(:has(> .dph-card:nth-child(5))) {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dph-card {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 238px;
    position: relative;
    transition: box-shadow .3s ease;
    box-sizing: border-box;
}

.dph-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0,0,0,0.15);
}

.dph-card .detail-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.dph-card-logo {
    height: 56px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.dph-card-logo img {
    max-height: 56px;
    max-width: 180px;
    object-fit: contain;
}

.dph-card .dph-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.dph-card .detail-link {
    margin-top: auto;
}

/* ===== Term & Conditions ===== */

.resource-center .container {
    max-width: 1260px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.resource-center .section-padding {
    padding-top: 80px;
    padding-bottom: 40px;
}

.resource-center .pb-0 {
    padding-bottom: 0 !important;
}

/* Section Titles */
.resource-center .section-title {
    font-size: 40px;
    font-weight: 700;
    padding-bottom: 40px;
    color: #27201F;
    margin: 0;
}

.resource-center .text-center {
    text-align: center;
}

/* Detail Link */
.resource-center .detail-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #DA291C;
    font-size: 16px;
    font-weight: 400;
    margin-top: auto;
    text-decoration: none;
}

.resource-center .detail-link:hover {
    opacity: 0.8;
}

.resource-center .detail-link .arrow {
    width: 16px;
    height: 16px;
}

/* ===== Term & Conditions ===== */
.tc-section {
    background-color: #F7F7F7;
}

.tc-container {
    display: flex;
    gap: 32px;
    align-items: stretch;
    width: 100%;
}

.tc-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
}

.tc-card {
    background-color: #FFFFFF;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: box-shadow .3s ease;
}

.tc-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0,0,0,0.15);
}

.tc-card .detail-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.tc-card .tc-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #000;
}

.tc-image-container {
    flex: 1;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.tc-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Form & Statement + Knowledge Wrapper ===== */
.white-section-wrapper {
    background-color: #FFFFFF;
}

/* ===== Form & Statement ===== */
.fs-section .section-title {
    margin-bottom: 48px;
}

.fs-container {
    display: flex;
    gap: 16px;
}

.fs-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 212px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    transition: box-shadow .3s ease;
}

.fs-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0,0,0,0.15);
}

.fs-card .detail-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.fs-card-img {
    flex: 1;
    background-size: cover;
    background-position: center;
    transition: transform .35s ease;
}

.fs-card:hover .fs-card-img {
    transform: scale(1.05);
}

.fs-card-content {
    background-color: #F7F7F7;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fs-card-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
}

/* ===== Knowledge ===== */
.knowledge-section .section-title {
    margin-bottom: 48px;
}

.k-container {
    display: flex;
    gap: 16px;
}

.k-card {
    flex: 1;
    height: 212px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    position: relative;
    transition: box-shadow .3s ease;
}

.k-card:hover {
    border-radius: 12px;
    box-shadow: 0 0 16px 0 rgb(0,0,0,0.15);
}

.k-card .detail-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.layout-row .k-card-img {
    width: 301px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    transition: transform .35s ease;
}

.k-card:hover .k-card-img {
    transform: scale(1.05);
}

.layout-row .k-card-content {
    flex: 1;
    background-color: #F7F7F7;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.k-card-content .k-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    text-align: left;
}

/* ===== Responsive ===== */
@media (max-width: 1279px) {
    .resource-center .section-title {
        font-size: 28px;
    }

    .resource-center .section-padding {
        padding-top: 60px;
    }
}

@media (max-width: 992px) {
    .tc-container {
        flex-direction: column;
        height: auto;
    }

    .tc-grid {
        height: auto;
    }

    .tc-image-container {
        height: 300px;
        flex: none;
    }

    .fs-container,
    .k-container {
        flex-direction: column;
    }

    .fs-card,
    .k-card {
        height: auto;
    }

    .fs-card-img {
        min-height: 200px;
    }

    .layout-row {
        flex-direction: column;
    }

    .layout-row .k-card-img {
        width: 100%;
        min-height: 200px;
    }
}

@media (min-width: 1896px) { 
    /* 5 cards or fewer: fixed card height on large screens */
    .dph-grid:not(:has(> .dph-card:nth-child(6))) .dph-card {
        height: 280px;
    }
}

@media (max-width: 1896px) and (min-width: 1280px) {
    .dph-card {
        height: 238px;
    }

    /* 5 cards or fewer: show 3 per row */
    .dph-grid:not(:has(> .dph-card:nth-child(6))) {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Fewer than 5 cards: auto-fit width */
    .dph-grid:not(:has(> .dph-card:nth-child(5))) {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 1279px) and (min-width: 768px) {
    .dph-card {
        height: 280px;
    }

    /* 5 cards or fewer: show 3 per row */
    .dph-grid:not(:has(> .dph-card:nth-child(6))) {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Fewer than 5 cards: auto-fit width */
    .dph-grid:not(:has(> .dph-card:nth-child(5))) {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}


@media (max-width: 767px) {
    .dph-grid {
        grid-template-columns: 1fr;
    }

    .dph-grid:has(> .dph-card:nth-child(6)) {
        grid-template-columns: 1fr;
    }

    .tc-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }

    .tc-card {
        min-height: 120px;
    }

    .resource-center .section-title {
        font-size: 28px;
    }

    .resource-center .section-padding {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    .dph-card {
        min-height: 250px;
    }

}

/* Tweak: widen knowledge card content around 1024px */
@media (max-width: 1100px) and (min-width: 993px) {
    .layout-row .k-card-img {
        width: 240px;
    }
}
