/*
Theme Name: Reinventing University
Template: twentytwentyfive
Description: Child theme ของ Twenty Twenty-Five สำหรับเว็บไซต์การพลิกโฉมมหาวิทยาลัย (สป.อว.)
Version: 0.4.0
Text Domain: reinventing
*/

:root {
	--ru-navy: var(--wp--preset--color--accent-1);
	--ru-orange: var(--wp--preset--color--accent-2);
	--ru-sky: var(--wp--preset--color--accent-3);
	--ru-muted: var(--wp--preset--color--accent-4);
	--ru-navy-deep: #11184a;
	--ru-radius: 14px;
	--ru-shadow: 0 10px 30px rgba(20, 28, 79, 0.10);
	--ru-gutter: clamp(16px, 4vw, 40px);
	--ru-ink: #16205a;
	--ru-cream: #fbf8f3;
	--ru-g1: #e8a317; --ru-g2: #2563c9; --ru-g3: #1f9d6b; --ru-g4: #7c4dcc; --ru-g5: #d9466f;
	--ru-stripe: linear-gradient(90deg, var(--ru-g1) 0 20%, var(--ru-g2) 20% 40%, var(--ru-g3) 40% 60%, var(--ru-g4) 60% 80%, var(--ru-g5) 80%);
	--ru-display: "IBM Plex Sans Thai", "Sarabun", sans-serif;
}

h1, h2, h3, h4, .wp-block-site-title { font-family: var(--ru-display); }
.wp-block-button__link { border-radius: 10px; font-weight: 600; padding: 14px 26px; }
.wp-block-button:not(.is-style-outline):not(.is-style-ru-link) .wp-block-button__link { background: var(--ru-ink); color: #fff; }
.wp-block-button:not(.is-style-outline):not(.is-style-ru-link) .wp-block-button__link:hover { background: var(--ru-orange); }
.is-style-outline .wp-block-button__link { border: 2px solid var(--ru-ink); color: var(--ru-ink); background: transparent; }
.is-style-ru-link .wp-block-button__link { background: transparent; color: var(--ru-ink); padding: 14px 4px; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--ru-g1); }

body { background: #fff; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * { margin-block-start: 0; }
.ru-main { margin: 0; }
.ru-main > .wp-block-post-content > * { margin-block-start: 0; }

/* ---------- Header ---------- */
.ru-header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 0 rgba(20, 28, 79, 0.08); }
.admin-bar .ru-header { top: var(--wp-admin--admin-bar--height, 32px); }
.ru-topbar { background: var(--ru-navy-deep); color: rgba(255, 255, 255, 0.85); font-size: 13px; padding: 6px var(--ru-gutter); }
.ru-topbar p { margin: 0; }
.ru-topbar strong { color: var(--ru-orange); }
.ru-mainbar { padding: 14px var(--ru-gutter); }
.ru-brand { gap: 12px; flex-shrink: 0; }
.ru-brand .wp-block-site-title { white-space: nowrap; }
.ru-brand > .wp-block-group { gap: 0; }
.ru-logo-mhesi, .ru-logo-mark { margin: 0; }
/* ตรา อว. คู่โลโก้ Reinventing คั่นด้วยเส้นบาง แบบเว็บเดิม */
.ru-logo-mhesi { display: flex; align-items: center; padding-right: 12px; border-right: 1px solid rgba(20, 28, 79, 0.15); }
.ru-logo-mhesi a { display: block; width: 52px; height: 52px; }
.ru-logo-mhesi img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ru-logo-mark a { display: block; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: #fff; }
.ru-logo-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ru-brand .wp-block-site-title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.ru-brand .wp-block-site-title a { color: var(--ru-navy); text-decoration: none; }
.ru-brand-sub { margin: 0; font-size: 13px; color: var(--ru-muted); line-height: 1.3; }

.ru-nav { font-size: 15px; font-weight: 500; gap: 4px; }
.ru-nav .wp-block-navigation-item__content { padding: 8px 8px; white-space: nowrap; border-radius: 8px; text-decoration: none; }
.ru-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover { background: var(--ru-sky); color: var(--ru-navy); }
.ru-nav .wp-block-navigation__submenu-container {
	border: 0 !important; border-radius: 12px; box-shadow: var(--ru-shadow); padding: 8px !important; min-width: 260px !important;
}
.ru-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 8px 12px; font-size: 14px; }
.ru-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { background: var(--ru-sky); color: var(--ru-navy); }
.ru-nav .wp-block-navigation-submenu__toggle { margin-left: -6px; }

