/* Cairo FACE — agenda.html additions: the gala tab as the one standout
   call to action in the day bar, and the agenda filters.
   4px spacing scale; radii 8 / 12 / 16 / pill. Gold is reserved for the gala. */

:root {
  --gala-gold: #E2B25A;
  --gala-gold-soft: rgba(226, 178, 90, 0.18);
  --gala-ink: #0B2233;
}

/* ── Gala night tab ── */
html body .agbar .agdaytab--gala {
  position: relative; overflow: hidden; isolation: isolate;
  gap: 4px; padding: 12px 20px; min-width: 200px;
  background: linear-gradient(135deg, #0B2233 0%, #16405F 60%, #1E4C6E 100%);
  border: 1px solid var(--gala-gold);
  box-shadow: 0 0 0 4px var(--gala-gold-soft), 0 12px 28px rgba(11, 34, 51, 0.28);
  animation: gala-glow 3.2s ease-in-out infinite;
}
html body .agbar .agdaytab--gala .agdaytab__day { color: #fff; font-size: 16px; }
html body .agbar .agdaytab--gala .agdaytab__day::before { background: var(--gala-gold); box-shadow: 0 0 8px var(--gala-gold); }
html body .agbar .agdaytab--gala .agdaytab__date { color: rgba(255, 255, 255, 0.78); }
html body .agbar .agdaytab--gala .agdaytab__cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 4px 12px; border-radius: 9999px;
  background: var(--gala-gold); color: var(--gala-ink);
  font-size: 13px; font-weight: 700; letter-spacing: 0.01em;
  transition: gap 0.25s var(--ease-out), background 0.25s var(--ease-ui);
}
/* a slow light sweep across the card */
html body .agbar .agdaytab--gala::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-18deg);
  animation: gala-sweep 4.8s ease-in-out infinite;
}
html body .agbar .agdaytab--gala:hover { border-color: #F3CD85; transform: translateY(-2px); }
html body .agbar .agdaytab--gala:hover .agdaytab__cta { gap: 12px; background: #F3CD85; }
html body .agbar .agdaytab--gala:focus-visible { outline: 2px solid var(--gala-gold); outline-offset: 4px; }

@keyframes gala-glow {
  0%, 100% { box-shadow: 0 0 0 4px var(--gala-gold-soft), 0 12px 28px rgba(11, 34, 51, 0.28); }
  50%      { box-shadow: 0 0 0 8px rgba(226, 178, 90, 0.08), 0 12px 32px rgba(226, 178, 90, 0.3); }
}
@keyframes gala-sweep {
  0%, 55% { left: -60%; }
  100%    { left: 130%; }
}

/* ── day tabs: match count while filtering ── */
.agdaytab__n {
  margin-top: 4px; padding: 2px 8px; border-radius: 9999px;
  font-size: 12px; font-weight: 600; background: var(--accent); color: #fff;
}
.agdaytab__n.is-zero { background: rgba(10, 26, 40, 0.08); color: var(--muted-light); }

/* ── filter panel ── */
.agfilter {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px 24px; margin-bottom: 16px; border-radius: 16px;
  background: #fff; border: 1px solid var(--hairline-light);
}
.agfilter__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.agfilter__k { font-size: 13px; font-weight: 600; color: var(--ink); min-width: 72px; }
.agfilter__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.agchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; font-family: inherit; cursor: pointer; }
.agchip b { font-size: 12px; font-weight: 600; opacity: 0.7; font-variant-numeric: tabular-nums; }
.agchip.is-on b { opacity: 0.9; }

.agfilter__row--fields {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: end;
}
.agfilter__field { margin-bottom: 0; }
.agfilter__field input[type="search"] { width: 100%; }

.agfilter__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.agfilter__count { margin: 0; font-size: 14px; color: var(--muted-light); }
.agfilter__clear {
  min-height: 40px; padding: 0 16px; border-radius: 9999px; cursor: pointer;
  font: 500 14px/1 inherit; font-family: inherit;
  border: 1px solid var(--hairline-light); background: #fff; color: var(--accent-strong);
}
.agfilter__clear:hover { border-color: var(--accent); }

/* ── results ── */
.agday.is-filtered .agses.is-dim { opacity: 0.18; filter: grayscale(1); pointer-events: none; }
.agday.is-filtered .agses.is-hit { box-shadow: inset 0 0 0 2px var(--accent-strong), 0 8px 20px rgba(10, 26, 40, 0.12); z-index: 2; }
.agday.is-filtered .agcard.is-dim { display: none; }
.agses { transition: opacity 0.25s var(--ease-ui), filter 0.25s var(--ease-ui), box-shadow 0.25s var(--ease-ui); }
.agempty {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
  background: #FFF6E0; border: 1px solid #F0D58A; color: #5B4300; font-size: 14px;
}
.agtalk--hit { background: rgba(82, 136, 176, 0.1); border-radius: 8px; box-shadow: 0 0 0 1px rgba(82, 136, 176, 0.35); }

/* ── Courses chip: the day's courses replace its session grid ── */
.agday.is-courses .agridwrap, .agday.is-courses .agmob, .agday.is-courses .agplenary,
.agday.is-courses .breakout, .agday.is-courses .aggala { display: none; }
.agcourses { display: flex; flex-direction: column; gap: 16px; margin: 0 0 32px; }
.agcourses__h { margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); }
.agcourses__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.agcourse__link {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px 20px;
  height: 100%; padding: 16px; border-radius: 16px; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--hairline-light);
  transition: border-color 0.2s var(--ease-ui), box-shadow 0.2s var(--ease-ui), transform 0.2s var(--ease-ui);
}
.agcourse__link:hover { border-color: var(--accent); box-shadow: 0 12px 28px rgba(10, 26, 40, 0.1); transform: translateY(-2px); }
.agcourse__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.agcourse__img { grid-row: 1 / -1; position: relative; border-radius: 12px; overflow: hidden; background: #E7EEF4; min-height: 160px; }
.agcourse__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.agcourse__body { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; }
.agcourse__k { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.agcourse__t { font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); margin-bottom: 4px; }
.agcourse__m { font-size: 14px; line-height: 1.45; color: var(--muted-light); }
.agcourse__s { margin-top: 8px; padding: 4px 12px; border-radius: 9999px; font-size: 13px; font-weight: 600; }
.agcourse__s.is-open { background: #E3F5EA; color: #0F5A2C; }
.agcourse__s.is-full { background: #FFF3DD; color: #6B4300; }
.agcourse__go { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent-strong); }
.agcourse__link:hover .agcourse__go { gap: 12px; }
@media (max-width: 1023px) { .agcourses__list { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .agcourse__link { grid-template-columns: 1fr; grid-template-rows: auto; }
  .agcourse__img { grid-row: auto; min-height: 0; aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) { .agcourse__link { transition: none; } .agcourse__link:hover { transform: none; } }

/* ── phones ── */
@media (max-width: 767px) {
  .agfilter { padding: 16px; gap: 12px; }
  .agfilter__row { gap: 8px; }
  .agfilter__k { min-width: 0; width: 100%; }
  /* chips scroll sideways instead of stacking four rows deep */
  .agfilter__chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .agfilter__chips::-webkit-scrollbar { display: none; }
  .agchip { flex: 0 0 auto; white-space: nowrap; }
  .agfilter__row--fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .agfilter__field--doc { grid-column: 1 / -1; }
  /* the gala gets its own full row: title + date left, CTA right */
  html body .agbar .agdaytab--gala {
    grid-column: 1 / -1; min-width: 0; padding: 12px 16px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 2px;
  }
  html body .agbar .agdaytab--gala .agdaytab__day { grid-column: 1; }
  html body .agbar .agdaytab--gala .agdaytab__date { grid-column: 1; }
  html body .agbar .agdaytab--gala .agdaytab__cta { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; padding: 8px 16px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html body .agbar .agdaytab--gala, html body .agbar .agdaytab--gala::after { animation: none; }
  .agses { transition: none; }
}
