/**
 * Tiedosto: assets/css/layout.css (Versio 2.2 - Aspect Ratio Fix)
 * Kuvaus: Korjattu lukijan asettelu.
 * TÄRKEÄÄ: object-fit: contain estää mainosten ja tekstin vääristymisen.
 */

/* --- PERUS ASETUKSET --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.app-header {
    background-color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: #0056b3;
    text-decoration: none;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* --- LUKIJA (FIXED) --- */

.reader-viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000; /* Musta tausta korostaa lehteä */
    z-index: 1;

    /* Keskitys */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.reader-canvas-container {
    /* Kontti ottaa kaiken tilan */
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.reader-canvas-container img {
    /* TÄMÄ ESTÄÄ VENYMISEN: */
    max-width: 100%;
    max-height: 100%;
    width: auto;     /* Automaattinen leveys suhteessa korkeuteen */
    height: auto;    /* Automaattinen korkeus suhteessa leveyteen */

    /* Varmistaa että kuva mahtuu ruutuun vääristymättä */
    object-fit: contain;

    display: block;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