/* เมนูยาว + โลโก้คู่: ยุบเป็น hamburger ตั้งแต่จอเล็กกว่า 1280px */
@media (max-width: 1279px) {
	.ru-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.ru-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
.ru-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 24px var(--ru-gutter); }
.ru-nav .is-menu-open .wp-block-navigation-item__content { font-size: 17px; }

/* ---------- Footer ---------- */
.ru-footer {
	background: var(--ru-navy-deep); color: rgba(255, 255, 255, 0.78);
	padding: 64px var(--ru-gutter) 24px; margin-top: 0; font-size: 15px; position: relative;
}
.ru-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--ru-stripe); }
.ru-footer h4 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.ru-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.ru-footer a:hover { color: var(--ru-orange); }
.ru-footer-brand { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.ru-footer-links { list-style: none; padding: 0; margin: 0; }
.ru-footer-links li { margin: 6px 0; }
.ru-footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 20px; margin-top: 40px; font-size: 13px; color: rgba(255, 255, 255, 0.55); }

/* ---------- Page hero + breadcrumb ---------- */
.ru-page-hero { position: relative; background: var(--ru-cream); color: var(--ru-ink); padding: 48px var(--ru-gutter) 56px; }
.ru-page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--ru-stripe); }
.ru-page-hero .wp-block-post-title { color: var(--ru-ink); font-size: clamp(28px, 4vw, 46px); line-height: 1.25; margin-top: 14px; }
.ru-page-hero > * { max-width: 1200px; margin-left: auto !important; margin-right: auto !important; }
.ru-breadcrumb { font-size: 14px; color: var(--ru-muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ru-breadcrumb a { color: var(--ru-muted); text-decoration: none; }
.ru-breadcrumb a:hover { color: var(--ru-orange); }
.ru-breadcrumb [aria-current] { color: var(--ru-ink); font-weight: 600; }
.ru-page-body { padding: 48px var(--ru-gutter) 80px; }

/* ---------- Cards (หน้าย่อย / กลุ่ม) ---------- */
.ru-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-top: 40px; }
.ru-card {
	display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--ru-radius);
	background: #fff; border: 1px solid #e3e8f5; color: var(--wp--preset--color--contrast); text-decoration: none;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ru-card:hover { transform: translateY(-4px); box-shadow: var(--ru-shadow); border-color: transparent; }
.ru-card-num { font-weight: 700; color: var(--ru-orange); font-size: 14px; letter-spacing: 0.05em; }
.ru-card-title { font-weight: 600; font-size: 17px; line-height: 1.5; color: var(--ru-navy); flex: 1; }
.ru-card-more { font-size: 14px; color: var(--ru-muted); }
.ru-card:hover .ru-card-more { color: var(--ru-orange); }

/* ---------- Content helpers (ใช้ใน content/pages) ---------- */
.ru-page-body .ru-lead { font-size: 20px; line-height: 1.8; color: var(--wp--preset--color--contrast); }
.ru-page-body h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 56px; }
.ru-page-body h2:first-child { margin-top: 0; }
.ru-figure img { border-radius: var(--ru-radius); box-shadow: var(--ru-shadow); }
.ru-figure figcaption { text-align: center; color: var(--ru-muted); font-size: 14px; }

