.cv-download {
  background-color: #f89899;
  border: 2px solid #FFFFFF;
  border-radius: 30px;
  box-shadow: #1a001a 4px 4px 0 0;
  color: #1a001a;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
  font-size: 18px;
  padding: 0 18px;
  line-height: 50px;
  text-align: center;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  font-family: Satoshi, Arial, sans-serif;
  transition: color 0.3s ease, background-color 0.3s ease;
  position: relative; /* ensure button itself is on top */
  z-index: 2;
  margin-bottom: 4rem;
}

#cv {
  display: flex;
  flex-direction: column;
  align-items: center; /* centres horizontally */
}

/* layout container */
.certs {
  width: 100%;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
  box-sizing: border-box;
  z-index: 2;
}

/* badge list */
.certs-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* each list item provides a sizing context for the iframe */
.certs-content li {
  flex: 0 0 auto;
  width: 320px;            /* make each card wide enough to show full text */
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 2;
}

/* the element that Credly replaces - give it full width inside the li */
.certs-content div[data-share-badge-id] {
  width: 100%;
}

/* force the iframe element itself to use the li width (important) */
.certs-content iframe {
  width: 100% !important;
  height: 270px !important;
  min-height: 270px;
  border: none;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.certs-content iframe:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* responsive */
@media (max-width: 800px) {
  .certs-content li { width: 280px; }
}
@media (max-width: 600px) {
  .certs-content { gap: 1rem; }
  .certs-content li { width: 100%; max-width: 420px; }
  .certs-content iframe { height: auto !important; min-height: 200px; }
}

/* Responsive iframe container using aspect ratio technique */
.pdf-container {
  position: relative;
  width: 100%;
  max-width: 800px; /* Maximum width for desktop */
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Create responsive aspect ratio */
.pdf-container::before {
  content: "";
  display: block;
  padding-top: 75%; /* 4:3 aspect ratio (height = 75% of width) */
}

.pdf-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  z-index: 2;
}

/* Mobile optimizations */
@media (max-width: 992px) {
  #cv {
    padding: 3rem 1rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-subtitle {
    font-size: 1.1rem;
  }
  
  .pdf-container {
    max-width: 95vw;
  }
  
  /* Adjust aspect ratio for mobile - make it taller */
  .pdf-container::before {
    padding-top: 120%; /* Taller aspect ratio for mobile viewing */
  }
}

@media (max-width: 768px) {
  #cv {
    padding: 2rem 0.5rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .pdf-container {
    max-width: 98vw;
    border-radius: 8px;
  }
  
  .pdf-container iframe {
    border-radius: 8px;
  }
  
  /* Even taller for small screens */
  .pdf-container::before {
    padding-top: 140%;
  }
}

@media (max-width: 576px) {
  #cv {
    padding: 1.5rem 0.25rem;
  }
  
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
  }
  
  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  
  .pdf-container {
    border-radius: 6px;
  }
  
  .pdf-container iframe {
    border-radius: 6px;
  }
  
  /* Maximum height for very small screens */
  .pdf-container::before {
    padding-top: 150%;
  }
}

/* Alternative: Fixed height approach for very small screens */
@media (max-width: 480px) {
  .pdf-container::before {
    display: none; /* Remove aspect ratio */
  }
  
  .pdf-container {
    height: 60vh; /* Fixed height based on viewport */
    min-height: 400px;
  }
  
  .pdf-container iframe {
    position: static; /* Remove absolute positioning */
    width: 100%;
    height: 100%;
  }
}