/* Home page styles */

.home {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
}

.home__recent {
  margin-bottom: 28px;
}

.home__recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.home__recent-header .section-title {
  margin-bottom: 0;
}

.home__all-files {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.home__all-files:hover {
  color: var(--full-contrast);
  background: var(--border-light);
}

.home__all-files::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 6px 10px;
  color: var(--tooltip-fg);
  background: var(--tooltip-bg);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  z-index: 50;
  pointer-events: none;
}

.home__all-files:hover::after,
.home__all-files:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.home__action {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 2em;
}

.home__form {
  margin-bottom: 8px;
}

.home__input-group {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--pre-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home__input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 78, 206, 0.15);
}

.home__file-tree-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: auto;
  align-self: stretch;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-subtle);
  border-radius: 7px 0 0 7px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.home__file-tree-button svg {
  display: block;
  flex-shrink: 0;
}

.home__file-tree-button:hover {
  color: var(--full-contrast);
  background: rgba(9, 78, 206, 0.05);
}

.home__file-tree-button:focus-visible {
  outline: none;
  color: var(--accent);
  background: rgba(9, 78, 206, 0.08);
}

.home__file-tree-button--active,
.home__file-tree-button[aria-expanded="true"] {
  color: var(--accent);
  background: rgba(9, 78, 206, 0.08);
}

.home__file-tree-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.home__input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--mono-font);
  font-size: 1rem;
  border: none;
  background: transparent;
  color: var(--full-contrast);
  outline: none;
}

.home__input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.home__button {
  border: none;
  border-radius: 0 7px 7px 0;
  border-left: 1px solid var(--border-subtle);
}

.home__button:hover {
  background: rgba(9, 78, 206, 0.05);
  border-color: transparent;
  border-left-color: var(--border-subtle);
}

.home__hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.recent-files {
  padding-left: 1.5em;
}

.recent-files__item {
  margin-bottom: 0.5em;
}

/* Matches the document switcher list sizing */
.recent-files__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--muted);
}

.recent-files__link:hover .recent-files__name {
  text-decoration: underline;
}

.recent-files__file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.recent-files__name {
  position: relative;
}

.recent-files__name::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  padding: 6px 10px;
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
  z-index: 50;
  pointer-events: none;
}

.recent-files__name:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.recent-files__time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
