/* Project card board. Cards, folder tabs and the grid come from base.css. */

.shell:not(.is-wide) { width: 100%; max-width: 100%; padding-inline: clamp(22px, 4vw, 64px); }

.project-grid .project-card { grid-column: span 3; }

.card-role { color: var(--blue); }

/* Each team is its own top-level folder (colour from idColor — the same
   deterministic hash the calendar colours a team's events with, so a team
   reads as one colour everywhere). A repeated folder-tab per member read as
   a second row of top-level folders with no sense of nesting, so members
   use .section-label's plain muted-rule idiom instead — one visual step
   down from a folder tab, not a peer of it — plus a left rule to show the
   nesting in the layout itself, not just in colour. The colour becomes a
   small dot rather than a filled pill, so it reads as a tag, not a folder. */
/* #project-board, not just .folder-dropzone.team-members: list mode's
   .project-board.is-list .folder-dropzone rule is also 3 classes, and being
   later in this file it would otherwise win the tie and zero this gap. */
#project-board .folder-dropzone.team-members { display: flex; flex-direction: column; gap: 24px; }
.member-group { padding-left: 18px; border-left: 2px solid var(--line); }
.member-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.member-head::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.member-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--member-color); }

/* Wraps to a second row rather than scrolling under the pointer. */
.home-view-nav {
  flex-wrap: wrap;
  gap: 4px 24px;
}
.home-view-nav .nav-item { flex: 0 0 auto; white-space: nowrap; }
/* Section rule: sits in the doubled gap ahead of the tab that opens a group. */
.home-view-nav .is-group-start { margin-left: 24px; }
.home-view-nav .is-group-start::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 13px;
  left: -24px;
  width: 1px;
  background: var(--line);
}
.intro,
.home-view-nav,
.project-controls { width: min(1500px, 100%); margin-inline: auto; }
.title-row .primary-action[hidden] { display: none; }
.masthead-search { width: min(300px, 34vw); margin-left: auto; margin-bottom: 9px; }
.masthead-search[hidden] { display: none; }
.project-controls { display: flex; margin-bottom: 16px; }
.project-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #aaa499;
  transition: border-color .12s;
}
.project-search-field:focus-within { border-color: var(--blue); }
.project-search-field svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.5;
}
.project-search-field:focus-within svg { stroke: var(--blue); }
.project-search-field input {
  width: 100%;
  min-width: 0;
  padding: 3px 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-body);
}
.project-search-field input::placeholder { color: #aaa49a; }
.project-search-field button {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  padding: 0 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}
.project-search-field button:hover { color: var(--blue); }
.project-search-field button[hidden] { display: none; }
.home-layout-toggle { align-self: center; margin-bottom: 0; }
.home-layout-toggle button { padding-bottom: 7px; }
.project-controls[hidden] { display: none; }
.home-layout-toggle[hidden] { display: none; }
.home-view-panel { --home-workspace-height: clamp(520px, calc(100vh - 330px), 850px); width: 100%; min-height: 320px; }
.home-view-panel > [data-projects-view],
.home-view-panel > [data-announcements-view],
.home-view-panel > [data-lab-view-panel],
.home-view-panel > [data-resources-view],
.home-view-panel > [data-teams-view],
.home-view-panel > [data-feedback-view],
.home-view-panel > [data-messages-view],
.home-view-panel > [data-account-view],
.home-view-panel > [data-tracker-view],
.home-view-panel > [data-presentations-view],
.home-view-panel > [data-polls-view],
.home-view-panel > [data-admin-view],
.home-view-panel > .home-blank-view { width: min(1500px, 100%); margin-inline: auto; }
.home-blank-view { min-height: 320px; }
.home-load-error { margin: 0; padding: 42px 0; color: var(--red); font-size: var(--text-body); }
.home-blank-view[hidden],
.folder-board[hidden],
[data-announcements-view][hidden],
[data-lab-view-panel][hidden],
[data-resources-view][hidden],
[data-presentations-view][hidden],
[data-teams-view][hidden],
[data-feedback-view][hidden],
[data-messages-view][hidden],
[data-account-view][hidden] { display: none; }
[data-tracker-view][hidden] { display: none; }

.project-create-dialog { width: min(590px, calc(100% - 24px)); }
.project-create-form { padding: 30px 34px 34px; }
.project-create-form .dialog-head { margin-bottom: 32px; }
.project-create-form .dialog-head .eyebrow { margin-bottom: 9px; }
.project-create-close { position: absolute; top: 18px; right: 18px; }
.project-create-error { min-height: 18px; margin: 12px 0 -8px; color: var(--red); font-size: var(--text-control); }
[data-project-create-submit]:disabled { cursor: wait; opacity: .5; }

.project-search-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}
.project-search-empty span { color: var(--blue); font: italic 28px/1 var(--serif); }
.project-search-empty p { margin: 0; font: 400 22px/1.2 var(--serif); }

