/* R108_CCC_GALLERY_PAGED_V135_ACTIVE
   Gallery หน้า Landing: 10 รูปต่อหน้า + Pagination
   มือถือ: รูปแรกเต็มความกว้าง รูปถัดไป 2 คอลัมน์ตามตัวอย่าง */

.khaokho-theme.ploysea-theme .gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.khaokho-theme.ploysea-theme .gallery-page-number,
.khaokho-theme.ploysea-theme .gallery-page-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--primary) 32%, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  color: #18343c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .07);
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.khaokho-theme.ploysea-theme a.gallery-page-number:hover,
.khaokho-theme.ploysea-theme a.gallery-page-arrow:hover,
.khaokho-theme.ploysea-theme a.gallery-page-number:focus-visible,
.khaokho-theme.ploysea-theme a.gallery-page-arrow:focus-visible,
.khaokho-theme.ploysea-theme .gallery-page-number.is-current {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.khaokho-theme.ploysea-theme .gallery-page-arrow.is-disabled {
  opacity: .35;
  cursor: default;
  box-shadow: none;
}

.khaokho-theme.ploysea-theme .gallery-page-summary {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .khaokho-theme.ploysea-theme .gallery-section .section-head {
    margin-bottom: 14px !important;
  }

  .khaokho-theme.ploysea-theme .gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 12px !important;
  }

  .khaokho-theme.ploysea-theme .gallery-grid > .gallery-card,
  .khaokho-theme.ploysea-theme .gallery-grid > .gallery-card:nth-child(6n) {
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0;
    min-height: 0 !important;
    aspect-ratio: 6 / 5;
    border: 1px solid rgba(15, 23, 42, .10) !important;
    border-radius: 0 !important;
    background: #e5e7eb;
  }

  .khaokho-theme.ploysea-theme .gallery-grid > .gallery-card:first-child,
  .khaokho-theme.ploysea-theme .gallery-grid > .gallery-card.gallery-card-featured {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    aspect-ratio: 16 / 7;
  }

  /* ถ้าจำนวนรูปในหน้านั้นทำให้แถวสุดท้ายเหลือรูปเดียว ให้ขยายเต็มแถว */
  .khaokho-theme.ploysea-theme .gallery-grid > .gallery-card:last-child:nth-child(even) {
    grid-column: 1 / -1 !important;
    aspect-ratio: 16 / 7;
  }

  .khaokho-theme.ploysea-theme .gallery-card-link,
  .khaokho-theme.ploysea-theme .gallery-card-link img {
    width: 100%;
    height: 100%;
  }

  .khaokho-theme.ploysea-theme .gallery-card-link img {
    object-fit: cover;
  }

  .khaokho-theme.ploysea-theme .gallery-card figcaption {
    padding: 18px 9px 7px !important;
    font-size: 9px !important;
  }

  .khaokho-theme.ploysea-theme .gallery-pagination {
    gap: 6px;
    margin-top: 18px;
  }

  .khaokho-theme.ploysea-theme .gallery-page-number,
  .khaokho-theme.ploysea-theme .gallery-page-arrow {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 13px;
  }

  .khaokho-theme.ploysea-theme .gallery-page-summary {
    font-size: 11px;
  }
}
