/* ==========================================================================
   MAGICBREW PERSONAL SITE — GLOBAL STYLESHEET (style_v2.css)
   Base design system extracted from index.html for site-wide coherence.
   ========================================================================== */

/* --- 1. CUSTOM FONTS --- */
@font-face {
    font-family: 'DepartureMono-Regular';
    src: url('font/DepartureMono-Regular.woff2') format('woff2'),
         url('font/DepartureMono-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* --- 2. CSS VARIABLES (THEME TOKENS) --- */
:root {
    --main-green: #ccffcc;
    --dark-green: #008000;
    --olive-base: #2b3d16;
    --main-orange: #ff6600;
    --bg-color: #ffffff;
    --border-style: 4px outset var(--main-orange);
    --border-hover: 4px inset var(--dark-green);
    --text-outline: -1px -1px 0 #000,
                     1px -1px 0 #000,
                    -1px  1px 0 #000,
                     1px  1px 0 #000;
}

/* --- 3. RESET & BASE LAYOUT --- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg-color);
    font-family: 'DepartureMono-Regular', monospace;
    overflow: hidden; /* Prevents outer window scroll; frames scroll independently */
}

/* --- 4. FRAME CONTAINER (TWO-COLUMN RETRO LAYOUT) --- */
.frame-container {
    display: flex;
    height: 100vh;
    border-top: var(--border-style);
}

/* --- 5. LEFT SIDEBAR --- */
.sidebar {
    width: 280px;
    border-right: var(--border-style);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    text-align: center;

    /* Base dark olive background + procedural pixel-grid camo pattern */
    background-color: var(--olive-base);
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.5) 1px, transparent 1px),
        conic-gradient(#111a05 90deg, transparent 90deg),
        conic-gradient(rgba(100, 140, 20, 0.4) 90deg, transparent 90deg);
    background-size:
        5px 5px,    /* Fine grid X */
        5px 5px,    /* Fine grid Y */
        10px 10px,  /* Deep moss shadow layer */
        20px 20px;  /* Warm grass highlight layer */
}

/* Avatar frame inside the sidebar (transparent so PNG alpha shows the camo backdrop) */
.avatar-box {
    width: 100px;
    height: 100px;
    background: transparent;
    border: 2px solid #000000;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    background: #cccccc59;
}

.sidebar-footer {
    font-size: 10px;
    margin-top: 25px;
}

/* Language Switcher Button in Sidebar (injected by translate.js) */
.lang-toggle {
    margin-top: 15px;
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.25);
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 12px;
    cursor: pointer;
    text-transform: uppercase;
}

.lang-toggle:hover {
    background-color: var(--main-orange);
    color: #ffffff;
}

.lang-toggle:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* --- 6. SIDEBAR NAVIGATION --- */
.nav-list {
    padding: 0;
    margin: 30px 0 0 0;
    list-style-type: none;
}

.nav-item {
    margin-bottom: 12px;
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.25);
}

.nav-item a {
    display: block;
    padding: 6px 8px;
    text-decoration: none;
}

/* Highlights the link for the currently active page */
.nav-item a.active {
    background-color: var(--main-green);
    color: #000000;
}

/* --- 7. MAIN CONTENT AREA (RIGHT FRAME) --- */
.main-content {
    flex-grow: 1;
    padding: 40px;
    color: #ffffff;
    overflow-y: auto;
    scroll-behavior: smooth;
    background-image: url('img/bgLR.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    scrollbar-width: thin;
    scrollbar-color: var(--main-orange) var(--main-green);
}

/* Full-height flex layout modifier for pages with a full-section embed (e.g., wishlist.html) */
.main-content--fill {
    display: flex;
    flex-direction: column;
    padding: 25px 30px;
}

.main-content--fill hr {
    margin: 18px 0;
    flex-shrink: 0;
}

/* --- 8. TYPOGRAPHY & LINKS --- */
h1, h2, h3 {
    text-transform: uppercase;
    line-height: 1.5;
    color: #ffffff;
    font-size: 16px;
    margin: 0 0 20px 0;
    text-shadow: var(--text-outline);
}

p {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px 0;
    text-shadow: var(--text-outline);
}

a {
    color: var(--main-orange);
    text-decoration: underline;
    font-weight: bold;
    cursor: pointer;
}

a:hover {
    background-color: var(--main-orange);
    color: #ffffff;
    text-decoration: none;
}

hr {
    border: 0;
    border-top: 2px dashed var(--main-orange);
    margin: 30px 0;
    clear: both;
}

.page-footer {
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    padding-bottom: 10px;
}

/* --- 9. SOCIAL FEED CARDS (INDEX.HTML) --- */
.feed-container {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start; /* Keeps Mastodon speech bubble compact to its text height */
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 10px auto 20px auto;
}

/* Stacked column on the right for Mastodon + SoundCloud */
.feed-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feed-card {
    flex: 1;
    min-width: 300px;
    border: var(--border-style);
    padding: 20px;
    background: rgba(0, 0, 0, 0.45);
}

.feed-column .feed-card {
    flex: none;
    width: 100%;
}

/* Give the Pixelfed photos card more room so the 2x2 squares display big */
#pixelfed-post {
    flex: 1.45;
    min-width: 360px;
}

