.header { height: var(--height); }
.logo-mark { background-image: url("favicon.png"); }
.header-tools { height: 100%; }

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-items: center;
  gap: calc(var(--gap-large) * 2);
  padding-inline: var(--padding-large);
}

.clock { align-self: end; display: flex; flex-direction: column; align-items: center; gap: var(--gap-small); }
.clock-time { font-size: calc(var(--font-size-extra-large) * 5); font-weight: 700; line-height: 1; }
.clock-date, .clock-greeting { font-size: var(--font-size-large); color: var(--fg-1); }

.search-form {
  width: min(calc(var(--height) * 20), 100%);
  height: var(--height);
  display: grid;
  grid-template-columns: calc(var(--height) * 4) minmax(0, 1fr) calc(var(--height) * 4);
  gap: var(--gap-small);
}
.search-form > select { width: 100%; }
.search-form > .searchbox { min-width: 0; height: 100%; }

.bookmarks {
  align-self: start;
  width: min(calc(var(--height) * 24), 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(var(--gap-large) * 2);
  overflow-y: auto;
  padding: var(--padding-small);
}

.bookmarks.empty .bookmark-list { grid-template-columns: minmax(0, calc(var(--height) * 8)); justify-content: center; }
.bookmark-group { display: flex; flex-direction: column; gap: var(--gap-small); flex: none; }
.bookmark-group-title { font-size: var(--font-size-extra-small); font-weight: 700; text-transform: uppercase; color: var(--fg-1); }
.bookmark-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--height) * 6), 1fr));
  gap: var(--gap-medium);
}

.bookmark {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--height);
  align-items: center;
  height: calc(var(--height) * 2);
  padding-inline-end: var(--padding-small);
  border: var(--border-width) solid var(--border);
  border-radius: var(--border-radius-medium);
  background: var(--bg-1);
}
.bookmark:hover, .bookmark:focus-within, .bookmark.drop-target { border-color: var(--highlight); }
.bookmark.dragging { background: transparent; }
.bookmark-list.drop-target { background: color-mix(in srgb, var(--highlight) 10%, transparent); }

.bookmark-link {
  display: flex;
  align-items: center;
  gap: var(--gap-small);
  height: 100%;
  min-width: 0;
  padding-inline: var(--padding-medium);
  color: inherit;
  text-decoration: none;
}
.bookmark-mark {
  flex: none;
  width: var(--height);
  height: var(--height);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-small);
  background: color-mix(in srgb, var(--highlight) 20%, transparent);
  color: var(--highlight);
  font-weight: 700;
  text-transform: uppercase;
}
.bookmark-text { display: flex; flex-direction: column; min-width: 0; }
.bookmark-title, .bookmark-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bookmark-title { font-weight: 700; }
.bookmark-host { font-size: var(--font-size-extra-small); color: var(--fg-1); }

.bookmark-add { height: calc(var(--height) * 2); width: 100%; justify-content: center; }

.bookmark-form { display: flex; flex-direction: column; gap: var(--gap-large); }
.bookmark-form > button { align-self: flex-end; width: calc(var(--height) * 4); }

@media (max-width: 48rem) {
  .clock-time { font-size: calc(var(--font-size-extra-large) * 3); }
  .search-form { height: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search-form > .searchbox { grid-column: 1 / -1; grid-row: 1; height: var(--height); }
  .search-form > select { grid-column: 1; grid-row: 2; height: var(--height); }
  .search-form > #search-button { grid-column: 2; grid-row: 2; }
}
