/* ==========================================================================
   calendar.css — styles only the earnings calendar uses
   ========================================================================== */

.calendar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 64px;
}

/* Shown on phones only; see the media query at the bottom */
.phone-only {
  display: none;
}

/* ---------- Title row ---------- */
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.page-note {
  font-size: 13px;
  color: var(--fg-3);
}

.page-footnote {
  font-size: 12px;
  color: var(--fg-3);
}

/* ---------- The pitch ---------- */
.pitch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pitch-lead {
  font-size: 15px;
  font-weight: 500;
}

.pitch-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-3);
}

.pitch-button {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  justify-self: start;
}

/* ---------- Range chips and the count ---------- */
.tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.chips {
  display: flex;
  gap: 2px;
}

.chip {
  padding: 7px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}

.chip:hover {
  color: var(--fg);
}

.chip[aria-pressed="true"] {
  background: var(--gridline);
  color: var(--fg);
}

.tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools-right .button {
  height: 36px;
}

/* ---------- Days ---------- */
.days {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.day {
  display: flex;
  flex-direction: column;
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0 10px;
}

.day-heading h2 {
  font-size: 15px;
  font-weight: 500;
}

.day-heading span {
  font-size: 13px;
  color: var(--fg-3);
}

/* Columns: time, company, sector, last quarter + YoY, date, arrow */
.event-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px 200px 110px 20px;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}

a.event-row:hover {
  background: var(--hover);
  text-decoration: none;
}

.event-row-head {
  min-height: 32px;
  font-size: 12px;
  color: var(--fg-3);
}

.ev-time {
  font-size: 13px;
  color: var(--fg-2);
}

.ev-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ev-name-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.ev-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
}

.ev-ticker {
  font-size: 13px;
  color: var(--fg-3);
}

.ev-sub {
  font-size: 12px;
  color: var(--fg-3);
}

/* Last quarter's revenue and its change on a year before */
.ev-revenue {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  font-size: 15px;
}

.ev-revenue .amount {
  font-weight: 500;
}

.ev-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.ev-change.up {
  color: var(--up);
}

.ev-change.down {
  color: var(--down);
}

.ev-change.flat {
  color: var(--fg-2);
}

.ev-estimated {
  font-size: 12px;
  color: var(--fg-3);
}

.ev-arrow {
  color: var(--fg-3);
}

/* ---------- Loading, nothing scheduled, couldn't load ---------- */
.event-row .skeleton {
  height: 14px;
}

.event-row .skeleton.time {
  width: 70px;
}

.event-row .skeleton.name {
  width: 170px;
}

.event-row .skeleton.sector {
  width: 76px;
}

.event-row .skeleton.revenue {
  width: 110px;
  justify-self: end;
}

.event-row .skeleton.date {
  width: 70px;
}

.calendar-message {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-2);
}

.calendar-message button {
  padding: 0 0 0 4px;
  border: none;
  background: none;
  color: var(--accent);
}

/* ---------- Narrow window: the sector column goes ---------- */
@media (max-width: 900px) {
  .event-row {
    grid-template-columns: 120px minmax(0, 1fr) 200px 110px 20px;
  }

  .event-row > :nth-child(3) {
    display: none;
  }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  .calendar {
    padding-top: 20px;
    padding-bottom: 48px;
  }

  .pitch {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools {
    flex-direction: column;
    align-items: stretch;
  }

  .tools-right {
    justify-content: flex-end;
  }

  /* company (with time and sector beneath), revenue, arrow */
  .event-row {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 12px;
    min-height: 64px;
  }

  .not-phone {
    display: none !important;
  }

  .phone-only {
    display: flex;
  }
}
