/* Archives overlay — same card grid as home, not smushed */

.archives-overlay {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: var(--body-bg);
  color: var(--text);
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px calc(40px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.archives-open-btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.archives-inner {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding-top: 8px;
  box-sizing: border-box;
}

.archives-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.archives-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 3px 0 var(--card-border);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.archives-tag {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
}

.archives-title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* Critical: use same vertical stack + spacing as home unit-cards */
#archives-cards.unit-cards,
.archives-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 100%;
  box-sizing: border-box;
}

#archives-cards .unit-card {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  display: block;
  /* prevent float collapse from Study Now button */
  overflow: visible;
}

#archives-cards .unit-card::after {
  content: '';
  display: table;
  clear: both;
}

#archives-cards .unit-card h2 {
  margin: 8px 0 6px;
}

#archives-cards .unit-card p {
  margin: 0 0 8px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .archives-inner {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  .archives-title {
    font-size: 24px;
  }
  #archives-cards.unit-cards,
  .archives-cards {
    gap: 12px !important;
  }
}

/* Unit cards in the archives use the theme (on home they sit on the dark backdrop) */
.archives-overlay .unit-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: 0 4px 0 var(--card-border), var(--shadow) !important;
  backdrop-filter: none;
}
.archives-overlay .unit-card:hover {
  background: var(--card-bg) !important;
  border-color: var(--blue) !important;
  box-shadow: 0 6px 0 var(--card-border), var(--shadow-lg) !important;
}
.archives-overlay .unit-card h2 { color: var(--text); }
.archives-overlay .unit-card p { color: var(--text-secondary); }
.archives-back-btn:hover { border-color: var(--blue); }
.archives-level {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-secondary); margin: 14px 0 -2px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border, rgba(127, 127, 127, 0.25));
}
.archives-level:first-child { margin-top: 4px; }
.archives-empty { color: var(--text-secondary); text-align: center; margin-top: 40px; font-family: var(--font-mono); font-size: 13px; }