/* Phone navigation. The tab row carries 11+ tabs and wraps to three rows on a
   handset, so below 700px the page title takes over: it names the open view
   already, and a caret turns it into the list of the others. Above 700px the
   caret is gone and the heading is inert, so it reads as an ordinary title. */
.home-title { position: relative; }
.home-title-toggle {
  display: inline-flex;
  align-items: center;
  gap: .16em;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  pointer-events: none;
  text-align: left;
}
/* No overflow clip here: h1 sets line-height .9, so the glyphs sit outside
   their line box and any clipping cuts their tops off. View names are one
   word, so there is nothing to truncate. */
.home-title-toggle > span:first-child { min-width: 0; }
.home-title-caret { display: none; }
.home-title-menu { display: none; }

@media (max-width: 900px) {
  .project-grid .project-card { grid-column: span 12; }
}

@media (max-width: 700px) {
  .home-view-nav { display: none; }

  .home-title-toggle { cursor: pointer; pointer-events: auto; }
  .home-title-caret {
    width: 0;
    height: 0;
    flex: none;
    display: block;
    margin-bottom: .12em;
    border: .17em solid transparent;
    border-bottom: 0;
    border-top-color: currentColor;
    opacity: .55;
  }
  .home-title-toggle[aria-expanded="true"] .home-title-caret { opacity: 1; transform: rotate(180deg); }

  .home-title-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 7px);
    left: 0;
    max-height: min(58vh, 420px);
    display: block;
    width: min(240px, calc(100vw - 40px));
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper-raised);
    box-shadow: var(--shadow);
  }
  .home-title-menu[hidden] { display: none; }
  .home-title-menu-item {
    min-height: var(--tap);
    display: block;
    width: 100%;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: var(--text-reading)/1.35 var(--sans);
    letter-spacing: .005em;
    text-align: left;
  }
  .home-title-menu-item:last-child { border-bottom: 0; }
  .home-title-menu-item.is-active { color: var(--blue); }

  .home-view-panel { --home-workspace-height: 620px; }
  .masthead-search { width: 100%; margin-left: 0; }
  /* The phone is always on the list layout, so the choice has nothing to
     offer; .project-controls holds nothing else. */
  .project-controls { display: none; }
}

.project-board.is-list .folder-dropzone { grid-template-columns: 1fr; gap: 0; }
.project-board.is-list .project-card {
  grid-column: 1 / -1;
  height: 86px;
  min-height: 0;
  display: block;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(251, 249, 243, .62);
  cursor: pointer;
}
.project-board.is-list .project-card + .project-card { margin-top: -1px; }
.project-board.is-list .project-card:hover { z-index: 1; background: var(--paper-raised); }
.project-board.is-list .card-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  align-items: center;
  column-gap: clamp(15px, 2.2vw, 30px);
  padding: 0 15px;
}
.project-board.is-list .card-identity { min-width: 0; display: grid; grid-template-areas: "title" "role" "summary"; }
.project-board.is-list .project-card h2 {
  grid-area: title;
  height: 25px;
  min-height: 0;
  display: block;
  margin: 0;
  overflow: hidden;
  font: 400 21px/25px var(--serif);
  letter-spacing: -.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-board.is-list .card-role {
  grid-area: role;
  height: 12px;
  margin: 3px 0 0;
  overflow: hidden;
  font: 700 9px/12px var(--sans);
  letter-spacing: .12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-board.is-list .card-summary {
  grid-area: summary;
  height: 17px;
  min-height: 0;
  display: block;
  margin: 5px 0 0;
  padding: 0;
  overflow: hidden;
  border-top: 0;
  font: italic 12px/17px var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-board.is-list .card-bottom { margin: 0; }
.project-board.is-list .project-meta {
  display: grid;
  grid-template-columns: 96px 110px;
  gap: 10px;
  justify-content: end;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 700px) {
  /* The row's heights are fixed so the columns line up down the page, so the
     type and the boxes holding it come down together. */
  .project-board.is-list .project-card { height: 70px; }
  .project-board.is-list .card-body { grid-template-columns: minmax(0, 1fr) 96px; padding: 0 11px; }
  .project-board.is-list .project-card h2 { height: 19px; font: 400 15px/19px var(--serif); }
  .project-board.is-list .card-role { height: 11px; font-size: 8px; line-height: 11px; }
  .project-board.is-list .card-summary { height: 15px; font-size: 11px; line-height: 15px; }
  .project-board.is-list .project-meta { grid-template-columns: 96px; gap: 3px; font-size: var(--text-meta); }
}
