/*
 * index.css
 * Styles specific to index.php (public-facing landing page).
 * Depends on theme.css being loaded first.
 *
 * สารบัญ (refactored — รวม selector/​media query ที่ซ้ำแล้ว):
 *   1. Reset
 *   2. Site Header
 *   3. Hero Carousel
 *   4. Stat Banner / Stat Info
 *   5. Mining Chart Section
 *   6. Generic Sections
 *   7. Poster v1 (single card)
 *   8. Poster v2 (split card, Mining 4.0 gold theme)
 *   9. Feature Cards
 *   10. Highlight (layout 1 / layout 2) + Swiper gold buttons
 *   11. Event (slider / bg-image variant / list v2)
 *   12. Conclusion
 *   13. Footer
 *   14. Bootstrap carousel/grid replacement
 *   15. Article Page
 *   16. All Content Tabs
 *   17. Activity Calendar
 *   18. Editor UI (format toolbar, gallery uploader)
 *   19. Highlight Grid (all_content.php cards)
 *   20. Responsive — รวมทุก breakpoint ไว้ท้ายไฟล์ (991 → 900 → 768 → 600 → 480)
 */

/* ══════════════════════════════════════════════════════════
   1. RESET
   ══════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    margin: 0px;
    overflow-x: hidden; /* กันเนื้อหากว้างเกินจอ (มักเกิดจาก swiper/รูปที่ยังไม่ resize) */
}
a { text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   2. SITE HEADER
   ══════════════════════════════════════════════════════════ */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.site-logo { display: flex; align-items: center; gap: 16px; }
.header-logo-img { height: 42px; width: auto; object-fit: contain; }
.header-logo-i4  { height: 52px; width: auto; object-fit: contain; }
.site-nav { display: flex; gap: 8px; }
.site-nav a {
    padding: 8px 18px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
    color: var(--primary);
    background: var(--surface);
    font-weight: 600;
}
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
}
.nav-hamburger:hover { background: var(--surface); }
.header-prototype-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ══════════════════════════════════════════════════════════
   3. HERO CAROUSEL
   ══════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 550px;
    display: flex;
    align-items: center;
    color: var(--white);
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
    position: relative;
    z-index: 2;
    width: 100%;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}