.ru-callout { background: var(--ru-sky); border-radius: var(--ru-radius); padding: 28px 32px; border-left: 5px solid var(--ru-orange); }
.ru-callout > *:first-child { margin-top: 0; }
.ru-callout > *:last-child { margin-bottom: 0; }

.ru-checklist { list-style: none; padding: 0; }
.ru-checklist li { position: relative; padding-left: 36px; margin: 12px 0; }
.ru-checklist li::before {
	content: "✓"; position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
	background: var(--ru-orange); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
}

.ru-timeline { list-style: none; padding: 0 0 0 28px; border-left: 3px solid var(--ru-sky); margin-left: 8px; }
.ru-timeline li { position: relative; margin: 0 0 28px; }
.ru-timeline li::before {
	content: ""; position: absolute; left: -38px; top: 6px; width: 17px; height: 17px; border-radius: 50%;
	background: #fff; border: 4px solid var(--ru-orange);
}
.ru-timeline li strong:first-child { display: inline-block; color: var(--ru-navy); background: var(--ru-sky); padding: 2px 12px; border-radius: 999px; font-size: 15px; margin-bottom: 6px; }

.ru-indicators li { margin: 10px 0; }
.ru-indicators li strong { color: var(--ru-navy); }
.ru-feature .wp-block-list { padding-left: 20px; }
.ru-features.is-layout-flex { align-items: stretch !important; }

.ru-contact-card { background: #fff; border: 1px solid #e3e8f5; border-radius: var(--ru-radius); padding: 28px; }
.ru-contact-card h3 { margin-top: 0; font-size: 20px; }

/* ---------- News ---------- */
.ru-news-grid { gap: 24px !important; }
.ru-news-card {
	height: 100%; background: #fff; border-radius: var(--ru-radius); overflow: hidden; border: 1px solid #e3e8f5;
	transition: transform 0.2s, box-shadow 0.2s;
}
.ru-news-card:hover { transform: translateY(-4px); box-shadow: var(--ru-shadow); }
.ru-news-card .wp-block-post-featured-image { margin: 0; }
.ru-news-card .wp-block-post-featured-image img { width: 100%; object-fit: cover; }
.ru-news-body { padding: 18px 20px 22px; }
.ru-news-date { font-size: 13px; color: var(--ru-orange); font-weight: 600; margin: 0 0 6px; }
.ru-news-body .wp-block-post-title { font-size: 17px; line-height: 1.55; margin: 0; font-weight: 600; }
.ru-news-body .wp-block-post-title a { color: var(--ru-navy); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ru-pagination { margin-top: 48px; gap: 8px; }
.ru-pagination a, .ru-pagination .page-numbers { padding: 6px 14px; border-radius: 8px; text-decoration: none; }
.ru-pagination .page-numbers.current { background: var(--ru-navy); color: #fff; }

.ru-page-hero .wp-block-query-title, .ru-page-hero h1 { color: var(--ru-ink); font-size: clamp(28px, 4vw, 44px); line-height: 1.3; margin-top: 12px; }
.ru-post-meta { color: var(--ru-orange); font-weight: 600; margin-top: 8px; }
.ru-single-feature { margin-bottom: 40px; }
.ru-single-feature img { border-radius: var(--ru-radius); box-shadow: var(--ru-shadow); }
.ru-article { font-size: 18px; line-height: 1.85; }
.ru-article img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; }
.ru-back { margin-top: 48px; padding-top: 24px; border-top: 1px solid #e3e8f5; }
.ru-back a { color: var(--ru-navy); font-weight: 600; text-decoration: none; }

/* ---------- Homepage ---------- */
.ru-eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.14em; color: var(--ru-orange) !important; text-transform: uppercase; margin: 0; }
.ru-section { padding: clamp(56px, 8vw, 104px) var(--ru-gutter); }
.ru-section-alt, .ru-section-tint { background: var(--ru-cream); }

/* Hero: พื้นสว่าง แบ่งซ้าย-ขวา */
.ru-hero { position: relative; overflow: hidden; background: var(--ru-cream); padding: clamp(28px, 4vw, 56px) var(--ru-gutter) clamp(56px, 8vw, 104px); }
.ru-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--ru-stripe); }
.ru-hero-cols { gap: clamp(32px, 5vw, 72px) !important; }
.ru-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ru-ink); margin: 0 0 20px; }
.ru-kicker::before { content: ""; width: 28px; height: 2px; background: var(--ru-orange); }
.ru-hero h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.34; letter-spacing: -0.01em; color: var(--ru-ink); margin: 0 0 24px; }
.ru-hl { background: var(--ru-stripe) no-repeat 0 80% / 100% 0.08em; color: var(--ru-g2); padding: 0; }

