/*
Theme Name: FatTabby W95
Theme URI: https://fattabby.com/
Author: Your Name
Description: Windows 95 retro style WP theme for FatTabby ecosystem. Fully draggable "windows", classic Start bar, and more.
Version: 1.0
License: MIT
Text Domain: fattabby-w95
Tags: retro, windows95, draggable, minimal, teal
*/

/* --- WINDOWS 95 CORE STYLES --- */
body {
    background: #008080 !important;
    font-family: 'Tahoma', 'Segoe UI', 'MS Sans Serif', system-ui, sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
a { color: #1a34af; text-decoration: underline; }
a:hover { color: #0c54c7; text-decoration: underline wavy; }

.window {
    background: #d4d0c8;
    border: 2px solid #fff;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    box-shadow: 3px 3px 0 #666;
    margin: 16px;
    min-width: 320px;
    max-width: 600px;
    position: relative;
    z-index: 1;
    border-radius: 2px;
}
.window-titlebar {
    background: #003399;
    color: #fff;
    font-weight: bold;
    font-size: 1.08em;
    padding: 5px 8px 4px 12px;
    border-bottom: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}
.window-titlebar .window-title {
    font-size: 1em;
    letter-spacing: 0.05em;
}
.window-titlebar .window-close {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #fff;
    color: #000;
    text-align: center;
    font-weight: bold;
    border: 2px outset #aaa;
    border-radius: 2px;
    cursor: pointer;
    margin-left: 6px;
}
.window-content {
    padding: 20px 22px 20px 18px;
    font-size: 1.02em;
    min-height: 100px;
    max-height: 60vh;
    overflow-y: auto;
}
@media (max-width: 800px) {
    .window {
        min-width: 90vw;
        max-width: 98vw;
        margin: 10px auto;
    }
    .sidebar {
        float: none;
        width: 100%;
        margin: 0 auto;
    }
}
.sidebar {
    float: right;
    width: 240px;
    margin: 16px 18px 16px 0;
    z-index: 10;
}
.sidebar .window {
    margin: 0 0 16px 0;
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 800px) {
    .sidebar {
        width: 96vw;
        float: none;
        margin: 0 auto 8px auto;
    }
}

/* --- TASKBAR + START MENU --- */
#taskbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 38px;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    border-bottom: 2px solid #404040;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Tahoma', 'MS Sans Serif', system-ui, sans-serif;
}
#start-btn {
    margin-left: 8px;
    height: 32px;
    padding: 0 16px 0 28px;
    background: #f6f6f6 url('/wp-content/themes/fattabby-w95/images/win95-icons.png') 4px 4px no-repeat;
    background-size: 22px 22px;
    color: #000;
    border: 2px outset #808080;
    font-weight: bold;
    font-size: 1.15em;
    border-radius: 3px;
    cursor: pointer;
    box-shadow: 1px 1px 0 #888;
    display: flex;
    align-items: center;
    user-select: none;
}
#start-btn:active {
    border-style: inset;
    background: #e8e8e8 url('/wp-content/themes/fattabby-w95/images/win95-icons.png') 4px 4px no-repeat;
}
#start-menu {
    display: none;
    position: absolute;
    left: 0;
    bottom: 38px;
    min-width: 210px;
    background: #d4d0c8;
    border: 2px outset #fff;
    box-shadow: 2px 2px 8px #1119;
    z-index: 110;
    padding: 0;
    font-family: inherit;
}
#start-menu ul {
    list-style: none;
    margin: 0; padding: 0;
}
#start-menu li {
    padding: 12px 16px;
    border-bottom: 1px solid #bbb;
    font-weight: bold;
    cursor: pointer;
    font-size: 1.06em;
    color: #222;
}
#start-menu li:hover {
    background: #0c54c7;
    color: #fff;
}
#taskbar-clock {
    margin-right: 18px;
    font-family: inherit;
    background: #e2e2e2;
    border: 2px inset #808080;
    padding: 4px 16px 2px 16px;
    border-radius: 2px;
    font-size: 1.12em;
    letter-spacing: 0.04em;
    min-width: 68px;
    text-align: right;
}

/* --- 404 BSOD --- */
.bsod-404 {
    background: #0018ba;
    color: #fff;
    font-family: 'Consolas', 'Courier New', monospace;
    width: 100vw;
    height: 100vh;
    text-align: center;
    padding-top: 18vh;
    font-size: 1.6em;
    letter-spacing: 0.04em;
}

