/* Background */

.background {
    width: 100%;
    min-height: auto;
    position: relative;
    overflow: hidden;
    padding-top: 40px;
    padding-bottom: 60px; /* garante respiro sobre o footer */
    background: url('../img/bg1.png') center / cover no-repeat;
    background-attachment: fixed;
}

.divisoria {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 10;
}

.divisoria hr {
    width: 100%;
    border: none;
    border-top: 2px solid #C0C0C0;
    margin: 0;
}

.box {
    position: relative;
    display: block;
    padding: 0 16px;
}

.box-img {
    position: relative;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(2, 360px);
    /* grid-template-columns: repeat(2, minmax(320px, 1fr)); max-width: 880px; */
    justify-content: center;
    justify-items: center;
    align-content: start;
    gap: 40px; /* espaço entre os cards */
    padding: 40px 0;
    margin: 0 auto;
    background: none !important;
}

/* Raças */

.cardrace {
    position: relative;
    width: 360px;
    height: 460px;
    border-radius: 12px;
    padding: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    transition: 0.5s ease;
    color: white;
}

.cardrace.humano {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race1.png') center/cover no-repeat;
}

.cardrace.elfo {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race2.png') center/cover no-repeat;
}

.cardrace.drow {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race3.png') center/cover no-repeat;
}

.cardrace.tiefling {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race4.png') center/cover no-repeat;
}

.cardrace.anao {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race5.png') center/cover no-repeat;
}

.cardrace.orc {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race6.png') center/cover no-repeat;
}

.cardrace.aasimar {
    background: 
    linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('../img/race7.png') center/cover no-repeat;
}

.cardrace::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.5;
    transition: 0.3s ease;
}

.cardrace:hover::after {
    opacity: 0.25;
}

.cardrace::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45); /* escurece a imagem */
  z-index: 1;
}

.cardHeader {
    text-transform: uppercase;
    position: relative;
    width: 100%;
    text-align: center;
    font-weight: bold;
    transition: all 0.5s ease;
    margin: 0 auto;
}

.cardHeader::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    width: 60%; /* tamanho da linha */
    height: 3px;
    background: aqua;
    opacity: 0;
}

.details {
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transform: translateY(70%);
    transition: all 0.5s ease;
}

.cardrace:hover .details {
    transform: translateY(0%);
    transition-delay: 0.5s;
}

.cardrace:hover .cardHeader::after {
    transition: 0.5s ease;
    opacity: 1;
}

.cardrace:hover {
    transform: scale(1.06);
    border-radius: 15px;
}

.cardText {
    line-height: 1.4;
    font-size: 0.975rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;  /* animação suave */
    margin-top: 10px;
}

.cardrace:hover .cardText {
    opacity: 1; 
    max-height: 300px;          /* altura suficiente para mostrar o texto */
    transition-delay: 0.3s;     /* aparece um pouco depois do movimento */
}

/* Resolucao */

@media (max-width: 768px) {
    .box-img {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 24px 0;
    }

    .cardrace {
        width: 92vw;  
        max-width: 480px;  
        height: auto;   
        min-height: 420px; 
    }
}