.compete-wrap {
  width: 90%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 1rem;
  padding-bottom: 0;
  margin-bottom: 0;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .compete-wrap {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .compete-tiles {
    margin-bottom: 0;
  }

  /* Ensure no extra spacing after compete content */
  .compete-wrap + .site-footer {
    margin-top: 0 !important;
  }
}

.compete-header {
  text-align: center;
  margin-bottom: 2rem;
}

.compete-main-title {
  font-size: 72px;
  margin-bottom: 0;
}

.compete-image-container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  margin-bottom: 3rem;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .compete-image-container {
    margin-bottom: 1.5rem;
  }
}

.compete-header-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
}

.compete-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  position: relative;
}

.compete-tile {
  flex: 0 0 33.333%;
  min-width: 0;
  position: relative;
  background-color: #fff;
  border: none;
  display: flex;
  min-height: 200px;
}

/* Desktop: 3 tiles per row with internal borders */
.compete-tile:nth-child(3n + 1) {
  border-right: 1px solid #159fc4;
}

.compete-tile:nth-child(3n + 2) {
  border-right: 1px solid #159fc4;
}

.compete-tile:nth-child(-n + 3) {
  border-bottom: 1px solid #159fc4;
}

/* Ensure all tiles have right borders except the last in each row */
.compete-tile:not(:nth-child(3n)) {
  border-right: 1px solid #159fc4;
}

.compete-tile-link {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  width: 100%;
  transition: all 0.3s ease;
  gap: 1rem;
  justify-content: flex-start;
}

.compete-tile-link:hover {
  background-color: var(--bs-main-blue);
  text-decoration: none;
}

.compete-tile-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--bs-main-blue);
  margin-bottom: 0;
  transition: color 0.3s ease;
  flex-shrink: 0;
  align-self: flex-start;
  text-align: left;
  line-height: 1.2;
  max-width: 120px;
}

.compete-tile-link:hover .compete-tile-title {
  color: #fff;
}

.compete-tile-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-left: 0;
  text-align: right;
  margin-top: 1.5rem;
  align-items: flex-start;
}

.compete-tile-content p {
  font-size: 16px;
  color: #666;
  margin: 0;
  transition: color 0.3s ease;
  text-align: right;
}

.compete-tile-link:hover .compete-tile-content p {
  color: #e3f2fd;
}

/* Responsive adjustments for Compete page */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .compete-main-title {
    font-size: 48px;
  }

  /* Tablet: 2 tiles per row with complete borders */
  .compete-tile {
    flex: 0 0 50%;
    min-height: auto;
    border: 1px solid #159fc4;
  }

  /* Remove bottom border from first 4 tiles (top 2 rows) */
  .compete-tile:nth-child(-n + 4) {
    border-bottom: none;
  }

  /* Ensure all tiles have right borders - override the even tile rule for last row */
  .compete-tile:nth-child(5) {
    border-right: 1px solid #159fc4 !important;
  }

  .compete-tile-link {
    padding: 1.5rem 1rem;
    justify-content: flex-start;
  }

  .compete-tile-title {
    font-size: 20px;
    max-width: 120px;
    text-align: left;
  }

  .compete-tile-content {
    text-align: left;
    margin-top: 1rem;
  }

  .compete-tile-content p {
    font-size: 14px;
    text-align: left;
  }
}

@media (max-width: 767.98px) {
  .compete-main-title {
    font-size: 36px;
  }

  .compete-tile {
    flex: 0 0 100%;
    border: 1px solid #159fc4;
    min-height: auto;
  }

  .compete-tile:not(:last-child) {
    border-bottom: none;
  }

  .compete-tile-link {
    padding: 1.25rem 1rem;
    justify-content: flex-start;
  }

  .compete-tile-title {
    font-size: 18px;
    max-width: 90px;
    text-align: left;
  }

  .compete-tile-content {
    margin-left: 0;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .compete-tile-content p {
    font-size: 14px;
    text-align: left;
  }

  .compete-wrap {
    width: 90%;
  }
}
