/*
 * Unofficial Soundgarden Homepage — Responsive Stylesheet
 *
 * Strategy: desktop (≥600px) appearance is unchanged.
 * Mobile (<600px) gets a fluid layout and hamburger navigation
 * in place of the imagemap-based nav.
 */

/* ---------- Base ---------- */

body {
    margin: 0;
    padding: 0;
}

a {
    outline: none;
}

/* All images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* ---------- Homepage nav styles
   (consolidated from index.shtml inline CSS) ---------- */

#main-nav,
#secondary-nav {
    font-family: "Fjalla One", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 13px;
}

#main-nav        { color: #333333; }
#main-nav a      { color: #333333; text-decoration: none; }
#secondary-nav   { color: #666666; }
#secondary-nav a { color: #666666; text-decoration: none; }

/* Page title text heading injected by JS on mobile — hidden on desktop */
.mobile-page-title { display: none; }

/* Restore fixed width on the spacer GIF used to enforce left-column width in
   release/multimedia tables. The global img max-width:100% rule would otherwise
   allow it to shrink, collapsing the gray info column on desktop. */
td[bgcolor="#EEEEEE"] img[src*="x.gif"],
td[bgcolor="#eeeeee"] img[src*="x.gif"] {
    width: 110px;
    min-width: 110px;
}

/* ================================================================
   ARCHIVE — search results and individual message display
   ================================================================ */

/* Search result item */
.search-result {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eeeeee;
}

.search-result-meta {
    color: #666666;
    font-size: 11px;
    margin-top: 2px;
}

.search-result-snippet {
    font-family: monospace;
    font-size: 11px;
    color: #444444;
    margin-top: 4px;
}

/* Individual message display */
.message-header {
    background: #f0f0f0;
    border-left: 3px solid #333333;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
}

.msg-subject {
    font-family: "Fjalla One", sans-serif;
    font-size: 15px;
    color: #000000;
    margin-bottom: 4px;
}

.msg-meta {
    color: #666666;
}

.message-body {
    margin-top: 12px;
}

/* Prose paragraphs — reflowable */
.msg-p {
    font-size: 13px;
    line-height: 1.6;
    margin: 0 0 10px;
}

/* Preformatted sections: ASCII art, spacer-formatted sigs, indented blocks */
.msg-pre {
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
    margin: 0 0 10px;
}

/* Signature (after "-- " separator): dimmed */
.msg-sig {
    color: #888888;
}

/* Quoted text ("> " prefix lines) */
.msg-quote {
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
    color: #555555;
    border-left: 3px solid #cccccc;
    padding-left: 10px;
    margin: 0 0 10px 8px;
}

/* Search term highlight — used in both snippets and message body */
mark {
    background-color: #ffff99;
    color: inherit;
    padding: 0 1px;
}

/* Prev / position / next navigation bar */
.msg-nav {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
    padding: 6px 0;
    margin: 10px 0;
    font-size: 11px;
}

.msg-nav-prev  { flex: 2; text-align: left;   }
.msg-nav-pos   { flex: 1; text-align: center; color: #666666; }
.msg-nav-next  { flex: 2; text-align: right;  }

/* ================================================================
   LIGHTBOX — applies at all viewport widths
   ================================================================ */

#sg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

#sg-lightbox.open {
    display: flex;
}

#sg-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

#sg-lb-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sg-lb-img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

#sg-lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 2;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.8;
}

#sg-lb-close:hover { opacity: 1; }

#sg-lb-prev,
#sg-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 56px;
    cursor: pointer;
    padding: 8px 16px;
    line-height: 1;
    opacity: 0.6;
}

#sg-lb-prev { left:  0; }
#sg-lb-next { right: 0; }

#sg-lb-prev:hover,
#sg-lb-next:hover { opacity: 1; }

#sg-lb-caption {
    color: #cccccc;
    font-family: "Fjalla One", sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-top: 10px;
    text-align: center;
    max-width: 80vw;
}

#sg-lb-counter {
    color: #555555;
    font-family: "Fjalla One", sans-serif;
    font-size: 11px;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

/* ---------- Desktop defaults: show imagemap nav, hide mobile elements ---------- */

.desktop-nav       { display: block; }
.mobile-nav-header { display: none;  }
.mobile-nav-panel  { display: none;  }
.navmap-footer     { display: block; }

/* ================================================================
   MOBILE — max-width 599px
   ================================================================ */

