/* =========================
   Calendar shell
========================= */
.cs-cal {
  border: 1px solid #e0e3ea;
  border-radius: 12px;
  overflow: hidden;
  font-family: Sans-Serif, serif;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

/* =========================
   Topbar
========================= */
.cs-cal__topbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid #e0e3ea;
  padding: 12px 15px;
  background-color: #16254C;
}

/* Picker group */
.cs-cal__picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 240px;
}

.cs-cal__nav {
  padding: 0 12px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  font-size: 35px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  transition: background 0.15s;
}

.cs-cal__nav:hover {
  background: rgba(255,255,255,0.25);
}

.cs-cal__date {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  flex: 1 1 auto;
  min-width: 140px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  text-align: center;
  font-weight: 600;
}

/* Today button */
.cs-cal__today {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 14px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}

.cs-cal__today:hover {
  background: rgba(255,255,255,0.25);
}

/* Status (hidden when empty) */
.cs-cal__status {
  color: #555;
  padding: 0 15px 10px 15px;
}

.cs-cal__status:empty {
  display: none;
}

/* Mobile topbar */
@media (max-width: 768px) {
  .cs-cal__topbar {
    padding: 8px;
  }

  .cs-cal__picker {
    width: 100%;
    min-width: 0;
  }

  .cs-cal__today {
    width: auto;
    text-align: center;
  }
}

/* =========================
   Body / list container
========================= */
.cs-cal__body {
  padding: 15px 15px 15px 15px;
  background: #f7f8fa;
  max-height: 500px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .cs-cal__body {
    max-height: 60vh;
    padding: 5px 5px 5px 5px;
  }
}

/* =========================
   List + groups
========================= */
.cs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-list__day {
  padding: 6px 0 14px;
}

.cs-list__daytitle {
  margin: 10px 0 5px;
  font-size: 12px;
  font-weight: 700;
  /* border-bottom: 1px solid #16254C; */
  text-transform: uppercase;
  color: #16254C;
  letter-spacing: 0.05em;
  //padding-bottom: 4px;
}

.cs-list__dayitems {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Clickable event card */
.cs-list__item {
  padding: 10px 14px;
  border: 1px solid #eee;
  border-left: 3px solid #B11116;
  border-radius: 8px;
  background-color: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.cs-list__item.cs-event {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.cs-list__item.cs-event:hover {
  border-left-color: #16254C;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cs-list__title {
  font-weight: 700;
  margin: 0 0 4px;
  color: #16254C;
  font-size: 14px;
}

.cs-list__meta {
  color: #666;
  font-size: 13px;
}

/* Event layout */
.cs-event {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cs-event__thumb {
  width: auto;
  height: 90px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #eee;
  flex: 0 0 auto;
}

.cs-event__content {
  min-width: 0;
}

/* Empty / section title */
.cs-empty {
  padding: 0;
}

.cs-empty__title {
  font-weight: 700;
  margin: 0 0 6px;
}

.cs-empty__subtitle {
  margin: 0 0 10px;
  color: #555;
  font-size: 14px;
}

.cs-sectiontitle {
  margin: 14px 0 10px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: #16254C;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================
   Flatpickr dots
========================= */
.flatpickr-day {
  position: relative;
}

.flatpickr-day.has-event .cs-dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d62828;
}

/* =========================
   Modal
========================= */
.cs-modal {
  display: none;
}

.cs-modal.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.cs-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.cs-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: auto 1fr;
}

/* Close button */
.cs-modal__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cs-modal__close::before {
  content: "×";
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

.cs-modal__close:focus {
  outline: none;
}

.cs-modal__close:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* Media / carousel */
.cs-modal__media {
  position: relative;
  background: #111;
}

.cs-modal__carousel {
  position: relative;
  overflow: hidden;
}

.cs-modal__track {
  display: flex;
  transition: transform 220ms ease;
}

.cs-modal__slide {
  flex: 0 0 100%;
}

.cs-modal__img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.cs-modal__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.cs-modal__arrow--left {
  left: 10px;
}

.cs-modal__arrow--right {
  right: 10px;
}

.cs-modal__dots {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.cs-modal__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

.cs-modal__dot.is-active {
  background: #fff;
}

/* Modal content */
.cs-modal__content {
  padding: 16px 18px 18px;
  overflow: auto;
}

.cs-modal__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
}

.cs-modal__meta {
  color: #444;
  margin-bottom: 10px;
  font-size: 14px;
}

.cs-modal__locations {
  margin: 8px 0 12px;
  color: #666;
  font-size: 14px;
}

.cs-modal__loc {
  margin-top: 2px;
}

.cs-modal__desc {
  font-size: 15px;
  color: #222;
}

.cs-modal__desc p {
  margin: 0 0 10px;
}

/* Prevent body scroll when modal open */
body.cs-modal-open {
  overflow: hidden;
}


/* ---------- Topbar sizing fix ---------- */

/* Make picker row not explode on desktop */
.cs-cal__picker {
  flex: 0 1 auto;           /* don't force full width */
  min-width: 0;
}

/* Keep date input at a sensible width on desktop */
.cs-cal__date {
  flex: 0 0 auto;
  width: 160px;             /* <- desktop width */
  max-width: 180px;
}

/* Make sure "I dag" never gets pushed out */
.cs-cal__today {
  flex: 0 0 auto;
}

/* ---------- Mobile fix ---------- */
@media (max-width: 520px) {
  .cs-cal__topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* picker uses full width on mobile */
  .cs-cal__picker {
    flex: 1 1 100%;
    width: 100%;
  }

  /* date grows on mobile, so it doesn't look cramped */
  .cs-cal__date {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  /* put today below picker and make it visible */
  .cs-cal__today {
    flex: 1 1 100%;
    width: 100%;
    text-align: center;
  }
}
