/* Landing cards reused on parkrun event pages: prints, how it works, challenge tracker. */

/* lines 2477-2686 from landing.css */
/* Image Reveal Section */
.image-reveal-section {
  padding: 4rem 0;
  background: var(--background);
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-reveal-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.image-reveal-card {
  background: var(--background-light);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  overflow: clip;
}

.image-reveal-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.image-reveal-animation {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cover-image-wrapper {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cover-image {
  position: relative;
  width: 100%;
  max-height: 350px;
  border-radius: 10px;
  overflow: hidden;
  will-change: clip-path;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Initial state - clipped from right with visible wave edge */
  /* Wave will be animated via JavaScript */
  clip-path: polygon(
    100% 0%,
    90% 0%,
    88% 2%,
    85% 5%,
    88% 10%,
    90% 15%,
    88% 20%,
    85% 25%,
    88% 30%,
    90% 35%,
    88% 40%,
    85% 45%,
    88% 50%,
    90% 55%,
    88% 60%,
    85% 65%,
    88% 70%,
    90% 75%,
    88% 80%,
    85% 85%,
    88% 90%,
    90% 95%,
    88% 98%,
    90% 100%,
    100% 100%
  );
}

.cover-image img {
  width: 100%;
  height: auto;
  min-height: 250px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
}

.image-reveal-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: left;
}

.image-reveal-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: left;
}

.image-reveal-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  text-align: justify;
}

.image-reveal-description code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--text-color);
}

/* Responsive adjustments for image reveal section */
@media (max-width: 968px) {
  .image-reveal-content-wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .image-reveal-text {
    text-align: left;
  }

  .image-reveal-heading {
    text-align: left;
  }

  .image-reveal-description {
    text-align: justify;
  }

  .image-reveal-card {
    min-height: auto;
  }
}

@media (min-width: 769px) and (max-width: 968px) {
  .cover-image img {
    width: 100%;
    height: auto;
    min-height: 250px;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .image-reveal-section {
    padding: 2rem 0;
  }

  .image-reveal-container {
    padding: 0 1rem;
  }

  .image-reveal-card {
    padding: 2rem 1.5rem;
  }

  .image-reveal-heading {
    font-size: 2rem;
  }

  .image-reveal-description {
    font-size: 1rem;
  }

  .cover-image img {
    width: 100%;
    height: 100px;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
  }
}

/* lines 2842-3116 from landing.css */
/* How It Works Section */
.how-it-works-section {
  padding: 2rem 0;
  background: var(--background);
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* min-height: 600px; */
}

.how-it-works-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.how-it-works-card {
  background: var(--background-light);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  position: relative;
  /* overflow: hidden; */
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.how-it-works-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.how-it-works-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.how-it-works-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.how-it-works-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.how-it-works-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature-text h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 0.25rem 0;
}

.feature-text p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.how-it-works-animation {
  position: absolute;
  height: 50vh;
  /* overflow: hidden; */
  clip-path: polygon(-50% -50%, 150% -50%, 150% 100%, -50% 100%);
  margin-inline: auto;
  margin-block-start: -5%;
  width: min(100%, 450px); /* Reduced width for less space between cards */
  bottom: -3rem;
  right: 0;
}

.animated-cards-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animated-card {
  position: absolute;
  width: 100%;
  max-width: 280px; /* Increased from 200px */
  height: 320px; /* Increased from 250px */
  background: var(--background-light); /* Solid background */
  border: 2px solid rgba(255, 162, 92, 0.4);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  /* Start below - will be animated by GSAP */
  transform: translate(0, 50%) rotate(0deg);
  transform-origin: bottom center; /* Rotate around bottom center */
  will-change: transform, opacity;
  pointer-events: auto; /* Ensure cards can be interacted with if needed */
  cursor: pointer; /* Show pointer cursor to indicate interactivity */
  transition: box-shadow 0.3s ease; /* Smooth shadow transition on hover */
}

.animated-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); /* Enhanced shadow on hover */
}

.card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem; /* Increased gap for better spacing */
  text-align: center;
  width: 100%;
  padding: 0.5rem; /* Add padding for better text spacing */
}

.card-icon {
  width: 70px; /* Increased from 60px */
  height: 70px; /* Increased from 60px */
  border-radius: 18px;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem; /* Increased from 1.75rem */
  box-shadow: 0 4px 12px rgba(255, 162, 92, 0.3);
}

.animated-card h4 {
  font-size: 1.35rem; /* Increased for better readability */
  font-weight: 700; /* Bolder for better contrast */
  color: var(--text-color);
  margin: 0 0 0.5rem 0; /* Add margin below heading */
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); /* Subtle shadow for readability */
}

.animated-card p {
  font-size: 1rem; /* Increased for better readability */
  color: var(--text-color); /* Changed from muted to full color for better contrast */
  margin: 0;
  line-height: 1.6;
  font-weight: 500; /* Slightly bolder */
}

/* Cards are all stacked in the same position and will rotate around bottom center */
.animated-card {
  left: 50%;
  /* GSAP will handle centering with xPercent: -50 */
  /* Cards will all be at the same position and rotate around bottom center */
}

.card-1 {
  z-index: 1;
}
.card-2 {
  z-index: 2;
}
.card-3 {
  z-index: 4;
}
.card-4 {
  z-index: 2;
}

/* Responsive adjustments for how it works section */

/* Mobile Responsive for How It Works */
@media (max-width: 968px) {
  .how-it-works-content-wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* Hide cards animation on tablet and mobile */
  .how-it-works-animation {
    display: none;
  }
}