input, button, select, textarea {
    font-family: 'Tahoma', 'MS Sans Serif', system-ui, sans-serif;
    font-size: 1em;
    background: #eaeaea;
    border: 2px outset #bbb;
    border-radius: 2px;
    padding: 4px 8px;
}
button, input[type="submit"] {
    font-weight: bold;
    box-shadow: 1px 1px 0 #aaa;
    cursor: pointer;
}
input[type="search"] {
    width: 88%;
    margin-bottom: 7px;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 12px; background: #b0b0b0; }
::-webkit-scrollbar-thumb { background: #003399; border-radius: 2px; }
::-webkit-scrollbar-corner { background: #b0b0b0; }

/* --- MISC --- */
.window-pagination {
    border-top: 2px solid #ccc;
    margin: 0;
    padding: 6px 18px 8px 18px;
    background: #e2e2e2;
    font-size: 1em;
}
@media (max-width: 540px) {
    .window,
    .sidebar { min-width: 96vw; max-width: 99vw; }
    .window-content { padding: 12px 5vw 18px 5vw; }
    #taskbar-clock { min-width: 52px; font-size: 1em; }
}
/* Featured images and content images should never overflow window */
.window img, .window-content img, .post-thumbnail img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 0 auto 12px auto;
    border: 2px inset #bbb; /* optional retro border */
    box-sizing: border-box;
}
.window img, .window-content img, .post-thumbnail img {
    max-width: 340px;
    width: 100%;
    height: auto !important;
    display: block;
    margin: 0 auto 12px auto;
    border: 2px inset #bbb;
    box-sizing: border-box;
}
body { font-family: 'Press Start 2P', 'Tahoma', Arial, sans-serif; }

/* ========== MOBILE RETRO FIXES (stack all windows, fix bg color) ========== */
@media (max-width: 700px) {
    body {
        background: #008080 !important;   /* Ensure teal bg everywhere */
    }
    .window {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        min-width: 96vw !important;
        max-width: 99vw !important;
        margin: 14px auto !important;
        box-shadow: 1px 1px 0 #666;
    }
    /* Hide floating Home and Social windows (if you want to save space) */
    .window[style*="left:32%"], 
    .window[style*="left:24px"] {
        min-width: 96vw !important;
        max-width: 99vw !important;
        margin-top: 12px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        position: static !important;
    }
    /* Sidebar widgets become full width below content */
    .sidebar {
        width: 96vw !important;
        float: none !important;
        margin: 0 auto 8px auto !important;
        position: static !important;
    }
    /* Taskbar remains at bottom, full width */
    #taskbar {
        position: fixed !important;
        width: 100vw !important;
        min-width: 100vw !important;
        left: 0 !important;
    }
    /* Remove any possible double backgrounds */
    html {
        background: #008080 !important;
    }
}

/* Extra: On very narrow screens, let post images shrink too */
@media (max-width: 480px) {
    .window img, .window-content img {
        max-width: 90vw !important;
    }
}
@media (max-width: 700px) {
    .container {
        display: block !important;
    }
    .main-content, .sidebar {
        float: none !important;
        width: 96vw !important;
        margin: 0 auto 12px auto !important;
        position: static !important;
        clear: both !important;
    }
    .sidebar {
        margin-top: 0 !important;
    }
    .window {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Make ALL .window-titlebar look identical, including sidebar widgets */
.window-titlebar {
    background: #003399 !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 1.08em;
    padding: 5px 8px 4px 12px;
    border-bottom: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
    letter-spacing: 0.02em;
}

.window-titlebar .window-title {
    color: #fff !important;
    font-size: 1em;
    letter-spacing: 0.05em;
    font-family: inherit;
}

/* Optional: Sidebar widget titlebars shouldn't be draggable */
.sidebar .window-titlebar {
    cursor: default;
}
.sidebar .window-content {
    padding: 14px 16px 14px 12px;
    font-size: 1em;
}
/* Style ALL sidebar widget titles as retro blue titlebars */
.sidebar .window-titlebar,
.sidebar .window-titlebar .window-title,
.sidebar .widget-title,
.sidebar h2 {
    background: #003399 !important;
    color: #fff !important;
    font-weight: bold;
    font-size: 1.08em !important;
    padding: 5px 8px 4px 12px !important;
    border-bottom: 2px solid #fff !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin: 0 !important;
    letter-spacing: 0.02em;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Remove duplicate spacing for h2 widget titles in windows */
.sidebar .window .widget-title {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    color: inherit !important;
    border: none !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    display: inline !important;
}
/* Make Start menu use the same retro font as the rest of the UI */
#start-menu,
#start-menu ul,
#start-menu li,
#start-menu a {
    font-family: 'Press Start 2P', 'Tahoma', 'Segoe UI', Arial, sans-serif !important;
    font-size: 1.05em !important;
    letter-spacing: 0;
    font-variant-ligatures: none;
}
#start-menu li {
    font-weight: bold;
    color: #003399;
    padding: 12px 16px;
    border-bottom: 1px solid #bbb;
}
#start-menu li:hover {
    background: #0c54c7;
    color: #fff;
}
.container {
    padding-top: 80px !important;
}
.main-content .window,
.main-content .window.draggable {
    z-index: 100 !important;
    position: relative;
}
@media (max-width: 700px) {
    .desktop-icons {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        z-index: 222 !important;
        background: #008080 !important;
        padding: 7px 0 3px 0 !important;  /* slightly more for better tap targets */
        margin: 0 !important;
        display: flex;
        flex-direction: row;
        gap: 10px;
        justify-content: center;
        overflow-x: auto;
        overflow-y: visible;
        border-bottom: 2px solid #4a4a4a;
        box-shadow: 0 3px 6px #0002;
        scrollbar-width: thin;
    }
    .desktop-icon {
        min-width: 48px;
        width: 56px;
        max-width: 56px;
        font-size: 0.86em;
        align-items: center;
        margin: 0 3px !important;
        padding: 0;
        text-align: center;
    }
    .desktop-icon img {
        width: 34px;
        height: 34px;
        margin: 0 0 2px 0;
    }
    .desktop-icon span {
        font-size: 0.60em;
        padding: 0;
        margin: 0;
        width: 100%;
        display: block;
        line-height: 1.02;
        word-break: break-word;
    }
    /* THIS IS THE ONLY PADDING-TOP YOU NEED */
    .container {
        padding-top: 60px !important;
    }
}
@media (max-width: 700px) {
    .window.social, .window.home { display: none !important; }
}

body.error404 .desktop-icons,
body.error404 .window.home,
body.error404 .window.social {
    display: none !important;
}
body.error404 #taskbar { display: none !important; }
body.error404 {
    overflow: hidden !important;
}