/* Fraunces — variable display serif */
@font-face {
  font-family: 'Fraunces';
  src: url("/assets/fraunces-latin-wght-normal.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* DM Sans — humanist body sans */
@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-400-normal.woff2") format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-500-normal.woff2") format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-600-normal.woff2") format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono — reference numbers */
@font-face {
  font-family: 'JetBrains Mono';
  src: url("/assets/jetbrains-mono-latin-400-normal.woff2") format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   FULLCALENDAR OVERRIDES
   ============================================================ */
.fc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border-default);
}

.fc-col-header-cell {
  background: var(--surface-subtle);
  padding: 8px 0;
}
.fc-col-header-cell-cushion {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none !important;
}

.fc-daygrid-day-number {
  font-family: 'Fraunces', serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none !important;
  padding: 6px 8px;
}

.fc-day-today-custom .fc-daygrid-day-number {
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 0;
}
.fc-day-today { background: transparent !important; }

.fc-event {
  border-radius: 6px !important;
  border: none !important;
  padding: 2px 6px !important;
  margin-bottom: 2px !important;
  cursor: pointer !important;
}
.fc-event:hover { opacity: 0.85; }

.fc-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
.fc-event-icon { font-size: 10px; flex-shrink: 0; }
.fc-event-title {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-event-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  opacity: 0.75;
  flex-shrink: 0;
}

.fc-timegrid-slot { height: 48px !important; }
.fc-timegrid-slot-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.fc-timegrid-now-indicator-line  { border-color: var(--brand-primary) !important; }
.fc-timegrid-now-indicator-arrow { border-top-color: var(--brand-primary) !important; }

.fc-daygrid-more-link {
  font-size: 0.7rem;
  color: var(--brand-primary);
  font-weight: 600;
}

/* ============================================================
   FILTER PILLS
   ============================================================ */
.filter-pill { cursor: pointer; user-select: none; }

.filter-pill.active.delivery  { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }
.filter-pill.active.pickup    { background: #4F46E5; border-color: #4F46E5; color: white; }
.filter-pill.active.dropoff   { background: #0D9488; border-color: #0D9488; color: white; }
.filter-pill:not(.active)     { background: var(--surface-subtle); border-color: var(--border-default); color: var(--text-muted); }

/* ============================================================
   EVENT POPOVER
   ============================================================ */
#calendar-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  animation: fade-in 150ms ease;
}

.calendar-popover-inner {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-raised);
  width: 280px;
  overflow: hidden;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-default);
}
.popover-type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.popover-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}
.popover-close:hover { color: var(--text-primary); }

.popover-body  { padding: 14px 16px; }
.popover-name  { font-family: 'Fraunces', serif; font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin: 0 0 2px; }
.popover-ref   { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); margin: 0 0 10px; }
.popover-detail { font-size: 0.8125rem; color: var(--text-secondary); margin: 0 0 4px; }

.popover-footer { padding: 10px 16px; border-top: 1px solid var(--border-default); background: var(--surface-subtle); }
.popover-link   { font-size: 0.8125rem; font-weight: 600; color: var(--brand-primary); text-decoration: none; }
.popover-link:hover { opacity: 0.8; }

@media (max-width: 640px) {
  #calendar-popover { top: auto; bottom: 0; left: 0; right: 0; transform: none; }
  .calendar-popover-inner { width: 100%; border-radius: 16px 16px 0 0; }
}

/* ============================================================
   VIEW SWITCHER ACTIVE STATE
   ============================================================ */
[data-view].active    { background: var(--surface-card); box-shadow: 0 1px 3px rgba(60,40,20,0.10); color: var(--text-primary); }
[data-view]:not(.active) { color: var(--text-muted); }

/* ============================================================
   CALENDAR — MOBILE (month view shows dots)
   ============================================================ */
@media (max-width: 640px) {
  .fc-daygrid-event {
    height: 6px;
    width: 6px;
    border-radius: 50% !important;
    margin: 1px !important;
    padding: 0 !important;
    display: inline-block;
  }
  .fc-event-chip        { display: none; }
  .fc-daygrid-event-dot { display: none; }
  .fc-daygrid-day-number  { font-size: 0.75rem; padding: 4px; }
  .fc-col-header-cell-cushion { font-size: 0.625rem; }
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
#command-palette:not(.hidden) {
  display: block;
}

.command-item.highlighted,
.command-item:focus {
  background: var(--surface-subtle);
  outline: none;
}
