/* Compacte agendaweergave voor de homepage */
.hv-home-agenda {
  margin-top: 24px;
}

.hv-home-agenda-view .view-content-wrap {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  border: 0 !important;
  align-items: stretch !important;
}

.hv-home-agenda-view .hv-agenda-card {
  display: grid !important;
  grid-template-columns: 70px minmax(0, 1fr) !important;
  grid-template-areas:
    "date title"
    "date department"
    "date practical"
    "date action" !important;
  column-gap: 14px !important;
  row-gap: 8px !important;
  align-items: start !important;
  min-width: 0 !important;
  height: 100% !important;
  box-sizing: border-box !important;
  padding: 18px !important;
  border: 1px solid #d8e4ea !important;
  border-top: 4px solid #1686b3 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  box-shadow: 0 5px 18px rgba(19, 57, 79, .08) !important;
}

.hv-home-agenda-view .hv-agenda-card:hover {
  border-color: #1686b3 !important;
  box-shadow: 0 8px 24px rgba(19, 57, 79, .14) !important;
  transform: translateY(-2px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hv-home-agenda-view .views-field-field-datum-agendapunt {
  grid-area: date !important;
  width: auto !important;
  align-self: start !important;
}

.hv-home-agenda-view .hv-cal-date {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 68px !important;
  min-height: 78px !important;
  padding: 8px 5px !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
  background: #e9f5fa !important;
  color: #0c5876 !important;
  text-align: center !important;
}

.hv-home-agenda-view .hv-cal-day {
  display: block !important;
  font-size: 29px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}

.hv-home-agenda-view .hv-cal-month {
  display: block !important;
  margin-top: 4px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

.hv-home-agenda-view .hv-cal-year {
  display: block !important;
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  color: #43788c !important;
}

.hv-home-agenda-view .views-field-title {
  grid-area: title !important;
  min-width: 0 !important;
}

.hv-home-agenda-view .views-field-title h3 {
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere !important;
}

.hv-home-agenda-view .views-field-title h3 a {
  color: #153d56 !important;
  text-decoration: none !important;
}

.hv-home-agenda-view .views-field-title h3 a:hover,
.hv-home-agenda-view .views-field-title h3 a:focus {
  color: #0b789f !important;
  text-decoration: underline !important;
}

.hv-home-agenda-view .views-field-field-afdeling {
  grid-area: department !important;
  min-width: 0 !important;
  color: #5d6f79 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.hv-home-agenda-view .views-label-field-afdeling {
  font-weight: 700 !important;
  color: #385d6e !important;
}

.hv-home-agenda-view .hv-event-practical {
  grid-area: practical !important;
  margin: 0 !important;
  color: #4e6671 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

.hv-home-agenda-view .views-field-view-node {
  grid-area: action !important;
  align-self: end !important;
  width: 100% !important;
  margin-top: 8px !important;
  padding-top: 12px !important;
  border-top: 1px solid #e3edf1 !important;
}

.hv-home-agenda-view .hv-agenda-cta a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 9px 10px !important;
  border-radius: 7px !important;
  background: #1686b3 !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  text-decoration: none !important;
}

.hv-home-agenda-view .hv-agenda-cta a:hover,
.hv-home-agenda-view .hv-agenda-cta a:focus {
  background: #0d6488 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.hv-agenda-more {
  margin-bottom: 20px !important;
  border-color: #1686b3 !important;
  color: #0d6488 !important;
}

.hv-agenda-more:hover,
.hv-agenda-more:focus {
  background: #1686b3 !important;
  color: #ffffff !important;
}

@media (max-width: 1100px) {
  .hv-home-agenda-view .view-content-wrap {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 650px) {
  .hv-home-agenda-view .view-content-wrap {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .hv-home-agenda-view .hv-agenda-card {
    grid-template-columns: 62px minmax(0, 1fr) !important;
    column-gap: 12px !important;
    padding: 15px !important;
  }

  .hv-home-agenda-view .hv-cal-date {
    width: 60px !important;
    min-height: 72px !important;
  }

  .hv-home-agenda-view .hv-cal-day {
    font-size: 26px !important;
  }
}

/* Specifieke override voor de bestaande homepage-wrapper */
#home-agenda#home-agenda .hv-home-agenda-view .hv-agenda-card {
  display: grid !important;
  grid-template-columns: 70px minmax(0, 1fr) !important;
  grid-template-areas: "date title" "date department" "date practical" "date action" !important;
  grid-template-rows: auto auto 1fr auto !important;
  align-items: start !important;
  gap: 8px 14px !important;
  min-height: 0 !important;
  padding: 18px !important;
  text-align: left !important;
  transform: none !important;
  float: none !important;
  width: auto !important;
}

#home-agenda#home-agenda .hv-home-agenda-view .views-field-field-datum-agendapunt { grid-area: date !important; }
#home-agenda#home-agenda .hv-home-agenda-view .views-field-title { grid-area: title !important; }
#home-agenda#home-agenda .hv-home-agenda-view .views-field-field-afdeling { grid-area: department !important; }
#home-agenda#home-agenda .hv-home-agenda-view .hv-event-practical { grid-area: practical !important; }
#home-agenda#home-agenda .hv-home-agenda-view .views-field-view-node { grid-area: action !important; align-self: end !important; width: 100% !important; margin-top: 8px !important; }

@media (max-width: 1100px) {
  #home-agenda#home-agenda .hv-home-agenda-view .view-content-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 650px) {
  #home-agenda#home-agenda .hv-home-agenda-view .view-content-wrap { grid-template-columns: minmax(0, 1fr) !important; }
  #home-agenda#home-agenda .hv-home-agenda-view .hv-agenda-card { grid-template-columns: 62px minmax(0, 1fr) !important; padding: 15px !important; }
}

/* Laatste prioriteitscorrectie: de legacy flexregel mag de datumkaarten niet overschrijven. */
#home-agenda#home-agenda#home-agenda .hv-home-agenda-view .hv-agenda-card {
  display: grid !important;
  flex-direction: initial !important;
}

/* Ook bij een ingelogde mobiele beheerweergave blijft de agenda-actie aanklikbaar. */
#home-agenda#home-agenda#home-agenda .hv-agenda-more {
  position: relative !important;
  z-index: 1000 !important;
}