/* Shared styles for archive magazine issues */

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: #111;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

form { margin: 0; padding: 0; }


img { display: block; }
td img { vertical-align: top; }

/* ---- Sticky nav bar ---- */
.page-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #222;
    border-bottom: 1px solid #333;
    padding: 8px 16px;
    min-height: 44px;
}

.page-nav a, .page-nav span {
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}

.nav-prev, .nav-next {
    min-width: 80px;
    color: #aaa;
    font-weight: 500;
    transition: color 0.15s;
}

a.nav-prev:hover, a.nav-next:hover {
    color: #fff;
}

.nav-next { text-align: right; }

.nav-report {
    color: #fff;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    background: #922;
    border: 1px solid #a33;
    border-radius: 4px;
    padding: 3px 8px;
    margin-right: 12px;
}
.nav-report:hover { background: #b33; border-color: #c44; }

.nav-center {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-home {
    color: #7ab;
    font-weight: 500;
    text-decoration: none;
}
.nav-home:hover { color: #adf; }

.nav-sep { color: #555; }

.nav-issue {
    color: #999;
    font-size: 13px;
}

.nav-center select {
    background: #333;
    color: #ddd;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    max-width: 240px;
    cursor: pointer;
}

.nav-center select:hover {
    border-color: #777;
}

/* ---- Page wrapper ---- */
.page-wrap {
    max-width: 100%;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.logo {
    margin-bottom: 10px;
    filter: invert(1);
    max-width: 400px;
    height: auto;
}

.page-content {
    border: 2px solid #000;
    background: #fff;
    color: #000;
    line-height: 1.3;
    font-size: 12px;
}

/* Line break replacements */
.nl {
    height: 0;
}
.sp {
    height: 14px;
}

/* ---- Template content fixes ---- */

/* Padding for columns content inside background TDs */
td[background] > table {
    margin: 15px auto 0 auto;
    padding: 0 10px;
}

td[background] > table td a img {
    display: block;
    margin: 0 auto;
    border: 1px solid #000;
}

/* ---- Image modal overlay ---- */
#img-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

#img-modal-overlay.active {
    display: flex;
}

#img-modal-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* ---- Responsive ---- */
@media (max-width: 700px) {
    .page-nav {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 10px;
    }

    .nav-prev, .nav-next {
        min-width: auto;
        font-size: 13px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .logo {
        max-width: 100%;
        height: auto;
    }

    .page-content {
        max-width: 100vw;
        overflow-x: auto;
    }
}
