/* ── Events Page Styles ──────────────────────────────────────────────────── */

/* Hide Quarto's auto-generated page title since we render our own */
.quarto-title-block { display: none !important; }
#title-block-header { display: none !important; }

/* ── Page container ── */
.events-page {
  padding: 2.5rem 2rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* ── Section header ── */
.events-section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.events-section-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #003B5C;
  margin-bottom: 0.4rem;
}

.events-section-header p {
  color: #555;
  font-size: 1.05rem;
  margin: 0;
}

/* ── Academic Year Filter ── */
.events-year-filter {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.year-filter-btn {
  padding: 0.4rem 1.1rem;
  border: 2px solid #2774AE;
  background: #fff;
  color: #2774AE;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.year-filter-btn:hover,
.year-filter-btn.active {
  background: #2774AE;
  color: #fff;
}

/* ── Carousel wrapper ── */
.events-carousel-outer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.events-track-container {
  overflow: hidden;
  flex: 1;
  border-radius: 4px;
}

.events-track {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ── Carousel nav buttons ── */
.carousel-arrow {
  background: #fff;
  border: 2px solid #2774AE;
  color: #2774AE;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
  line-height: 1;
}

.carousel-arrow:hover:not(:disabled) {
  background: #2774AE;
  color: #fff;
}

.carousel-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

/* ── Carousel dots ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c5d8ea;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
  background: #2774AE;
  transform: scale(1.25);
}

/* ── Event Card ── */
.event-card {
  flex: 0 0 280px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 59, 92, 0.10);
  cursor: pointer;
  transition: transform 0.22s, box-shadow 0.22s;
  user-select: none;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(0, 59, 92, 0.18);
}

/* Card photo */
.card-photo-wrap {
  width: 100%;
  height: 175px;
  overflow: hidden;
  position: relative;
}

.card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-photo-placeholder {
  width: 100%;
  height: 175px;
  background: linear-gradient(135deg, #2774AE 0%, #003B5C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-placeholder svg {
  opacity: 0.35;
}

/* Card body */
.card-body-inner {
  padding: 1rem 1.1rem 1.2rem;
}

.card-category-badge {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border-radius: 20px;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.55rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #003B5C;
  margin: 0 0 0.55rem 0;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.card-meta-item {
  font-size: 0.82rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-meta-item svg {
  flex-shrink: 0;
  color: #2774AE;
}

/* Category colours */
.cat-lunch-learn   { background: #e8f5e9; color: #2e7d32; }
.cat-townhall      { background: #e3f2fd; color: #1565c0; }
.cat-social        { background: #fff3e0; color: #e65100; }
.cat-workshop      { background: #f3e5f5; color: #6a1b9a; }
.cat-default       { background: #f5f5f5; color: #424242; }

/* ── Modal overlay ── */
.event-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 40, 0.60);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.event-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.event-modal-box {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  max-width: 660px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.88) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.48, 0.64, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.event-modal-overlay.active .event-modal-box {
  transform: scale(1) translateY(0);
}

/* Modal close button */
.modal-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: rgba(0, 0, 0, 0.38);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
  line-height: 1;
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Modal photo */
.modal-photo-wrap {
  width: 100%;
  height: 260px;
  overflow: hidden;
  position: relative;
}

.modal-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-photo-placeholder {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, #2774AE 0%, #003B5C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-photo-placeholder svg {
  opacity: 0.30;
}

/* Modal body */
.modal-body-inner {
  padding: 1.75rem 2rem 2rem;
}

.modal-category-badge {
  display: inline-block;
  padding: 0.22rem 0.8rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #003B5C;
  margin: 0 0 1.1rem 0;
  line-height: 1.3;
}

.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-bottom: 1.3rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid #e8eef3;
}

.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #444;
}

.modal-meta-item svg {
  color: #2774AE;
  flex-shrink: 0;
}

.modal-description {
  color: #333;
  line-height: 1.75;
  font-size: 0.97rem;
  margin-bottom: 1.5rem;
}

.modal-description.placeholder-desc {
  color: #999;
  font-style: italic;
}

.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #2774AE;
  color: #fff !important;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.15s;
}

.modal-link-btn:hover {
  background: #003B5C;
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* ── Important Dates Section ── */
.important-dates-section {
  max-width: 1100px;
  margin: 3.5rem auto 1rem;
  padding: 0 2rem;
}

.important-dates-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #003B5C;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #FFD100;
  display: inline-block;
}

.important-dates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.important-date-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.1rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,59,92,0.08);
  border-left: 4px solid transparent;
  transition: box-shadow 0.2s;
}

.important-date-item:hover {
  box-shadow: 0 3px 14px rgba(0,59,92,0.13);
}

.date-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.date-item-title {
  flex: 1;
  font-size: 0.96rem;
  font-weight: 600;
  color: #1a1a1a;
}

.important-date-link {
  color: #2774AE;
  text-decoration: none;
  transition: color 0.15s;
}

.important-date-link:hover {
  color: #003B5C;
  text-decoration: underline;
}

.date-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.date-item-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
}

.date-item-date {
  font-size: 0.82rem;
  color: #666;
  white-space: nowrap;
}

/* Urgency colours */
.urgency-red    { background: #ef5350; color: #fff; }
.urgency-orange { background: #FF9800; color: #fff; }
.urgency-yellow { background: #FFC107; color: #333; }
.urgency-green  { background: #66BB6A; color: #fff; }

.date-dot.urgency-red    { background: #ef5350; }
.date-dot.urgency-orange { background: #FF9800; }
.date-dot.urgency-yellow { background: #FFC107; }
.date-dot.urgency-green  { background: #66BB6A; }

.important-dates-loading,
.important-dates-empty {
  color: #888;
  font-size: 0.95rem;
  padding: 1rem 0;
  list-style: none;
}

/* ── Recurring Events Section ── */
.recurring-section {
  max-width: 1100px;
  margin: 4rem auto 3rem;
  padding: 0 2rem;
}

.recurring-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #003B5C;
  margin-bottom: 2.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #FFD100;
  display: inline-block;
}

.recurring-row {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.recurring-row-reverse {
  flex-direction: row-reverse;
}

.recurring-text {
  flex: 1;
}

.recurring-badge {
  display: inline-block;
  padding: 0.22rem 0.8rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.75rem;
}

.recurring-text h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #003B5C;
  margin: 0 0 0.75rem 0;
}

.recurring-text p {
  color: #444;
  line-height: 1.8;
  font-size: 0.97rem;
  margin: 0;
}

.recurring-image-wrap {
  flex: 0 0 420px;
}

.recurring-image-wrap img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.recurring-image-placeholder {
  width: 100%;
  height: 320px;
  background: linear-gradient(135deg, #2774AE 0%, #003B5C 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recurring-image-placeholder svg {
  opacity: 0.3;
}

.recurring-image-placeholder .recurring-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

@media (max-width: 768px) {
  .recurring-row,
  .recurring-row-reverse {
    flex-direction: column;
    gap: 1.5rem;
  }
  .recurring-image-wrap {
    flex: none;
    width: 100%;
  }
  .recurring-image-placeholder {
    height: 180px;
  }
}

/* ── Empty state ── */
.events-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: #888;
  font-size: 1.05rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .events-page { padding: 1.5rem 1rem 3rem; }
  .events-section-header h1 { font-size: 1.8rem; }
  .event-card { flex: 0 0 240px; }
  .carousel-arrow { width: 38px; height: 38px; font-size: 1.1rem; }
  .modal-body-inner { padding: 1.25rem 1.25rem 1.5rem; }
  .modal-photo-wrap, .modal-photo-placeholder { height: 200px; }
}


.navcard-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  margin-top: 1rem;
}

.navcard-hidden {
  display: none !important;
}