/* ==========================================================
   upcoming-events-desktop.css
   Desktop only (>= 992px): แปลง Card 3 คอลัมน์ เป็นแถวเต็มจอ
   - โหลดต่อจาก CSS เดิม (หลัง head.php) เพื่อให้ override ได้
   - Mobile / Tablet ไม่ได้รับผลกระทบ
   ========================================================== */

@media (min-width: 992px) {
  /* 1) Container เต็มจอ (แทน Bootstrap .container แบบ fixed width) */
  .container.content-page {
    width: 100%;
    max-width: none;
    padding-left: 48px;
    padding-right: 48px;
  }

  /* 2) แบนเนอร์โฆษณา: 4 ใบเรียงแถวเดียว */
  .content-page .adsHeader > [class*="col-"] {
    width: 25%;
  }

  /* 3) หัวข้อ + ปุ่ม Filter */
  .content-page .portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding-left: 0;
  }

  /* 4) แต่ละ Event = 1 แถวเต็มความกว้าง */
  .content-page .isotope-container .isotope-item {
    width: 100%;
    float: none;
    padding: 8px 0;
  }

  /* 5) Card แบบ Grid: ซ้าย = แบนเนอร์, ขวา = ข้อมูล + ลิงก์
     ความสูงการ์ด = ความสูงรูป (แถวสุดท้ายยืดหดตามรูป ไม่ดันตามเนื้อหา) */
  .content-page .isotope-container .isotope-item > .card {
    display: grid;
    grid-template-columns: minmax(360px, 32%) 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: 0;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
  }

  /* แถบวันที่ → ขวาบน */
  .content-page .isotope-item > .card > .topTitleBorder:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
  }
  .content-page .isotope-item > .card > .topTitleBorder:nth-child(1) .TopTitle {
    text-align: left;
    padding-left: 24px;
  }

  /* แบนเนอร์ → ซ้าย (ครอบทุกแถว) แสดงภาพเต็ม ไม่ครอป ไม่มีช่องว่างใต้ภาพ */
  .content-page .isotope-item > .card > .card-body:nth-child(2) {
    grid-column: 1;
    grid-row: 1 / span 3;
    display: block;
    margin: 0;
    padding: 0 10px 0 0;
    line-height: 0;
  }
  .content-page .isotope-item > .card > .card-body:nth-child(2) a {
    display: block;
    width: 100%;
  }
  .content-page .isotope-item > .card > .card-body:nth-child(2) img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  /* ชื่อ Event + สถานที่ → ขวากลาง */
  .content-page .isotope-item > .card > .topTitleBorder:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    padding: 12px 24px 4px;
  }
  .content-page .isotope-item > .card > .topTitleBorder:nth-child(3) .TopTitle {
    text-align: left;
    font-size: 22px;
  }
  .content-page .isotope-item > .card > .topTitleBorder:nth-child(3) p {
    margin: 4px 0 0;
  }

  /* ลิงก์ฟอร์มทั้งหมด → ขวาล่าง 3 คอลัมน์
     ถ้าลิงก์เยอะเกินความสูงรูป จะเลื่อนในกรอบ (ไม่ดันการ์ดให้สูงขึ้น) */
  .content-page .isotope-item > .card > .card-body-2 {
    grid-column: 2;
    grid-row: 3;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 24px 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    align-content: start;
    border-top: 1px solid #ddd;
    margin-top: 8px;
  }
  .content-page .isotope-item > .card > .card-body-2 > div {
    padding: 3px 0;
  }

  /* 6) สลับสีพื้นหลัง: การ์ดลำดับคู่ = เทาอ่อน */
  .content-page .isotope-container .isotope-item:nth-child(even) > .card {
    background: #ebf5f6;
  }
  .content-page
    .isotope-container
    .isotope-item:nth-child(even)
    > .card
    > .topTitleBorder:nth-child(3),
  .content-page
    .isotope-container
    .isotope-item:nth-child(even)
    > .card
    > .card-body-2 {
    background: transparent;
  }
}
