/* Palaban — mobile-first, homepage colours */
.sg-pal-toggle { display: flex; gap: 8px; margin: 12px 0 0; }
.sg-pal-toggle-btn {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700;
  border: 0; background: #fff; color: #181818; box-shadow: inset 0 0 0 1.5px #e7e7e7;
  cursor: pointer; font: inherit;
}
.sg-pal-toggle-btn.is-on { background: #181818; color: #fff; box-shadow: none; }
.sg-pal-view[hidden] { display: none !important; }

.sg-pal-cards { display: grid; gap: 14px; }
.sg-pal-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: stretch;
  background: #fff; border: 1px solid #e7e7e7; border-radius: 16px; overflow: hidden;
  text-decoration: none; color: #181818; box-shadow: 0 8px 28px rgba(16,16,16,.06);
}
.sg-pal-card-media { background: #181818; }
.sg-pal-card-img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 3/4; }
.sg-pal-card-body { padding: 12px 12px 14px 0; min-width: 0; }
.sg-pal-card h3 { margin: 6px 0 2px; font-size: 1.05rem; letter-spacing: -0.03em; line-height: 1.2; }
.sg-pal-sub, .sg-pal-meta, .sg-pal-slots { margin: 0 0 2px; color: #5c5c5c; font-size: .9rem; }
.sg-pal-prize { margin: 4px 0; font-weight: 800; color: #C00808; }
.sg-pal-cta { margin-top: 8px; min-height: 36px; padding: 6px 14px; font-size: .85rem; pointer-events: none; }
.sg-pal-card.is-past { opacity: .85; }
.sg-pal-past h2 { color: #5c5c5c; }

.sg-pal-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 8px; border-radius: 999px;
  background: #ececec; color: #444;
}
.sg-pal-badge-open { background: #eef6ee; color: #1d6b32; }
.sg-pal-badge-full { background: #fff4d6; color: #8a5a00; }
.sg-pal-badge-closed { background: #ececec; color: #444; }
.sg-pal-badge-past { background: #f0f0f0; color: #666; }

.sg-pal-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.sg-pal-cal-dow { font-size: 11px; font-weight: 700; color: #5c5c5c; text-align: center; padding: 4px 0; }
.sg-pal-cal-cell {
  min-height: 64px; background: #fff; border: 1px solid #eee; border-radius: 8px;
  padding: 4px; font-size: 11px;
}
.sg-pal-cal-cell.is-empty { background: transparent; border-color: transparent; }
.sg-pal-cal-cell.has-event { border-color: #C00808; }
.sg-pal-cal-num { display: block; font-weight: 700; }
.sg-pal-cal-link { display: block; color: #C00808; font-weight: 700; text-decoration: none; line-height: 1.2; margin-top: 2px; }

.sg-pal-poster { margin: 0 0 16px; }
.sg-pal-poster-img { width: 100%; height: auto; display: block; border-radius: 16px; background: #181818; }
.sg-pal-event-head { position: relative; }
.sg-pal-venue { margin: 0 0 8px; color: #5c5c5c; }
.sg-pal-venue a { color: #C00808; }
.sg-pal-list { list-style: none; margin: 0; padding: 0; }
.sg-pal-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e7e7e7; }
.sg-pal-list li:last-child { border-bottom: 0; }
.sg-pal-dl { display: grid; gap: 10px; margin: 0; }
.sg-pal-dl div { margin: 0; }
.sg-pal-dl dt { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #5c5c5c; }
.sg-pal-dl dd { margin: 2px 0 0; font-weight: 700; }
.sg-pal-rules { margin: 0; padding-left: 1.15em; }
.sg-pal-dates { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sg-pal-dates a { display: flex; justify-content: space-between; gap: 8px; align-items: center; text-decoration: none; color: #181818; padding: 10px 12px; border: 1px solid #e7e7e7; border-radius: 12px; background: #fff; }
.sg-pal-dates a[aria-current="page"] { box-shadow: inset 0 0 0 1.5px #181818; }
.sg-pal-form-wrap { margin: 8px 0 32px; }
.sg-pal-form-lead { color: #5c5c5c; }
.sg-pal-form .sg-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; margin: 0 0 14px; }
.sg-pal-form .sg-check input { margin-top: 4px; }

@media (min-width: 700px) {
  .sg-pal-cards { grid-template-columns: 1fr 1fr; }
  .sg-pal-card { grid-template-columns: 140px 1fr; }
  .sg-pal-poster { max-width: 520px; margin-left: auto; margin-right: auto; }
  .sg-pal-dl { grid-template-columns: 1fr 1fr; }
  .sg-pal-cal-cell { min-height: 88px; font-size: 12px; }
}
@media (min-width: 1024px) {
  body.single-sgf_event .sg-main > *:not(.sg-hero),
  body.post-type-archive-sgf_event .sg-main > *:not(.sg-hero) {
    max-width: 1120px;
    width: min(calc(100% - (var(--pad) * 2)), 1120px);
  }
  .sg-pal-event-top {
    display: grid;
    grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    margin: 8px 0 12px;
  }
  .sg-pal-poster { max-width: none; margin: 0; }
  .sg-pal-poster-img { width: 100%; height: auto; object-fit: contain; }
  .sg-pal-event-head { padding-top: 0; }
  .sg-pal-form-wrap { max-width: 520px; }
  .sg-pal-list, .sg-pal-dates { max-width: 560px; }
  .sg-pal-dl { max-width: 640px; }
  .sg-pal-cal-cell { min-height: 100px; font-size: 13px; }
  .sg-pal-cal-link { font-size: 12px; word-break: break-word; }
}
@media (min-width: 1200px) {
  .sg-pal-cards { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1366px) {
  .sg-pal-event-top {
    grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
    gap: 48px;
  }
}

/* Branded fallback when an event has no poster yet */
.sg-pal-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: #181818; color: #fff;
  box-sizing: border-box; width: 100%; height: 100%;
  padding: 20px 16px;
}
.sg-pal-fallback-single {
  aspect-ratio: 3/4; border-radius: 16px; min-height: 320px; padding: 40px 24px;
}
.sg-pal-fallback-card { min-height: 100%; padding: 12px 8px; }
.sg-pal-fallback-logo {
  width: 72px; height: auto; object-fit: contain; margin: 0 0 12px;
  filter: brightness(1.05);
}
.sg-pal-fallback-card .sg-pal-fallback-logo { width: 40px; margin-bottom: 8px; }
.sg-pal-fallback-kicker {
  margin: 0 0 8px; font-size: 10px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: #C00808;
}
.sg-pal-fallback-title {
  margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; color: #fff;
}
.sg-pal-fallback-card .sg-pal-fallback-title { font-size: .78rem; }
.sg-pal-fallback-sub, .sg-pal-fallback-when {
  margin: 8px 0 0; color: #cfcfcf; font-size: .95rem;
}
.sg-pal-fallback-card .sg-pal-fallback-sub,
.sg-pal-fallback-card .sg-pal-fallback-when { font-size: .65rem; margin-top: 4px; }
.sg-pal-fallback-card .sg-pal-fallback-title,
.sg-pal-fallback-card .sg-pal-fallback-sub,
.sg-pal-fallback-card .sg-pal-fallback-when { display: none; }
.sg-pal-fallback-card { justify-content: center; padding: 10px 6px; }
.sg-pal-fallback-card .sg-pal-fallback-logo { width: 48px; margin: 0 0 10px; }
.sg-pal-card-media { overflow: hidden; }
