/**
 * UI Components CSS for Refu in English
 * Hero, Category Filters, Cards Grid, Popular Section, Newsletter Banner
 */

/* Category Badges */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--refu-radius-sm);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: fit-content;
  transition: opacity var(--refu-transition-fast);
}

.category-badge.cat-international,
.category-badge.cat-lifestyle,
.category-badge.cat-default {
  background-color: var(--refu-purple-primary);
  color: #FFFFFF;
}

.category-badge.cat-animals,
.category-badge.cat-relationships,
.category-badge.cat-money-profit {
  background-color: var(--refu-lime-accent);
  color: #18181B;
}

.category-badge:hover {
  opacity: 0.9;
}

/* Post Meta (Author, Date, Reading Time) */
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--refu-color-text-muted);
}

.post-meta-bullet {
  color: var(--refu-color-text-light);
}

/* ==========================================================================
   1. HERO SECTION (Featured Article Top)
   ========================================================================== */
.hero-section {
  padding-top: 40px;
  padding-bottom: 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-content .category-badge {
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--refu-font-serif);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--refu-color-text-heading);
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.hero-title a:hover {
  color: var(--refu-purple-primary);
}

.hero-excerpt {
  font-size: 17px;
  line-height: 1.6;
  color: var(--refu-color-text-muted);
  margin-bottom: 28px;
  max-width: 90%;
}

.hero-meta {
  margin-bottom: 28px;
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--refu-color-text-heading);
  border-bottom: 2px solid var(--refu-lime-accent);
  padding-bottom: 4px;
  transition: all var(--refu-transition-fast);
}

.read-more-link .arrow {
  transition: transform var(--refu-transition-fast);
}

.read-more-link:hover {
  color: var(--refu-purple-primary);
  border-bottom-color: var(--refu-purple-primary);
}

.read-more-link:hover .arrow {
  transform: translateX(4px);
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: var(--refu-radius-lg);
  overflow: hidden;
  box-shadow: var(--refu-shadow-md);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-image-wrapper:hover img {
  transform: scale(1.03);
}

/* ==========================================================================
   2. CATEGORY FILTER PILLS BAR
   ========================================================================== */
.category-filter-section {
  padding-top: 16px;
  padding-bottom: 40px;
}

.category-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-pill {
  padding: 8px 24px;
  border-radius: var(--refu-radius-full);
  font-size: 14px;
  font-weight: 700;
  color: var(--refu-purple-primary);
  border: 1.5px solid var(--refu-purple-primary);
  background-color: transparent;
  transition: all var(--refu-transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.cat-pill:hover,
.cat-pill.is-active {
  background-color: var(--refu-purple-primary);
  color: #FFFFFF;
  border-color: var(--refu-purple-primary);
  box-shadow: var(--refu-shadow-sm);
}

/* ==========================================================================
   3. MAIN CONTENT CARDS GRID
   ========================================================================== */
.posts-grid-section {
  padding-bottom: 64px;
}

.main-posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start !important; /* Prevents card height stretch blowout */
}

/* Big Left Featured Card */
.card-featured-large {
  display: flex;
  flex-direction: column;
  border-radius: var(--refu-radius-md);
  border: 1px solid var(--refu-color-border-light);
  overflow: hidden;
  background-color: var(--refu-color-bg-card);
  transition: transform var(--refu-transition-fast), box-shadow var(--refu-transition-fast);
  height: auto !important; /* Prevents white background from stretching down */
  align-self: start !important;
}

.card-featured-large:hover {
  transform: translateY(-4px);
  box-shadow: var(--refu-shadow-md);
}

.card-featured-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-featured-large:hover .card-featured-thumb img {
  transform: scale(1.04);
}

.card-featured-thumb .category-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
}

.card-featured-body {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-featured-body .post-title {
  font-family: var(--refu-font-serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--refu-color-text-heading);
  margin-bottom: 16px;
}

.card-featured-body .post-title a:hover {
  color: var(--refu-purple-primary);
}

/* Right 2x2 Grid */
.cards-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Uniform 3-Column Category Archive Grid */
.cards-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: start;
}

.card-standard {
  display: flex;
  flex-direction: column;
  border-radius: var(--refu-radius-md);
  border: 1px solid var(--refu-color-border-light);
  overflow: hidden;
  background-color: var(--refu-color-bg-card);
  transition: transform var(--refu-transition-fast), box-shadow var(--refu-transition-fast);
  height: 100%;
}

.card-standard:hover {
  transform: translateY(-3px);
  box-shadow: var(--refu-shadow-md);
}

.card-standard-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-standard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-standard:hover .card-standard-thumb img {
  transform: scale(1.04);
}

.card-standard-thumb .category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.card-standard-body {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.card-standard-body .post-title {
  font-family: var(--refu-font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--refu-color-text-heading);
  margin-bottom: 14px;
}

.card-standard-body .post-title a:hover {
  color: var(--refu-purple-primary);
}

/* ==========================================================================
   4. POPULAR THIS WEEK SECTION
   ========================================================================== */
.popular-section {
  padding-top: 32px;
  padding-bottom: 64px;
}

.popular-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.popular-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.popular-title {
  font-family: var(--refu-font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--refu-color-text-heading);
}

.popular-accent-line {
  width: 48px;
  height: 3px;
  background-color: var(--refu-lime-accent);
  border-radius: 2px;
}

.carousel-nav-btns {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--refu-purple-primary);
  color: var(--refu-purple-primary);
  transition: all var(--refu-transition-fast);
}

.carousel-btn:hover {
  background-color: var(--refu-purple-primary);
  color: #FFFFFF;
}

.popular-items-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.popular-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.popular-number-outline {
  font-family: var(--refu-font-serif);
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--refu-lime-accent);
  text-stroke: 1.5px var(--refu-lime-accent);
  user-select: none;
  flex-shrink: 0;
}

