:root {
  --primary: #8ecf4f;
  --bg: #c1e1cc57;
  --card: #ffffff;
  --text: #07203b;
  --muted: #5d7b98;
  --border: rgba(142, 207, 79, 0.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: var(--bg); color: var(--text); line-height: 1.6; }

header { text-align: center; padding: 3rem 1rem 1.25rem; background: linear-gradient(180deg, #f2fbff 0%, #ffffff 100%); }
header h1 { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.5rem; }
header p { color: var(--muted); font-size: 1.1rem; }

.site-logo {
  display: block;
  margin: 0 auto 0.9rem;
  max-width: 320px;
  width: 100%;
  height: auto;
}

main { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem; }

h2 { font-size: 1.5rem; margin-bottom: 1rem; }

/* Weekly Runs Grid */
.runs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.runs-carousel .runs-grid {
  display: flex;
  gap: 1rem;
  margin-top: 8px;

}

.carousel-section .runs-grid {
  margin-bottom: 8px;
}

.run-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border-top: 4px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.run-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.run-card .tag {
  display: inline-block;
  background: rgba(142, 207, 79, 0.16);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.runs-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* Photo carousel should mirror runs carousel styles and behavior */
.photo-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.photo-track-wrapper {
  overflow: hidden;
  width: 100%;
}

.carousel-track-wrapper {
  overflow: hidden;
  width: 100%;
}

.photo-track-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  min-height: 420px;
}

.photo-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.35s ease;
}

.photo-track.fade-mode {
  display: block;
  position: relative;
  width: 100%;
  min-height: 420px;
}

.photo-track.fade-mode .photo-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.65s ease;
  pointer-events: none;
}

.photo-track.fade-mode .photo-slide.active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.photo-track.fade-mode .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.photo-slide {
  width: 100%;
  max-width: 100%;
  min-height: 320px;
  flex: 0 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
}

.photo-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Enable JS swipe handling and a grab cursor for carousels */
.carousel-track-wrapper,
.photo-track-wrapper {
  touch-action: pan-y;
  cursor: grab;
}

.carousel-track-wrapper:focus,
.photo-track-wrapper:focus {
  outline: none;
}

.carousel-track-wrapper:active,
.photo-track-wrapper:active {
  cursor: grabbing;
}

.photo-carousel-caption {
  margin-top: 1rem;
  text-align: center;
}

.photos-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.carousel-track-wrapper .runs-grid {
  transition: transform 0.35s ease;
}

.carousel-button {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-button:hover {
  background: rgba(142, 207, 79, 0.1);
  transform: translateY(-1px);
}

.carousel-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.runs-carousel .run-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.runs-carousel .run-card:not(.active) {
  opacity: 0.85;
}

.runs-carousel .run-card.active {

  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.18);
}

@media (max-width: 900px) {
  .runs-carousel .run-card {
    min-width: 80vw;
    max-width: 80vw;
  }
}

@media (max-width: 600px) {
  .runs-carousel {
    gap: 0.75rem;
  }

  .carousel-button {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .runs-carousel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: start;
  }

  .carousel-track-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .carousel-button {
    width: calc(50% - 0.5rem);
    max-width: 220px;
    justify-content: center;
    margin: 0;
    grid-row: 2;
  }

  .carousel-button.prev {
    grid-column: 1;
  }

  .carousel-button.next {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .runs-carousel {
    gap: 0.75rem;
  }

  .carousel-button {
    width: calc(50% - 0.5rem);
    max-width: none;
  }

  .shop-iframe-container {
    padding-bottom: 65%;
  }
}

/* Mirror mobile button layout for photo carousel */
@media (max-width: 860px) {
  .photo-carousel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: start;
  }

  .photo-track-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .photo-carousel .carousel-button {
    width: calc(50% - 0.5rem);
    max-width: 220px;
    justify-content: center;
    margin: 0;
    grid-row: 2;
  }

  .photo-carousel .carousel-button.prev {
    grid-column: 1;
  }

  .photo-carousel .carousel-button.next {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .photo-carousel {
    gap: 0.75rem;
  }

  .photo-carousel .carousel-button {
    width: calc(50% - 0.5rem);
    max-width: none;
  }
}

.runs-carousel .run-card {
  min-width: 280px;
  flex: 0 0 auto;
}

.run-card li {
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.run-card li strong {
  color: var(--text);
}

/* Google Calendar Section */
.schedule-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

.strava-route-embed {
  margin-top: 1.5rem;
}

#strava-routes-section p {
  margin-bottom: 0.75rem;
}

/* Responsive Google Calendar Container */
.calendar-container {
  position: relative;
  padding-bottom: 75%; /* Aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.calendar-hint {
  display: none;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.route-select-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* route-select-label removed (unused) */

.other-runs-list,
.social-links {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
}

.other-runs-list li,
.social-links li {
  margin-bottom: 0.75rem;
}

.other-runs-list a,
.social-links a,
.shop-section a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.other-runs-list a:hover,
.social-links a:hover,
.shop-section a:hover {
  text-decoration: underline;
}

.contact-section h2 {
  margin-bottom: 1rem;
  color: var(--text);
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
}

.contact-description {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.email-link {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  background: rgba(142, 207, 79, 0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  width: fit-content;
}

.email-link:hover {
  background: rgba(142, 207, 79, 0.2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.contact-socials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 700px) {
  .contact-socials {
    grid-template-columns: 1fr;
  }
  
  .contact-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .calendar-hint {
    display: block;
  }
}

.route-select {
  min-width: 220px;
  width: 320px;
  max-width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid var(--primary);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(142, 207, 79, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.route-select:hover {
  box-shadow: 0 6px 16px rgba(142, 207, 79, 0.3);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.route-select:focus {
  outline: none;
  box-shadow: 0 6px 20px rgba(142, 207, 79, 0.4);
  border-color: var(--primary);
}

.calendar-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.shop-iframe-container {
  position: relative;
  padding-bottom: 75%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.shop-iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


.strava-section {
  margin-top: 2rem;
}

.strava-section {
  margin-top: 2rem;
}

.strava-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(255, 69, 0, 0.18), rgba(255, 69, 0, 0.06));
  border: 1px solid rgba(255, 69, 0, 0.25);
  border-radius: 12px;
}

.strava-card p {
  color: var(--muted);
  margin-top: 0.25rem;
}

.strava-button {
  display: inline-block;
  padding: 0.8rem 1rem;
  background: #fc4c02;
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.strava-embed {
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
  padding: 0.75rem;
}

.strava-embed iframe {
  width: 100%;
  min-height: 420px;
  border: 0;
  border-radius: 8px;
}
