.calendar-wrap {
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.calendar-title {
  font-family: var(--font-serif);
  font-size: 16px;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  background: none;
  border: 1px solid var(--color-border);
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.calendar-nav button:hover {
  background: var(--color-surface);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* CRITICAL: display:contents makes the wrapper invisible to the grid parent */
#cal-cells {
  display: contents;
}

.calendar-day-name {
  text-align: center;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.calendar-cell {
  min-height: 70px;
  padding: 6px;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  vertical-align: top;
}

.calendar-cell:nth-child(7n) {
  border-right: none;
}

.calendar-cell.other-month {
  background: var(--color-surface);
  opacity: .5;
}

.calendar-cell.today {
  background: #FFF9F0;
}

.calendar-date {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.calendar-today-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--color-black);
  color: var(--color-white);
  font-size: 10px;
  border-radius: 50%;
  text-align: center;
  line-height: 18px;
}

.cal-event {
  font-size: 10px;
  padding: 2px 4px;
  background: var(--color-gold);
  color: var(--color-black);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.cal-event:hover {
  background: var(--color-muted);
  color: var(--color-white);
}

@media (max-width: 768px) {
  .calendar-cell {
    min-height: 44px;
    padding: 3px;
  }

  .calendar-date {
    font-size: 10px;
  }

  .cal-event {
    display: none; /* Ascunde evenimentele pe mobile — prea mic */
  }

  .calendar-cell.has-event {
    background: #FFF3E0;
  }
}