@media (max-width: 599px) {

    /* Hide desktop imagemap nav */
    .desktop-nav { display: none; }

    /* Hide section bar / page title images — text heading shown instead */
    img[src*="/inline/1998/"] { display: none; }

    /* Page title text heading for subpages */
    .mobile-page-title {
        display: block;
        font-family: "Fjalla One", sans-serif;
        font-size: 16px;
        font-weight: normal;
        color: #333333;
        margin: 8px 0 4px;
        padding: 0;
        letter-spacing: 0.5px;
    }

    /* Body: small side gutters */
    body {
        padding: 0 8px;
        box-sizing: border-box;
    }

    /* ---- Two-column release/multimedia info layout → single column on mobile ----
       Target: <table><tr><td bgcolor="#EEEEEE">info</td><td>content</td></tr></table>
       Reflow to: info block stacked above content block. */

    td[bgcolor="#EEEEEE"],
    td[bgcolor="#eeeeee"] {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        padding: 12px !important;
        margin-bottom: 12px;
    }

    td[bgcolor="#EEEEEE"] + td,
    td[bgcolor="#eeeeee"] + td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Spacer GIFs used to enforce left-column min-width — suppress on mobile */
    td[bgcolor="#EEEEEE"] img[src*="x.gif"],
    td[bgcolor="#eeeeee"] img[src*="x.gif"] {
        display: none;
    }

    /* Thumbnails in info column: flow horizontally and wrap instead of stacking */
    td[bgcolor="#EEEEEE"] center,
    td[bgcolor="#eeeeee"] center {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    /* Hide the <br> tags between thumbnails — layout is now handled by flex */
    td[bgcolor="#EEEEEE"] center br,
    td[bgcolor="#eeeeee"] center br {
        display: none;
    }

    /* <p> tags between thumbnails implicitly wrap the <a> that follows them.
       display:contents removes the <p> from the box model so its child <a>
       participates directly in the flex layout without the p's margins. */
    td[bgcolor="#EEEEEE"] center p,
    td[bgcolor="#eeeeee"] center p {
        display: contents;
    }

    /* Force all tables to fit the viewport.
       Handles both the width=600 content wrapper and inner photo grids.
       Nav tables inside .desktop-nav are already display:none. */
    table {
        width: 100% !important;
    }

    /* ---- Sticky mobile header bar ---- */

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        background: #ffffff;
        border-bottom: 1px solid #cccccc;
        position: sticky;
        top: 0;
        z-index: 100;
        margin: 0 -8px; /* cancel body side padding */
    }

    /* Left side of header: site name + optional section indicator */
    .header-left {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .mobile-nav-header .site-name {
        font-family: "Fjalla One", sans-serif;
        font-size: 20px;
        color: #000000;
        text-decoration: none;
        letter-spacing: 1px;
    }

    /* Section indicator: e.g. "RELEASES" in gray, links to section root */
    .section-indicator {
        font-family: "Fjalla One", sans-serif;
        font-size: 14px;
        color: #999999;
        text-decoration: none;
        letter-spacing: 0.5px;
    }

    .section-indicator:visited {
        color: #999999;
    }

    .hamburger-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #333333;
        padding: 4px 8px;
        line-height: 1;
    }

    /* ---- Mobile nav panel (drops below header when open) ---- */

    .mobile-nav-panel {
        display: none;
        background: #ffffff;
        border-bottom: 2px solid #333333;
        padding: 0 12px 12px;
        margin: 0 -8px; /* cancel body side padding */
    }

    .mobile-nav-panel.open {
        display: block;
    }

    .mobile-nav-panel ul {
        list-style: none;
        margin: 0;
        padding: 8px 0 0;
    }

    .mobile-nav-panel ul li {
        padding: 7px 0;
        border-bottom: 1px solid #eeeeee;
    }

    .mobile-nav-panel ul li:last-child {
        border-bottom: none;
    }

    .mobile-nav-panel ul li a {
        font-family: "Fjalla One", sans-serif;
        font-size: 14px;
        color: #000099;
        text-decoration: none;
        letter-spacing: 0.5px;
    }

    .mobile-nav-panel ul li a:visited {
        color: #3333cc;
    }

    /* Utility links: visually separated from main nav */
    .mobile-nav-panel .utility-links {
        margin-top: 8px;
        padding-top: 4px;
        border-top: 1px solid #999999;
    }

    .mobile-nav-panel .utility-links li a {
        font-size: 12px;
        color: #666666;
    }

    .mobile-nav-panel .utility-links li a:visited {
        color: #666666;
    }

    /* Hide footer utility nav on mobile (those links live in the hamburger) */
    .navmap-footer { display: none; }

    /* ---- Two-column list tables (misc/index.shtml) ---- */
    .two-col-list td {
        display: block;
        width: 100% !important;
        white-space: normal;
    }

    /* Remove the gap between stacked <ul> elements so they read as one list */
    .two-col-list td ul {
        margin-bottom: 0;
    }
    .two-col-list td + td ul {
        margin-top: 0;
    }

    /* ---- Archive page ---- */

    /* <nobr> elements holding month-link rows — allow wrapping on mobile */
    nobr {
        white-space: normal;
    }

    /* Nested <blockquote> elements compound to ~80px side margins —
       reduce to something sensible on narrow screens */
    blockquote {
        margin-left: 12px;
        margin-right: 0;
    }

}
