/* หน้าแรก: เอกสาร / ข่าว / ปุ่มดูทั้งหมด / การ์ดปฏิทินการศึกษา — โหลดหลัง banner-slider.css (ตำแหน่งเดิมของ CSS ชุดนี้) */

/* ══ เอกสารดาวน์โหลด ═══════════════════════════════════ */
/* แถวเอกสาร: ชี้เมาส์แล้ว "นิ่ง" — แค่พื้นแถวอ่อน ๆ + แถบซ้ายบาง + ชื่อเอกสารเปลี่ยนสี
   (เดิมแถวเด้งขึ้น+เงา+ปุ่มเด้งขยาย เลื่อนเมาส์ผ่านหลายแถวแล้วลายตา) */
#documents-section .table-npu tbody tr.premium-doc-row,
#documents-section .table-npu tbody tr.premium-doc-row:hover {
    background-color: transparent !important; /* style.css ใส่พื้นฟ้าอ่อนที่ tr — ให้ td เป็นคนเปลี่ยนสีแทน (กลางคืนจะได้ไม่ขาวทั้งแถว) */
    transform: none !important;
    box-shadow: none !important;
}
.premium-doc-row td {
    transition: background-color .15s ease, box-shadow .15s ease;
}
.premium-doc-row:hover td {
    background-color: rgba(0, 51, 102, 0.035) !important;
}
.premium-doc-row:hover td:first-child {
    box-shadow: inset 3px 0 0 0 #f4b41a;
}
.premium-doc-row a:not(.btn) { transition: color .15s ease; }
.premium-doc-row:hover a:not(.btn) { color: #0b4a8b; }
.premium-doc-row .doc-btn { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.premium-doc-row .doc-btn:hover { filter: brightness(1.05); }
/* กลางคืน (พื้นกระจกเข้ม) */
html.space-bg-mode:not(.hs-day) .premium-doc-row:hover td { background-color: rgba(255, 255, 255, 0.045) !important; }
html.space-bg-mode:not(.hs-day) .premium-doc-row:hover a:not(.btn) { color: #ffd54a !important; }
.documents-section { background: #f8fafc; }
.home-doc-search { max-width: 550px; }
.btn-navy-gradient { background: linear-gradient(135deg, #003366, #0066cc); border: none; }

/* ══ ข่าว ══════════════════════════════════════════════ */
/* Premium News Card Styles */
.premium-news-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 51, 102, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
}

.premium-news-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    transition: all 0.7s ease;
    z-index: 10;
    pointer-events: none;
}

.premium-news-card:hover::after {
    left: 200%;
}

.premium-news-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.15);
    border-color: rgba(0, 51, 102, 0.15);
}

.premium-news-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.premium-news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-news-card:hover .premium-news-img {
    transform: scale(1.1) rotate(2deg);
}

.premium-news-img-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    z-index: 1;
}

.premium-news-date-badge {
    position: absolute;
    bottom: 15px; left: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #003366;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.premium-news-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.premium-news-card h5 {
    transition: color 0.3s ease;
}

.premium-news-card:hover h5 {
    color: #004a99 !important;
}

.premium-news-readmore {
    transition: all 0.3s ease;
}

/* แถบข่าวเลื่อนซ้าย-ขวา */
.news-carousel { position: relative; --nc-gap: 24px; }
.nc-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * var(--nc-gap)) / 4);
    gap: var(--nc-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    padding: 16px 2px 24px; /* เผื่อการ์ดยกตัวตอน hover (-12px) ไม่ให้โดนตัด */
    scrollbar-width: none;
}
.nc-track::-webkit-scrollbar { display: none; }
.nc-track:focus-visible { outline: 3px solid rgba(0, 74, 153, .35); outline-offset: 4px; border-radius: 16px; }
.nc-slide { scroll-snap-align: start; min-width: 0; }
.nc-slide > a { display: block; height: 100%; }
.nc-arrow {
    position: absolute;
    top: 116px; /* กึ่งกลางรูปข่าว (padding 16 + รูปสูง 200 / 2) */
    transform: translateY(-50%);
    z-index: 5;
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 51, 102, .12);
    background: #fff;
    color: #003366;
    box-shadow: 0 8px 24px rgba(0, 51, 102, .18);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: background .2s, color .2s, opacity .2s, transform .2s;
}
.nc-prev { left: -22px; }
.nc-next { right: -22px; }
.nc-arrow:hover:not(:disabled) { background: #003366; color: #ffd700; transform: translateY(-50%) scale(1.08); }
.nc-arrow:disabled { opacity: 0; pointer-events: none; }
.nc-dots { display: flex; justify-content: center; gap: 16px; margin-top: 8px; min-height: 8px; }
.nc-dots button::after { content: ""; position: absolute; inset: -8px; } /* พื้นที่กด 24px (WCAG 2.5.8) */
.nc-dots button { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 8px; background: rgba(0, 51, 102, .2); transition: width .25s, background .25s; }
.nc-dots button.active { width: 24px; background: #003366; }
.nc-more-card {
    height: 100%; min-height: 200px;
    border-radius: 16px;
    border: 2px dashed rgba(0, 51, 102, .2);
    background: linear-gradient(160deg, #f4f8fc, #e8f0f9);
    color: #003366;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    text-align: center; padding: 24px;
    transition: background .3s, border-color .3s;
}
.nc-more-card:hover { border-color: #003366; background: linear-gradient(160deg, #e8f0f9, #d6e4f4); color: #003366; }
.nc-more-icon { width: 64px; height: 64px; border-radius: 50%; background: #003366; color: #ffd700; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
html.space-bg-mode:not(.hs-day) .nc-arrow { background: rgba(8, 16, 40, .85); color: #ffd54a; border-color: rgba(255, 213, 74, .35); }
html.space-bg-mode:not(.hs-day) .nc-dots button { background: rgba(255, 255, 255, .25); }
html.space-bg-mode:not(.hs-day) .nc-dots button.active { background: #ffd54a; }
html.space-bg-mode:not(.hs-day) .nc-more-card { background: rgba(8, 16, 40, .6); color: #fff; border-color: rgba(255, 213, 74, .35); }
@media (max-width: 991.98px) {
    .nc-track { grid-auto-columns: calc((100% - var(--nc-gap)) / 2); }
    .nc-prev { left: -8px; }
    .nc-next { right: -8px; }
}
@media (max-width: 575.98px) {
    .news-carousel { --nc-gap: 14px; }
    .nc-track { grid-auto-columns: 84%; } /* เห็นขอบการ์ดถัดไป = รู้ว่าปัดต่อได้ */
    .nc-arrow { display: none; } /* มือถือใช้ปัดนิ้ว */
}
@media (prefers-reduced-motion: reduce) { .nc-track { scroll-behavior: auto; } }

.premium-news-card:hover .premium-news-readmore {
    color: #ffd700 !important;
    transform: translateX(5px);
}
.news-section-wrapper { background: #ffffff; }
.premium-news-title { font-size: 1.05rem; line-height: 1.5; height: 3.1em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ══ ปุ่ม "ดูทั้งหมด" ═════════════════════════════════════ */
@keyframes btnShine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    background: linear-gradient(135deg, #003366 0%, #004a99 50%, #003366 100%);
    background-size: 200% 100%;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0, 51, 102, 0.35);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-view-all:hover {
    background-position: 100% 0;
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 51, 102, 0.45);
    color: white;
}

.btn-view-all-text {
    position: relative;
    z-index: 2;
}

.btn-view-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.btn-view-all:hover .btn-view-all-icon {
    background: rgba(255, 255, 255, 0.35);
    transform: translateX(5px);
}

.btn-view-all::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: btnShine 4s infinite cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

/* ══ การ์ดปฏิทินการศึกษา ═════════════════════════════════ */
/* Academic Calendar Cards */
.academic-calendar-section {
    position: relative;
    overflow: hidden;
}
.academic-calendar-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0,51,102,0.04) 0%, transparent 70%);
    pointer-events: none;
}
.academic-calendar-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,215,0,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #003366, #ffd700);
    border-radius: 2px;
}
.cal-card {
    background: #fff;
    border: 1px solid rgba(0,51,102,0.08);
    border-radius: 16px;
    padding: 40px 30px 25px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.cal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #003366, #ffd700);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cal-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(0,51,102,0.15);
    border-color: rgba(0,51,102,0.15);
}
.cal-card:hover::before {
    opacity: 1;
}
.cal-card-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 2.2rem;
    transition: all 0.4s ease;
    position: relative;
}
.cal-card-icon::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(0,0,0,0.08);
    transition: all 0.6s ease;
}
.cal-card:hover .cal-card-icon {
    transform: scale(1.1) rotate(5deg);
}
.cal-card:hover .cal-card-icon::after {
    transform: rotate(-180deg);
    border-color: rgba(0,0,0,0.15);
}
.cal-icon-teal {
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,180,216,0.3);
}
.cal-icon-blue {
    background: linear-gradient(135deg, #003366 0%, #004a99 100%);
    color: #ffd700;
    box-shadow: 0 10px 30px rgba(0,51,102,0.3);
}
.cal-icon-purple {
    background: linear-gradient(135deg, #6c3483 0%, #4a235a 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(108,52,131,0.3);
}
.cal-card-body {
    flex-grow: 1;
    margin-bottom: 20px;
}
.cal-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.cal-card-subtitle {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
    font-weight: 500;
}
.cal-card-desc {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.6;
    margin-bottom: 0;
}
.cal-card-footer {
    width: 100%;
}
.cal-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 28px;
    background: linear-gradient(135deg, #003366 0%, #001a33 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.cal-card-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.cal-card:hover .cal-card-btn::before {
    left: 100%;
}
.cal-card:hover .cal-card-btn {
    box-shadow: 0 8px 25px rgba(0,51,102,0.35);
    transform: translateY(-2px);
}
.cal-card-btn i {
    transition: transform 0.3s ease;
}
.cal-card:hover .cal-card-btn i {
    transform: translateX(5px);
}
@media (max-width: 768px) {
    .cal-card {
        padding: 30px 20px 20px;
    }
    .cal-card-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

/* ══ การ์ดลัด (เดิม inline style) ══════════════════════════ */
.container.position-relative.quick-link-ribbon { z-index: 10; }   /* ต้องชนะ space-earth.css: html.space-bg-mode body > .container { z-index: 1 } */
.quick-link-row { transform: translateY(0); margin-bottom: 30px; margin-top: 50px; }
