/* ==========================================================
   Home page - template gallery
   ----------------------------------------------------------
   1. Header
   2. Template grid
   3. Template card
   4. Footer
   5. Motion
   ========================================================== */


/* ---------- 1. Header ---------- */

.hero {
  position: relative;
  padding: 56px 20px 32px;
  text-align: center;
}

.btn--icon {
  display: inline-grid;
  width: 44px;
  min-height: 44px;
  padding: 8px;
  place-items: center;
}

.btn--icon svg {
  width: 20px;
  height: 20px;
}

.home-account-action,
.home-logout {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  margin: 0;
}

.home-account-action {
  padding: 10px 18px;
}

.home-nav {
  position: absolute;
  top: 24px;
  left: 20px;
  z-index: 3;
  display: flex;
  gap: 18px;
}

.home-nav a {
  color: var(--ac);
  font-weight: bold;
  text-decoration: none;
}

.home-nav a:hover,
.home-nav a:focus-visible {
  text-decoration: underline;
}

.home-logout__message {
  position: absolute;
  top: 60px;
  right: 16px;
  z-index: 2;
  max-width: min(80vw, 320px);
  margin: 0;
  color: var(--ac);
  font-size: 0.85rem;
  text-align: right;
}

.hero__emoji {
  font-size: clamp(3rem, 14vw, 4.5rem);
  animation: float 3s ease-in-out infinite;
}

@media (max-width: 520px) {
  .home-nav {
    top: 76px;
    left: 0;
    right: 0;
    justify-content: center;
  }

  .hero {
    padding-top: 118px;
  }
}

.hero__title {
  margin: 0.2em 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  background: linear-gradient(90deg, #ff4d8d, #ffb703, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
}

.home-seo-copy {
  width: min(calc(100% - 40px), 760px);
  margin: 0 auto;
  padding: 0 0 12px;
  text-align: center;
}

.home-seo-copy h2 {
  margin: 0 0 8px;
  color: var(--ac);
  font-size: clamp(1.25rem, 4vw, 1.7rem);
}

.home-seo-copy p {
  margin: 0;
  color: var(--muted);
}

.subscription-status {
  width: min(calc(100% - 32px), 960px);
  margin: 0 auto 16px;
  padding: 16px 20px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.subscription-status p {
  margin: 0;
}

.subscription-status .btn {
  margin-top: 10px;
}


/* ---------- 2. Template grid ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;

  max-width: 1000px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}


/* ---------- 3. Template card ---------- */

.template {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;

  background: linear-gradient(145deg, var(--c1), var(--c2));
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s, box-shadow 0.25s;
}

.template:hover,
.template:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.template__emoji {
  font-size: 3.6rem;
}

.template__name {
  margin: 0.3em 0 0.1em;
  font-size: 1.4rem;
}

.template__tagline {
  margin: 0 0 14px;
  font-size: 0.95rem;
  opacity: 0.92;
}

.template__cta {
  padding: 8px 18px;

  background: rgba(255, 255, 255, 0.25);
  font-weight: bold;
  border-radius: 999px;
}


/* ---------- 4. Footer ---------- */

.footer {
  padding: 0 20px 32px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer p {
  margin: 0 0 8px;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__links a {
  color: var(--ac);
}


/* ---------- 5. Motion ---------- */

@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__emoji {
    animation: none;
  }

  .template {
    transition: none;
  }
}
