/*
  Josh's Custom CSS Reset
  https://www.joshwcomeau.com/css/custom-css-reset/
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* General styles and layout */
@font-face {
  font-family: "Roboto";
  font-weight: 400;
  font-display: swap;
  src: local(Roboto), local(Roboto-Regular),
    url(./assets/fonts/roboto-regular-webfont.woff2) format(woff2);
}

@font-face {
  font-family: "Roboto";
  font-weight: 700;
  font-display: swap;
  src: local(Roboto), local(Roboto-Bold),
    url(./assets/fonts/roboto-bold-webfont.woff2) format(woff2);
}

:root {
  --blue: #0284c7;
  --yellow: #fbbf24;
  --slate300: #cbd5e1;
  --slate500: #64748b;
  --slate950: #020617;
  --white: #ffffff;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Roboto", sans-serif;
  min-height: 100svh;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

*:focus-visible {
  outline: 2px solid var(--slate950);
  outline-offset: 2px;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: max-content 1fr;
  grid-template-rows: auto 1fr;
}

/* Sidebar */
.sidebar {
  grid-row: 1 / 3;
  background-color: var(--blue);
  color: var(--white);
  padding: 16px 32px 16px 16px;
}

.title {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 32px;
}

.title__icon {
  width: 2.25rem;
}

.nav__list {
  list-style: none;
  padding: 0;
  width: 100%;
}

.nav__list-item:nth-child(6) {
  margin-bottom: 32px;
}

.nav__link {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  margin: 8px 0.5rem;
}

.nav__link:hover {
  text-decoration: underline;
}

.nav__link:active {
  color: var(--yellow);
}

.nav__link:focus-visible {
  outline-color: var(--white);
}

.nav__icon {
  height: 1.25rem;
  fill: var(--white);
}

.nav__link:active .nav__icon {
  fill: var(--yellow);
}

/* SVG icons in header and main content  */
.icon {
  height: 1.25rem;
}

.cta {
  flex-shrink: 0;
}

.cta .icon {
  fill: var(--slate950);
}
.cta:hover .icon {
  fill: var(--slate500);
}

.cta:active .icon {
  fill: var(--blue);
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* Header */
.header {
  display: grid;
  grid-template-columns: minmax(13rem, 3fr) minmax(10rem, 2fr);
  gap: 24px;
  align-items: center;
  background-color: var(--white);
  color: var(--slate950);
  font-weight: 700;
  padding: 24px 20px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-bar__input {
  flex: 1;
  background-color: var(--slate300);
  font-weight: 400;
  border-color: transparent;
  border-radius: 16px;
  padding: 1px 8px;
}

.account {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 16px;
}

.account__user {
  color: var(--slate950);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account__user:hover {
  text-decoration: underline;
}

.account__user:active {
  color: var(--blue);
}

.account__avatar {
  height: 2.5rem;
}

.greeting {
  display: flex;
  align-items: center;
  gap: 16px;
  line-height: 1.2;
}

.greeting__avatar {
  height: 4rem;
}

.actions__list {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  padding: 0;
}

.actions__list-item {
  flex-grow: 1;
}

.actions__link {
  display: block;
  background-color: var(--blue);
  color: var(--white);
  text-decoration: none;
  text-align: center;
  width: 100%;
  padding: 4px 8px;
  border-radius: 20px;
}

.actions__link:hover {
  text-decoration: underline;
}

.actions__link:active {
  color: var(--yellow);
}

/* Main content */
.main-content {
  display: grid;
  grid-template-columns: 3fr minmax(15rem, 1fr);
  background-color: var(--slate300);
  box-shadow: inset 0 2px 4px var(--slate500);
}

.projects {
  margin: 24px 20px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 20px;
  align-items: stretch;
  list-style: none;
  padding: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  color: var(--slate500);
  height: 100%;
  border-left: var(--yellow) solid 8px;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 4px var(--slate500);
}

.project-card__title {
  color: var(--slate950);
  font-size: 1.125rem;
  text-decoration: none;
  margin-bottom: 8px;
}

.project-card__title:hover {
  text-decoration: underline;
}

.project-card__title:active {
  color: var(--yellow);
}

.project-card__text {
  margin-bottom: 16px;
}

.project-card__icons {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-top: auto;
}

.project-card__button {
  background-color: var(--white);
  border-color: transparent;
  padding: 0;
  cursor: pointer;
}

/* Aside */
.aside {
  background-color: var(--slate300);
  margin: 24px 20px 0 0;
}

.aside__card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 4px var(--slate500);
}

.announcements__list,
.trending__list {
  list-style: none;
  padding: 0;
}

.announcements__list-item {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--slate300);
  margin-bottom: 24px;
}

.announcements__list-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
}

.announcements__link {
  font-size: 0.875rem;
  color: var(--slate500);
  text-decoration: none;
}

.announcements__title {
  font-size: 1rem;
  color: var(--slate950);
  margin-bottom: 6px;
}

.announcements__link:hover .announcements__title {
  text-decoration: underline;
}

.announcements__link:active .announcements__title {
  color: var(--blue);
}

.trending__list-item {
  margin-bottom: 24px;
}

.trending__list-item:last-child {
  margin-bottom: 0;
}

.trending__link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--slate500);
  text-decoration: none;
}

.trending__link:hover .trending__project {
  text-decoration: underline;
}

.trending__link:active .trending__project {
  color: var(--blue);
}

.trending__avatar {
  height: 3.5rem;
}

.trending__user-name {
  color: var(--slate950);
}

/* Footer */
.attribution {
  font-size: 0.75rem;
  text-align: center;
  color: var(--slate500);
  padding: 12px;
}
.attribution a {
  color: inherit;
}
