/* ==========================================================================
   หน้ากิจกรรมทั้งหมด (/events) - การ์ดกิจกรรม (event/list/_card)
   --------------------------------------------------------------------------
   โหลดต่อจาก news.css (ตัวแปร --nw-* ป้าย .nw-badge รูป .nw-thumb
   โครงหน้ารายการ + แถบเครื่องมือ .nw-listpage / .nw-toolbar ชุดเดียวกับหน้าข่าวสารทั้งหมด)
   สเกลเดียวกับหน้ารายการทรัพยากรของ belib (/book/all) - ขนาดเป็น px
   ========================================================================== */

/* มุมมองตาราง: 3 คอลัมน์ การ์ดแนวนอน (รูปซ้าย | ข้อมูลขวา) */
.el-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}
.el-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.el-card {
    position: relative;
    display: grid;
    grid-template-columns: 54% minmax(0, 1fr);
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(33, 48, 105, .10);
    transition: box-shadow .2s;
}
.el-card:hover { box-shadow: 0 12px 26px rgba(33, 48, 105, .18); }
.el-card:has(a:focus-visible) { outline: 3px solid rgba(85, 112, 208, .55); outline-offset: 3px; }

/* รูปโปสเตอร์ - สัดส่วนตามแบบ (แนวตั้งเล็กน้อย) */
.el-card-media { aspect-ratio: 295 / 338; }
.el-card-media img { transition: transform .35s ease; }
.el-card:hover .el-card-media img { transform: scale(1.04); }

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

/* วันที่: "08 ก.ย." แดง / "2569" กรมท่า กลางการ์ด มีเส้นคั่นด้านล่าง */
.el-date {
    margin: 0 0 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--nw-line);
    text-align: center;
    line-height: 1.25;
}
.el-date time { display: block; }
.el-date-dm {
    display: block;
    color: var(--nw-red);
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: 28px;
    white-space: nowrap;
}
.el-date-y {
    display: block;
    margin-top: 2px;
    color: var(--nw-navy-deep);
    font-family: var(--bs-font-primary);
    font-weight: 500;
    font-size: 18px;
}
.el-date-to {
    display: block;
    margin-top: 4px;
    color: var(--nw-muted);
    font-size: 12px;
}

.el-card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}
.el-card-cat {
    margin-bottom: 8px;
    padding: 2px 8px;
    font-size: 13px;
}
.el-time {
    margin: 0 0 4px;
    color: var(--nw-navy-deep);
    font-size: 14px;
}
.el-card-title {
    margin: 0;
    font-family: var(--bs-font-primary);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.el-card-title a { color: var(--nw-navy-deep); text-decoration: none; }
/* ลิงก์ชื่อกิจกรรมขยายเต็มการ์ด */
.el-card-title a::after { content: ""; position: absolute; inset: 0; }
.el-card-title a:focus-visible { outline: 0; }
.el-card:hover .el-card-title a { color: var(--nw-red); }
.el-card-excerpt {
    margin: 8px 0 0;
    color: var(--nw-muted);
    font-size: 15px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* สถานที่ชิดล่างการ์ด บรรทัดเดียว */
.el-place {
    align-self: stretch;
    margin: auto 0 0;
    padding-top: 10px;
    overflow: hidden;
    color: var(--nw-text);
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* มุมมองรายการ: รูป | วันที่ (คอลัมน์ของตัวเอง เส้นคั่นด้านขวา) | ข้อมูล */
.el-list .el-card { grid-template-columns: 200px minmax(0, 1fr); }
.el-list .el-card-media { aspect-ratio: auto; min-height: 180px; }
.el-list .el-card-body {
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
    padding: 22px 26px;
}
.el-list .el-date {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 130px;
    margin: 0;
    padding: 0 24px 0 0;
    border-bottom: 0;
    border-right: 1px solid var(--nw-line);
}
.el-list .el-card-title { font-size: 19px; }

@media (max-width: 1199.98px) {
    .el-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .el-grid { grid-template-columns: minmax(0, 1fr); }
    .el-list .el-card { grid-template-columns: 120px minmax(0, 1fr); }
    .el-list .el-card-body { flex-direction: column; gap: 10px; padding: 16px; }
    .el-list .el-date {
        flex: none;
        padding: 0 0 10px;
        border-right: 0;
        border-bottom: 1px solid var(--nw-line);
        text-align: left;
    }
    .el-list .el-date-dm { display: inline; font-size: 22px; }
    .el-list .el-date-y { display: inline; margin-left: 6px; font-size: 16px; }
    .el-list .el-card-title { font-size: 16px; }
    .el-list .el-card-excerpt { display: none; }
}
@media (max-width: 419.98px) {
    .el-card { grid-template-columns: 45% minmax(0, 1fr); }
}
