/* Episode calendar (see inc/episode-calendar.php,
   template-parts/podcast/episode-calendar.php, js/interactions.js's
   initEpisodeCalendar()). Dark surface to match the sidebar it always
   lives in (.category-feed__sidebar, on both single-show.php and the
   Podcast hub's Category Feed page). */

.episode-calendar__body.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.episode-calendar {
  color: var(--color-white);
}

.episode-calendar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.episode-calendar__month {
  font-size: 13px;
  font-weight: 700;
}

.episode-calendar__nav {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.episode-calendar__nav:hover {
  border-color: var(--color-accent);
  color: var(--color-accent) !important;
}

.episode-calendar__nav svg {
  width: 9px;
  height: 9px;
  fill: currentColor;
}

.episode-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.episode-calendar__dow {
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  color: rgba(255, 255, 255, 0.35);
  padding-bottom: 4px;
}

.episode-calendar__day {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.4);
  position: relative;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}

.episode-calendar__day--muted {
  color: rgba(255, 255, 255, 0.15);
}

.episode-calendar__day--today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.episode-calendar__day--fill {
  color: var(--color-white) !important;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.episode-calendar__day--fill:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

/* A leading/trailing day (adjacent month) that also has an episode —
   still its real show color, just dimmer than the current month's
   fills so the two read as distinct at a glance. Full opacity on
   hover/focus so it's still clearly usable, not just decorative. */
.episode-calendar__day--fill-muted {
  opacity: 0.5;
}

.episode-calendar__day--fill-muted:hover,
.episode-calendar__day--fill-muted:focus-visible {
  opacity: 1;
}

.episode-calendar__day-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.episode-calendar__day-badge span {
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.episode-calendar__pop {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.episode-calendar__pop-date {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4) !important;
  margin: 0 0 6px;
}

.episode-calendar__pop-ep {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-white) !important;
  text-decoration: none;
  padding: 4px 0;
}

.episode-calendar__pop-ep:hover {
  color: var(--color-accent) !important;
}

.episode-calendar__pop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.episode-calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.episode-calendar__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.episode-calendar__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}

/* ==== "light" variant — same component on a white surface (the
   homepage promo card) instead of the dark sidebar it was built for.
   Overrides every rgba(255,255,255,...) (built assuming a dark
   background) with a dark-on-light equivalent; a filled day's colored
   background and white day-count badge stay as-is either way, since
   they're not white-on-dark, they're white-on-show-color. ==== */
.episode-calendar--light {
  color: var(--color-text);
}

.episode-calendar--light .episode-calendar__nav {
  border-color: var(--color-border);
  color: var(--color-text-muted) !important;
}

.episode-calendar--light .episode-calendar__nav:hover {
  border-color: var(--color-accent);
  color: var(--color-accent) !important;
}

.episode-calendar--light .episode-calendar__dow {
  color: var(--color-text-faint);
}

.episode-calendar--light .episode-calendar__day {
  color: var(--color-text-muted);
}

.episode-calendar--light .episode-calendar__day--muted {
  color: var(--color-text-faint);
}

.episode-calendar--light .episode-calendar__day--today {
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.episode-calendar--light .episode-calendar__pop {
  background: var(--color-bg-alt);
  border-color: var(--color-border-light);
}

.episode-calendar--light .episode-calendar__pop-date {
  color: var(--color-text-faint) !important;
}

.episode-calendar--light .episode-calendar__pop-ep {
  color: var(--color-text) !important;
}

.episode-calendar--light .episode-calendar__pop-ep:hover {
  color: var(--color-accent) !important;
}

.episode-calendar--light .episode-calendar__legend {
  border-top-color: var(--color-border-light);
}

.episode-calendar--light .episode-calendar__legend-item {
  color: var(--color-text-muted);
}
