/* Layout and page-specific styles — 98.css handles all Win98 component aesthetics */

/* === Desktop === */
body {
    background: #008080;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
}

/* === Main app window === */
.main-window {
    width: 100%;
    max-width: 960px;
    height: calc(100vh - 24px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.main-window > .window-body {
    flex: 1;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}

/* === Menu / nav bar === */
.title-bar, .title-bar-text { user-select: none; }

.main-menu-bar {
    display: flex;
    align-items: center;
    padding: 2px 4px;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    user-select: none;
}

.main-menu-bar a {
    display: inline-block;
    padding: 3px 10px;
    color: #000;
    text-decoration: none;
    font-size: 11px;
}

.main-menu-bar a:hover,
.main-menu-bar a.active {
    background: #000080;
    color: #fff;
}

/* ============================================================
   Home page
   ============================================================ */
.home-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Windows CMD prompt colour */
.prompt-win { color: #c0c0c0; }

/* === Notepad chrome === */
.notepad-menubar {
    display: flex;
    padding: 0 2px;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    font-size: 11px;
    user-select: none;
}

.notepad-menubar span {
    padding: 3px 8px;
    cursor: default;
}

.notepad-menubar span:hover {
    background: #000080;
    color: #fff;
}

/* Remove window-body margin/padding so the textarea sits flush */
.notepad-editor-wrap {
    margin: 0 !important;
    padding: 2px !important;
}

/* The sunken text-area panel */
.notepad-editor {
    background: #fff;
    padding: 6px 8px;
    min-height: 140px;
    overflow: auto;
}

/* Top row: photo viewer + notepad side by side */
.home-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notepad-window { flex: 1; }

/* Windows Picture and Fax Viewer */
.photo-viewer-window { flex-shrink: 0; width: 130px; }

.photo-viewer-body {
    margin: 0 !important;
    padding: 0;
    background: #fff;
    min-height: 130px;
    overflow: hidden;
}

.photo-viewer-body img {
    display: block;
    width: 100%;
    height: auto;
}

.photo-viewer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 6px;
    background: #c0c0c0;
    border-top: 1px solid #808080;
}

.photo-viewer-nav button {
    min-width: auto;
    padding: 2px 7px;
}

.photo-nav-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: #808080;
    margin: 0 3px;
    box-shadow: 1px 0 #fff;
}

.intro-text {
    padding: 6px 8px;
    line-height: 1.75;
    color: #222;
}

.intro-text h4 {
    margin-top: 0;
    margin-bottom: 0.4em;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.intro-text .placeholder {
    color: #aaa;
    font-style: italic;
}

/* Two-column lower section: terminal left, blogs widget right */
.home-lower {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.home-lower .terminal-window { flex: 1; min-width: 0; }

/* Latest blogs widget */
.blogs-widget-window { width: 240px; flex-shrink: 0; }

.blog-widget-list { list-style: none; padding: 0; margin: 0; }

.blog-widget-list li {
    padding: 5px 0;
    border-bottom: 1px solid #c0c0c0;
    font-size: 11px;
}
.blog-widget-list li:last-child { border-bottom: none; }

.blog-widget-list li a {
    display: block;
    color: #000080;
    text-decoration: none;
    font-weight: bold;
}
.blog-widget-list li a:hover { text-decoration: underline; }

.blog-widget-date { display: block; color: #808080; font-size: 10px; margin-top: 1px; }

.blog-widget-footer { margin-top: 8px; font-size: 11px; }
.blog-widget-footer a { color: #000080; }

/* Terminal sub-window */
.terminal-window { min-width: 0; }

.terminal-body {
    background: #000;
    color: #c0c0c0;
    font-family: 'Lucida Console', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 14px;
    overflow-x: auto;
}

.tl { display: block; white-space: pre; min-height: 1.5em; }
.tl.tl-output a { color: #8be9fd; text-decoration: none; }
.tl.tl-output a:hover { text-decoration: underline; }

.prompt-user { color: #50fa7b; }
.prompt-host { color: #8be9fd; }
.prompt-sep  { color: #555; }
.prompt-path { color: #2d7a47; }

/* CSS typing animation */
.cmd-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    width: 0;
}

@keyframes typing-cmd1 { from { width: 0; } to { width: 19ch; } }
@keyframes typing-cmd2 { from { width: 0; } to { width: 2ch; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink  { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* cmd1: "ssh andrew@ajy.cool" = 19 chars; 2s pause before start, slow deliberate typing */
.t-cmd1 { animation: typing-cmd1 2.5s steps(19, end) 2.0s forwards; }
.t-out1, .t-prompt2, .t-out2, .t-prompt3 { opacity: 0; }
/* step-start jumps to opacity:1 immediately at trigger time; 100s keeps it
   in the active phase so fill-mode unreliability can't revert it */
.t-out1    { animation: appear 100s step-start 5.3s; }
.t-prompt2 { animation: appear 100s step-start 5.7s; }
/* cmd2: `ls` = 2 chars */
.t-cmd2    { animation: typing-cmd2 0.5s steps(2, end) 5.7s forwards; }
.t-out2    { animation: appear 100s step-start 6.4s; }
.t-prompt3 { animation: appear 100s step-start 6.8s; }
/* cursor: blink's 0% keyframe is opacity:1, so it appears the moment blink starts */
.t-cursor  {
    opacity: 0;
    animation: blink 1s step-end 6.8s infinite;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: #50fa7b;
    vertical-align: text-bottom;
    margin-left: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .t-cmd1 { width: 19ch !important; animation: none !important; }
    .t-cmd2 { width: 2ch  !important; animation: none !important; }
    .t-out1, .t-prompt2, .t-out2, .t-prompt3, .t-cursor { opacity: 1 !important; animation: none !important; }
    .t-cursor { animation: blink 1s step-end infinite !important; }
}

/* ============================================================
   Resume page
   ============================================================ */
.resume-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    gap: 8px;
    box-sizing: border-box;
}

.resume-wrap iframe {
    flex: 1;
    width: 100%;
    min-height: 70vh;
    border: none;
}

/* ============================================================
   Blog page — Explorer-style two-pane layout
   ============================================================ */

/* Tag tab strip — sits at top of .main-body, two-pane fills the rest */
.blog-tag-tabs {
    flex-shrink: 0;
}

/* Win98-style button look for anchor tags */
.btn-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #c0c0c0;
    color: #000;
    text-decoration: none;
    font-size: 11px;
    font-family: inherit;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
                inset -2px -2px #808080, inset 2px 2px #dfdfdf;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.btn-tag.active {
    box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
                inset -2px -2px #dfdfdf, inset 2px 2px #808080;
    padding: 4px 9px 2px 11px;
}

.btn-tag:hover:not(.active) {
    background: #d4d0c8;
}

/* Two-pane explorer area — fills space left after tab strip */
.blog-two-pane {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: auto;
    border-top: 2px solid #808080;
}

/* Left: post list panel */
.blog-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #808080;
    overflow: hidden;
}

.blog-sidebar-label {
    padding: 3px 8px;
    font-size: 10px;
    color: #808080;
    border-bottom: 1px solid #c0c0c0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.blog-post-panel {
    flex: 1;
    overflow-y: auto;
    margin: 4px;
}

/* Override tree-view default cursor/color for post links */
.blog-post-panel.sunken-panel { background: #fff; }

.blog-post-list { list-style: none; padding: 0; margin: 0; }

.blog-post-list li { padding: 4px 6px; cursor: pointer; }
.blog-post-list li:hover { background: #000080; }
.blog-post-list li:hover a,
.blog-post-list li:hover .post-date { color: #fff; }
.blog-post-list li.active { background: #000080; }
.blog-post-list li.active a,
.blog-post-list li.active .post-date { color: #fff; }

.blog-post-list li a {
    display: block;
    color: #000;
    text-decoration: none;
    font-size: 11px;
    line-height: 1.4;
}

.post-date { display: block; font-size: 10px; color: #808080; }

.post-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}

/* Tiny tag badge (sidebar) */
.tag-badge {
    display: inline-block;
    padding: 0 4px;
    font-size: 9px;
    background: #c0c0c0;
    border: 1px solid #808080;
    color: #444;
    text-decoration: none;
}
.blog-post-list li.active  .tag-badge,
.blog-post-list li:hover   .tag-badge {
    background: #000060;
    border-color: #aaa;
    color: #ddd;
}

/* Right: post content pane */
.blog-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 32px;
    min-width: 0;
    background: #fff;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #fff;
    margin: 4px;
}

.blog-content .post-header {
    border-bottom: 1px solid #c0c0c0;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.blog-content .post-header h1 { font-size: 15px; margin-bottom: 4px; }
.blog-content .post-header .post-meta { font-size: 11px; color: #808080; }

.blog-content .post-header-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.blog-content .post-body { font-size: 11px; line-height: 1.7; }

.blog-content .post-body h2,
.blog-content .post-body h3 { font-size: 11px; font-weight: bold; margin: 18px 0 6px; }

.blog-content .post-body p  { margin-bottom: 10px; }
.blog-content .post-body a  { color: #00f; }

.blog-content .post-body code {
    font-family: inherit;
    font-size: inherit;
    background: #f0f0f0;
    border: 1px solid #c0c0c0;
    padding: 0 3px;
}

.blog-content .post-body pre {
    font-family: inherit;
    font-size: inherit;
    background: #f0f0f0;
    border: 1px solid #808080;
    padding: 10px;
    overflow-x: auto;
    margin-bottom: 12px;
    box-shadow: inset 1px 1px #808080;
}

.blog-content .post-body pre code { background: none; border: none; padding: 0; }

.blog-content .post-body blockquote {
    font-family: inherit;
    font-size: inherit;
    border-left: 3px solid #808080;
    padding-left: 12px;
    color: #808080;
    margin: 12px 0;
}

.blog-content .post-body ul,
.blog-content .post-body ol { padding-left: 20px; margin-bottom: 10px; }
.blog-content .post-body li { margin-bottom: 4px; }

.blog-empty { color: #808080; padding: 20px; font-size: 11px; }

/* Mobile sidebar toggle (CSS-only checkbox trick) */
.sidebar-toggle-input { display: none; }
.sidebar-toggle-btn   { display: none; }

/* ============================================================
   Lab page — Win98 Explorer icon view
   ============================================================ */
.lab-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
}

.lab-toolbar button { min-width: auto; padding: 1px 6px; }

.lab-address {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    font-size: 11px;
}

.lab-address input {
    flex: 1;
    font-size: 11px;
    font-family: inherit;
    height: 20px;
}

.lab-icon-view {
    flex: 1;
    overflow: auto;
    margin: 4px;
    padding: 8px;
    background: #fff;
}

.lab-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 4px;
    align-items: flex-start;
}

.lab-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #000;
    padding: 4px;
    user-select: none;
}

.lab-icon:hover, .lab-icon:focus {
    outline: 1px dotted #000;
    background: #000080;
    color: #fff;
}

.lab-thumb {
    display: block;
    width: 120px;
    height: 90px;
    image-rendering: pixelated;
    border: 1px solid #808080;
    box-shadow: inset 1px 1px #808080;
}

.lab-icon-label { font-size: 11px; text-align: center; }

/* Life demo */
.life-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-bottom: 1px solid #808080;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.life-speed-label {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.life-gen { font-size: 11px; margin-left: auto; white-space: nowrap; }

.life-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #808080;
    overflow: auto;
    padding: 8px;
    min-height: 0;
}

#life-canvas {
    image-rendering: pixelated;
    width: 480px;
    height: 360px;
    cursor: crosshair;
    display: block;
    box-shadow: 2px 2px 0 #000;
}

.life-statusbar { margin: 0 1px 1px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    body { padding: 4px; }
    .main-window { height: calc(100vh - 8px); }
    .home-content { padding: 12px; }

    .home-top  { flex-direction: column; }
    .home-lower { flex-direction: column; }
    .notepad-window { flex: none; }
    .blogs-widget-window { width: 100%; }

    .sidebar-toggle-btn {
        display: block;
        margin: 6px;
        width: calc(100% - 12px);
        box-sizing: border-box;
        text-align: left;
    }

    .blog-two-pane {
        flex-direction: column;
    }

    .blog-sidebar {
        display: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #808080;
        max-height: 50vh;
    }

    .sidebar-toggle-input:checked ~ .blog-two-pane .blog-sidebar {
        display: flex;
    }

    .blog-content { margin: 4px; }

    .intro-photo img { width: 80px; }
}
