/* --- 1. FONTTIEN TUONTI JA MUUTTUJAT --- */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Poppins:wght@300;400;600;700&family=Sanchez&family=Stack+Sans+Headline:wght@400;700&display=swap');

:root {
    --tex-yellow: #ffed00;
    --tex-dark: #1a1a1a;
    --tex-blue: #0056b3;
    --bg-light: #f4f7f9;
    --text-main: #2c3e50;
    --text-muted: #666666;
    --shadow-sm: 0 4px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.2);
    --radius: 12px;
}

/* --- 2. CATEGORY HERO (YLÄOSA) --- */
.category-hero {
    background: var(--bg-light);
    padding: 50px 20px;
    font-family: 'Poppins', sans-serif;
    border-radius: var(--radius);
}

.category-hero__wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Vasen sivupalkki */
.category-hero__sidebar {
    flex: 0 0 280px;
}

.hero-book-cover img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border-bottom: 5px solid var(--tex-yellow);
}

.hero-mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.mini-card {
    background: #fff;
    padding: 15px 10px;
    text-align: center;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.mini-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #888;
    margin-bottom: 5px;
}

.mini-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--tex-blue);
}

/* Oikea sisältöalue */
.category-hero__content {
    flex: 1;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.hero-title {
    font-family: "Sanchez", serif;
    font-size: 48px;
    color: var(--tex-dark);
    margin: 0 0 20px 0;
    line-height: 1.1;
}

/* Infokortit (Grid) */
.hero-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.detail-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid #eef2f7;
    transition: all 0.2s ease;
}

.detail-card:hover {
    border-color: var(--tex-yellow);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.detail-icon {
    font-size: 24px;
    margin-right: 15px;
    background: #f8f9fa;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.detail-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--tex-dark);
}

.full-width {
    grid-column: 1 / -1;
}

.hero-description {
    background: #fff;
    padding: 25px;
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 5px solid var(--tex-blue);
    line-height: 1.8;
    color: #444;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.03);
}

/* --- 3. JULKAISUKORTIT (WORK-CARD GRID) --- */
.sarjat-div, .works-grid {
    display: grid;
    /* Käytetään täsmälleen samaa leveyttä kuin tekijäsivulla (170px) */
   grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 20px;
    width: 100%;
}


.work-card-link {
    text-decoration: none;
    color: inherit;
}

.work-card {
    transition: transform 0.2s;
    margin-bottom: 20px;
}

.work-card:hover {
    transform: translateY(-5px);
}


.work-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; 
    overflow: hidden;
    border-radius: 4px;
    border:solid 2px #e0e0e0;
    background-color: #f0f0f0;
    flex-shrink: 0; /* Estää kuvaa pienenemästä, jos teksti vie tilaa */
}

.work-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.work-card:hover img {
    transform: scale(1.05);
}

/* Numero-overlay kuvan päällä */
.work-number {
    position: absolute;
    top: 5px;
    right: 5px;
    background: white;
    color: #000;
    border: 1px solid #ddd;
    font-weight: 700;
    font-size: 1.2rem;
    padding: 4px 10px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 5;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
 


.work-info h3 {
    font-weight: 700;
    color: #111;
    margin-top: 12px;
}

.work-card h3 {
    margin-bottom: 2px;
    font-size: 0.95rem;
}
/* Omistus-checkbox */


/* --- 4. SIVUNUMEROINTI (PAGINATION) --- */
.pagination {
    justify-content: center;
    flex-wrap: wrap;
    margin: 40px 0;
}

.pagination .page-link {
    background-color: #333333;
    color: #ffffff;
    border: 1px solid #444;
    margin: 0 3px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover,
.pagination .active > .page-link {
    background-color: var(--tex-blue);
    color: #fff;
    border-color: var(--tex-blue);
}

.pagination .active > .page-link {
    font-weight: bold;
}

.pagination .page-item.disabled .page-link {
    background-color: #222;
    color: #777;
    border-color: #444;
}

/* --- 5. RESPONSIIVISUUS --- */
@media (max-width: 900px) {
    .category-hero__wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .category-hero__sidebar {
        width: 100%;
        max-width: 300px;
    }
    .hero-title {
        font-size: 36px;
        text-align: center;
        margin-top: 20px;
    }
    .back-link {
        text-align: center;
    }
}

@media (max-width: 500px) {
    .sarjat-div {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 15px;
    }
    .hero-details-grid {
        grid-template-columns: 1fr;
    }
  
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 14px;
    }
    .hero-title {
        font-size: 28px;
    }
}

/* Mobiiliasettelu */
@media (max-width: 768px) {
    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* --- VUOSIKERTA / VOLUME PINO-TYYLI --- */
.vuosikerta_muokkaa {
    position: absolute;
    top: 5px;
    right: 5px; /* Tai left, jos oikealla on jo numero */
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #333;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}
/* --- CONTAINER --- */
.vuosikerta_muokkaa:hover {
    background: var(--tex-yellow);
    color: #000;
}

/* CONTAINER */
.volume-stack-container {
    width: 100%;
    max-width: 180px;
    margin: 20px auto;
}


/* CARD */
.work-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #ccc;

    box-shadow: 
       

        0 6px 0 -4px #e6e6e6,
        0 8px 0 -4px #dddddd,
        0 10px 0 -4px #d4d4d4,
        0 12px 0 -4px #cccccc,
        0 14px 0 -4px #c4c4c4,

        0 18px 25px rgba(0,0,0,0.25); /* syvempi varjo */
}
/* IMAGE */
.volume-img {
    display: block;
    width: 100%;
    height: auto;
}

/* YEAR BADGE */
.volume-year-badge {
    position: absolute;
    bottom: 15%;
    left: 0;
    width: 100%;

    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);

    text-align: center;
    padding: 6px 0;

    font-weight: 800;
    font-size: 1.5rem;

    z-index: 10;
}