/* Calendar page — month grid, toolbar, day panel */
@import url('./base.css');

fc-calendar-toolbar,
.fc-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

fc-calendar-toolbar h2,
.fc-calendar-toolbar h2 {
  font-size: 18px;
  font-weight: 600;
  min-width: 180px;
  text-align: center;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin-left: auto;
}

.view-toggle button {
  border: none;
  border-radius: 0;
  background: var(--surface);
  padding: 6px 12px;
}

.view-toggle button.on {
  background: var(--ink);
  color: #fff;
}

.view-toggle button + button {
  border-left: 1px solid var(--rule);
}

fc-legend,
.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}

fc-legend span,
.fc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.fc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  align-items: start;
}

.fc-layout > * {
  min-width: 0;
}

@media (max-width: 900px) {
  .fc-layout {
    grid-template-columns: 1fr;
  }
}

fc-month-grid {
  display: block;
  min-width: 0;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}

.month-grid .dow {
  background: #efebe3;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.month-grid .day {
  background: var(--surface);
  min-height: 104px;
  padding: 8px;
  vertical-align: top;
  cursor: pointer;
  text-align: left;
  border: none;
  font: inherit;
  color: inherit;
  width: 100%;
  min-width: 0;
  display: block;
  overflow: hidden;
}

.month-grid .day:hover {
  background: #faf7f0;
}

.month-grid .day.outside {
  background: #f0ede6;
  color: #a8a49a;
  cursor: default;
}

.month-grid .day.selected {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}

.month-grid .day.today .num {
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.num {
  font-size: 12px;
  font-weight: 600;
}

.plan-marks {
  display: flex;
  gap: 3px;
}

.plan-marks i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.event {
  font-size: 11px;
  line-height: 1.25;
  padding: 3px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

fc-day-panel,
.fc-day-panel {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 18px 20px;
  min-height: 320px;
  position: sticky;
  top: 16px;
}

fc-day-panel h3,
.fc-day-panel h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

fc-day-panel .sub,
.fc-day-panel .sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

fc-day-panel .day-head,
.fc-day-panel .day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 24px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

fc-day-panel .day-head-main,
.fc-day-panel .day-head-main {
  min-width: 0;
}

fc-day-panel .day-head-weather,
.fc-day-panel .day-head-weather {
  min-width: 0;
  text-align: right;
}

fc-day-panel .day-cols,
.fc-day-panel .day-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 32px;
  align-items: start;
}

fc-day-panel .day-cols > section,
.fc-day-panel .day-cols > section {
  margin-bottom: 0;
  min-width: 0;
}

.calendar-week-panel fc-day-panel .day-cols,
.calendar-week-panel .fc-day-panel .day-cols {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .calendar-week-panel fc-day-panel .day-cols,
  .calendar-week-panel .fc-day-panel .day-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  fc-day-panel .day-head-weather,
  .fc-day-panel .day-head-weather {
    text-align: left;
  }
}

fc-day-panel section,
.fc-day-panel section {
  margin-bottom: 18px;
}

fc-day-panel section:last-child,
.fc-day-panel section:last-child {
  margin-bottom: 0;
}

fc-day-panel h4,
.fc-day-panel h4 {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

fc-day-panel ul,
.fc-day-panel ul {
  list-style: none;
}

fc-day-panel li,
.fc-day-panel li {
  font-size: 13px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: start;
}

fc-day-panel li:last-child,
.fc-day-panel li:last-child {
  border-bottom: none;
}

fc-day-panel .title,
.fc-day-panel .title {
  font-weight: 600;
  line-height: 1.3;
}

fc-day-panel .item,
.fc-day-panel .item {
  min-width: 0;
}

fc-day-panel .item-head,
.fc-day-panel .item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

fc-day-panel .meta,
.fc-day-panel .meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
  margin-top: 3px;
}

fc-day-panel .method,
.fc-day-panel .method {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9a3412;
  background: #fff4eb;
  border: 1px solid #ffc89a;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

fc-day-panel .method.cancelled-tag,
.fc-day-panel .method.cancelled-tag {
  color: #78716c;
  background: #f5f2ec;
  border-color: var(--rule);
}

fc-day-panel .chips,
.fc-day-panel .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

fc-day-panel li.open .empty,
.fc-day-panel li.open .empty {
  font-style: italic;
  opacity: 0.7;
}

fc-day-panel .slot,
fc-day-panel .time,
.fc-day-panel .slot,
.fc-day-panel .time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 2px;
}

fc-day-panel .empty,
.fc-day-panel .empty {
  font-size: 13px;
  color: var(--muted);
}

fc-day-panel li.cancelled .title,
.fc-day-panel li.cancelled .title,
fc-day-panel li.cancelled .time,
.fc-day-panel li.cancelled .time {
  text-decoration: line-through;
  opacity: 0.55;
}

.chip-ev {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
}

fc-day-panel .hint,
.fc-day-panel .hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 12px;
}

fc-events-list,
.fc-events-list {
  display: block;
  margin-top: 24px;
}

fc-events-list h3,
.fc-events-list h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

fc-events-list ul,
.fc-events-list ul {
  list-style: none;
}

fc-events-list li,
.fc-events-list li {
  display: grid;
  grid-template-columns: 140px 80px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}

fc-events-list .when,
.fc-events-list .when {
  color: var(--muted);
}

fc-events-list .cat,
.fc-events-list .cat {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

#monthView[hidden],
fc-week-look[hidden] {
  display: none !important;
}

.fc-layout.calendar-week-panel {
  grid-template-columns: minmax(0, 1fr);
}

.calendar-week-panel fc-month-grid,
.calendar-week-panel fc-events-list {
  display: none;
}

/* Full-width panel: relax the sidebar sticky + stretch the detail columns. */
.calendar-week-panel fc-day-panel,
.calendar-week-panel .fc-day-panel {
  position: static;
}

fc-day-panel .weather,
.fc-day-panel .weather {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px 8px;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  fc-day-panel .weather,
  .fc-day-panel .weather {
    justify-content: flex-start;
  }
}

fc-day-panel .weather-icon,
.fc-day-panel .weather-icon {
  font-size: 14px;
  line-height: 1;
}

fc-day-panel .weather-temps,
.fc-day-panel .weather-temps {
  font-variant-numeric: tabular-nums;
}

fc-day-panel .weather-temps .hi,
.fc-day-panel .weather-temps .hi {
  font-weight: 650;
}

fc-day-panel .weather-temps .lo,
.fc-day-panel .weather-temps .lo {
  color: var(--muted);
  font-weight: 500;
}

fc-day-panel .weather-sum,
.fc-day-panel .weather-sum {
  color: var(--muted);
  font-size: 12px;
}

fc-day-panel .weather-link,
.fc-day-panel .weather-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  margin-left: 2px;
}

fc-day-panel .weather-link:hover,
.fc-day-panel .weather-link:hover {
  color: var(--ink);
}

fc-day-panel .weather-alerts,
.fc-day-panel .weather-alerts {
  margin-top: 4px;
  font-size: 11px;
  color: #9a3412;
  line-height: 1.35;
}

.planner-week {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  margin-bottom: 18px;
}

.planner-week fc-week-look {
  display: block;
}
