/* Event schedule on activity.html (js/agifair-schedule.js marks today) */
.ags {
  --ags-green: #198754;
  --ags-green-dark: #0d5037;
  --ags-ink: #1f2d27;
  --ags-muted: #5f7068;
  --ags-line: #e1ebe5;
  --ags-soft: #f4f9f6;
  font-family: Kanit, sans-serif;
  color: var(--ags-ink);
}

.ags-head {
  text-align: center;
  margin-bottom: 2rem;
}

.ags-head__kicker {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ags-green);
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid rgba(25, 135, 84, 0.2);
}

.ags-head h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.ags-head__theme {
  font-size: 1.1rem;
  color: var(--ags-green-dark);
  margin-bottom: 0.75rem;
}

.ags-head__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.98rem;
  color: var(--ags-muted);
}

.ags-head__meta .fa {
  color: var(--ags-green);
  margin-right: 0.35rem;
}

/* Activities that run every day */
.ags-daily {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.ags-daily__item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--ags-line);
  box-shadow: 0 8px 22px rgba(15, 42, 32, 0.06);
}

.ags-daily__icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ags-green), #157347);
}

.ags-daily__item:nth-child(2) .ags-daily__icon {
  background: linear-gradient(135deg, #22a6c9, #1d6fd6);
}

.ags-daily__item:nth-child(3) .ags-daily__icon {
  background: linear-gradient(135deg, #f59e0b, #d9480f);
}

.ags-daily__label {
  font-size: 0.82rem;
  color: var(--ags-muted);
}

.ags-daily__title {
  font-weight: 600;
  line-height: 1.3;
}

.ags-daily__time {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ags-green-dark);
}

/* Day picker */
.ags-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.ags-day-chip {
  position: relative;
  display: block;
  padding: 0.7rem 0.6rem;
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
  color: var(--ags-ink);
  background: #fff;
  border: 1px solid var(--ags-line);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ags-day-chip:hover {
  color: var(--ags-ink);
  transform: translateY(-2px);
  border-color: rgba(25, 135, 84, 0.45);
  box-shadow: 0 10px 20px rgba(15, 42, 32, 0.08);
}

.ags-day-chip__dow {
  display: block;
  font-size: 0.8rem;
  color: var(--ags-muted);
}

.ags-day-chip__date {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ags-green-dark);
  line-height: 1.25;
}

.ags-day-chip__what {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--ags-muted);
}

.ags-day-chip.is-today {
  background: linear-gradient(135deg, var(--ags-green), #157347);
  border-color: transparent;
}

.ags-day-chip.is-today .ags-day-chip__dow,
.ags-day-chip.is-today .ags-day-chip__date,
.ags-day-chip.is-today .ags-day-chip__what {
  color: #fff;
}

.ags-today-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  color: #3f3008;
  background: linear-gradient(135deg, #f5e6a8, #e2c275);
}

.ags-day-chip .ags-today-badge {
  position: absolute;
  top: -0.6rem;
  right: 0.4rem;
  margin: 0;
}

/* Legend */
.ags-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-bottom: 1.75rem;
  font-size: 0.85rem;
  color: var(--ags-muted);
}

.ags-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.35rem;
  border-radius: 3px;
  background: var(--ags-tag);
}

