/* ===== PERUS ===== */
body {
 font-family: 'Inter', sans-serif ;
    scroll-behavior: smooth;

}

/* ===== GRID ===== */
.sarjat-div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    justify-items: center;
}

/* ===== KORTTI ===== */
.kansikuva-card {
    width: 190px;
    position: relative;

    background: #fff;
    border-radius: 6px;
    overflow: hidden;

    border: 1px solid #e6e6e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);

    cursor: pointer;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kansikuva-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
/* animaation viive */
.kansikuva-card:nth-child(1) { animation-delay: 0.05s; }
.kansikuva-card:nth-child(2) { animation-delay: 0.1s; }
.kansikuva-card:nth-child(3) { animation-delay: 0.15s; }
.kansikuva-card:nth-child(4) { animation-delay: 0.2s; }

/* hover */
.kansikuva-card:hover {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* ===== KUVA ===== */
.img-wrapper {
    position: relative;
    overflow: hidden;
}

.sarja-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center top;

    display: block;

    transition: transform 0.3s ease;
}

.kansikuva-card:hover .sarja-img {
    transform: scale(1.05);
}

.kansikuva-card:hover .sarja-img {
    transform: scale(1.08);
    filter: brightness(1) contrast(1.1);
}

/* ===== OVERLAY ===== */
/* ===== OVERLAY ===== */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;           /* Varmista, että alkaa reunasta */
    width: 100%;
    padding: 20px 10px 10px; 
    
    /* Tämä luo tumman liukuvärin alareunaan */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 80%, rgba(0, 0, 0, 0.4) 80%, transparent 100%);
    
    z-index: 5;        /* Nostetaan varmuuden vuoksi päällimmäiseksi */
    pointer-events: none; /* Estää overlayta häiritsemästä klikkaamista */
}

/* ===== TEKSTI ===== */
.sarja-otsikko {
    color: #ffffff !important; /* Pakotetaan valkoiseksi */
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    display: block;    /* Varmistetaan että vie tilan */
}


/* ===== SHINE EFEKTI ===== */
.kansikuva-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );

    transition: 0.6s;
    z-index: 2;
}

.kansikuva-card:hover::after {
    left: 100%;
}

/* ===== PINO-EFEKTI ===== */
.kansikuva-card::before {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 5px;
    width: calc(100% - 10px);
    height: 8px;

    background: #f0f0f0;
    border-radius: 0 0 6px 6px;
    z-index: -1;
}

/* ===== ADMIN NAPPI ===== */
.vuosikerta_muokkaa {
    position: absolute;
    top: 10px;
    right: 10px;

    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);

    padding: 6px 8px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;

    opacity: 0;
    transition: 0.2s;
}

.kansikuva-card:hover .vuosikerta_muokkaa {
    opacity: 1;
}

.vuosikerta_muokkaa:hover {
    transform: scale(1.1);
    background: #fff;
}

/* ===== LINKKI ===== */
.sarja-linkki {
    text-decoration: none;
    color: inherit;
}

/* ===== LIPUT ===== */
.flag-icon {
    width: 35px;
    height: 25px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* ===== DROPDOWN ===== */
#dropdownButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 8px 15px;
    border-radius: 20px;
    background: #fff !important;
    border: 1px solid #ddd;

    transition: all 0.2s ease;
}

#dropdownButton:hover {
    background: #f5f5f5 !important;
}

/* ===== LINKIT ===== */
.back {
    text-decoration: none;
    color: #555;
    transition: 0.2s;
}

.back:hover {
    color: #000;
}

/* ===== ANIMAATIO ===== */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MOBIILI ===== */
@media (max-width: 600px) {
    .sarjat-div {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .kansikuva-card {
         width: 140px;
    }

    .sarja-img {
        height: 190px;
    }

  
}