.hero-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
.hero h1 { font-size: 48px; font-weight: 700; line-height: 1.25; margin-bottom: 20px; }
.hero h1 span { color: var(--secondary); display: inline-block; position: relative; }
.hero h1 span::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--accent);
    opacity: 0.3;
    z-index: -1;
}
.hero p { font-size: 18px; color: rgba(255,255,255,0.9); line-height: 1.7; margin-bottom: 40px; max-width: 700px; }
.btn-hero-primary {
    padding: 14px 32px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 600;
    transition: 0.2s;
    box-shadow: var(--shadow-md);
}
.btn-hero-primary:hover { background: var(--accent-light); transform: translateY(-2px); color: var(--text-dark); }
.btn-hero-outline {
    padding: 14px 32px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 500;
    transition: 0.2s;
    backdrop-filter: blur(4px);
}
.btn-hero-outline:hover { background: rgba(255,255,255,0.15); border-color: var(--white); color: var(--white); }
.carousel-control-prev,
.carousel-control-next { width: 6%; z-index: 10; }
.carousel-indicators { z-index: 10; margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════
   4. STAT BANNER / STAT INFO
   ══════════════════════════════════════════════════════════ */
.stat-banner-section {
    background-color: var(--navy-stat);
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.stat-header { text-align: center; margin-bottom: 40px; z-index: 2; }
.stat-title  { color: var(--white); font-size: 32px; font-weight: 700; margin-bottom: 10px; }

@keyframes goldPulse {
    0%   { opacity: 0.8; transform: scale(1);    text-shadow: 0 0  5px rgba(223,165,57,0.2); }
    50%  { opacity: 1;   transform: scale(1.05); text-shadow: 0 0 20px rgba(223,165,57,0.9); }
    100% { opacity: 0.8; transform: scale(1);    text-shadow: 0 0  5px rgba(223,165,57,0.2); }
}
.stat-cta-text {
    color: var(--gold-mid);
    font-size: 22px;
    font-weight: 600;
    animation: goldPulse 2.5s infinite ease-in-out;
    display: inline-block;
}

.stat-banner-container { max-width: 1000px; width: 100%; z-index: 2; }
.stat-banner-box {
    display: flex;
    flex-wrap: nowrap;
    border: 2px solid var(--gold-mid);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    backdrop-filter: blur(4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}
.stat-item {
    flex: 1;
    padding: 40px 20px;
    text-align: center;
    border-right: 2px solid rgba(223,165,57,0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s;
}
.stat-item:hover    { transform: translateY(-5px); }
.stat-item:last-child { border-right: none; }
.stat-label {
    color: var(--gold-mid);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}
.stat-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}
.stat-value .number {
    color: var(--white);
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    font-family: Arial, Helvetica, sans-serif;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.stat-value .unit { color: var(--gold-mid); font-size: 20px; font-weight: 600; }

/* ปุ่มกดเพิ่มเติมใต้สถิติ */
.stat-action {
    text-align: center;
    margin-top: 40px;
    z-index: 2;
}
.btn-glow-gold {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #dfa539 0%, #b88628 100%);
    color: #121212;
    padding: 16px 36px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(223, 165, 57, 0.3);
}
.btn-glow-gold i { font-size: 24px; }
.btn-glow-gold:hover {
    transform: translateY(-4px);
    background: transparent;
    color: #dfa539;
    border-color: #dfa539;
    box-shadow: 0 10px 25px rgba(223, 165, 57, 0.5);
}

.stat-info-section {
    background: var(--bg-page);
    padding: 60px 24px;
}
.stat-info-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
}
.stat-info-item {
    flex: 1;
    padding: 0 32px;
    text-align: left;
}
.stat-info-item:first-child { padding-left: 0; }
.stat-info-item:last-child { padding-right: 0; }
.stat-info-divider {
    width: 1px;
    background: var(--border);
    margin: 4px 0;
}
.stat-info-label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}
.stat-info-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-info-number {
    font-size: 56px;
    font-weight: 700;
    color: #2f6fed;
    line-height: 1;
    font-family: Arial, Helvetica, sans-serif;
}
.stat-info-icon {
    font-size: 32px;
    color: #999999;
    opacity: 0.7;
    line-height: 1;
    flex-shrink: 0;
}
.stat-info-icon img {
    width: 68px !important;
    height: 68px !important;
    object-fit: contain;
}
.stat-info-desc p {
    font-size: 15px;
    color: #8a8a8a;
    line-height: 1.7;
    margin: 0;
}

/* ══════════════════════════════════════════════════════════
   5. MINING CHART SECTION (home)
   ══════════════════════════════════════════════════════════ */
.mining-chart-section {
    background: var(--bg-page);
    padding: 20px 24px 80px;
}
.mining-chart-container {
    max-width: 1100px;
    margin: 0 auto;
}
.mining-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.mining-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.mining-card-head { margin-bottom: 14px; }
.mining-card-title { font-size: 16px; font-weight: 700; color: var(--text); }
.mining-card-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.mining-chart-legend { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.mining-cl-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.mining-cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.mining-chart-wrap { position: relative; height: 240px; }

.mining-donut-layout { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.mining-donut-wrap { position: relative; width: 190px; height: 190px; flex-shrink: 0; }
.mining-donut-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.mining-donut-num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; }
.mining-donut-lbl { font-size: 12px; color: var(--text-muted); }

.mining-donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 10px; }
.mining-dl-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mining-dl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mining-dl-label { flex: 1; color: var(--text); }
.mining-dl-pct { font-weight: 700; color: var(--text); }

/* ══════════════════════════════════════════════════════════
   6. GENERIC SECTIONS
   ══════════════════════════════════════════════════════════ */
.section     { padding: 80px 24px; background: var(--bg-page); }
.section-alt { background: var(--bg-page); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.video-box {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.video-box iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.section-subtext {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   7. POSTER v1 (single card, full-bleed background)
   ══════════════════════════════════════════════════════════ */
.section-poster {
    background: var(--bg-page);
    padding: 60px 24px;
}
.section-poster .section-inner {
    background: linear-gradient(160deg, var(--navy-poster) 0%, var(--primary-light) 100%);
    border-radius: 28px;
    padding: 56px 32px;
    box-shadow: 0 25px 50px rgba(14, 31, 78, 0.25);
    color: var(--white);
    text-align: center;
}
.poster-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--gold-light);
    color: var(--text-dark);
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 24px;
    box-shadow: 0 4px 10px rgba(245,158,11,0.3);
}
.poster-badge i { color: var(--yellow-light); }
.section-poster h2 { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.section-poster p  { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 40px; }

.poster-image-wrapper {
    max-width: 800px;
    margin: 0 auto 40px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.poster-image-wrapper img { width: 100%; height: auto; display: block; }
.poster-image-wrapper .video-box {
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

/* Poster swiper (ใช้ปุ่ม/pagination สีทองเพราะพื้นหลังเป็นสีกรมท่า) */
.posterSwiper { width: 100%; }
.posterSwiper .swiper-slide {
    background: var(--navy-poster);
}
.posterSwiper .swiper-pagination-bullet {
    background: rgba(255,255,255,0.6);
    opacity: 1;
}
.posterSwiper .swiper-pagination-bullet-active {
    background: var(--gold-mid);
}
.posterSwiper .swiper-button-next,
.posterSwiper .swiper-button-prev {
    color: var(--text-dark);
    background: var(--gold-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.posterSwiper .swiper-button-next:after,
.posterSwiper .swiper-button-prev:after { font-size: 16px; font-weight: bold; }

/* ปุ่ม CTA พื้นฐาน (ใช้ร่วมกันหลายจุด เช่น poster v2, event list v2) */
.btn-poster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    color: var(--navy-poster);
    padding: 14px 36px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: 0.3s;
}
.btn-poster:hover {
    background: var(--bg-page);
    transform: translateY(-3px);
    color: var(--navy-poster);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* ══════════════════════════════════════════════════════════
   8. POSTER v2 (Split Card, Mining 4.0 gold theme)
   ══════════════════════════════════════════════════════════ */
.section-poster-v2 {
    background: var(--bg-page);
    padding: 80px 24px;
}
.poster-v2-card {
    position: relative;
    overflow: hidden;
    background: var(--navy-poster);
    border: 1px solid rgba(223, 165, 57, 0.25);
    border-radius: var(--radius-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    box-shadow: 0 20px 45px rgba(0,0,0,0.25);
}
/* ลายกริดจางๆ บนพื้น navy ให้ดูธีม industrial/mining เหมือน hero */
.poster-v2-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}
/* แสงเรืองทองมุมขวาบน */
.poster-v2-card::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(223,165,57,0.35) 0%, rgba(223,165,57,0) 70%);
    z-index: 1;
    pointer-events: none;
}

.poster-v2-text {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 320px;
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);
    text-align: left;
}
.poster-v2-text .poster-badge {
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.poster-v2-text .poster-badge i {
    animation: goldPulse 2.5s infinite ease-in-out;
}
.poster-v2-text h2 {
    position: relative;
    padding-left: 16px;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.35;
}
.poster-v2-text h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-mid), var(--gold-light));
}
.poster-v2-text p  { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 32px; line-height: 1.7; }

/* ปุ่ม CTA ในโซนนี้: gold gradient + glow แทนขาวธรรมดา */
.poster-v2-text .btn-poster {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--gold-mid) 0%, #b88628 100%);
    color: #17213f;
    box-shadow: 0 8px 20px rgba(223, 165, 57, 0.3);
    border: 2px solid transparent;
}
.poster-v2-text .btn-poster:hover {
    background: transparent;
    color: var(--gold-mid);
    border-color: var(--gold-mid);
    box-shadow: 0 10px 25px rgba(223, 165, 57, 0.45);
    transform: translateY(-4px);
}
.poster-v2-text .btn-poster i { transition: transform 0.25s ease; }
.poster-v2-text .btn-poster:hover i { transform: translateX(4px); }

.poster-v2-media {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 320px;
    background: rgba(0,0,0,0.2);
    border-left: 1px solid rgba(223, 165, 57, 0.25);
}
.poster-v2-media .posterSwiper,
.poster-v2-media .swiper-slide { height: 100%; min-height: 320px; }
.poster-v2-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.poster-v2-media .video-box {
    height: 100%;
    padding-bottom: 0;
}
.poster-v2-media .video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ══════════════════════════════════════════════════════════
   9. FEATURE CARDS
   ══════════════════════════════════════════════════════════ */
.section-title { font-size: 32px; font-weight: 700; color: var(--primary); text-align: center; margin-bottom: 48px; }
.feature-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); border-color: var(--secondary); }
.feature-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary);
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    transition: 0.3s;
}
.feature-card:hover .feature-icon-wrapper { background: var(--primary); color: var(--white); transform: scale(1.1); }
.feature-card h4 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.feature-card p  { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   10. HIGHLIGHT (layout 1 / layout 2) + Swiper gold buttons
   ══════════════════════════════════════════════════════════ */
/* -- layout 1: image + text side by side -- */
.highlight-section {
    background: var(--bg-page);
    padding: 80px 24px 100px;
    position: relative;
}
.highlight-header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    color: var(--primary);
    font-size: 32px;
    font-weight: 700;
}
.highlight-slide-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    max-width: 1150px;
    margin: 0 auto;
}
.hi-image-part { flex: 1; min-width: 300px; }
.hi-image-part img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    background: var(--white);
}
.hi-btn-more {
    background: var(--white);
    color: var(--dark-border);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: 0.3s;
}
.hi-btn-more:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); color: var(--primary); }
.hi-text-part { flex: 1.2; min-width: 300px; color: var(--navy-text); }
.hi-text-part h3 { font-weight: 700; font-size: 26px; margin-bottom: 24px; line-height: 1.4; }
.hi-text-part .hi-desc { font-size: 16px; line-height: 1.8; color: var(--text); }

