@import url('./palette.css');

.week-look {
  margin-bottom: 16px;
}

.week-look-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.week-look-head h2 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.week-look-head .range {
  font-size: 12px;
  color: var(--muted);
}

.week-look-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-look-nav {
  display: flex;
  gap: 6px;
}

.week-look-nav button {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.week-look-nav button:hover {
  border-color: #c8c2b4;
}

.week-look-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 900px) {
  .week-look-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .week-look-grid {
    grid-template-columns: 1fr;
  }
}

.week-day {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 11px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 128px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-day:hover {
  border-color: #c8c2b4;
}

.week-day.today {
  border-color: var(--seamus);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--seamus) 25%, transparent);
}

.week-day.selected {
  outline: 2px solid var(--seamus);
  outline-offset: -1px;
}

.week-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
}

.week-day-name {
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.week-day-num {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.week-day.today .week-day-num {
  background: var(--seamus);
  color: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.week-day-items,
.week-day-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.week-chip {
  font-size: 10px;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 100%;
}

.week-chip.plan-meal {
  background: var(--seamus-soft, #fff4eb);
  color: #9a3412;
  border: 1px solid var(--seamus-border, #ffc89a);
}

.week-chip.plan-activity {
  background: color-mix(in srgb, var(--seamus) 12%, white);
  color: #c2410c;
  border: 1px solid color-mix(in srgb, var(--seamus) 35%, white);
}

.week-chip.cancelled {
  text-decoration: line-through;
  opacity: 0.5;
  background: #f5f5f4 !important;
  color: #78716c !important;
  border: 1px dashed #d6d3d1 !important;
}

.week-day-empty {
  font-size: 11px;
  color: var(--muted);
}

.week-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.week-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.week-row {
  font-size: 10px;
  line-height: 1.35;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 4px;
  align-items: baseline;
}

.week-row-time {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.week-row.cancelled {
  text-decoration: line-through;
  opacity: 0.5;
}

.week-look.full .week-day {
  min-height: 280px;
  max-height: 460px;
  padding: 12px 13px 14px;
}

.week-look.full .week-day-body {
  gap: 8px;
  overflow-y: auto;
}

.week-look.full .week-chip {
  font-size: 11px;
  padding: 4px 7px;
  white-space: normal;
}

.week-look.full .week-day-items {
  gap: 5px;
}

.week-look.full .week-row {
  font-size: 11px;
}

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

.view-toggle button {
  font: inherit;
  font-size: 12px;
  border: none;
  background: var(--surface);
  color: var(--muted);
  padding: 5px 12px;
  cursor: pointer;
}

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

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

.calendar-week-panel .layout {
  grid-template-columns: 1fr;
}

.calendar-week-panel .panel {
  position: static;
  margin-top: 4px;
}