/* ลายตกแต่ง hero (motion.js สร้าง): เส้นคลื่น + รูปทรงสีประจำ 5 กลุ่ม, --d = ความลึกเวลาขยับตามเมาส์ */
.ru-hero-decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; max-width: none !important; margin: 0 !important; }
.ru-hero > :not(.ru-hero-decor) { position: relative; z-index: 1; }
.ru-hero > .ru-hero-decor + * { margin-block-start: 0; }
.ru-hero-waves { position: absolute; left: -4%; top: 0; width: 108%; height: 100%; fill: none; }
.ru-hero-waves path { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ru-hero-waves path:nth-child(1) { stroke: var(--ru-g2); opacity: 0.22; }
.ru-hero-waves path:nth-child(2) { stroke: var(--ru-g4); opacity: 0.16; }
.ru-hero-waves path:nth-child(3) { stroke: var(--ru-g1); opacity: 0.22; }
.ru-shape {
	position: absolute; --d: 30;
	transform: translate3d(calc(var(--ru-mx, 0) * var(--d) * 1px), calc(var(--ru-my, 0) * var(--d) * 1px), 0);
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.ru-shape i { display: block; }
.ru-shape-ring { top: 12%; left: 2.5%; --d: 30; }
.ru-shape-ring i { width: 18px; height: 18px; border: 2px solid var(--ru-g2); border-radius: 50%; }
.ru-shape-dot { top: 9%; right: 34%; --d: 55; }
.ru-shape-dot i { width: 10px; height: 10px; border-radius: 50%; background: var(--ru-g1); }
.ru-shape-tri { bottom: 20%; left: 47%; --d: 40; }
.ru-shape-tri i { width: 18px; height: 16px; background: var(--ru-g5); clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: 0.85; }
.ru-shape-plus { top: 16%; right: 3.5%; --d: 25; }
.ru-shape-plus i { width: 18px; height: 18px; background: linear-gradient(var(--ru-g3), var(--ru-g3)) center / 100% 3px no-repeat, linear-gradient(var(--ru-g3), var(--ru-g3)) center / 3px 100% no-repeat; }
.ru-shape-square { bottom: 14%; right: 5%; --d: 45; }
.ru-shape-square i { width: 15px; height: 15px; border: 2px solid var(--ru-g4); border-radius: 3px; transform: rotate(20deg); }
.ru-shape-dot2 { bottom: 26%; left: 3.5%; --d: 60; }
.ru-shape-dot2 i { width: 7px; height: 7px; border-radius: 50%; background: var(--ru-g2); }
.ru-hero-lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ru-muted); max-width: 540px; }
.ru-hero .wp-block-buttons { margin-top: 32px; gap: 20px; align-items: center; }
.ru-hero-visual { position: relative; margin: 0; }
.ru-hero-visual::before {
	content: ""; position: absolute; inset: 18px -18px -18px 18px; border-radius: 20px;
	background: repeating-linear-gradient(45deg, rgba(31, 42, 107, 0.08) 0 2px, transparent 2px 10px); z-index: 0;
}
.ru-hero-visual img { position: relative; z-index: 1; border-radius: 20px; box-shadow: 0 30px 60px rgba(20, 28, 79, 0.18); }

