:root {
  --bg: hsl(0, 0%, 98%);
  --dark: hsl(0, 0%, 15%);
  --dark-gray: hsl(0, 0%, 56%);
  --gray: hsl(0, 0%, 86%);
  --light: hsl(0, 0%, 100%);
  --color: hsl(204, 100%, 48%);
  --width: 935px;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--dark);
  background: var(--bg);
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 1rem 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  justify-content: center;
  border-block-end: 1px solid var(--gray);
  padding: 1rem 0;
}

header div {
  overflow-x: hidden;
}

header a {
  color: #00376b;
}

nav {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 1rem;
}

nav a {
  color: currentColor;
}

.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pageNav {
  justify-content: space-between;
  padding: 1rem;
}

.postNav {
  justify-content: space-between;
  padding: 1rem;
}

footer {
  padding: 1rem;
  font-size: smaller;
  color: var(--dark-gray);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

a {
  color: var(--color);
  text-decoration: none;
}

h1 {
  font-weight: normal;
}

time,
address {
  font-style: normal;
  color: var(--dark-gray);
  text-transform: uppercase;
  font-size: smaller;
}

li {
  list-style: none;
}

.posts {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(calc(300px - 1.5rem), 1fr));
  grid-template-rows: auto;
  justify-content: center;
  margin-top: 2rem;
}

/* image overlay */
.post-link {
  position: relative;
  margin: 0 auto;
  width: 300px;
}
.post-link .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: 0.2s ease;
}
.post-link:hover .overlay {
  cursor: pointer;
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}
.overlay-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  color: var(--light);
  text-align: center;
  font-weight: bold;
  font-size: larger;
}

.post {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border: 1px solid var(--gray);
}

.post-info {
  background: var(--light);
  border-inline-start: 1px solid var(--gray);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.user {
  display: flex;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-block-end: 1px solid var(--gray);
  padding: 1rem;
}

.caption {
  padding: 0 1rem;
  flex-grow: 1;
}

.media {
  bottom: 0;
  padding: 1rem;
  border-block-end: 1px solid var(--gray);
}

.media a {
  display: block;
  color: currentColor;
  font-size: smaller;
}

.comments {
  margin: 0 auto;
  margin-block-start: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
}

.comment {
  padding: 1rem;
  background: hsla(0, 0%, 95%);
  border: 1px solid hsla(0, 0%, 80%);
  border-radius: 3px;
}

blockquote {
  padding-inline-start: 0.5rem;
  border-inline-start: 2px solid hsla(0, 0%, 80%);
}

img {
  display: block;
  height: auto;
  width: 100%;
}

video {
  width: 100%;
  height: auto;
  align-self: center;
}

.image {
  max-height: 600px;
  object-fit: contain;
  background: white;
}

.thumbnail {
  object-fit: cover;
  height: 300px;
}

.avatar {
  align-self: center;
  justify-self: center;
  height: 150px;
  width: 150px;
  border-radius: 50%;
}

.avatar-small {
  display: inline-block;
  align-self: center;
  justify-self: center;
  height: 32px;
  width: 32px;
  border-radius: 50%;
}

.banner {
  position: sticky;
  top: 0;
  left: 0;
  background: white;
  border-block-end: 1px solid var(--gray);
  padding: 0.75rem;
  will-change: transform;
  z-index: 100;
}

.banner-links {
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  width: var(--width);
}

.user-name {
  display: inline;
}

.btn {
  display: inline-block;
  color: var(--light);
  font-size: 90%;
  font-weight: 600;
  background: var(--color);
  border-radius: 4px;
  margin: 0 2rem;
  padding: 5px 9px;
}

.btn-link {
  color: inherit;
  display: inline-block;
}

.logo {
  font-family: cursive;
  font-weight: bold;
  font-size: 1.25rem;
}

.icon {
  color: currentColor;
  display: inline-block;
  vertical-align: bottom;
  height: 1.25rem;
  width: 1.25rem;
}

.color {
  color: var(--color);
}

.col-container {
  overflow-y: auto;
}

.likes,
.following,
.followers {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0 1rem;
  max-height: 81vh;
  overflow-y: auto;
}

.like,
.follow,
.follower {
  max-width: 200px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.form-container {
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
}

form {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 0.5rem 1rem;
}

input {
  border: none;
  width: 100%;
  outline: none;
  padding: 0.5rem;
}

button[type='submit'] {
  border: none;
  background: none;
  color: var(--color);
  cursor: pointer;
}
