/* WRITINGS PAGE STYLES */
.writing-page {
  font-family: Georgia, serif;
  background-color: #f7f6fb;
  color: purple;
}

/* Container */
.writing-page .contain {
  width: 60%;
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 0;
}

/* Heading */
.writing-page h1 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 50px;
}

/* Story Row */
.story-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Story Previews */
.story-preview {
  flex: 1 1 48%;
  cursor: pointer;
  transition: transform 0.2s;
  margin-bottom: 20px;
  max-width: 600px;
  border: 5px;
  border-radius: 10px;
  background: #fff;
  transition: box-shadow 0.3s, transform 0.2s;
}

.story-preview:hover {
  color: violet;
  transform: translateY(-5px);
  box-shadow: 5px 6px 18px violet;
  transform: translateY(-2px);
  
}

.story-title {
  font-weight: bold;
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.story-text {
  font-size: 1.2rem;
  line-height: 1.8;
}

.click-hint {
  font-size: 0.9rem;
  color: gray;
  margin-top: 5px;
}

.preview-img {
  width: 100%;
  display: block;
  margin-bottom: 10px;
}

/* Full Story Page */
.full-story {
  display: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}


#story-title {
  font-weight: bold;
  font-size: 2rem;
  margin-bottom: 30px;
}

#story-text {
  font-size: 1.2rem;
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: left;
}

.back {
  margin-top: 50px;
  cursor: pointer;
  font-size: 1rem;
  color: gray;
}

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

/* Fade-in animation for previews on load */
.fade {
  opacity: 0;
  animation: fadeIn 0.8s forwards;
}

.story-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  margin: 24px 0;
}
.preview-image {
  max-width: 600px;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  margin: 24px 0;
}

/* Media Queries */
@media (max-width: 700px) {
  .story-preview {
    flex: 1 1 100%;
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ===== PREVIEW PAGE ONLY (override centering) ===== */
.preview-layout {
  width: 90% !important;
  max-width: 1200px !important;
  margin: 0 auto;
}

/* Keep stories side by side */
.preview-layout .story-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

/* Preview images */
.preview-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}
.preview-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Two per row */
.preview-layout .story-preview {
  flex: 1 1 calc(50% - 20px);
  margin-bottom: 20px;
}


/* Mobile fallback */
@media (max-width: 900px) {
  .preview-layout .story-preview {
    flex: 1 1 100%;
  }


.full-story {
  display: none;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  max-width: fit-content;
}


/* MOBILE ADJUSTMENTS FOR FULL STORY ONLY */
 /* keep your existing max-width */
  #full-story {
    text-align: left;    /* align text to the left */ 
  }

  #full-story.full-story .contain {
    width: 100%;       /* take full width */
    max-width: 100%;   /* remove max-width limit */
    margin: 0;         /* remove centering */
    padding: 20px;     /* optional padding */
  }


  #story-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
  }

  #story-text {
    font-size: 1rem;
    line-height: 1.6;
  }

  .story-img {
    width: 100%;
    height: auto;        /* scale images properly */
  }

  .back {
    margin-top: 30px;
    font-size: 0.95rem;
  }
}

