/* Archive page: month calendar + sidebar. Leans on styles.css and home.css
   for the masthead, panels, dots and buttons; everything here is the
   calendar layout itself. */

/* The page frame matches every other page (home.css .wrap); the calendar
   and sidebar just sit inside it. */

.archive-blurb {
  margin: 6px 0 0;
  max-width: 46ch;
  color: var(--muted);
}

.archive-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
  margin-top: 18px;
}

/* ----- controls ------------------------------------------------------------ */

.cal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-nav-btn {
  appearance: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.cal-nav-btn:hover:not(:disabled) {
  border-color: var(--ink);
}

.cal-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal-month-select,
.cal-date-search {
  font-family: var(--sans, inherit);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.cal-date-search {
  flex: 1;
  min-width: 150px;
  font-weight: 400;
}

.cal-date-search.bad {
  border-color: #c5221f;
}

.cal-variant-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.cal-tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--sans, inherit);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.cal-tab.active {
  background: var(--ink);
  color: var(--accent-ink);
}

/* ----- calendar ------------------------------------------------------------ */

.cal-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
}

.cal-title {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 20px;
  text-align: center;
  margin: 2px 0 12px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.cal-dow {
  font-family: var(--sans, inherit);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.cal-day {
  position: relative;
  min-height: 62px;
  padding: 6px 6px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  text-align: center;
}

.cal-day.available {
  cursor: pointer;
}

.cal-day.available:hover {
  background: var(--bg);
}

.cal-day.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.cal-day.today .cal-day-num {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cal-day-num {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.cal-day.empty .cal-day-num,
.cal-day:not(.available) .cal-day-num {
  color: var(--muted);
  opacity: 0.45;
  font-weight: 400;
}

.cal-day-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.cal-day-dots .dot {
  width: 7px;
  height: 7px;
}

.cal-day .cal-check {
  position: absolute;
  top: 5px;
  right: 5px;
}

.cal-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #2c6e49;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 10px 2px 4px;
  font-family: var(--sans, inherit);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* ----- sidebar ------------------------------------------------------------- */

.side-note {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.your-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}

.your-tile .n {
  display: block;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.your-tile .k {
  display: block;
  font-family: var(--sans, inherit);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.day-label {
  color: var(--accent-red, #9a1f1a);
}

.day-difficulties {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  margin-bottom: 10px;
}

.day-diff {
  appearance: none;
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--sans, inherit);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 5px 0;
  border-radius: 999px;
  cursor: pointer;
}

.day-diff.active {
  background: var(--ink);
  color: var(--accent-ink);
}

.day-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}

.day-row:first-of-type {
  border-top: none;
}

.day-row .day-name {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
}

.day-row .cal-check {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.day-row-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.day-btn {
  display: inline-block;
  font-family: var(--sans, inherit);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
}

.day-btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.day-btn:hover {
  filter: brightness(1.08);
}

/* ----- recent editions ------------------------------------------------------ */

.recent-editions {
  margin-top: 22px;
}

.recent-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.recent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.recent-date {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 14.5px;
}

.recent-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ----- narrow screens ------------------------------------------------------- */

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

  .recent-cards {
    grid-template-columns: 1fr;
  }

  .cal-day {
    min-height: 52px;
  }
}

/* ---------- Tier boundaries on the calendar (#64) ---------- */

/* Locked days stay clickable — the day panel explains and sells — but read
   as behind glass: dimmed numeral and dots, a small lock in the corner. */
.cal-day.locked .cal-day-num {
  color: var(--muted);
  font-weight: 400;
}

.cal-day.locked .cal-day-dots {
  opacity: 0.4;
}

.cal-day .cal-lock {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  opacity: 0.55;
  filter: grayscale(1);
}

/* inline pitch in the day panel for a locked date */
.day-gate p {
  margin: 8px 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.day-gate .day-btn {
  display: inline-block;
}

/* premium-only print affordance on playable free-window days (#59) */
.day-print-locked {
  opacity: 0.75;
  cursor: pointer;
}

/* Your Archive panel CTAs (#64) */
.your-cta {
  display: inline-block;
  margin-top: 10px;
}

.your-horizon {
  margin-top: 12px;
}

.your-horizon b {
  color: var(--ink);
}
