/*
 * Reel News - News Feed Styling
 *
 * Developed by: Reel News team
 * Description: Defines the layout and appearance of the
 * vertically scrolling news feed and article cards.
 *
 * Team-developed functionality:
 * - Article card layout, typography, and positioning.
 * - Background image overlay for text readability.
 * - Responsive styling for smaller screens.
 * - Reel News category/button appearance, subject to
 *   attribution of any tutorial-derived styling.
 *
 * External code/references:
 * - Vertical scrolling and scroll-snapping behavior adapted
 *   from YouTube tutorials.
 *
 * External technologies:
 * - Standard CSS; no additional CSS libraries used in this file.
 */

#center {
  width: 100%;
  height: 100%;
}

.feed {
  height: 100svh;
  width: 100%;
  max-width: 1126px;
  margin-inline: auto;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;

  position: relative;
}

.feed-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;

  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
  font-size: 24px;

  z-index: 0;
  pointer-events: none;
}

.feed::-webkit-scrollbar {
  display: none;
}

.article-card {
  height: 100svh;
  width: min(90%, 900px);
  margin-inline: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr; /* top | middle | bottom */
}

/* Dark fade at the TOP so the white text is readable */
.article-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.85), transparent 60%);
}

.article-text {
  grid-row: 1;
  align-self: start;
  position: relative;
  z-index: 1;
  max-width: 750px;
  width: 100%;
  margin-inline: auto;
  padding: 60px 40px 0;
  color: white;
  text-align: center;
}

.article-text h1 {
  color: white;
  font-size: 36px;
  margin: 0 0 20px;
  line-height: 1.1;
}

.article-text p {
  font-size: 18px;
  line-height: 1.5;
}

.article-action {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  position: relative;
  z-index: 1;
}

.category {
  display: inline-block;
  background: #e63946;
  padding: 7px 12px;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
}

@media (max-width: 360px) {
  .article-card {
    width: 100%;
  }

  .article-text {
    padding: 48px 24px 0;
  }

  .article-text h1 {
    font-size: clamp(28px, 8vw, 36px);
  }
}