/* -- swiper gold buttons: ใช้ร่วมกับ swiper บนพื้น navy/gold ทั้ง highlight/poster -- */
.swiper-button-gold {
    background-color: var(--gold-bright);
    color: var(--black);
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.swiper-button-gold:after { font-size: 18px !important; font-weight: 900; }
.swiper-pagination-gold .swiper-pagination-bullet-active { background: var(--black); }

/* -- layout 2: single-slide with thumbnails -- */
.hi-slider-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}
.hi-slider-media {
    flex: 1 1 520px;
    min-width: 320px;
}
.hiMainSwiper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
}
.hiMainSwiper .swiper-slide img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}
.hiThumbSwiper {
    padding: 4px 2px;
}
.hiThumbSwiper .swiper-slide {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.55;
    transition: 0.2s;
    border: 2px solid transparent;
}
.hiThumbSwiper .swiper-slide img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}
.hiThumbSwiper .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--secondary);
}
.hi-slider-pagination {
    position: static;
    margin-top: 10px;
    text-align: center;
}
.hi-slider-text {
    flex: 1 1 380px;
    min-width: 280px;
    position: relative;
}
.hi-text-panel {
    display: none;
}
.hi-text-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
.hi-text-panel h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
    margin-bottom: 14px;
}
.hi-text-panel .hi-desc {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
    margin-bottom: 20px;
}