/* หัวข้อ section: ชิดซ้าย มีเลขลำดับและเส้นใต้ */
.ru-head { display: flex; align-items: baseline; gap: 18px; padding-bottom: 16px; margin-bottom: 40px; border-bottom: 2px solid var(--ru-ink); }
.ru-head > * { margin: 0 !important; }
.ru-head h2 { flex: 1 1 0; min-width: 0; }
.ru-head-num { font-family: var(--ru-display); font-weight: 600; font-size: 15px; color: var(--ru-orange); }
.ru-head h2, .ru-band h2 { font-size: clamp(26px, 3.2vw, 38px); color: var(--ru-ink); }
.ru-head-link { margin-left: auto !important; font-weight: 600; }
.ru-head-link a { color: var(--ru-ink); text-decoration: none; }
.ru-head-link a:hover { color: var(--ru-orange); }

/* 5 กลุ่ม: bento สีประจำกลุ่ม */
.ru-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ru-bento > * { margin: 0 !important; }
.ru-tile {
	--c: var(--ru-ink); position: relative; padding: 28px; border-radius: 18px; min-height: 210px;
	display: flex; flex-direction: column; justify-content: flex-end;
	background: color-mix(in srgb, var(--c) 9%, #fff); transition: background 0.25s, transform 0.25s;
}
.ru-tile > * { margin: 0 !important; }
.ru-tile-1 { --c: var(--ru-g1); } .ru-tile-2 { --c: var(--ru-g2); } .ru-tile-3 { --c: var(--ru-g3); }
.ru-tile-4 { --c: var(--ru-g4); } .ru-tile-5 { --c: var(--ru-g5); }
.ru-tile .ru-tile-num { position: absolute; top: 20px; right: 24px; font-family: var(--ru-display); font-weight: 700; font-size: 64px; line-height: 1; color: var(--c); opacity: 0.9; }
.ru-tile h3 { font-size: 22px; line-height: 1.35; margin-bottom: 6px !important; padding-right: 84px; }
.ru-tile h3 a { color: var(--ru-ink); text-decoration: none; }
.ru-tile h3 a::after { content: ""; position: absolute; inset: 0; }
.ru-tile p { color: var(--ru-muted); font-size: 15px; }
.ru-tile:not(.ru-tile-intro):hover { background: var(--c); transform: translateY(-3px); }
.ru-tile:not(.ru-tile-intro):hover :is(h3 a, p) { color: #fff; }
.ru-tile-intro { background: var(--ru-ink); justify-content: space-between; }
.ru-tile-intro p { color: rgba(255, 255, 255, 0.85); font-size: 17px; line-height: 1.7; }
.ru-tile-intro .ru-tile-link a { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ru-g1); }

/* แนวคิด 4 Re- เป็นลำดับขั้น */
.ru-steps { counter-reset: step; gap: 32px !important; }
.ru-step { counter-increment: step; border-top: 3px solid var(--ru-ink); padding-top: 20px; }
.ru-step::before { content: "0" counter(step); display: block; font-family: var(--ru-display); font-weight: 700; color: var(--ru-orange); font-size: 14px; margin-bottom: 8px; }
.ru-step h3 { font-size: 22px; margin: 0 0 10px; color: var(--ru-ink); }
.ru-step p { color: var(--ru-muted); font-size: 16px; margin: 0; }

/* ข่าว: แบบนิตยสาร */
.ru-mag { gap: clamp(24px, 4vw, 48px) !important; }
.ru-lead-story > * { margin: 0 !important; }
.ru-lead-story .wp-block-post-featured-image { margin-bottom: 20px !important; }
.ru-lead-story img { border-radius: 16px; width: 100%; object-fit: cover; }
.ru-lead-story .wp-block-post-title { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.4; margin: 6px 0 10px !important; }
.ru-lead-story .wp-block-post-title a, .ru-story .wp-block-post-title a { color: var(--ru-ink); text-decoration: none; }
.ru-lead-story .wp-block-post-title a:hover, .ru-story .wp-block-post-title a:hover { color: var(--ru-orange); }
.ru-lead-story .wp-block-post-excerpt { color: var(--ru-muted); }
.ru-lead-story .wp-block-post-excerpt__more-text { display: none; }
.ru-story-list { list-style: none; padding: 0; margin: 0; }
.ru-story-list > li { margin: 0 !important; padding: 18px 0; border-bottom: 1px solid #e6e2d8; }
.ru-story-list > li:first-child { padding-top: 0; }
.ru-story { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.ru-story > * { margin: 0 !important; }
.ru-story img { border-radius: 10px; width: 96px; height: 96px; object-fit: cover; }
.ru-story .wp-block-post-title { font-size: 16px; line-height: 1.5; margin: 4px 0 0; font-weight: 600; }
.ru-story .wp-block-post-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* แถบระบบที่เกี่ยวข้อง */
.ru-band { background: var(--ru-ink); color: rgba(255, 255, 255, 0.8); }
.ru-band h2 { color: #fff; margin: 8px 0 12px; }
.ru-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ru-links li { margin: 0; }
.ru-links li:first-child { grid-column: 1 / -1; }
.ru-links a {
	display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.8); text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.ru-links a::after { content: "→"; color: var(--ru-g1); }
.ru-links a strong { color: #fff; margin-right: auto; padding-right: 8px; white-space: nowrap; }
.ru-links a:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--ru-g1); }

/* หน้าย่อยใช้ซ้ำ */
.ru-features { gap: 24px; }
.ru-feature { background: #fff; border-radius: var(--ru-radius); padding: 32px; border: 1px solid #e6e2d8; transition: box-shadow 0.2s; }
.ru-feature:hover { box-shadow: var(--ru-shadow); }
.ru-feature .ru-eyebrow { margin-bottom: 10px; }
.ru-feature h3 { font-size: 21px; margin: 0 0 8px; }
.ru-feature p { color: var(--ru-muted); }

@media (max-width: 1099px) {
	.ru-news-grid.is-layout-grid { grid-template-columns: repeat(2, 1fr) !important; }
	.ru-bento { grid-template-columns: repeat(2, 1fr); }
	.ru-tile-intro { grid-column: 1 / -1; min-height: 0; }
}
@media (max-width: 781px) {
	.ru-topbar .wp-block-group > p:first-child { display: none; }
	.ru-brand-sub { display: none; }
	.ru-logo-mhesi { padding-right: 10px; }
	.ru-logo-mhesi a, .ru-logo-mark a { width: 44px; height: 44px; }
	.ru-hero-visual::before { inset: 10px -8px -10px 8px; }
	.ru-shape-tri, .ru-shape-dot2, .ru-shape-dot { display: none; }
	.ru-shape-ring { top: 3%; left: auto; right: 8%; }
	.ru-links { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.ru-news-grid.is-layout-grid { grid-template-columns: 1fr !important; }
	.ru-bento { grid-template-columns: 1fr; }
	.ru-tile { min-height: 170px; }
	.ru-tile .ru-tile-num { font-size: 48px; }
	.ru-tile h3 { padding-right: 64px; font-size: 20px; }
	.ru-head { flex-wrap: wrap; }
	.ru-head-link { flex-basis: 100%; }
}

/* ---------- Motion (assets/motion.js เติม .ru-motion ที่ <html>) ---------- */
:root { --ru-ease: cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes ru-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ru-zoom-out { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1); } }
@keyframes ru-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ru-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* เผยเนื้อหาตอนเลื่อนถึง */
.ru-motion .ru-reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ru-ease), transform 0.8s var(--ru-ease); transition-delay: var(--ru-delay, 0ms); }
.ru-motion .ru-reveal.is-visible { opacity: 1; transform: none; }
.ru-motion .ru-figure.ru-reveal { transform: scale(0.96); }
.ru-motion .ru-figure.ru-reveal.is-visible { transform: none; }

/* เส้นใต้หัวข้อ section วาดจากซ้ายไปขวา */
.ru-head { position: relative; border-bottom-color: transparent; }
.ru-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--ru-ink); transform-origin: left; }
.ru-motion .ru-head.ru-reveal { transform: none; }
.ru-motion .ru-head.ru-reveal::after { transform: scaleX(0); transition: transform 1.1s var(--ru-ease) 0.15s; }
.ru-motion .ru-head.ru-reveal.is-visible::after { transform: scaleX(1); }
.ru-step { border-top: 0; position: relative; }
.ru-step::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--ru-ink); transform-origin: left; transition: transform 0.9s var(--ru-ease) calc(var(--ru-delay, 0ms) + 0.2s); }
.ru-motion .ru-step.ru-reveal::after { transform: scaleX(0); }
.ru-motion .ru-step.ru-reveal.is-visible::after { transform: scaleX(1); }

