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

body {
  background-color: #FAFAFA;
}

/* Wrapper for large screens */
.size-for-big-screens {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* Navbar */
nav div:first-child {
  background-color: #7c73e6;
  padding: 10px;
}

nav div:first-child h1 {
  font-family: sans-serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: 1px;
  color: white;
  margin-left: 10px;
}

nav div:last-child {
  background-color: white;
  padding: 8px;
}

/* Story grid */
.container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  padding: 20px;
}

.story-card-add-new-story {
  position: relative;
  overflow: hidden;
}

.story-card-add-new-story img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.story-card-add-new-story .overlay-text {
  position: absolute;
  top: 15px;
  left: 32px;
  right: 15px;
  color: black;
}

.story-card-add-new-story .overlay-text h2 {
  font-size: 30px;
  margin-top: 70px;
}

.story-card-add-new-story .overlay-text h3 {
  font-size: 18px;
  font-weight: normal;
}


.story-card {
  background-color: white;
  border-bottom: 2px solid #7c73e6;
  border-radius: 10px;
  min-height: 350px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.story-card:hover {
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
}

.story-card img {
  width: 100%;
  height: 240px;
  border-radius: 10px 10px 0 0;
  object-fit: cover;
  display: block;
}

.story-card h3 {
  font-family: sans-serif;
  font-size: 22px;
  margin: 5px 10px;
}

.story-card p {
  font-family: sans-serif;
  color: grey;
  margin: 5px 10px;
}

/* Metadata row (date left, author right) */
.story-meta {
  font-size: 12px;
  color: #666;
  margin: 10px;
  display: flex;
  justify-content: space-between;
}

.add-story-btn {
  background-color: #7c73e6;
  border-radius: 8px;
  padding: 10px 20px;
  color: white;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: background 0.3s ease;
}
.add-story-btn:hover {
  background-color: #958cf0;
}


/* Pagination */
.pagination {
  margin: 20px;
  text-align: center;
}

.pagination a {
  display: inline-block;
  padding: 10px 20px;
  background-color: #7c73e6;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  color: white;
  text-decoration: none;
  font-family: sans-serif;
  font-size: 20px;
  font-weight: 600;
  border-radius: 25px;
  margin: 0 5px;
}

.pagination a.active {
  background-color: white;
  color: #7c73e6;
  border: 1px solid #7c73e6;
}

.pagination a:hover:not(.active) {
  background-color: white;
  color: #7c73e6;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .container {
      grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  nav div:first-child h1 {
      text-align: center;
  }
  nav div:last-child {
      display: flex;
      justify-content: center;
  }
  .container {
      grid-template-columns: 1fr;
  }
  .story-card {
      min-height: auto;
  }
  .pagination a {
      padding: 6px 12px;
      font-size: 16px;
  }
}

@media (max-width: 500px) {
  .container {
      grid-template-columns: 1fr; /* 1 column for mobile */
  }
  .story-card {
      min-height: auto;
  }
  .pagination a {
      padding: 6px 12px;
      font-size: 16px;
  }
}