/* ทำให้ iframe แสดงผลสวยในมือถือ */
      .gallery-embed-wrapper {
        position: relative;
        width: 100%;
        min-height: 520px;
      }
      .gallery-embed {
        border: 0;
        width: 100%;
        height: 900px; /* เดสก์ท็อป */
      }
      @media (max-width: 991.98px) {
        .gallery-embed { height: 1200px; }
      }
      @media (max-width: 575.98px) {
        .gallery-embed { height: 1500px; }
      }

      /* ===== Mourning ribbon badge (ใช้ <img> แสดงรูปจริง ไม่เป็นลิงก์) ===== */
      .mourning-badge{
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 2147483000;
        pointer-events: none; /* ไม่บังการคลิก UI เดิม */
      }
      .mourning-badge img{
        width: 110px;    /* ขนาดใหญ่ ชัดเจน */
        height: 110px;
        object-fit: cover;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,.25);
        display: block;
      }
      @media (max-width: 575.98px){
        .mourning-badge{ top:10px; right:10px; }
        .mourning-badge img{ width: 86px; height: 86px; }
      }
      @media print{
        .mourning-badge{ display: none !important; }
      }

      /* Mourning popup: pure CSS/JS ไม่พึ่ง Bootstrap เพื่อไม่กระทบโครงสร้างเดิม */
      .mourning-popup-mask {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.72);
        z-index: 99999;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 18px;
      }
      .mourning-popup-mask.is-show { display: flex; }
      .mourning-popup-box {
        width: min(94vw, 760px);
        background: linear-gradient(180deg,#ffffff 0%,#f7f7f7 100%);
        border: 8px solid #111;
        border-radius: 22px;
        box-shadow: 0 25px 70px rgba(0,0,0,.45);
        text-align: center;
        color: #111;
        overflow: hidden;
        font-family: "TH Sarabun New", "Sarabun", Tahoma, sans-serif;
      }
      .mourning-popup-head {
        background: #111;
        color: #fff;
        padding: 14px 18px;
        font-size: clamp(24px, 4vw, 38px);
        font-weight: 700;
        letter-spacing: .5px;
      }
      .mourning-popup-body {
        padding: clamp(22px, 4vw, 42px);
      }
      .mourning-ribbon-large {
        width: 92px;
        max-width: 22vw;
        margin-bottom: 18px;
      }
      .mourning-popup-title {
        font-size: clamp(30px, 5vw, 52px);
        line-height: 1.15;
        font-weight: 700;
        margin-bottom: 16px;
      }
      .mourning-popup-text {
        font-size: clamp(22px, 3.4vw, 34px);
        line-height: 1.35;
        margin-bottom: 16px;
      }
      .mourning-popup-footer {
        font-size: clamp(20px, 3vw, 30px);
        line-height: 1.35;
        color: #222;
        margin-top: 18px;
      }
      .mourning-popup-btn {
        margin-top: 22px;
        border: 0;
        background: #111;
        color: #fff;
        border-radius: 999px;
        padding: 10px 34px;
        font-size: clamp(18px, 2.5vw, 24px);
        cursor: pointer;
      }
      .mourning-popup-btn:hover { background: #333; }

      /* Ribbon */
        .mourning-badge{
            position: fixed;
            top: 15px;
            right: 15px;
            z-index: 9998;
        }

        .mourning-badge img{
            width: 70px;
            height: auto;
        }

        /* Popup */
        .mourning-overlay{
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,.88);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            padding: 20px;
        }

        .mourning-popup{
            position: relative;
        }

        .mourning-popup img{
            max-width: 92vw;
            max-height: 92vh;
            width: auto;
            height: auto;
            object-fit: contain;
            display: block;
        }

        .mourning-close{
            position: absolute;
            top: -12px;
            right: -12px;
            width: 42px;
            height: 42px;
            border: 0;
            border-radius: 50%;
            background: #fff;
            cursor: pointer;
            font-size: 24px;
            font-weight: bold;
        }

        @media (max-width:768px){

            .mourning-badge img{
                width: 50px;
            }

            .mourning-popup img{
                max-width: 96vw;
                max-height: 88vh;
            }
        }
    
      /* ===== Mourning RWD Final Override ===== */
      .mourning-badge{
        position: fixed !important;
        top: 14px !important;
        right: 14px !important;
        z-index: 2147483000 !important;
        pointer-events: none !important;
      }
      .mourning-badge img{
        width: 86px !important;
        height: 86px !important;
        max-width: 18vw !important;
        max-height: 18vw !important;
        object-fit: contain !important;
        display: block !important;
      }
      .mourning-overlay{
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0,0,0,.88) !important;
        z-index: 2147483500 !important;
        display: flex;
        align-items: center !important;
        justify-content: center !important;
        padding: 18px !important;
        box-sizing: border-box !important;
      }
      .mourning-popup{
        position: relative !important;
        display: inline-block !important;
        max-width: 96vw !important;
        max-height: 94vh !important;
        text-align: center !important;
        z-index: 2147483600 !important;
      }
      .mourning-popup img{
        width: auto !important;
        height: auto !important;
        max-width: 92vw !important;
        max-height: 90vh !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
        border-radius: 6px !important;
        box-shadow: 0 18px 60px rgba(0,0,0,.55) !important;
      }
      .mourning-close{
        position: absolute !important;
        top: -16px !important;
        right: -16px !important;
        width: 46px !important;
        height: 46px !important;
        line-height: 42px !important;
        border: 2px solid #ffffff !important;
        border-radius: 50% !important;
        background: #111111 !important;
        color: #ffffff !important;
        font-size: 30px !important;
        font-weight: 700 !important;
        text-align: center !important;
        cursor: pointer !important;
        z-index: 2147483647 !important;
        padding: 0 !important;
        box-shadow: 0 4px 15px rgba(0,0,0,.45) !important;
      }
      .mourning-close:hover,
      .mourning-close:focus{
        background: #ffffff !important;
        color: #111111 !important;
        outline: none !important;
      }
      @media (max-width:768px){
        .mourning-badge img{
          width: 58px !important;
          height: 58px !important;
          max-width: 20vw !important;
          max-height: 20vw !important;
        }
        .mourning-overlay{
          padding: 12px !important;
        }
        .mourning-popup img{
          max-width: 96vw !important;
          max-height: 86vh !important;
        }
        .mourning-close{
          top: 8px !important;
          right: 8px !important;
          width: 42px !important;
          height: 42px !important;
          line-height: 38px !important;
          font-size: 28px !important;
        }
      }