.popular-thumb-wrapper {
  width: 90px;
  height: 90px;
  border-radius: var(--refu-radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.popular-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popular-card-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popular-card-content .category-badge {
  font-size: 10px;
  padding: 2px 8px;
}

.popular-card-title {
  font-family: var(--refu-font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--refu-color-text-heading);
}

.popular-card-title a:hover {
  color: var(--refu-purple-primary);
}

/* ==========================================================================
   5. WEEKLY NEWSLETTER BANNER
   ========================================================================== */
.newsletter-section {
  padding-bottom: 64px;
}

.newsletter-banner {
  background-color: var(--refu-purple-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(203, 224, 45, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  border-radius: var(--refu-radius-lg);
  padding: 48px 56px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  box-shadow: var(--refu-shadow-purple);
  position: relative;
  overflow: hidden;
}

.newsletter-banner-left {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 50%;
}

.newsletter-icon-bulb {
  width: 56px;
  height: 56px;
  color: var(--refu-lime-accent);
  flex-shrink: 0;
}

.newsletter-headline {
  font-family: var(--refu-font-serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
}

.newsletter-banner-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  max-width: 520px;
}

.newsletter-banner-right p {
  font-size: 15px;
  color: #E2D5F0;
  line-height: 1.5;
}

.newsletter-form-row {
  display: flex;
  align-items: center;
  background-color: #FFFFFF;
  border-radius: var(--refu-radius-sm);
  padding: 4px;
}

.newsletter-form-row input[type="email"] {
  flex-grow: 1;
  border: none;
  outline: none;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--refu-color-text-heading);
}

.newsletter-form-row input[type="email"]::placeholder {
  color: var(--refu-color-text-muted);
}

.newsletter-submit-btn {
  background-color: var(--refu-lime-accent);
  color: #18181B;
  font-weight: 800;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--refu-radius-sm);
  transition: background-color var(--refu-transition-fast);
  white-space: nowrap;
}

.newsletter-submit-btn:hover {
  background-color: var(--refu-lime-hover);
}

/* Responsive Component Media Queries */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-title {
    font-size: 36px;
  }

  .main-posts-grid {
    grid-template-columns: 1fr;
  }

  .cards-archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .popular-items-row {
    grid-template-columns: 1fr 1fr;
  }

  .newsletter-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 36px;
  }

  .newsletter-banner-left {
    max-width: 100%;
  }

  .newsletter-banner-right {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cards-subgrid,
  .cards-archive-grid {
    grid-template-columns: 1fr;
  }

  .popular-items-row {
    grid-template-columns: 1fr;
  }

  .newsletter-form-row {
    flex-direction: column;
    background-color: transparent;
    gap: 10px;
    padding: 0;
  }

  .newsletter-form-row input[type="email"] {
    width: 100%;
    border-radius: var(--refu-radius-sm);
  }

  .newsletter-submit-btn {
    width: 100%;
  }
}