/* -- date badge: ใช้ร่วมกันใน highlight grid และ event card -- */
.hi-card-v2-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════════
   11. EVENT (slider / bg-image variant / list v2)
   ══════════════════════════════════════════════════════════ */
/* -- event slider (grid + swiper) -- */
.event-slider-container { padding: 20px 0 40px; position: relative; }
.event-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}
.event-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--secondary); }
.event-img   { width: 100%; height: 200px; object-fit: cover; background: var(--border); }
.event-body  { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.event-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 12px; line-height: 1.4; }
.event-desc  { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; flex: 1; }
.event-readmore { color: var(--secondary); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; }

/* ปุ่ม swiper generic (ใช้ได้กับหลาย slider ที่พื้นหลังสว่าง) */
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary);
    background: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.swiper-button-next:after,
.swiper-button-prev:after { font-size: 16px; font-weight: bold; }
.swiper-pagination-bullet-active { background: var(--secondary); }

/* -- event section แบบพื้นหลังรูป (legacy) -- */
.section.event-section {
    background: var(--bg-page);
    padding: 80px 24px;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    position: relative;
}
.section.event-section .section-inner {
    position: relative;
    z-index: 1;
}

/* -- event list v2 (timeline/list) -- */
.event-section-v2 {
    background: var(--bg-page);
    padding: 60px 0;
    position: relative;
}
.event-section-v2 .section-inner { position: relative; z-index: 1; }
.event-list-v2 { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.event-row-v2 {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    transition: 0.3s;
}
.event-row-v2:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,0.2); }
.event-row-v2-img { width: 220px; min-width: 220px; height: auto; object-fit: cover; }
.event-row-v2-body { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.event-row-v2-title { font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.event-row-v2-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.event-row-v2-link { color: var(--secondary); font-weight: 600; font-size: 14px; align-self: flex-start; }

/* ══════════════════════════════════════════════════════════
   12. CONCLUSION
   ══════════════════════════════════════════════════════════ */
/* legacy full-bleed image variant, currently unused */
.conclusion-section {
    width: 100%;
    display: block;
    line-height: 0;
    background: var(--white);
}
.conclusion-section img { width: 100%; height: auto; display: block; }

/* sec_conclusion, rendered before the footer */
.conclusion-text-wrap { max-width: 860px; text-align: center; }
.conclusion-text { font-size: 16px; line-height: 1.8; color: var(--text); text-align: left; }
.conclusion-text p { margin-bottom: 16px; }
.conclusion-text p:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   13. FOOTER
   ══════════════════════════════════════════════════════════ */
.site-footer {
    --footer-text-solid: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--footer-text-solid);
    padding: 80px 24px 24px;
    margin-top: 0;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-grid  { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 48px; margin-bottom: 60px; }
.footer-brand .logo-text { color: var(--footer-text-solid); font-size: 20px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.footer-col h4 { color: var(--footer-text-solid); font-size: 15px; font-weight: 600; margin-bottom: 20px; position: relative; padding-bottom: 12px; }
.footer-col h4::after { content: ''; position: absolute; bottom: 0; left: 0; width: 30px; height: 2px; background: var(--footer-text-solid); opacity: 0.5; }
.contact-info-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--footer-text-solid); opacity: 0.85; }
.contact-info-item i { font-size: 16px; color: var(--footer-text-solid); margin-top: 2px; }
.footer-col a.footer-link { display: block; color: var(--footer-text-solid); opacity: 0.85; font-size: 14px; margin-bottom: 12px; transition: 0.2s; }
.footer-col a.footer-link:hover { opacity: 1; transform: translateX(2px); }
.social-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: var(--footer-text-solid);
    font-size: 18px; text-decoration: none; transition: all 0.3s ease;
}
.social-btn:hover { background: rgba(255,255,255,0.3); transform: translateY(-3px); color: var(--footer-text-solid); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 24px; display: flex; justify-content: space-between;
    font-size: 13px; color: var(--footer-text-solid); opacity: 0.7;
}
.footer-logos {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--white);
    border-radius: 16px;
    padding: 14px 28px;
    margin-bottom: 24px;
    width: fit-content;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.footer-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

