/* static/custom-certificados.css */

.card {
  width: 220px;
  min-height: 320px;
  border-radius: 20px;
  background: #f5f5f5;
  position: relative;
  padding: 1.4rem 1rem 1.8rem 1rem;
  border: 2px solid #c3c6ce;
  transition: 0.4s cubic-bezier(.4,1.4,.3,1);
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-bottom: 1.2rem;
  box-sizing: border-box;
}

.card-details {
  color: black;
  height: 100%;
  gap: .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.card-button {
  transform: translate(-50%, 125%);
  width: 70%;
  border-radius: 1rem;
  border: none;
  background-color: #008bf8;
  color: #fff;
  font-size: 1rem;
  padding: .5rem 1rem;
  position: absolute;
  left: 50%;
  bottom: 0;
  opacity: 0;
  transition: 0.3s cubic-bezier(.4,1.4,.3,1);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 10px 0 rgba(0,0,0,0.09);
}

.text-body {
  color: rgb(134, 134, 134);
  text-align: center;
  font-size: 0.95em;
  margin-bottom: 0.3em;
}

.text-title {
  font-size: 1.07em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.15em;
}

.card:hover,
.card:focus-within {
  border-color: #008bf8;
  box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.22);
  z-index: 2;
}
.card:hover .card-button,
.card:focus-within .card-button {
  transform: translate(-50%, 50%);
  opacity: 1;
}

.card-details img {
  transition: transform 0.25s cubic-bezier(.4,2,.3,1), box-shadow 0.2s;
  border-radius: 12px;
}
.card:hover .card-details img,
.card:focus-within .card-details img {
  transform: scale(1.10);
  box-shadow: 0 6px 28px 0 rgba(0,0,0,0.18);
}

.dark .card {
  background: #222a35;
  border-color: #224466;
  transition: background 0.3s, border-color 0.3s;
}
.dark .card-details {
  color: #eee;
}
.card-button:focus {
  outline: 2px solid #008bf8;
  outline-offset: 2px;
}
.card-button:hover, .card-button:active {
  background-color: #2563eb;
}

/* Aumenta a área clicável do botão em mobile */
@media (hover: none) and (pointer: coarse) {
  .card-button {
    min-height: 44px;
  }
}

/* --- MELHORIAS PARA MOBILE --- */
@media (max-width: 640px) {
  .card {
    width: 95vw;
    min-width: 0;
    max-width: 330px;
    padding: 1rem 0.4rem 1.5rem 0.4rem;
    margin-bottom: 0.8rem;
  }
  .card-details img {
    width: 82vw !important;
    max-width: 220px;
    height: auto !important;
    min-height: 90px;
  }
  .text-title {
    font-size: 1em;
  }
  .text-body {
    font-size: 0.85em;
  }
  .card-button {
    font-size: 0.94em;
    padding: .45rem .8rem;
  }
}

/* --- MELHORIAS PARA TELAS MUITO PEQUENAS (EXTRAS) --- */
@media (max-width: 400px) {
  .card {
    min-height: 230px;
    padding: 0.6rem 0.2rem 1rem 0.2rem;
  }
  .card-details img {
    width: 95vw !important;
    max-width: 160px;
    min-height: 60px;
  }
}