/* Category colours (left bar, tag and legend) */
.ags--conf { --ags-tag: #1d6fd6; --ags-tag-bg: #e6f0fd; }
.ags--contest { --ags-tag: #c9831a; --ags-tag-bg: #fff3dd; }
.ags--train { --ags-tag: #0d8f7a; --ags-tag-bg: #e0f5f1; }
.ags--animal { --ags-tag: #b4378a; --ags-tag-bg: #fbe7f4; }
.ags--service { --ags-tag: #2f9e44; --ags-tag-bg: #e6f6e9; }
.ags--fun { --ags-tag: #7048e8; --ags-tag-bg: #efeafd; }
.ags--break { --ags-tag: #adb5bd; --ags-tag-bg: #f1f3f5; }

/* One day */
.ags-day {
  scroll-margin-top: 110px;
  margin-bottom: 2rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--ags-line);
  box-shadow: 0 12px 32px rgba(15, 42, 32, 0.06);
  overflow: hidden;
}

.ags-day__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  color: #fff;
  background: linear-gradient(110deg, var(--ags-green-dark) 0%, var(--ags-green) 60%, #22a06b 100%);
}

.ags-day__num {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ags-day__num b {
  font-size: 1.55rem;
  font-weight: 700;
}

.ags-day__num small {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.ags-day__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.ags-day__sub {
  font-size: 0.9rem;
  opacity: 0.9;
}

.ags-day.is-today .ags-day__head {
  background: linear-gradient(110deg, #8a6a12 0%, #c9a227 60%, #e2c275 100%);
}

.ags-day__body {
  padding: 0.5rem 1.25rem 1rem;
}

.ags-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 1.1rem 0 0.3rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--ags-soft);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ags-tag, var(--ags-green-dark));
}

.ags-group a {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.ags-subgroup {
  margin: 0.8rem 0 0.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ags-muted);
}

.ags-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ags-item {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-bottom: 1px dashed var(--ags-line);
  box-shadow: inset 4px 0 0 var(--ags-tag);
}

.ags-item:last-child {
  border-bottom: 0;
}

.ags-time {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ags-green-dark);
  white-space: nowrap;
}

.ags-title {
  font-weight: 500;
  font-size: 1.02rem;
  line-height: 1.45;
}

.ags-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  vertical-align: 0.12em;
  white-space: nowrap;
  color: var(--ags-tag);
  background: var(--ags-tag-bg);
}

.ags-detail {
  margin-top: 0.2rem;
  font-family: 'Open Sans', Kanit, sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ags-muted);
}

.ags-detail ul,
.ags-detail ol {
  margin: 0.2rem 0 0;
  padding-left: 1.2rem;
}

.ags-place {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #3d5248;
}

.ags-place .fa {
  width: 1rem;
  color: #d9480f;
}

.ags-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ags-tag);
  background: var(--ags-tag-bg);
}

.ags-link:hover {
  filter: brightness(0.95);
  color: var(--ags-tag);
}

.ags-note {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #7a4b00;
  background: #fff7e6;
  border-left: 3px solid #f59e0b;
}

.ags-item.ags--break .ags-title {
  color: var(--ags-muted);
  font-weight: 400;
}

.ags-dailyrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.9rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--ags-muted);
  background: var(--ags-soft);
}

.ags-dailyrow b {
  font-weight: 600;
  color: var(--ags-green-dark);
}

.ags-remark {
  text-align: center;
  font-size: 0.95rem;
  color: var(--ags-muted);
}

@media (max-width: 991.98px) {
  .ags-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ags-daily {
    grid-template-columns: 1fr;
  }

  .ags-days {
    display: flex;
    overflow-x: auto;
    padding: 0.7rem 0 0.4rem;
    scroll-snap-type: x mandatory;
  }

  .ags-day-chip {
    flex: 0 0 8.2rem;
    scroll-snap-align: start;
  }

  .ags-item {
    grid-template-columns: 1fr;
  }

  .ags-day__body {
    padding: 0.25rem 0.9rem 0.9rem;
  }

  .ags-day__head {
    padding: 0.85rem 0.9rem;
    gap: 0.75rem;
  }

  .ags-day__num {
    width: 50px;
    height: 50px;
  }

  .ags-day__title {
    font-size: 1.08rem;
  }

  .ags-day__sub {
    font-size: 0.84rem;
  }
}

@media print {
  .ags-days,
  .ags-legend {
    display: none;
  }

  .ags-day {
    break-inside: auto;
    box-shadow: none;
  }
}