/* Hero: ข้อความไล่ขึ้นทีละบรรทัด รูปซูมออก แถบ 5 สีวิ่งเข้า */
.ru-motion .ru-hero-cols > .wp-block-column:first-child > * { animation: ru-rise 0.9s var(--ru-ease) both; }
.ru-motion .ru-hero-cols > .wp-block-column:first-child > :nth-child(2) { animation-delay: 0.12s; }
.ru-motion .ru-hero-cols > .wp-block-column:first-child > :nth-child(3) { animation-delay: 0.24s; }
.ru-motion .ru-hero-cols > .wp-block-column:first-child > :nth-child(4) { animation-delay: 0.36s; }
.ru-motion .ru-hero-visual { animation: ru-zoom-out 1.6s var(--ru-ease) 0.1s both; }
.ru-hero-visual img { transform: translateY(var(--ru-parallax, 0)); transition: transform 0.2s linear; }
.ru-motion .ru-hero-visual::before { animation: ru-float 7s ease-in-out 1.6s infinite; }
.ru-motion .ru-hero::after, .ru-motion .ru-page-hero::after { transform-origin: left; animation: ru-grow-x 1.4s var(--ru-ease) 0.3s both; }
/* Hero: เส้นใต้ 5 สีวิ่งเข้า, เส้นคลื่นวาดตัวเองแล้วไหลช้า ๆ, รูปทรงโผล่ทีละชิ้นแล้วลอย/หมุนต่อเนื่อง */
@keyframes ru-underline { from { background-size: 0% 0.08em; } }
@keyframes ru-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes ru-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-3%); } }
@keyframes ru-pop { from { opacity: 0; scale: 0.2; } }
@keyframes ru-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes ru-spin { to { transform: rotate(360deg); } }
.ru-motion .ru-hl { animation: ru-underline 1.2s var(--ru-ease) 0.8s both; }
.ru-motion .ru-hero-waves { animation: ru-drift 16s ease-in-out 2.6s infinite; }
.ru-motion .ru-hero-waves path { stroke-dasharray: 1; animation: ru-draw 2.6s var(--ru-ease) both; }
.ru-motion .ru-hero-waves path:nth-child(2) { animation-delay: 0.25s; }
.ru-motion .ru-hero-waves path:nth-child(3) { animation-delay: 0.5s; }
.ru-motion .ru-shape { animation: ru-pop 0.9s var(--ru-ease) both; }
.ru-motion .ru-shape:nth-of-type(2) { animation-delay: 0.6s; }
.ru-motion .ru-shape:nth-of-type(3) { animation-delay: 0.75s; }
.ru-motion .ru-shape:nth-of-type(4) { animation-delay: 0.9s; }
.ru-motion .ru-shape:nth-of-type(5) { animation-delay: 1.05s; }
.ru-motion .ru-shape:nth-of-type(6) { animation-delay: 1.2s; }
.ru-motion .ru-shape:nth-of-type(1) { animation-delay: 1.35s; }
.ru-motion .ru-shape-ring i { animation: ru-bob 6s ease-in-out infinite; }
.ru-motion .ru-shape-dot i { animation: ru-bob 4.5s ease-in-out -1s infinite; }
.ru-motion .ru-shape-tri i { animation: ru-spin 14s linear infinite; }
.ru-motion .ru-shape-plus i { animation: ru-spin 10s linear infinite reverse; }
.ru-motion .ru-shape-square i { animation: ru-spin 18s linear infinite; }
.ru-motion .ru-shape-dot2 i { animation: ru-bob 5s ease-in-out -2s infinite; }

