/* ========================================
   KPCM Homepage: Latest Messages
======================================== */

.kpcm-latest-messages {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: calc(100% - 80px) !important;
    max-width: 1560px !important;
    margin: 0 auto !important;
    padding: 50px 0 58px !important;
    box-sizing: border-box;
    border-bottom: 2px solid #eae7e4;
}

.kpcm-latest-messages > *,
.kpcm-latest-messages .elementor-widget-shortcode,
.kpcm-latest-messages .elementor-shortcode {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

.kpcm-latest-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 30px !important;
    width: 100%;
    margin: 0 0 25px !important;
}

.kpcm-latest-title-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 28px !important;
    margin: 0 !important;
}

.kpcm-latest-heading,
.kpcm-latest-heading h2,
.kpcm-latest-heading h3 {
    margin: 0 !important;
    padding: 0 !important;
    color: #442b17;
    font-family: "Lora", serif !important;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.2;
}

.kpcm-latest-heading-ko,
.kpcm-latest-heading-ko p {
    margin: 0 !important;
    padding: 0 !important;
    color: #4c4946;
    font-family: "Noto Serif KR", serif !important;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
}

.kpcm-latest-view-all,
.kpcm-latest-view-all p {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center;
    align-self: center;
    width: auto !important;
    min-width: max-content;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #181410;
    font-family: "Pretendard Variable", sans-serif !important;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap !important;
}

.kpcm-latest-view-all a {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font: inherit !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: color 0.25s ease;
}

.kpcm-latest-view-all a::after {
    content: "→";
    display: inline-block;
    margin-left: 18px;
    color: #694045;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.25s ease;
}

.kpcm-latest-view-all:hover,
.kpcm-latest-view-all:hover a {
    color: #694045;
}

.kpcm-latest-view-all:hover a::after {
    transform: translateX(5px);
}

.kpcm-video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    width: 100%;
}

.kpcm-video-card {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.kpcm-video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #181410;
}

.kpcm-video-player iframe,
.kpcm-video-trigger {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.kpcm-video-trigger {
    cursor: pointer;
    appearance: none;
    background: #181410;
}

.kpcm-video-trigger img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.kpcm-video-trigger:hover img {
    transform: scale(1.015);
    opacity: 0.92;
}

.kpcm-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 48px;
    border-radius: 12px;
    background: rgba(24, 20, 16, 0.82);
    transform: translate(-50%, -50%);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.kpcm-video-play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 52%;
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 15px solid #ffffff;
    transform: translate(-50%, -50%);
}

.kpcm-video-trigger:hover .kpcm-video-play,
.kpcm-video-trigger:focus-visible .kpcm-video-play {
    background: #694045;
    transform: translate(-50%, -50%) scale(1.06);
}

.kpcm-video-trigger:focus-visible {
    outline: 3px solid #694045;
    outline-offset: -3px;
}

.kpcm-video-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    color: #4c4946;
    font-family: "Pretendard Variable", sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
}

.kpcm-video-title {
    color: inherit;
    font: inherit;
    text-decoration: none !important;
    transition: color 0.25s ease;
}

.kpcm-video-title:hover {
    color: #694045;
}

.kpcm-video-duration {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font: inherit;
}

.kpcm-video-duration::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 22px;
    margin: 0 17px;
    background: #c9c5c2;
}

.kpcm-video-error {
    margin: 20px 0;
    padding: 15px 18px;
    color: #8a1f11;
    background: #fff1ef;
    border: 1px solid #e7b7b0;
    font-family: "Pretendard Variable", sans-serif;
    font-size: 16px;
}

@media (max-width: 1024px) {
    .kpcm-video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .kpcm-latest-messages {
        width: calc(100% - 40px) !important;
        padding: 42px 0 45px !important;
    }

    .kpcm-latest-header {
        align-items: flex-end !important;
        gap: 20px !important;
        margin-bottom: 25px !important;
    }

    .kpcm-latest-title-group {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .kpcm-latest-heading,
    .kpcm-latest-heading h2,
    .kpcm-latest-heading h3 {
        font-size: 30px;
    }

    .kpcm-latest-view-all,
    .kpcm-latest-view-all p {
        font-size: 17px;
    }

    .kpcm-latest-view-all a::after {
        margin-left: 10px;
        font-size: 24px;
    }

    .kpcm-video-grid {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .kpcm-video-meta {
        margin-top: 12px;
        font-size: 19px;
    }

    .kpcm-video-duration::before {
        height: 19px;
        margin: 0 13px;
    }

    .kpcm-video-play {
        width: 58px;
        height: 42px;
        border-radius: 10px;
    }
}
