 *{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f0f2f5;
  color: #171717;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.navbar {
  height: 74px;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: 0 2px 7px #00000018;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 20px;
}

.nav-left,
.nav-right,
.nav-center {
  display: flex;
  align-items: center;
}

.nav-left {
  gap: 12px;
}

.facebook-logo {
  width: 58px;
  height: 58px;
  background: #0866ff;
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 56px;
  font-weight: bold;
  line-height: 1;
  overflow: hidden;
}

.nav-left input {
  width: 280px;
  height: 43px;
  border: 1px solid #ddd;
  background: #f0f2f5;
  border-radius: 24px;
  padding: 0 15px;
  outline: none;
}

.nav-center {
  justify-content: center;
  gap: clamp(20px, 5vw, 75px);
  flex: 1;
}

.nav-center a {
  color: #111;
  text-decoration: none;
  font-size: 35px;
  font-weight: bold;
}

.nav-right {
  gap: 9px;
}

.nav-right button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f2f5;
  font-size: 21px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.top-avatar {
  width: 48px;
  height: 48px;
}

.page-layout {
  display: grid;
  grid-template-columns: 290px minmax(400px, 840px) 290px;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 90px;
  height: calc(100vh - 100px);
  overflow-y: auto;
}

.side-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 5px;
  min-width: 0;
}

.side-profile .avatar {
  width: 48px;
  height: 48px;
}

.side-profile span {
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.main-content {
  width: 100%;
  min-width: 0;
}

.create-post {
  background: #fff;
  border-radius: 15px;
  padding: 15px 22px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: 0 2px 9px #00000018;
  margin-bottom: 22px;
}

.create-post input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: none;
  outline: none;
  border-radius: 28px;
  background: #f0f2f5;
  padding: 0 20px;
}

.create-post button {
  background: transparent;
  font-size: 25px;
  padding: 5px;
}

.video-button {
  color: #e41e26;
}

.photo-button {
  color: #42a85a;
}

.more-button {
  color: #e41e26;
}

.stories {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.story {
  height: 194px;
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #ddd;
  box-shadow: 0 2px 8px #00000020;
  isolation: isolate;
}

.story-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.story::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(transparent, #000b);
  z-index: -1;
}

.story-avatar {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #1877f2;
}

.story h3 {
  position: absolute;
  bottom: 13px;
  left: 4px;
  right: 4px;
  text-align: center;
  color: white;
  font-size: 14px;
  line-height: 1.35;
  text-shadow: 0 1px 4px #000;
}

.create-story {
  background: #fff;
}

.create-story::after {
  display: none;
}

.create-story > img {
  width: 100%;
  height: 65%;
  object-fit: cover;
}

.create-story .plus {
  position: absolute;
  top: 57%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 43px;
  height: 43px;
  background: #1877f2;
  color: #fff;
  border: 3px solid white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
}

.create-story h3 {
  color: #171717;
  text-shadow: none;
  bottom: 12px;
  font-size: 15px;
}

/* Feed post */
.post {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 9px #00000015;
  margin-bottom: 25px;
}

.post-header {
  min-height: 82px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-user {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.post-user strong {
  font-size: 17px;
}

.post-user span {
  color: #65676b;
  font-size: 13px;
}

.post-menu,
.close-post {
  background: transparent;
  font-size: 27px;
  padding: 4px;
}

.post-image-wrap {
  background: #d0cecd;
  width: 100%;
  text-align: center;
}

.post-image {
  display: block;
  width: 100%;
  max-height: 700px;
  object-fit: contain;
  margin: 0 auto;
}

.post-actions {
  display: flex;
  justify-content: space-around;
  padding: 12px;
  border-top: 1px solid #eee;
}

.post-actions button {
  background: transparent;
  padding: 8px;
  color: #555;
  font-weight: 600;
}

@media (max-width: 1250px) {
  .page-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
  }

  .right-sidebar {
    display: none;
  }

  .stories {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .story:nth-child(6) {
    display: none;
  }
}

@media (max-width: 760px) {
  .navbar {
    height: 62px;
    padding: 0 10px;
    gap: 8px;
  }

  .facebook-logo {
    width: 42px;
    height: 42px;
    font-size: 42px;
  }

  .nav-left {
    gap: 7px;
  }

  .nav-left input {
    width: min(43vw, 220px);
    height: 38px;
    font-size: 13px;
  }

  .nav-center {
    display: none;
  }

  .nav-right {
    gap: 5px;
  }

  .nav-right button {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .top-avatar {
    width: 35px;
    height: 35px;
  }

  .page-layout {
    display: block;
    padding: 12px 10px;
  }

  .left-sidebar,
  .right-sidebar {
    display: none;
  }

  .create-post {
    padding: 12px;
    gap: 8px;
    margin-bottom: 15px;
  }

  .create-post .avatar {
    width: 40px;
    height: 40px;
  }

  .create-post input {
    height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .create-post button {
    font-size: 19px;
  }

  .stories {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding: 2px 1px 12px;
    margin-bottom: 12px;
  }

  .story {
    flex: 0 0 112px;
    height: 175px;
    border-radius: 16px;
  }

  .story:nth-child(6) {
    display: block;
  }

  .story-avatar {
    width: 39px;
    height: 39px;
    top: 9px;
    left: 9px;
  }

  .story h3 {
    font-size: 13px;
  }

  .post {
    border-radius: 12px;
  }

  .post-header {
    padding: 12px;
  }

  .post-header .avatar {
    width: 42px;
    height: 42px;
  }

  .post-image {
    max-height: 75vh;
  }
}