:root {
  --bg: #f3f7fa;
  --surface: #ffffff;
  --line: #d5e1e8;
  --text: #182230;
  --muted: #5f6b7a;
  --brand: #4ca1da;
  --brand-dark: #237cb8;
  --tech: #4ca1da;
  --wellbeing: #ffd500;
  --saarlus: #a6c262;
  --weekend: #eef7fb;
  --danger: #d92d20;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.site-header {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 12px rgba(31, 65, 91, 0.06);
}

.site-logo {
  justify-self: start;
  padding: 0;
  background: transparent;
  min-height: 0;
}

.site-logo img {
  display: block;
  width: auto;
  height: 54px;
}

.site-header h1 {
  justify-self: center;
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 7px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.calendar-wrap {
  width: min(1800px, calc(100vw - 16px));
  margin: 16px auto 32px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(31, 65, 91, 0.12);
}

.fc {
  font-family: inherit;
}

.fc .fc-toolbar-title {
  font-size: 24px;
  font-weight: 800;
}

.fc .fc-button-primary {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(76, 161, 218, 0.24);
  font-weight: 700;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-daygrid-day.fc-day-sun,
.fc .fc-timegrid-col.fc-day-sat,
.fc .fc-timegrid-col.fc-day-sun {
  background: var(--weekend);
}

.fc .fc-daygrid-day-number {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.fc .fc-day-sun .fc-daygrid-day-number {
  color: var(--danger);
}

.fc-event {
  border-radius: 5px;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.fc-event:hover {
  filter: brightness(0.95);
}

.fc .fc-daygrid-event {
  align-items: flex-start;
  white-space: normal;
}

.fc .fc-daygrid-event .fc-event-main,
.fc .fc-daygrid-event .fc-event-title,
.fc .fc-daygrid-dot-event .fc-event-title {
  white-space: normal;
  overflow-wrap: anywhere;
}

.fc .fc-daygrid-event .fc-event-time {
  flex-shrink: 0;
}
.fc .fc-multimonth {
  border: 0;
}

.fc .fc-multimonth-title {
  padding: 10px 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-transform: capitalize;
}

.fc .fc-multimonth .fc-daygrid-day-frame {
  min-height: 86px;
}

.fc .fc-multimonth .fc-daygrid-day-top {
  justify-content: flex-start;
}

.fc .fc-multimonth .fc-daygrid-day-number {
  padding: 4px 6px;
  font-size: 13px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  padding: 22px;
  overflow: hidden;
  background: #ffffff;
  border-radius: 12px;
  border-top: 4px solid var(--brand);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.35);
}

.modal-card h2 {
  margin: 0 40px 18px 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  font-size: 24px;
  cursor: pointer;
}

.modal-card dl {
  display: grid;
  gap: 12px;
  min-height: 0;
  margin: 0 0 18px;
}

.modal-card dl > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
}

.modal-card dt {
  color: var(--muted);
  font-weight: 700;
}

.modal-card dd {
  margin: 0;
  white-space: pre-wrap;
}

.description-row {
  min-height: 0;
}

#modal-description {
  max-height: clamp(160px, 45vh, 420px);
  overflow-y: auto;
  padding-right: 8px;
}

#modal-url {
  align-self: flex-start;
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 72px 1fr 72px;
    gap: 10px;
    padding: 10px 12px;
  }

  .site-logo img {
    height: 42px;
  }

  .site-header h1 {
    font-size: 24px;
  }

  .calendar-wrap {
    width: 100%;
    margin-top: 0;
    padding: 8px;
    border-radius: 0;
  }

  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .fc .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .fc .fc-button-group {
    flex-wrap: wrap;
  }

  .fc .fc-multimonth .fc-daygrid-day-frame {
    min-height: 68px;
  }

  .modal-card dl > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