.ru-motion .ru-page-hero > * { animation: ru-rise 0.8s var(--ru-ease) both; }
.ru-motion .ru-page-hero > :nth-child(2) { animation-delay: 0.1s; }
.ru-motion .ru-page-hero > :nth-child(3) { animation-delay: 0.2s; }

/* Header ย่อเมื่อเลื่อนลง */
.ru-header, .ru-mainbar, .ru-logo-mark a, .ru-logo-mhesi a { transition: box-shadow 0.3s, padding 0.3s var(--ru-ease), width 0.3s, height 0.3s; }
.ru-header.is-scrolled { box-shadow: 0 8px 30px rgba(20, 28, 79, 0.10); }
.ru-header.is-scrolled .ru-mainbar { padding-top: 8px; padding-bottom: 8px; }
.ru-header.is-scrolled .ru-logo-mark a, .ru-header.is-scrolled .ru-logo-mhesi a { width: 42px; height: 42px; }

/* เมนู: เส้นใต้เลื่อนเข้าเมื่อชี้ */
.ru-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { position: relative; }
.ru-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 10px; right: 10px; bottom: 4px; height: 2px; background: var(--ru-orange);
	transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ru-ease);
}
.ru-nav .wp-block-navigation__container > .wp-block-navigation-item:hover > .wp-block-navigation-item__content::after { transform: scaleX(1); }
.ru-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover { background: transparent; }