/* ══════════════════════════════════════════════════════════
   14. BOOTSTRAP CAROUSEL / GRID REPLACEMENT
   (แทน Bootstrap โดยไม่ต้อง re-migrate JS)
   ══════════════════════════════════════════════════════════ */
.carousel { position: relative; overflow: hidden; }
.carousel-inner { position: relative; width: 100%; overflow: hidden; }
.carousel-item { display: none; position: relative; float: left; width: 100%; transition: transform 0.6s ease; }
.carousel-item.active { display: block; }
.carousel-item-next,
.carousel-item-prev { display: block; position: absolute; top: 0; }
.carousel-fade .carousel-item { opacity: 0; transition: opacity 0.6s ease; transform: none; }
.carousel-fade .carousel-item.active { opacity: 1; display: block; }
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    margin: 0;
    padding: 0;
    list-style: none;
}
.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
}
.carousel-indicators button.active { background: var(--white); }
.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--white);
    opacity: 0.7;
    transition: opacity 0.2s;
}
.carousel-control-prev { left: 16px; }
.carousel-control-next { right: 16px; }
.carousel-control-prev:hover,
.carousel-control-next:hover { opacity: 1; }
.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
}
.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
}
.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}

.row { display: flex; flex-wrap: wrap; gap: 40px; }
.col-lg-6 { flex: 1; min-width: 280px; }
.align-items-center { align-items: center; }
.g-5 { gap: 40px; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-end { align-items: flex-end; }
.mb-4 { margin-bottom: 16px; }
.gap-3 { gap: 12px; }

/* ══════════════════════════════════════════════════════════
   15. ARTICLE PAGE (article.php)
   ══════════════════════════════════════════════════════════ */
.article-cover {
    max-width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}
.article-cover img {
    width: 100%;
    height: auto;
    display: block;
}
.article-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    line-height: 1.4;
}
.article-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 28px;
}
.article-gallery-img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.article-content p { margin-bottom: 16px; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0; }
.article-content h2, .article-content h3 { color: var(--primary); margin: 28px 0 12px; }