.feed-body {
    font-size: 14px;
    width: 100%;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.feed-body--bold {
    font-size: 16px;
    font-weight: bold;
}

.feed-external-link {
    display: inline-block;
    margin-top: 18px;
}

/* --- 9B. PIXELATED WHITE SPEECH BUBBLE (MASTODON POST BACKDROP) --- */
.speech-bubble {
    position: relative;
    background-color: #ffffff;
    color: #111111;
    border: 3px solid #000000;
    padding: 14px 16px;
    margin: 10px 6px 22px 10px;
    /* Crisp pixel-art corner notches + hard retro drop shadow */
    box-shadow:
        -3px 0 0 0 #ffffff,
         3px 0 0 0 #ffffff,
         0 -3px 0 0 #ffffff,
         0  3px 0 0 #ffffff,
        -6px 0 0 0 #000000,
         6px 0 0 0 #000000,
         0 -6px 0 0 #000000,
         0  6px 0 0 #000000,
         7px 7px 0 0 rgba(0, 0, 0, 0.45);
}

/* Stepped pixel-art pointer tail at the bottom-left of the speech bubble */
.speech-bubble::before {
    content: "";
    position: absolute;
    bottom: -22px;
    left: 22px;
    width: 24px;
    height: 20px;
    background:
        /* Outer black pixel border of the tail */
        linear-gradient(#000000, #000000) 0 0 / 4px 16px no-repeat,
        linear-gradient(#000000, #000000) 0 16px / 8px 4px no-repeat,
        linear-gradient(#000000, #000000) 8px 12px / 4px 4px no-repeat,
        linear-gradient(#000000, #000000) 12px 8px / 4px 4px no-repeat,
        linear-gradient(#000000, #000000) 16px 4px / 4px 4px no-repeat,
        linear-gradient(#000000, #000000) 20px 0 / 4px 4px no-repeat;
}

/* White pixel fill inside the tail, covering the bottom border seamlessly */
.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 26px;
    width: 18px;
    height: 20px;
    background:
        linear-gradient(#ffffff, #ffffff) 0 0 / 18px 8px no-repeat,
        linear-gradient(#ffffff, #ffffff) 0 8px / 12px 4px no-repeat,
        linear-gradient(#ffffff, #ffffff) 0 12px / 8px 4px no-repeat,
        linear-gradient(#ffffff, #ffffff) 0 16px / 4px 4px no-repeat;
}

/* Crisp dark text without drop-shadow inside the white speech bubble */
.speech-bubble p,
.speech-bubble .feed-body {
    color: #111111;
    text-shadow: none;
}

.speech-bubble p:last-child {
    margin-bottom: 0;
}

.speech-bubble a {
    color: var(--dark-green);
}

.speech-bubble a:hover {
    background-color: var(--main-orange);
    color: #ffffff;
}

/* --- 9C. SOUNDCLOUD EMBED CARD (UNDER MASTODON) --- */
.sc-embed-wrap {
    width: 100%;
    background: #ffffff;
    border: 2px solid #000000;
    overflow: hidden;
}

.sc-embed-frame {
    width: 100%;
    height: 166px;
    border: 0;
    display: block;
}

.sc-embed-placeholder {
    padding: 14px 16px;
    color: #111111;
    font-size: 12px;
    line-height: 1.5;
}

.sc-embed-placeholder p,
.sc-embed-placeholder li {
    color: #111111;
    text-shadow: none;
    font-size: 12px;
    margin-bottom: 8px;
}

.sc-embed-placeholder ol {
    margin: 0;
    padding-left: 18px;
}

/* --- 10. IMAGE GALLERY GRID (SHARED BY FEEDS & GALLERY PAGES) --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Compact 2x2 grid for social feed previews (large 1:1 square tiles) */
.gallery-grid--compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 15px;
    width: 100%;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: var(--border-style);
    padding: 10px;
    background: #f0f0f0;
    transition: background-color 0.1s ease;
}

.gallery-item--compact {
    padding: 5px;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.gallery-item:hover {
    border: var(--border-hover);
    background: #e0ffe0;
}

.gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    image-rendering: pixelated;
    margin-bottom: 10px;
    border: 2px solid #000000;
    cursor: pointer;
}

.gallery-item--compact .gallery-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 0;
}

.caption {
    font-size: 10px;
    text-align: center;
    color: #333333;
    margin-top: 5px;
    text-shadow: none;
}

/* --- 11. EMBED MODULE (GOOGLE SHEETS / WISHLIST) --- */
.embed-module {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    width: 100%;
    border: var(--border-style);
    padding: 12px;
    background: rgba(0, 0, 0, 0.55);
}

.embed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.embed-header h2 {
    margin: 0;
}

.embed-frame-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 420px;
    background: #ffffff;
    border: 2px solid #000000;
    overflow: hidden;
}

.embed-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.embed-placeholder {
    padding: 25px;
    color: #111111;
    font-size: 13px;
    line-height: 1.6;
}

.embed-placeholder p,
.embed-placeholder li {
    color: #111111;
    text-shadow: none;
}

/* --- 12. LIGHTBOX MODAL --- */
.modal {
    display: none; /* Toggled to 'flex' via JS */
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border: 4px solid var(--main-green);
    box-shadow: 0 0 20px var(--main-orange);
    image-rendering: pixelated;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover,
.close:focus {
    color: var(--main-orange);
}

#caption-text {
    margin: 10px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #cccccc;
    padding: 10px 0;
    font-size: 12px;
}

/* --- 13. RESPONSIVE BREAKPOINT (MOBILE / TABLET) --- */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
    }

    .frame-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: var(--border-style);
    }

    .main-content {
        padding: 25px 20px;
    }

    #pixelfed-post,
    .feed-column {
        min-width: 100%;
    }

    .embed-module {
        min-height: 70vh;
    }

    .embed-frame-wrap {
        min-height: 60vh;
    }

    .modal-content {
        max-width: 95%;
    }
}
