header .header-menu-bar {
  background-color: #18416B;
}
/* Default styles for menu links */
header .header-menu-bar .menu-list > li > a {
    color: #ffffff !important; /* Default text color */
    background: transparent !important; /* Default background */
    position: relative;
    transition: color 0.3s, background 0.3s;
}

/* Hover and active styles for all menu items */
header .header-menu-bar .menu-list > li:hover > a,
header .header-menu-bar .menu-list > li.active > a {
    color: #333333 !important; /* Text color for hover and active state */
    background: #ffffff !important; /* Background color for hover and active state */
    border-radius: 0.3125rem;
}

/* Submenu arrow styles */
header .header-menu-bar .menu-list > li.has-submenu > a:after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-top: 0.3125rem solid #ffffff; /* Default arrow color */
    border-left: 0.3125rem solid transparent;
    border-right: 0.3125rem solid transparent;
    transition: border-top 0.3s;
}

/* Hover and active styles for submenu arrows */
header .header-menu-bar .menu-list > li.has-submenu:hover > a:after,
header .header-menu-bar .menu-list > li.active > a:after {
    border-top: 0.3125rem solid #333333 !important; /* Arrow color for hover and active state */
}

.footer {
  background: #18416B;
}
.categories-title{
    font-family: "athitisemibold", sans-serif;
    font-size:1rem;
    color:#0dcaf0;
}
.calendar-wrapper-full {
    width: 100%;
    margin: 20px 0;
    font-family: 'athitimedium', sans-serif;
}

.calendar-title {
    font-family: 'athitibold', sans-serif;
    color: #8e1c12;
}

/* 1. SCROLL AREA WITH BOOTSTRAP RATIO */
/* คุมสัดส่วน 16:9 และทำให้ข้างใน Scroll ได้ */
.calendar-scroll-area {
    overflow-y: auto;
    height: 100%;
    scroll-behavior: smooth;
    padding: 15px; /* เว้นระยะจากขอบ Ratio */
}

/* Custom Scrollbar (MFU Red Style) */
.calendar-scroll-area::-webkit-scrollbar { width: 6px; }
.calendar-scroll-area::-webkit-scrollbar-track { background: #f8f9fa; }
.calendar-scroll-area::-webkit-scrollbar-thumb { background: #8e1c12; border-radius: 10px; }

/* 2. THE GRID SYSTEM */
.calendar-grid {
    display: grid;
    /* แบ่ง 2 คอลัมน์บนจอใหญ่ และปรับเป็น 1 คอลัมน์บนจอเล็กอัตโนมัติ */
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); 
    gap: 20px;
    /* หัวใจสำคัญ: บังคับให้ไอเทมในแถวเดียวกันยืดตัวสูงเท่ากัน */
    align-items: stretch; 
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

/* 3. EQUAL HEIGHT EVENT CARD */
.calendar-grid .event-card {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eee;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%; /* ยืดให้เต็มความสูงของ Grid Cell */
    overflow: hidden;
}

.calendar-grid .event-card:hover {
    /*transform: translateY(-5px);*/
    box-shadow: 0 10px 20px rgba(142, 28, 18, 0.1);
    border-color: #8e1c1244;
}

/* 4. DATE BOX (STAY CENTERED) */
.calendar-grid .date-box {
    background: #8C111E;
    color: #ffffff;
    min-width: 90px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* ป้องกันวันที่โดนบีบ */
}

.calendar-grid .date-day {
    font-size: 1.8rem;
    font-family: 'athitibold', sans-serif;
    line-height: 1;
}

.calendar-grid .date-month {
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-top: 5px;
    font-family: 'athitibold', sans-serif;
}

/* 5. CONTENT DETAILS (FLEXIBLE HEIGHT) */
.calendar-grid .event-details {
    padding: 20px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* เริ่มจากด้านบน */
    background: #fff;
}

.calendar-grid .event-title {
    font-family: 'athitisemibold', sans-serif;
    font-size: 1.2rem;
    color: #333;
    line-height: 1.4;
    margin-bottom: 10px;
    /* ปลดล็อกให้แสดงผลครบถ้วน */
    display: block;
    overflow: visible;
    white-space: normal;
}

.calendar-grid .event-meta {
    font-size: 0.95rem;
    color: #777;
    margin-top: auto; /* ดันเวลา/สถานที่ไปอยู่ล่างสุดของการ์ดเสมอ */
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* 6. UI ELEMENTS (LOAD MORE & SKELETON) */
.load-more-box {
    text-align: center;
    margin-top: 30px;
}

.btn-load-more {
    background: transparent;
    border: 2px solid #8e1c12;
    color: #8e1c12;
    padding: 10px 45px;
    border-radius: 50px;
    font-family: 'athitibold', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-load-more:hover:not(:disabled) {
    background: #8e1c12;
    color: #fff;
}

.loading-skeleton {
    height: 120px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 16px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ลบสไตล์พื้นฐานของลิงก์ */
.event-card-link {
    display: block; /* ให้ลิงก์ครอบคลุมพื้นที่การ์ดทั้งหมด */
    color: inherit;
    transition: all 0.2s ease;
}

.event-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* เพิ่ม Effect เมื่อเอาเมาส์ไปชี้ ให้รู้ว่า "คลิกได้นะ" */
.event-card-link:hover .event-card {
    background-color: #fffafa; /* เปลี่ยนสีพื้นหลังนิดๆ */
    border-color: #8e1c12;     /* เน้นขอบให้ชัดขึ้น */
    cursor: pointer;
}

/* เพิ่ม Icon ลูกศรเล็กๆ ที่มุม (Optional - เพื่อบอกใบ้ User) */
.event-details {
    position: relative;
}

.event-card-link:hover .event-details::after {
    content: '\f061'; /* FontAwesome arrow-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e1c12;
    opacity: 0.5;
}