/* =========================================================
   SSHPT RWD safe overrides
   เพิ่มความยืดหยุ่นโดยไม่กระทบโครงสร้างเดิม
   ========================================================= */

img {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

@media (min-width: 1200px) {
    .container {
        max-width: 1150px;
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    table {
        width: 100% !important;
    }

    td {
        word-break: break-word;
    }
}

/* Strategy direction widget */
.strategy-widget {
    width: 790px;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #b7d7e8;
    background: #f8fbfd;
    color: #17324d;
    font-family: Tahoma, "TH Sarabun New", sans-serif;
    box-shadow: 0 6px 18px rgba(16, 68, 98, .12);
    box-sizing: border-box;
    overflow: hidden;
}

.strategy-widget *,
.strategy-modal * {
    box-sizing: border-box;
}

.strategy-widget__head {
    padding: 12px 16px 14px;
    background: linear-gradient(135deg, #087b9a 0%, #12a0b5 100%);
    color: #ffffff;
    text-align: center;
}

.strategy-widget__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
}

.strategy-widget__subtitle {
    margin-top: 3px;
    font-size: 17px;
    line-height: 1.35;
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.strategy-tile {
    position: relative;
    min-height: 88px;
    padding: 16px 18px 14px 58px;
    border: 0;
    border-right: 1px solid rgba(23, 50, 77, .18);
    border-top: 1px solid rgba(23, 50, 77, .18);
    text-align: left;
    color: #17324d;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
}

.strategy-tile:nth-child(2n) {
    border-right: 0;
}

.strategy-tile:hover,
.strategy-tile:focus {
    z-index: 1;
    filter: brightness(1.03);
    box-shadow: inset 0 0 0 2px rgba(8, 123, 154, .38), 0 5px 18px rgba(0, 0, 0, .13);
    outline: none;
}

.strategy-tile__no {
    position: absolute;
    left: 16px;
    top: 17px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .76);
    color: #0b6683;
    font-weight: 700;
    line-height: 30px;
    text-align: center;
}

.strategy-tile__title,
.strategy-tile__en {
    display: block;
}

.strategy-tile__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.strategy-tile__en {
    margin-top: 3px;
    font-size: 15px;
    color: rgba(23, 50, 77, .78);
    line-height: 1.25;
}

.strategy-tile--vision { background: #ccecf6; }
.strategy-tile--mission { background: #c9f0d1; }
.strategy-tile--values { background: #eeeeee; }
.strategy-tile--competencies { background: #fde3d5; }
.strategy-tile--hoshin { background: #f5d4ef; }
.strategy-tile--objectives { background: #bde9f6; }

.strategy-modal[hidden] {
    display: none;
}

.strategy-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.strategy-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 26, 43, .68);
}

.strategy-modal__panel {
    position: relative;
    width: min(760px, 94vw);
    max-height: 88vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .35);
    text-align: left;
    color: #1f2933;
    font-family: Tahoma, "TH Sarabun New", sans-serif;
    box-sizing: border-box;
}

.strategy-modal__label {
    padding: 13px 54px 10px 18px;
    background: #087b9a;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.35;
}

.strategy-modal__title {
    margin: 0;
    padding: 18px 22px 8px;
    font-size: 24px;
    line-height: 1.35;
    color: #0b6683;
}

.strategy-modal__body {
    padding: 4px 22px 24px;
    font-size: 18px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.strategy-modal__body p {
    margin: 0 0 10px;
}

.strategy-modal__body ul,
.strategy-modal__body ol {
    margin: 4px 0 0 24px;
    padding: 0;
}

.strategy-modal__body li {
    margin-bottom: 6px;
}

.strategy-modal__close {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #0b6683;
    font-size: 26px;
    line-height: 31px;
    cursor: pointer;
}

.strategy-modal-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .strategy-widget {
        width: 100%;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .strategy-widget__head {
        padding: 10px 12px 12px;
    }

    .strategy-widget__title {
        font-size: 17px;
    }

    .strategy-widget__subtitle {
        font-size: 14px;
    }

    .strategy-grid {
        grid-template-columns: 1fr;
    }

    .strategy-tile {
        min-height: 72px;
        border-right: 0;
        padding: 13px 12px 12px 52px;
        touch-action: manipulation;
    }

    .strategy-tile:nth-child(2n) {
        border-right: 0;
    }

    .strategy-tile__no {
        left: 13px;
        top: 14px;
        width: 28px;
        height: 28px;
        line-height: 28px;
    }

    .strategy-tile__title {
        font-size: 16px;
        line-height: 1.25;
    }

    .strategy-tile__en {
        font-size: 13px;
    }

    .strategy-modal {
        align-items: flex-start;
        padding: 10px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .strategy-modal__panel {
        width: 100%;
        max-height: none;
        min-height: auto;
        margin: 0;
        border-radius: 7px;
    }

    .strategy-modal__label {
        padding: 12px 50px 10px 14px;
        font-size: 13px;
        line-height: 1.35;
    }

    .strategy-modal__title {
        font-size: 19px;
        padding: 15px 15px 6px;
    }

    .strategy-modal__body {
        font-size: 16px;
        line-height: 1.6;
        padding: 4px 15px 18px;
    }

    .strategy-modal__body ul,
    .strategy-modal__body ol {
        margin-left: 20px;
    }

    .strategy-modal__close {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
        font-size: 28px;
        line-height: 34px;
    }
}

@media (max-width: 360px) {
    .strategy-widget__title {
        font-size: 16px;
    }

    .strategy-widget__subtitle {
        font-size: 13px;
    }

    .strategy-tile {
        padding-left: 48px;
    }

    .strategy-tile__title {
        font-size: 15px;
    }

    .strategy-modal__body {
        font-size: 15px;
    }
}
