:root {
  --nsac-navy: #22438e;
  --nsac-blue: #0085ca;
  --nsac-green: #2fb457;
  --nsac-grey: #6b7280;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--nsac-navy);
  color: white;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.85rem;
  opacity: 0.85;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: white;
  color: var(--nsac-navy);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.subscribe-btn:hover { background: #f0f0f0; }

main { padding: 1rem 1.5rem 2rem; max-width: 1200px; margin: 0 auto; }

.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filters-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.chips { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  user-select: none;
  transition: all 0.15s ease;
}

.chip-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}

.chip.active {
  border-color: currentColor;
  box-shadow: var(--shadow);
}

.chip.inactive {
  opacity: 0.45;
  text-decoration: line-through;
}

.calendar-wrap {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.last-updated {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* FullCalendar customisation */
.fc { font-family: inherit; }
.fc .fc-button-primary {
  background: var(--nsac-navy);
  border-color: var(--nsac-navy);
}
.fc .fc-button-primary:hover {
  background: #1a3470;
  border-color: #1a3470;
}
.fc .fc-button-primary:disabled {
  background: var(--nsac-navy);
  border-color: var(--nsac-navy);
  opacity: 0.5;
}
.fc .fc-toolbar-title { font-size: 1.25rem; }

/* Modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  z-index: 1000;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-card h2 { margin: 0 0 0.5rem; }
.modal-close {
  position: absolute; top: 0.5rem; right: 0.75rem;
  background: none; border: none;
  font-size: 1.75rem; line-height: 1;
  cursor: pointer; color: var(--text-muted);
  padding: 0.25rem 0.5rem;
}
.url-box {
  display: flex; gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}
.url-box input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: #f9fafb;
}
.url-box button {
  padding: 0.6rem 1rem;
  background: var(--nsac-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.copy-status {
  font-size: 0.85rem;
  color: var(--nsac-green);
  font-weight: 600;
  min-height: 1.2em;
  margin: 0;
}
.modal-card details {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.modal-card details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.25rem 0;
}
.modal-card details ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.modal-card details li { margin: 0.25rem 0; }

/* Mobile */
@media (max-width: 600px) {
  .site-header { padding: 0.75rem 1rem; }
  main { padding: 0.75rem 1rem 1.5rem; }
  .calendar-wrap { padding: 0.5rem; }
  .fc .fc-toolbar { flex-direction: column; gap: 0.5rem; }
  .fc .fc-toolbar-title { font-size: 1.1rem; }
}
