/* The pages in no project: the list of projects (index.html), and the About page (about.html, which adds
   about.css). Each is one card under the bar. */

body.home {
  min-height: 100svh;
}

.bar {
  grid-template-columns: auto 1fr auto;
}
.bar .surfaces {
  justify-self: start;
}

/* ---- the list of projects: the first thing on the page ---- */

.projects {
  position: relative;
  z-index: 5;
  padding: calc(var(--pad) + var(--bar-h) + 32px) clamp(16px, 5vw, 80px) 24px;
}
.projects-card,
.hero-card {
  width: min(780px, 100%);
  padding: 44px 48px;
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.projects-card h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.projects-card h1:focus {
  outline: none;
}
.projects-card h1:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.project-notice {
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--r-ctl);
  background: var(--warn-wash);
  color: var(--ink);
  font-weight: 600;
}
.project-empty {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 17px;
}
.project-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.project-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.project-row:last-child {
  border-bottom: 1px solid var(--rule);
}
.project-open {
  grid-column: 1;
  justify-self: start;
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.project-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  color: var(--ink-2);
  font-size: 14px;
}
.project-area-label {
  font-weight: 600;
}
/* The date is its own item: on a wide line it stands apart, on a narrow one it takes the next line. */
.project-changed {
  margin-left: 12px;
}
@media (max-width: 520px) {
  .project-changed {
    flex-basis: 100%;
    margin-left: 0;
  }
}
.project-row > .project-buttons {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.project-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-rename,
.project-row > .confirm {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.project-rename {
  display: grid;
  gap: 8px;
}
.confirm {
  padding: 14px 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--r-ctl);
  background: var(--warn-wash);
}
.confirm > * + * {
  margin-top: 10px;
}
.btn.danger {
  border-color: var(--map-bad);
}
.project-create {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}
.project-create h2 {
  font-size: 18px;
  font-weight: 700;
}
.project-field {
  display: grid;
  gap: 6px;
}
.project-field label,
.project-rename label {
  font-weight: 600;
}
.project-create input,
.project-create select,
.project-rename input {
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--field-line);
  border-radius: var(--r-ctl);
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
}
.project-create input:focus-visible,
.project-create select:focus-visible,
.project-rename input:focus-visible {
  border-color: var(--accent);
}
.project-create input[aria-invalid="true"],
.project-rename input[aria-invalid="true"] {
  border-color: var(--warn);
}
/* What the person is told about a field, under it. */
.project-hint {
  color: var(--ink-2);
  font-size: 14px;
}
.project-error {
  color: var(--warn);
  font-weight: 600;
}
.project-error:empty {
  display: none;
}
.project-create-go {
  justify-self: start;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.btn.project-create-go:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.08);
}

/* The page scrolls when its card is long: the version ends it instead of floating over the card. */
body.home .site-foot {
  position: relative;
  height: auto;
  padding: 0 clamp(16px, 5vw, 80px) 16px;
  left: 0;
}

@media (max-width: 899px) {
  body.home {
    display: flex;
    flex-direction: column;
  }
  .bar {
    order: 0;
    grid-template-columns: 1fr auto;
  }
  .bar .surfaces {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .projects {
    order: 1;
    padding: 4px 8px 8px;
  }
  .projects-card,
  .hero-card {
    width: 100%;
    padding: 28px 22px;
  }
  .project-row {
    grid-template-columns: 1fr;
  }
  .project-row > .project-buttons {
    grid-column: 1;
    grid-row: auto;
  }
}
/* The question's buttons while a project's share links are deleted on the server (#221): they wait without leaving
   the tab order (`aria-disabled`), so focus stays on them, and look as a disabled button does (`app.css`). */
.confirm .btn[aria-disabled="true"],
.project-buttons .btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
}
.confirm .btn[aria-disabled="true"]:hover,
.project-buttons .btn[aria-disabled="true"]:hover {
  background: var(--panel);
}
