/* Memorial Force Grayscale - บังคับรูปทุกรูปให้เป็นขาว-ดำตลอดเวลา */

/* CSS ที่มี priority สูงสุด - ขาว-ดำทุกกรณี */
body.memorial-theme img,
html.memorial-theme img,
.memorial-theme img,
body img,
html img,
img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    -webkit-filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    -moz-filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    -o-filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    -ms-filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* Hover state - ยังคงเป็นขาว-ดำแต่สว่างขึ้นเล็กน้อย */
body.memorial-theme img:hover,
html.memorial-theme img:hover,
.memorial-theme img:hover,
body img:hover,
html img:hover,
img:hover {
    filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    -webkit-filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    -moz-filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    -o-filter: grayscale(100%) brightness(1) contrast(1.4) !important;
    -ms-filter: grayscale(100%) brightness(1) contrast(1.4) !important;
}

/* รูปภาพทุกประเภท */
body img[src],
html img[src],
img[src],
img[src*=".jpg"],
img[src*=".jpeg"],
img[src*=".png"],
img[src*=".gif"],
img[src*=".webp"],
img[src*=".bmp"],
img[src*=".svg"] {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
    -webkit-filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* รูปภาพที่มีการกำหนด style แล้ว */
img[style],
img[style*="filter"],
img[style*="grayscale"] {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* รูปภาพในทุก element */
* img,
div img,
span img,
a img,
p img,
section img,
article img,
header img,
footer img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* Background images */
*[style*="background-image"] {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* Canvas และ video */
canvas,
video {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* รูปภาพใน iframe */
iframe img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* รูปภาพที่ load ภายหลัง */
img[data-src],
img[data-original] {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}

/* Override ทุก CSS อื่น */
img {
    filter: grayscale(100%) brightness(0.85) contrast(1.3) !important;
}