/* index.css */

/* ---- section alternating backgrounds ---- */
.bg-alt  { background: var(--BgAlt); }
.bg-white { background: var(--BgPage); }
.index-section { padding: 64px 0; }
.index-ad-wrap { padding-top: 16px; padding-bottom: 16px; }

/* ---- hero ---- */
.hero-section {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
  padding: 72px 0 64px;
  overflow: hidden;
  position: relative;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255,107,53,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-section__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.hero-section__content { flex: 1; max-width: 560px; }
.hero-section__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,107,53,0.12);
  color: var(--Theme);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero-section__title {
  font-family: var(--FontTitle);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--TextPrimary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero-section__desc {
  font-size: 17px;
  color: var(--TextSecondary);
  line-height: 1.6;
  margin-bottom: 32px;
}
.hero-section__btn { font-size: 16px; padding: 14px 32px; }
.hero-section__apps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}
.hero-app-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,107,53,0.15);
  border-radius: 12px;
  padding: 10px 16px;
  text-decoration: none;
  width: 220px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}
.hero-app-pill:hover {
  box-shadow: 0 4px 16px rgba(255,107,53,0.15);
  transform: translateX(4px);
}
.hero-app-pill__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}
.hero-app-pill__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--TextPrimary);
  max-width: 140px;
}

/* ---- app grids ---- */
.app-grid {
  display: grid;
  gap: 16px;
}
.app-grid > * { min-width: 0; }
.app-grid--3 { grid-template-columns: repeat(3, 1fr); }
.app-grid--4 { grid-template-columns: repeat(4, 1fr); }
.app-grid--5 { grid-template-columns: repeat(5, 1fr); }

/* compact card — tighter padding */
.app-card--compact { padding: 14px; overflow: hidden; }
.app-card--compact .app-card__top { margin-bottom: 0; min-width: 0; }
.app-card--compact .app-card__icon { width: 44px; height: 44px; border-radius: 10px; }
.app-card--compact .app-card__name { font-size: 13px; }

/* =========================================
   module-specific card variants
   ========================================= */

/* ② Productive Office & ⑨ Online — rich card (rating + downloads) */
.app-card--rich .app-card__top { margin-bottom: 0; }
.app-card--rich .app-card__metarow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--Border);
  min-height: 21px;
}
.app-card--rich .app-card__rating { margin-top: 0; }
.app-card__dl-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--TextSecondary);
  background: var(--BgAlt);
  border-radius: 8px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* ③ Highly Rated — rated card (orange rating badge) */
.app-card--rated .app-card__top { align-items: center; margin-bottom: 0; gap: 14px; }
.app-card--rated .app-card__icon { width: 60px; height: 60px; border-radius: 14px; }
.app-card__rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--ThemeGradient);
  border-radius: 20px;
  padding: 4px 10px;
}

/* ④ New User Exclusive — feature image card */
.app-card--feature {
  position: relative;
  padding: 0;
  aspect-ratio: 3 / 4;
  border: none;
}
.app-card__feature-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-card__feature-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.32) 45%, rgba(0,0,0,0) 75%);
}
.app-card__feature-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}
.app-card__feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: 20px;
  padding: 2px 8px;
}
.app-card__feature-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.app-card__feature-cat { font-size: 12px; color: rgba(255,255,255,0.82); }

/* ⑤ Nostalgic Classics — horizontal list card with Install button */
.app-card--list {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.app-card--list .app-card__icon { width: 56px; height: 56px; }
.app-card--list .app-card__info { display: flex; flex-direction: column; gap: 6px; }
.app-card__list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-card__list-meta .app-card__rating { margin-top: 0; }
.app-card__sep { width: 1px; height: 12px; background: var(--BorderMid); }
.app-card__get {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--Theme);
  border: 1.5px solid var(--Theme);
  border-radius: 20px;
  padding: 6px 18px;
  transition: background 0.2s ease, color 0.2s ease;
}
.app-card--list:hover .app-card__get {
  background: var(--ThemeGradient);
  color: #fff;
  border-color: transparent;
}

/* ⑥ App Types — centered tile with corner rating badge */
.app-card--tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 12px 16px;
}
.app-card--tile .app-card__icon { width: 56px; height: 56px; }
.app-card--tile .app-card__name { width: 100%; }
.app-card__tile-rating {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--ThemeGradient);
  border-radius: 20px;
  padding: 2px 8px;
}

/* ---- article grid ---- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ---- category grid ---- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-card {
  padding: 20px 12px;
  gap: 10px;
}
.cat-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--TextPrimary);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

/* ---- responsive ---- */
@media (max-width: 1199px) {
  .app-grid--5 { grid-template-columns: repeat(4, 1fr); }
  .article-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .hero-section__title { font-size: 36px; }
}
@media (max-width: 1023px) {
  .app-grid--4 { grid-template-columns: repeat(3, 1fr); }
  .hero-section__apps { display: none; }
}
@media (max-width: 767px) {
  .index-section { padding: 40px 0; }
  .hero-section { padding: 48px 0 40px; }
  .hero-section__inner { flex-direction: column; gap: 32px; }
  .hero-section__title { font-size: 28px; }
  .hero-section__desc { font-size: 15px; }
  .app-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .app-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .app-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(1, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-section__apps { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; width: 100%; }
  .hero-app-pill { width: calc(50% - 6px); }
  /* compact variants on mobile */
  .app-card--rated .app-card__top { flex-wrap: wrap; }
  .app-card--rated .app-card__icon { width: 48px; height: 48px; }
  .app-card--rated .app-card__info { flex: 1 1 calc(100% - 62px); }
  .app-card--rated .app-card__rating-badge { flex: 0 0 auto; }
  .app-card--list { padding: 12px; gap: 10px; }
  .app-card--list .app-card__icon { width: 46px; height: 46px; }
  .app-card--list .app-card__get { display: none; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
}