/* ══════════════════════════════════════════════════════════
   16. ALL CONTENT PAGE TABS
   ══════════════════════════════════════════════════════════ */
.all-content-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    row-gap: 10px;
    margin-top: 24px;
}
.all-content-tab {
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--white);
    border: 1px solid var(--border);
    transition: 0.2s;
}
.all-content-tab.active,
.all-content-tab:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ══════════════════════════════════════════════════════════
   17. ACTIVITY CALENDAR SECTION
   ══════════════════════════════════════════════════════════ */
.activity-calendar-section {
    background: var(--bg-page);
    padding: 60px 24px 100px;
}
.activity-header {
    max-width: 1200px;
    margin: 0 auto 32px;
    text-align: left;
}
.activity-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #318241;
    margin-bottom: 0px;
}
.activity-eyebrow::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #318241;
    border-radius: 2px;
    display: inline-block;
}
.activity-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-top: 2px;
}
.activity-list { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.activity-row {
    display: flex;
    align-items: center;
    gap: 22px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 22px 28px;
    box-shadow: var(--shadow-sm);
    transition: 0.2s;
}
.activity-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.activity-badge {
    flex-shrink: 0;
    min-width: 56px;
    height: 68px;
    padding: 8px 12px;
    border-radius: 14px;
    background: #DCEAFB;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.activity-day { font-size: 26px; font-weight: 700; color: #2563B0; line-height: 1.1; }
.activity-month { font-size: 13px; font-weight: 600; color: #2563B0; margin-top: 2px; }
.activity-row-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.activity-row-desc { font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   18. EDITOR UI (format toolbar, gallery uploader)
   ══════════════════════════════════════════════════════════ */
.text-format-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
.fmt-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
}
.fmt-btn:hover { background: var(--surface); border-color: var(--secondary); color: var(--secondary); }

.gallery-list-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.gallery-item-card {
    position: relative;
    width: 90px; height: 90px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}
.gallery-item-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item-new {
    position: relative;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 26px 10px 10px;
    width: 170px;
}
.gallery-item-new input[type="file"] { font-size: 11px; }
.btn-remove-gallery-item {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 5;
}
.btn-add-gallery {
    background: var(--secondary-tint-light);
    border: 1px dashed var(--secondary);
    color: var(--secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-add-gallery:hover { background: var(--secondary-tint); }

/* ══════════════════════════════════════════════════════════
   19. HIGHLIGHT GRID (all_content.php cards)
   ══════════════════════════════════════════════════════════ */
.highlight-grid-v2 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 28px !important;
}
.highlight-grid-v2 .hi-card-v2 {
    display: flex !important;
    flex-direction: column !important;
    background: var(--white) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    margin-bottom: 0 !important;
    border: 1px solid var(--border);
}
.highlight-grid-v2 .hi-card-v2-img {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}
.highlight-grid-v2 .hi-card-v2-img img {
    width: 100% !important;
    height: 200px !important;
    max-height: 200px !important;
    object-fit: cover !important;
    display: block !important;
}
.highlight-grid-v2 .hi-card-v2-body {
    padding: 22px !important;
}

/* ══════════════════════════════════════════════════════════
   20. RESPONSIVE — ทุก breakpoint รวมไว้ที่นี่ที่เดียว
   เรียงจากกว้าง → แคบ (991 → 900 → 768 → 600 → 480)
   เพื่อให้ progressive override (เช่น hero h1 ยิ่งจอเล็กยิ่งฟอนต์เล็กลง) ทำงานถูกต้อง
   ══════════════════════════════════════════════════════════ */

@media (max-width: 991px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 2px;
        background: var(--white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 10px 16px;
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 10px 14px; }
    .nav-hamburger { display: flex; align-items: center; justify-content: center; }
    .hero h1 { font-size: 36px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .site-footer { border-radius: 24px 24px 0 0; }
    .header-logo-img { height: 30px; }
    .header-logo-i4  { height: 40px; }
    .site-header-inner { padding: 0 16px; }
}

@media (max-width: 900px) {
    .mining-two-col { grid-template-columns: 1fr; }
    .hi-slider-layout { flex-direction: column; }
    .hiMainSwiper .swiper-slide img { height: 260px; }
}

@media (max-width: 768px) {
    /* stat info */
    .stat-info-container { flex-direction: column; gap: 32px; }
    .stat-info-divider { display: none; }
    .stat-info-item { padding: 0 !important; }
    /* article */
    .article-title { font-size: 24px; }
    /* hero */
    .hero-inner  { text-align: center; }
    .hero p      { margin-left: auto; margin-right: auto; }
    .hero-badge  { margin-left: auto; margin-right: auto; }
    /* footer */
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
    /* generic */
    .section-title { font-size: 26px; }
    .section-poster { padding: 60px 16px; }
    /* stat banner */
    .stat-banner-box { flex-direction: column; }
    .stat-item { border-right: none; border-bottom: 2px solid rgba(223,165,57,0.5); }
    .stat-item:last-child { border-bottom: none; }
    .stat-title    { font-size: 26px; }
    .stat-cta-text { font-size: 18px; }
    /* poster v2 */
    .poster-v2-card { flex-direction: column; }
    .poster-v2-text { padding: 36px 24px; text-align: center; }
    .poster-v2-text .btn-poster { align-self: center; }
    .poster-v2-media { border-left: none; border-top: 1px solid rgba(223, 165, 57, 0.25); }
    .poster-v2-media .posterSwiper,
    .poster-v2-media .swiper-slide { min-height: 240px; }
    /* event list v2 */
    .event-row-v2-img { width: 160px; min-width: 160px; }
}

@media (max-width: 600px) {
    /* event list v2 */
    .event-row-v2 { flex-direction: column; }
    .event-row-v2-img { width: 100%; height: 180px; }
    /* activity calendar */
    .activity-row { padding: 16px; gap: 14px; }
    .activity-badge { width: 52px; height: 52px; }
    .activity-day { font-size: 18px; }
}

@media (max-width: 480px) {
    /* stat banner / stat info */
    .stat-value .number { font-size: 40px; }
    .stat-value .unit    { font-size: 16px; }
    .stat-info-number    { font-size: 40px; }
    .stat-title           { font-size: 22px; }
    .stat-cta-text        { font-size: 16px; }
    /* highlight layout 2 */
    .hiMainSwiper .swiper-slide img { height: 200px; }
    .hiThumbSwiper .swiper-slide img { height: 70px; }
    .hi-text-panel h3 { font-size: 19px; }
    /* mining chart */
    .mining-chart-wrap { height: 200px; }
    .mining-donut-wrap { width: 150px; height: 150px; }
    .mining-donut-num  { font-size: 22px; }
    .mining-card       { padding: 16px; }
    /* padding ทั่วไป */
    .section,
    .section-poster,
    .section-poster-v2,
    .stat-banner-section,
    .highlight-section,
    .activity-calendar-section {
        padding-left: 16px;
        padding-right: 16px;
    }
    .hero-inner { padding: 40px 16px; }
    .hero h1    { font-size: 28px; }
    .hero p     { font-size: 15px; }
    .section-title { font-size: 22px; }
    .poster-v2-text { padding: 28px 18px; }
    .footer-logos {
        padding: 10px 16px;
        gap: 12px;
    }
    .footer-logo-img { height: 34px; }
}