@media (max-width: 768px) {
  .how-it-works-section {
    padding: 2rem 0;
    min-height: auto;
  }

  .how-it-works-container {
    padding: 0 1rem;
  }

  .how-it-works-card {
    padding: 2rem 1.5rem;
  }

  .how-it-works-heading {
    font-size: 2rem;
  }

  .how-it-works-description {
    font-size: 1rem;
  }

  /* Hide cards animation on mobile */
  .how-it-works-animation {
    display: none;
  }

  .feature-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .feature-text h3 {
    font-size: 1rem;
  }

  .feature-text p {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .how-it-works-steps {
    gap: 1rem;
  }

  .step-card {
    padding: 1.25rem;
  }
}

/* lines 3476-3804 from landing.css */
/* Infinite Scroll Tags Section */
.infinite-tags-section {
  padding: 4rem 0;
  background: var(--background);
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* overflow: hidden; */
}

.infinite-tags-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.infinite-tags-card {
  background: var(--background-light);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.infinite-tags-content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.infinite-tags-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: left;
}

.infinite-tags-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: left;
}

.infinite-tags-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  text-align: justify;
}

.landing-tracker-search-lead {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  text-align: left;
}

.landing-tracker-search-wrap {
  width: 100%;
  max-width: 28rem;
  align-self: flex-start;
}

.infinite-tags-text .landing-tracker-search-wrap .giant-search {
  width: 100%;
}

.infinite-tags-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-end;
}

.infinite-tags-features .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-direction: row-reverse;
}

.infinite-tags-features .feature-text {
  text-align: right;
}

.infinite-tags-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color) 0%, var(--color-alt) 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.125rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  align-self: center;
  margin-top: 1rem;
}

.infinite-tags-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.infinite-tags-cta:hover::before {
  left: 100%;
}

.infinite-tags-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.infinite-tags-cta:active {
  transform: translateY(0);
}

.cta-icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  display: inline-block;
  will-change: transform;
}

.infinite-tags-cta:not(:hover):not(:focus-visible) .cta-icon {
  animation: cta-arrow-nudge 3.2s ease-in-out infinite;
}

.infinite-tags-cta:hover .cta-icon {
  animation: none;
  transform: translateX(4px);
}

@keyframes cta-arrow-nudge {
  0%,
  62%,
  100% {
    transform: translateX(0);
  }
  70% {
    transform: translateX(6px);
  }
  78% {
    transform: translateX(0);
  }
  86% {
    transform: translateX(6px);
  }
  94% {
    transform: translateX(0);
  }
}

.infinite-tags-animation {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.infinite-tags-animation .fade {
  background: linear-gradient(
    90deg,
    var(--background-light) 0%,
    var(--background-light) 10%,
    transparent 20%,
    transparent 80%,
    var(--background-light) 90%,
    var(--background-light) 100%
  );
}

.tag-list {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 1rem 0;
  position: relative;
  padding: 1.5rem 0;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
}

.tag-list::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--background-light) 0%,
    var(--background-light) 10%,
    transparent 20%,
    transparent 80%,
    var(--background-light) 90%,
    var(--background-light) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.loop-slider {
  width: 100%;
}

.loop-slider .inner {
  display: flex;
  width: fit-content;
  animation-name: loop;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: var(--direction);
  animation-duration: var(--duration);
}

.tag {
  display: flex;
  align-items: center;
  gap: 0 0.5rem;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--background-light);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.4rem;
  padding: 0.7rem 1rem;
  margin-right: 1rem; /* Must use margin-right instead of gap for the loop to be smooth */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
}

.tag-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.tag span {
  font-size: 1.2rem;
  color: var(--color);
  font-weight: 600;
  opacity: 0.8;
}

.fade {
  pointer-events: none;
  background: linear-gradient(
    90deg,
    var(--background-light) 0%,
    var(--background-light) 10%,
    transparent 20%,
    transparent 80%,
    var(--background-light) 90%,
    var(--background-light) 100%
  );
  position: absolute;
  inset: 0;
  z-index: 10;
}

@keyframes loop {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 968px) {
  .infinite-tags-content-wrapper {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .infinite-tags-text {
    text-align: left;
  }

  .infinite-tags-heading {
    text-align: left;
  }

  .infinite-tags-description {
    text-align: justify;
  }

  .infinite-tags-features {
    align-items: flex-start;
  }

  .infinite-tags-features .feature-item {
    flex-direction: row;
  }

  .infinite-tags-features .feature-text {
    text-align: left;
  }

  .infinite-tags-cta {
    align-self: center;
  }

  /* .infinite-tags-animation {
    height: 400px;
  } */

  .infinite-tags-card {
    min-height: 500px;
  }
}

/* Medium screens: show 3 rows, no rotation */
@media (min-width: 768px) and (max-width: 967px) {
  /* Hide all loop-sliders except the first 3 on medium screens */
  .tag-list .loop-slider:nth-child(n + 4) {
    display: none;
  }
}

@media (max-width: 768px) {
  .infinite-tags-section {
    padding: 2rem 0;
  }

  .infinite-tags-card {
    min-height: auto;
    padding: 2rem 1.5rem;
  }

  /* .infinite-tags-animation {
    height: 300px;
  } */

  .infinite-tags-container {
    padding: 0 1rem;
  }

  .infinite-tags-card {
    padding: 2rem 1.5rem;
  }

  .infinite-tags-heading {
    font-size: 2rem;
  }

  .infinite-tags-description {
    font-size: 1rem;
  }

  .infinite-tags-cta {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .tag-list {
    max-width: 95vw;
    gap: 0.75rem 0;
    padding: 1rem 0;
  }

  /* Hide all loop-sliders except the first 2 on mobile */
  .tag-list .loop-slider:nth-child(n + 3) {
    display: none;
  }

  .tag {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }

  .tag span {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .infinite-tags-cta .cta-icon {
    animation: none !important;
  }
}