/* รูปซูมเมื่อชี้ */
.ru-lead-story .wp-block-post-featured-image, .ru-story .wp-block-post-featured-image, .ru-news-card .wp-block-post-featured-image { overflow: hidden; border-radius: 16px; }
.ru-story .wp-block-post-featured-image { border-radius: 10px; }
.ru-news-card .wp-block-post-featured-image { border-radius: 0; }
.ru-lead-story img, .ru-story img, .ru-news-card .wp-block-post-featured-image img { transition: transform 0.9s var(--ru-ease); }
.ru-lead-story:hover img, .ru-story:hover img, .ru-news-card:hover .wp-block-post-featured-image img { transform: scale(1.06); }

/* bento: ตัวเลขเลื่อน + ลูกศรโผล่ */
.ru-tile .ru-tile-num { transition: transform 0.5s var(--ru-ease), color 0.25s; }
.ru-tile:not(.ru-tile-intro):hover .ru-tile-num { transform: translateY(-6px) scale(1.06); color: rgba(255, 255, 255, 0.9); }
.ru-tile:not(.ru-tile-intro) h3 a::before { content: "→"; position: absolute; right: 28px; bottom: 26px; opacity: 0; transform: translateX(-10px); transition: opacity 0.3s, transform 0.4s var(--ru-ease); color: #fff; }
.ru-tile:not(.ru-tile-intro):hover h3 a::before { opacity: 1; transform: none; }
.ru-links a::after { transition: transform 0.35s var(--ru-ease); }
.ru-links a:hover::after { transform: translateX(6px); }
.wp-block-button__link { transition: background 0.25s, color 0.25s, transform 0.25s var(--ru-ease), box-shadow 0.25s; }
.wp-block-button:not(.is-style-ru-link) .wp-block-button__link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20, 28, 79, 0.18); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
