/* ==========================================================================
   หน้ากิจกรรมพิเศษทั้งหมด (/events) - การ์ดกิจกรรม (booking/events/_card)
   --------------------------------------------------------------------------
   โครงหน้า (breadcrumb / แบนเนอร์ / แถบเครื่องมือ / เลขหน้า) อยู่ใน booking.css (.bk-listpage)
   ขนาดเป็น px คงที่ สเกลเดียวกับหน้ารายการของ mrta-news (เนื้อหาใน .container กว้างสุด 1320px)
   วัดจากแบบ (เฟรม 1920) แล้วย่อตามความกว้างการ์ด ~300px
   ========================================================================== */

/* ── มุมมองตาราง: 4 คอลัมน์ ─────────────────────────────────────────────── */
.el-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.el-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(22, 48, 107, .08);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.el-card:hover {
    box-shadow: 0 10px 28px rgba(22, 48, 107, .14);
    transform: translateY(-2px);
}

/* รูปปก 16:10 (ตามแบบ / ขนาดที่หลังบ้านแนะนำ) - พื้นอ่อนระหว่างรูปกำลังโหลด */
.el-card-media {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 10;
    background: var(--bk-navy-soft);
    overflow: hidden;
}
.el-card-media > * { grid-area: 1 / 1; }
.el-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.el-card:hover .el-card-media img { transform: scale(1.04); }

/* ป้ายสถานะมุมซ้ายบนของรูป - สีตาม BookingEvent::list_state */
.el-badge {
    position: relative;
    z-index: 1;
    align-self: start;
    justify-self: start;
    margin: 14px 0 0 14px;
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}
.el-badge-open        { background: #0b5a3a; } /* WCAG AAA: ตัวขาว 8.3:1 (เดิม #1c863a = 4.4:1) */
.el-badge-nearly_full { background: #f2b705; color: #1f2a44; } /* ตัวขาวบนเหลืองไม่ผ่าน - ใช้ตัวเข้ม */
.el-badge-full        { background: var(--bk-red); }
.el-badge-soon        { background: var(--bk-navy); }
.el-badge-closed      { background: #454f69; }   /* ทึบ (เดิมโปร่ง .85 บนรูป วัดคอนทราสต์ไม่ได้) */

.el-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 16px 16px 24px;
}

.el-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* ป้ายที่นั่ง "ว่าง 18 / 20 ที่นั่ง" - ปิดรับแล้วเป็น "สิ้นสุดการรับสมัคร" สีเทา */
.el-seats {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50rem;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}
.el-seats-open        { background: #e4f6e9; color: #0b5a3a; } /* WCAG AAA 7.3:1 */
.el-seats-nearly_full { background: #fff4d1; color: #916600; }
.el-seats-full        { background: var(--bk-red-soft); color: var(--bk-red-deep); }
.el-seats-closed      { background: #e9ecf1; color: #3d4660; } /* พื้นเทาเข้มกว่าขาว - WCAG AAA 7.9:1 */

/* ป้ายหมวด (มุมมองรายการ) */
.el-cat {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 50rem;
    background: var(--bk-navy-soft);
    color: var(--bk-navy);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

/* ชื่อกิจกรรม 2 บรรทัด - สูงเท่ากันทุกใบ เส้นคั่น/ปุ่มจึงตรงกันทั้งแถว */
.el-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.9em;
    margin: 0;
    overflow: hidden;
    color: var(--bk-navy);
    font-family: var(--bs-font-primary);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.45;
}
.el-card-title a {
    color: inherit;
    text-decoration: none;
}
.el-card-title a:hover { color: var(--bk-red); }

.el-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 8px 0 0;
    overflow: hidden;
    color: var(--bk-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* วันที่ / เวลา / สถานที่ / ช่วงรับสมัคร - บรรทัดเดียว ยาวเกินตัดด้วย … */
.el-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--bk-line);
    list-style: none;
    color: var(--bk-navy);
    font-size: 15px;
    line-height: 1.5;
}
.el-meta li {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.el-meta i {
    flex: none;
    width: 14px;
    color: var(--bk-navy);
    font-size: 13px;
    text-align: center;
}
.el-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.el-card-foot {
    margin-top: auto;
    padding-top: 24px;
}

.el-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border-radius: 4px;
    background: #002777;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color .18s;
}
.el-btn:hover { background: #0b3bb8; color: #fff; }
.el-btn:focus-visible { outline: 3px solid rgba(85, 112, 208, .55); outline-offset: 2px; }
.el-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
}
.el-btn.is-disabled:hover { background: #002777; }

/* ── มุมมองรายการ: รูปซ้าย รายละเอียดขวา ข้อมูลกิจกรรม 2 คอลัมน์ ปุ่มชิดขวา ───── */
.el-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.el-card.is-list { flex-direction: row; }
.el-card.is-list .el-card-media {
    flex: 0 0 320px;
    aspect-ratio: auto;
    min-height: 200px;
}
.el-card.is-list .el-card-body { padding: 20px 24px; }
.el-card.is-list .el-card-title { min-height: 0; }
.el-card.is-list .el-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
}
.el-card.is-list .el-card-foot {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
}
.el-card.is-list .el-btn {
    width: auto;
    min-width: 200px;
}

/* ── จอเล็ก ─────────────────────────────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .el-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 991.98px) {
    .el-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .el-card.is-list .el-card-media { flex-basis: 260px; }
    .el-card.is-list .el-meta { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 575.98px) {
    .el-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }

    .el-card.is-list { flex-direction: column; }
    .el-card.is-list .el-card-media {
        flex: none;
        aspect-ratio: 16 / 10;
        min-height: 0;
    }
    .el-card.is-list .el-card-body { padding: 16px 16px 24px; }
    .el-card.is-list .el-btn { width: 100%; }
}
