/* =========================================================================
 * SSM Archive — site-wide styles
 * Loaded by: /index.html, /features.html, /owner-profiles/**.html
 * NOT loaded by: /archive/<issue>/pages/*.html (those use /archive/css/archive.css)
 * ========================================================================= */

/* ---- Base / reset ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #fff;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Flipbook viewer host — opt-in via class on <body> (index.html only) */
body.flipbook-host {
    height: 100vh;
    overflow: hidden;
}

/* ---- Nostalgic banner (all pages) ---- */
.nostalgic-banner {
    width: 100%;
    background: url('/oldschoolright.jpg') repeat-x right top;
    background-size: auto 100%;
    display: flex;
    flex-shrink: 0;
    overflow: hidden;
}
.nostalgic-banner img { display: block; height: auto; width: auto; }

/* ---- Main index: issue selector (index.html only) ---- */
#issue-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow-y: auto;
    height: 100vh;
}
#issue-selector h1 {
    font-size: 28px;
    font-weight: 600;
    color: #222;
    letter-spacing: 2px;
    margin-bottom: 8px;
}
#issue-selector .subtitle {
    font-size: 20px;
    color: #555;
    margin-bottom: 40px;
    letter-spacing: 2px;
}

/* Main index: issue card grid */
.issues-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    max-width: 900px;
}
.issue-card {
    cursor: pointer;
    width: 180px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.issue-card:hover { transform: translateY(-4px); }
.issue-card img {
    width: 180px;
    height: 233px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
}
.issue-card:hover img {
    border-color: #999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.issue-card .issue-title {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}
.issue-card .issue-pages { font-size: 12px; color: #888; margin-top: 2px; }

/* Main index: about box */
.about-section {
    max-width: 800px;
    width: calc(100% - 40px);
    margin-bottom: 20px;
    padding: 14px 24px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.about-text { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 6px; }
.about-signature { font-size: 12px; color: #777; text-align: right; }
.about-signature strong { color: #444; }

/* ---- Tab bar (hub pages: index, features, owner-profiles) ---- */
.view-tabs-wrap {
    display: flex;
    justify-content: center;
    padding: 0 20px;
}
.view-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    border: 2px solid #147294;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.view-tab {
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    background: #e2d9a2;
    color: #333;
    border: none;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    text-align: center;
}
.view-tab:not(:last-child) { border-right: 2px solid #147294; }
.view-tab.active { background: #147294; color: #fff; }
.view-tab:hover:not(.active) { background: #d4cb8e; }

/* ---- Generic header (features, owner-profiles hub pages) ---- */
.header {
    text-align: center;
    padding: 32px 20px 24px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 32px;
}
.header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #222;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.header .subtitle { font-size: 15px; color: #666; margin-bottom: 10px; }
.header .back-link, .back-link {
    font-size: 14px;
    color: #7ab;
    text-decoration: none;
}
.header .back-link:hover { color: #48a; text-decoration: underline; }

/* ---- Generic container & page layout ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ---- Year section / heading (features + owner-profiles) ---- */
.year-section {
    margin-bottom: 48px;
    width: 100%;
    max-width: 1100px;
}
.year-heading {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ccc;
}

/* ---- Features page cards ---- */
.issue-section { margin-bottom: 32px; }
.issue-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.issue-cover {
    width: 60px;
    height: 78px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
}
.issue-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}
.feature-count { font-size: 13px; color: #888; }

.features-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.feature-card {
    width: 180px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-card img {
    width: 180px;
    height: 230px;
    object-fit: cover;
    object-position: top;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    border: 1px solid #ddd;
    transition: box-shadow 0.2s;
}
.feature-card:hover img {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    border-color: #999;
}
.feature-title {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    line-height: 1.3;
}

/* ---- Owner profiles: make index grid ---- */
.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.index-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}
.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #999;
}
.index-card .make-logo { height: 24px; margin-bottom: 4px; }
.index-card-title { font-size: 16px; font-weight: 600; }
.index-card-count { font-size: 13px; color: #888; margin-top: 4px; }

/* ---- Owner profiles: profile list cards ---- */
.profile-list { display: flex; flex-wrap: wrap; gap: 16px; }
.profile-card { width: 180px; }
.profile-card-link {
    display: block;
    text-decoration: none;
    color: #333;
    transition: transform 0.2s;
}
.profile-card-link:hover { transform: translateY(-3px); }
.profile-card-img {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    border: 1px solid #ddd;
    background: #eee;
    transition: box-shadow 0.2s;
}
.profile-card-link:hover .profile-card-img {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    border-color: #999;
}
.profile-card-title {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.profile-card-user {
    display: block;
    font-size: 12px;
    color: #147294;
    text-decoration: none;
    margin-top: 2px;
}
.profile-card-user:hover { text-decoration: underline; }
.profile-card-views { display: block; font-size: 11px; color: #999; }

/* ---- Shared: section heading, make logo, user link ---- */
.section-heading {
    font-size: 16px;
    font-weight: 600;
    color: #147294;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}
.make-logo { height: 40px; width: auto; margin-bottom: 8px; }
.user-link { color: #147294; text-decoration: none; }
.user-link:hover { text-decoration: underline; }

/* ---- Year bar (owner-profiles model pages) ---- */
.year-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}
.year-link {
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
}
.year-link:hover { background: #e0e0e0; border-color: #999; }
.year-link.active {
    background: #147294;
    color: #fff;
    border-color: #147294;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin: 32px 0;
}
.page-link {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}
.page-link:hover { background: #f0f0f0; border-color: #999; }
.page-link.active {
    background: #147294;
    color: #fff;
    border-color: #147294;
}
.page-ellipsis { display: inline-block; padding: 8px 6px; font-size: 14px; color: #888; }

/* ---- Search form (owner-profiles index) ---- */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 32px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}
.search-form .filter-group { display: flex; flex-direction: column; gap: 4px; }
.search-form label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.search-form select {
    padding: 8px 12px;
    font-size: 14px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    cursor: pointer;
    min-width: 160px;
}
.search-form select:hover { border-color: #999; }
.search-form select:focus { border-color: #147294; outline: none; }
.search-form .btn-browse {
    padding: 8px 24px;
    font-size: 14px;
    background: #147294;
    color: #fff;
    border: 2px solid #147294;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
.search-form .btn-browse:hover { background: #0f5f7a; border-color: #0f5f7a; }

/* ---- Owner profiles: user page ---- */
.user-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ddd;
    margin-bottom: 12px;
}
.user-realname { font-size: 18px; color: #444; margin-bottom: 4px; }
.user-location { font-size: 14px; color: #888; margin-bottom: 8px; }
.user-about {
    margin-bottom: 32px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
}
.user-about h3 {
    font-size: 14px;
    font-weight: 600;
    color: #147294;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.user-about p { font-size: 14px; line-height: 1.6; color: #444; }
.user-photo-category { margin-bottom: 24px; }
.user-photo-category h4 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

/* ---- Owner profiles: detail page ---- */
/* Renamed from .page-nav to avoid colliding with archive.css */
.profile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 20px;
}
.profile-nav a {
    color: #147294;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.profile-nav a:hover { color: #0f5f7a; text-decoration: underline; }

.profile-header {
    text-align: center;
    padding: 32px 20px 24px;
    border-bottom: 1px solid #ddd;
}
.profile-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #222;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.profile-header .username { font-size: 16px; color: #666; }

.profile-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}
.detail-section { margin-bottom: 24px; }
.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #147294;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.detail-section p { font-size: 15px; line-height: 1.6; color: #444; }

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f5f5f5;
    border-radius: 8px;
}
.meta-item { font-size: 13px; }
.meta-item .label { color: #888; }
.meta-item .value { color: #333; font-weight: 500; }

.photo-gallery { margin-top: 32px; }
.photo-gallery h3 {
    font-size: 14px;
    font-weight: 600;
    color: #147294;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* ---- Gallery grid (shared by detail + user pages) ---- */
.gallery-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.gallery-card { width: 160px; }
.gallery-item img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: border-color 0.2s;
    cursor: pointer;
}
.gallery-item:hover img { border-color: #147294; }
.gallery-info { margin-top: 4px; }
.gallery-caption { display: block; font-size: 12px; color: #444; line-height: 1.3; }
.gallery-date { display: block; font-size: 11px; color: #999; margin-top: 2px; }

/* ---- Photo modal overlay (detail + user pages) ---- */
#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);
}

/* ---- Flipbook viewer (index.html only) ---- */
#viewer { display: none; height: 100vh; position: relative; }
#container { width: 100%; height: 100vh; }
#back-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
#back-btn:hover { background: rgba(60, 60, 60, 0.9); }

/* =========================================================================
 * Mobile (≤600px)
 * ========================================================================= */
@media (max-width: 600px) {

    /* Logo wrapper — gives the 16px gutter by padding the wrapper div */
    body > div[style*="padding-top:24px"] {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Main index subtitle */
    #issue-selector .subtitle {
        font-size: 15px;
        letter-spacing: 1px;
        text-align: center;
        margin-bottom: 24px;
        padding: 0 16px;
    }

    /* Generic header (features, owner-profiles) */
    .header { padding: 24px 16px 16px; margin-bottom: 24px; }
    .header h1 { font-size: 22px; letter-spacing: 0.5px; }
    .header .subtitle { font-size: 14px; }

    /* Tabs */
    .view-tabs-wrap { padding: 0 16px; }
    .view-tabs { width: 100%; }
    .view-tab {
        padding: 10px 8px;
        font-size: 13px;
        letter-spacing: 0.5px;
        flex: 1;
    }

    /* Search form */
    .search-form { padding: 16px; gap: 10px; }
    .search-form .filter-group { flex: 1 1 100%; }
    .search-form select { min-width: 0; width: 100%; font-size: 14px; }
    .search-form .btn-browse { width: 100%; padding: 12px 24px; }

    /* Features grid */
    .features-grid { gap: 10px; }
    .feature-card { width: 140px; }
    .feature-card img { width: 140px; height: 180px; }

    /* Profile cards */
    .profile-card { width: 140px; }
    .profile-card-img { width: 140px; height: 110px; }

    /* Gallery (detail + user pages) */
    .gallery-card { width: 110px; }
    .gallery-item img { width: 110px; height: 85px; }
    .meta-row { gap: 12px; }
}
