/* ============================================================
   Kanskje OS — Main Stylesheet
   Windows 95 / DOS / CRT-inspired WordPress Theme
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  /* Win95 System Colors */
  --win-hover:         #d0d8f0;
  --win-desktop:       #008080;
  --win-face:          #c0c0c0;
  --win-highlight:     #ffffff;
  --win-shadow:        #808080;
  --win-dark-shadow:   #404040;
  --win-active-title:  #000080;
  --win-title-text:    #ffffff;
  --win-window:        #ffffff;
  --win-border:        #dfdfdf;
  --win-menu-bar:      #c0c0c0;
  --win-selected:      #000080;
  --win-selected-text: #ffffff;
  --win-disabled:      #808080;
  --win-link:          #0000ee;
  --win-visited:       #551a8b;

  /* Terminal Colors */
  --term-bg:           #0a0a0a;
  --term-text:         #33ff33;
  --term-text-dim:     #1a8c1a;
  --term-cursor:       #33ff33;
  --term-border:       #1a3a1a;
  --term-amber:        #ffb000;
  --term-blue:         #4444ff;
  --term-white:        #c0c0c0;
  --term-header:       #001a00;

  /* Typography */
  --font-system:       'Segoe UI', 'Tahoma', 'Geneva', Arial, sans-serif;
  --font-mono:         'Courier New', 'Lucida Console', monospace;
  --font-pixel:        'Courier New', monospace;
  /* DOS/CP437 font — override with @font-face 'DOS437' if you host the webfont */
  --font-dos:          'DOS437', 'Perfect DOS VGA 437 Win', 'Fixedsys', 'Courier New', monospace;
  /* ASCII art rendering: fixed character width matching 80-col CP437 */
  --ascii-font-size:   14px;
  --ascii-line-height: 1.2;

  /* Layout */
  --container-max:     1140px;
  --sidebar-width:     280px;
  --content-gap:       24px;
  --border-radius:     0;

  /* Beveled Borders — Raised */
  --bevel-raised: inset -1px -1px 0 var(--win-dark-shadow),
                  inset 1px 1px 0 var(--win-highlight),
                  inset -2px -2px 0 var(--win-shadow),
                  inset 2px 2px 0 var(--win-border);

  /* Beveled Borders — Sunken/Pressed */
  --bevel-sunken: inset 1px 1px 0 var(--win-dark-shadow),
                  inset -1px -1px 0 var(--win-highlight),
                  inset 2px 2px 0 var(--win-shadow),
                  inset -2px -2px 0 var(--win-border);

  /* Beveled Borders — Panel (deep inset) */
  --bevel-panel:  inset 1px 1px 0 var(--win-shadow),
                  inset -1px -1px 0 var(--win-highlight);

  /* Beveled Borders — Group Box */
  --bevel-group:  inset 0 0 0 1px var(--win-shadow);
}

/* ── Reset & Base ───────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #000000;
  background-color: var(--win-desktop);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0,0,0,0.03) 3px,
      rgba(0,0,0,0.03) 4px
    );
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar Styling ──────────────────────────────────── */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
::-webkit-scrollbar-track {
  background: var(--win-face);
  box-shadow: var(--bevel-sunken);
}
::-webkit-scrollbar-thumb {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
}
::-webkit-scrollbar-corner {
  background: var(--win-face);
}
::-webkit-scrollbar-button {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  width: 16px;
  height: 16px;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-system);
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: #000000;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4, h5, h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--win-link);
  text-decoration: underline;
}
a:visited { color: var(--win-visited); }
a:hover, a:focus {
  color: var(--win-active-title);
  outline: 1px dotted var(--win-active-title);
  outline-offset: 1px;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--win-window);
  border: 1px solid var(--win-shadow);
  padding: 0.1em 0.3em;
}

pre {
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  line-height: var(--ascii-line-height);
  padding: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  border: 2px solid #000;
  box-shadow: var(--bevel-sunken);
  margin-bottom: 1rem;
  /* Critical: never wrap ASCII art */
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
  tab-size: 8; /* DOS default tab stop */
  -moz-tab-size: 8;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  white-space: inherit;
}

blockquote {
  border-left: 4px solid var(--win-shadow);
  margin: 1rem 0 1rem 1rem;
  padding: 0.5rem 1rem;
  background: var(--win-border);
  box-shadow: var(--bevel-sunken);
  font-style: italic;
}

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li { margin-bottom: 0.25rem; }

hr {
  border: none;
  border-top: 1px solid var(--win-shadow);
  border-bottom: 1px solid var(--win-highlight);
  margin: 1.5rem 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
th {
  background: var(--win-active-title);
  color: var(--win-title-text);
  padding: 0.4rem 0.75rem;
  text-align: left;
  font-weight: bold;
}
td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--win-shadow);
}
tr:nth-child(even) td { background: var(--win-border); }
tr:hover td { background: var(--win-hover); }

/* ── Win95 Core Components ──────────────────────────────── */

/* Window Container */
.win95-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.4);
  position: relative;
}

/* Title Bar */
.win95-titlebar {
  background: linear-gradient(
    to right,
    var(--win-active-title) 0%,
    #1084d0 60%,
    #0058b0 100%
  );
  color: var(--win-title-text);
  padding: 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 22px;
  user-select: none;
}

.win95-titlebar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.win95-titlebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Title Bar Buttons */
.win95-titlebar-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.win95-btn-ctrl {
  width: 16px;
  height: 14px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-family: var(--font-system);
  font-weight: bold;
  color: #000;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 1;
}

.win95-btn-ctrl:hover {
  background: var(--win-face);
  outline: none;
}

.win95-btn-ctrl:active,
.win95-btn-ctrl.pressed {
  box-shadow: var(--bevel-sunken);
}

.win95-btn-close::after { content: '✕'; font-size: 8px; }
.win95-btn-maximize::after { content: '□'; font-size: 9px; }
.win95-btn-minimize::after { content: '_'; font-size: 9px; padding-bottom: 4px; }

/* Menu Bar */
.win95-menubar {
  background: var(--win-menu-bar);
  border-bottom: 1px solid var(--win-shadow);
  padding: 2px 4px;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.win95-menu-item {
  padding: 2px 8px;
  font-size: 0.75rem;
  cursor: default;
  white-space: nowrap;
  text-decoration: none;
  color: #000;
  display: inline-block;
}

.win95-menu-item:hover,
.win95-menu-item:focus {
  background: var(--win-selected);
  color: var(--win-selected-text);
  outline: none;
}

.win95-menu-item:visited { color: #000; }

/* Window Content Area */
.win95-content-area {
  padding: 8px;
  background: var(--win-face);
}

/* Sunken Panel (like a textbox background) */
.win95-panel {
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  padding: 8px;
}

.win95-panel-grey {
  background: var(--win-face);
  box-shadow: var(--bevel-sunken);
  padding: 8px;
}

/* Status Bar */
.win95-statusbar {
  background: var(--win-face);
  border-top: 1px solid var(--win-shadow);
  padding: 2px 8px;
  font-size: 0.7rem;
  display: flex;
  gap: 4px;
  align-items: center;
}

.win95-statusbar-cell {
  box-shadow: var(--bevel-panel);
  padding: 1px 8px;
  min-width: 80px;
}

/* Divider Separator */
.win95-separator {
  width: 2px;
  background: transparent;
  box-shadow: 1px 0 var(--win-shadow), 2px 0 var(--win-highlight);
  margin: 2px 4px;
  align-self: stretch;
}

/* Buttons */
.win95-button,
input[type="submit"],
input[type="reset"],
input[type="button"],
button {
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-raised);
  border: none;
  padding: 4px 16px;
  font-family: var(--font-system);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-width: 75px;
  text-align: center;
  white-space: nowrap;
}

.win95-button:hover,
input[type="submit"]:hover {
  background: var(--win-face);
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.win95-button:active,
input[type="submit"]:active {
  box-shadow: var(--bevel-sunken);
}

.win95-button:focus,
input[type="submit"]:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.win95-button-primary {
  box-shadow: var(--bevel-raised),
              0 0 0 2px #000;
}

/* Form Inputs */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
  background: var(--win-window);
  color: #000;
  box-shadow: var(--bevel-sunken);
  border: none;
  padding: 4px 6px;
  font-family: var(--font-system);
  font-size: 0.875rem;
  width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--win-selected);
  outline-offset: -2px;
}

textarea { resize: vertical; min-height: 100px; }

label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.875rem;
}

.form-field { margin-bottom: 12px; }

/* Tabs */
.win95-tabs {
  display: flex;
  gap: 0;
  margin-bottom: -1px;
  flex-wrap: wrap;
}

.win95-tab {
  background: var(--win-face);
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: inset -1px 0 0 var(--win-shadow),
              inset 0 1px 0 var(--win-highlight),
              inset 1px 0 0 var(--win-highlight);
  position: relative;
  top: 1px;
  margin-right: 2px;
  text-decoration: none;
  color: #000;
}

.win95-tab.active {
  background: var(--win-face);
  z-index: 1;
  padding-top: 6px;
  box-shadow: inset -1px 0 0 var(--win-shadow),
              inset 0 2px 0 var(--win-highlight),
              inset 1px 0 0 var(--win-highlight);
  border-bottom: 2px solid var(--win-face);
}

.win95-tab:hover {
  background: var(--win-border);
  outline: none;
}

/* Progress Bar */
.win95-progressbar {
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  height: 20px;
  overflow: hidden;
  position: relative;
}

.win95-progressbar-fill {
  background: var(--win-selected);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--win-title-text);
  font-size: 0.7rem;
  transition: width 0.3s ease;
  background-image: repeating-linear-gradient(
    90deg,
    var(--win-selected) 0px,
    var(--win-selected) 10px,
    #0000aa 10px,
    #0000aa 12px
  );
}

/* Fieldset / Group Box */
.win95-fieldset {
  border: 1px solid var(--win-shadow);
  box-shadow: 1px 1px 0 var(--win-highlight);
  padding: 16px 12px 12px;
  margin-bottom: 16px;
  position: relative;
}

.win95-fieldset legend {
  background: var(--win-face);
  padding: 0 6px;
  font-size: 0.875rem;
  font-weight: bold;
  position: absolute;
  top: -0.75em;
  left: 8px;
}

/* ── Terminal Components ─────────────────────────────────── */

.terminal-window {
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.terminal-window::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.02) 2px,
    rgba(0, 255, 65, 0.02) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.terminal-titlebar {
  background: var(--term-header);
  border-bottom: 1px solid var(--term-border);
  padding: 4px 10px;
  font-size: 0.75rem;
  color: var(--term-text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-titlebar-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }

.terminal-body {
  padding: 16px;
  position: relative;
  z-index: 2;
}

.terminal-prompt {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin-bottom: 0.5em;
  flex-wrap: wrap;
}

.terminal-prompt-user {
  color: var(--term-text);
  font-weight: bold;
}

.terminal-prompt-path {
  color: var(--term-amber);
}

.terminal-prompt-symbol {
  color: var(--term-text);
}

.terminal-prompt-cmd {
  color: #ffffff;
  flex: 1;
}

.terminal-output {
  color: var(--term-text-dim);
  margin-bottom: 1em;
  padding-left: 0;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--term-cursor);
  vertical-align: text-bottom;
  animation: blink-cursor 1s step-start infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* DOS-style scanlines overlay */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.08),
    rgba(0,0,0,0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 10;
}

/* ── Site Layout ─────────────────────────────────────────── */

.site-wrapper {
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main site "window" */
.site-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              4px 4px 16px rgba(0,0,0,0.5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */

.site-header {
  background: var(--win-face);
}

.site-header-titlebar {
  background: linear-gradient(
    to right,
    var(--win-active-title) 0%,
    #1084d0 70%,
    #0058b0 100%
  );
  color: var(--win-title-text);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.site-header-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--win-title-text);
}

.site-logo-area:hover,
.site-logo-area:visited {
  color: var(--win-title-text);
  outline: none;
}

.site-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--win-face);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--bevel-raised);
  flex-shrink: 0;
}

.site-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.site-name {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.2;
}

.site-tagline {
  font-size: 0.7rem;
  opacity: 0.85;
  font-weight: normal;
}

.site-header-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* ── Navigation ──────────────────────────────────────────── */

.site-nav {
  background: var(--win-menu-bar);
  border-bottom: 2px solid var(--win-shadow);
  position: relative;
}

.site-nav-inner {
  display: flex;
  align-items: stretch;
  padding: 0;
  gap: 0;
  flex-wrap: wrap;
}

.site-nav .menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  flex: 1;
}

.site-nav .menu li {
  position: relative;
  margin: 0;
}

.site-nav .menu a {
  display: block;
  padding: 6px 14px;
  font-size: 0.8125rem;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
  line-height: 1.4;
}

.site-nav .menu a:visited { color: #000; }

.site-nav .menu a:hover,
.site-nav .menu a:focus {
  background: var(--win-selected);
  color: var(--win-selected-text);
  outline: none;
}

.site-nav .menu .current-menu-item > a,
.site-nav .menu .current-menu-ancestor > a {
  background: var(--win-selected);
  color: var(--win-selected-text);
}

/* Dropdown */
.site-nav .menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 999;
  min-width: 160px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 6px rgba(0,0,0,0.3);
  list-style: none;
  padding: 2px 0;
}

.site-nav .menu li:hover > .sub-menu,
.site-nav .menu li:focus-within > .sub-menu {
  display: block;
}

.site-nav .menu .sub-menu li { position: relative; }

.site-nav .menu .sub-menu a {
  padding: 4px 24px 4px 16px;
  width: 100%;
  font-size: 0.8125rem;
}

.site-nav .menu .sub-menu .sub-menu {
  left: 100%;
  top: 0;
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  border: none;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.8125rem;
  margin: 4px 8px;
}

.nav-toggle:focus { outline: 1px dotted #000; }

/* ── Content Layout ──────────────────────────────────────── */

.site-content {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--content-gap);
  padding: 12px;
  background: var(--win-desktop);
  flex: 1;
}

.site-content.no-sidebar {
  grid-template-columns: 1fr;
}

.content-area {
  min-width: 0;
}

.widget-area {
  min-width: 0;
}

/* ── Posts & Cards ───────────────────────────────────────── */

.post-card {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

.post-card-titlebar {
  background: linear-gradient(
    to right,
    #808080 0%,
    var(--win-shadow) 100%
  );
  color: var(--win-title-text);
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  user-select: none;
}

.post-card.featured .post-card-titlebar {
  background: linear-gradient(
    to right,
    var(--win-active-title) 0%,
    #1084d0 100%
  );
}

.post-card-body {
  padding: 12px;
}

.post-thumbnail {
  margin-bottom: 12px;
  box-shadow: var(--bevel-sunken);
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-meta {
  font-size: 0.75rem;
  color: var(--win-shadow);
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.post-meta a {
  color: var(--win-shadow);
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-title {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.post-title a {
  color: #000;
  text-decoration: none;
}

.post-title a:visited { color: #000; }
.post-title a:hover {
  color: var(--win-active-title);
  text-decoration: underline;
}

.post-excerpt {
  font-size: 0.875rem;
  color: #222;
  margin-bottom: 12px;
}

.post-card-footer {
  background: var(--win-face);
  border-top: 1px solid var(--win-shadow);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-tag a {
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  padding: 1px 6px;
  font-size: 0.7rem;
  text-decoration: none;
  color: #000;
  display: inline-block;
}

.post-tag a:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

/* Sticky Post */
.sticky .post-card-titlebar::before {
  content: '📌 ';
}

/* ── Single Post ─────────────────────────────────────────── */

.single-post-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

.post-content {
  padding: 16px;
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  margin: 8px;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  border-bottom: 2px solid var(--win-shadow);
  padding-bottom: 4px;
}

.post-content p { margin-bottom: 1.25em; }

.post-content ul,
.post-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25em;
}

.post-content img {
  max-width: 100%;
  height: auto;
  box-shadow: var(--bevel-sunken);
  margin: 1em auto;
}

.post-content .wp-block-image { margin: 1.5em 0; }

.post-content figure figcaption {
  font-size: 0.8rem;
  color: var(--win-shadow);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

.post-navigation {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 8px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-previous,
.nav-next {
  flex: 1;
  min-width: 0;
}

.nav-next { text-align: right; }

.nav-previous a,
.nav-next a {
  display: inline-block;
  padding: 6px 12px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  text-decoration: none;
  color: #000;
  font-size: 0.8125rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-previous a:hover,
.nav-next a:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

/* ── Archive / Category Header ───────────────────────────── */

.archive-header {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  margin-bottom: 16px;
}

.archive-header-titlebar {
  background: linear-gradient(
    to right,
    #4a4a8a 0%,
    #6060a0 100%
  );
  color: var(--win-title-text);
  padding: 4px 10px;
  font-size: 0.8125rem;
  font-weight: bold;
}

.archive-header-body {
  padding: 12px;
}

.archive-title { font-size: 1.2rem; margin-bottom: 4px; }
.archive-description { font-size: 0.875rem; color: #333; }

/* ── Sidebar & Widgets ───────────────────────────────────── */

.sidebar-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
  position: sticky;
  top: 16px;
}

.sidebar-titlebar {
  background: linear-gradient(
    to right,
    #404080 0%,
    #5555aa 100%
  );
  color: var(--win-title-text);
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  min-height: 20px;
  display: flex;
  align-items: center;
}

.sidebar-content { padding: 8px; }

.widget {
  margin-bottom: 12px;
}

.widget-title {
  background: var(--win-face);
  font-size: 0.8125rem;
  font-weight: bold;
  padding: 3px 8px;
  margin-bottom: 6px;
  box-shadow: var(--bevel-raised);
}

.widget-content {
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  padding: 8px;
  font-size: 0.8125rem;
}

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

.widget-content ul li {
  padding: 3px 0;
  border-bottom: 1px solid var(--win-border);
}

.widget-content ul li:last-child { border-bottom: none; }

.widget-content a {
  color: #000;
  text-decoration: none;
  font-size: 0.8125rem;
}

.widget-content a:hover {
  color: var(--win-active-title);
  text-decoration: underline;
}

/* Search Widget */
.widget .search-form {
  display: flex;
  gap: 4px;
}

.widget .search-form input[type="search"] {
  flex: 1;
  padding: 3px 6px;
  font-size: 0.8125rem;
}

.widget .search-form .search-submit {
  padding: 3px 10px;
  font-size: 0.8125rem;
  min-width: auto;
  white-space: nowrap;
}

/* ── Pagination ──────────────────────────────────────────── */

.pagination {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 8px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.8125rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  text-decoration: none;
  color: #000;
  font-size: 0.8125rem;
}

.pagination .page-numbers:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

.pagination .page-numbers.current {
  background: var(--win-selected);
  color: var(--win-title-text);
  box-shadow: var(--bevel-sunken);
}

.pagination .page-numbers.dots {
  background: transparent;
  box-shadow: none;
}

/* ── Comments ────────────────────────────────────────────── */

.comments-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
  margin-top: 16px;
}

.comments-list {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.comment {
  margin-bottom: 12px;
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  padding: 10px;
}

.comment.bypostauthor > .comment-inner > .comment-meta::before {
  content: '★ ';
  color: var(--win-active-title);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--win-shadow);
  flex-wrap: wrap;
}

.comment-author-name {
  font-weight: bold;
  color: #000;
}

.comment-avatar img {
  box-shadow: var(--bevel-raised);
}

.comment-text { font-size: 0.875rem; }
.comment-text p:last-child { margin-bottom: 0; }

.comment-reply a {
  font-size: 0.75rem;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 2px 8px;
  text-decoration: none;
  color: #000;
  display: inline-block;
  margin-top: 6px;
}

.comment-reply a:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

.children {
  list-style: none;
  margin-left: 24px;
  margin-top: 8px;
  padding: 0;
}

.comment-respond {
  padding: 8px;
}

.comment-reply-title {
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--win-shadow);
}

/* ── 404 Page ────────────────────────────────────────────── */

.error-404-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
}

.error-terminal {
  padding: 24px;
}

/* ── Search Results ──────────────────────────────────────── */

.search-header {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 12px;
  margin-bottom: 16px;
}

.search-header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-form-inline {
  display: flex;
  gap: 4px;
  flex: 1;
}

.search-form-inline input[type="search"] { flex: 1; }

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
  background: var(--win-face);
  border-top: 1px solid var(--win-shadow);
}

.site-footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
  border-bottom: 2px solid var(--win-shadow);
}

.site-footer-statusbar {
  display: flex;
  align-items: center;
  padding: 3px 8px;
  gap: 4px;
  font-size: 0.7rem;
  background: var(--win-face);
  flex-wrap: wrap;
}

.footer-start-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  border: none;
  padding: 2px 10px 2px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  font-family: var(--font-system);
  text-decoration: none;
  color: #000;
}

.footer-start-button:hover {
  color: #000;
  outline: 1px dotted #000;
  outline-offset: -3px;
}

.footer-start-icon { font-size: 16px; }

.footer-clock {
  margin-left: auto;
  box-shadow: var(--bevel-sunken);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  min-width: 60px;
  text-align: center;
}

.footer-credits {
  box-shadow: var(--bevel-sunken);
  padding: 2px 12px;
  font-size: 0.7rem;
  color: var(--win-shadow);
}

/* ── Homepage Sections ───────────────────────────────────── */

.homepage-hero {
  margin-bottom: 16px;
}

.hero-window {
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-mono);
  box-shadow: var(--bevel-sunken);
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  padding: 32px 40px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 2rem;
  color: var(--term-text);
  font-family: var(--font-mono);
  margin-bottom: 12px;
  font-weight: normal;
  text-shadow:
    0 0 4px  var(--term-text),
    0 0 14px var(--term-text),
    0 0 30px rgba(51, 255, 51, 0.5);
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--term-amber);
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.hero-cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-btn {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  color: #000;
  padding: 6px 20px;
  text-decoration: none;
  font-family: var(--font-system);
  font-size: 0.875rem;
  display: inline-block;
}

.hero-btn:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
  outline: none;
}

.hero-btn:visited { color: #000; }
.hero-btn:hover:visited { color: var(--win-title-text); }

.hero-btn-primary {
  background: var(--win-active-title);
  color: var(--win-title-text);
  box-shadow: var(--bevel-raised);
}

.hero-btn-primary:hover {
  background: #0000a0;
  color: var(--win-title-text);
}

.hero-btn-primary:visited { color: var(--win-title-text); }

/* Featured Posts Grid */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* DOS Panel Section */
.dos-panel {
  margin-bottom: 16px;
}

.dos-panel .terminal-body {
  min-height: 120px;
}

/* Recent Posts List */
.posts-list-window {
  background: var(--win-face);
  box-shadow: var(--bevel-raised),
              2px 2px 8px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

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

.posts-list-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--win-border);
  gap: 8px;
  font-size: 0.8125rem;
}

.posts-list-item:last-child { border-bottom: none; }

.posts-list-item:hover {
  background: var(--win-hover);
}

.posts-list-item-icon {
  width: 16px;
  flex-shrink: 0;
  font-size: 14px;
}

.posts-list-item-title {
  flex: 1;
  min-width: 0;
}

.posts-list-item-title a {
  text-decoration: none;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.posts-list-item-title a:hover { text-decoration: underline; }

.posts-list-item-date {
  color: var(--win-shadow);
  font-size: 0.75rem;
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* ── ASCII Art Display ───────────────────────────────────── */
/*
 * Usage options:
 *   1. Gutenberg Code block  — auto-styled via pre
 *   2. Shortcode: [ascii]...[/ascii]  — wraps in .ascii-viewer window
 *   3. Class on any element: class="ascii-art"
 *
 * For full CP437 fidelity, place a DOS font webfont in assets/fonts/
 * and declare it as font-family: 'DOS437' in your child theme.
 * Recommended: "Perfect DOS VGA 437 Win" (Zeh Fernando, free).
 */

/* Perfect DOS VGA 437 — self-hosted, bundled with theme */
@font-face {
  font-family: 'DOS437';
  src: local('Perfect DOS VGA 437 Win'),
       url('../fonts/PerfectDOSVGA437Win.woff') format('woff');
  font-weight: normal;
  font-style:  normal;
  font-display: block; /* block prevents FOUT on ASCII art */
  unicode-range: U+0000-00FF, U+2500-257F, U+2580-259F, U+25A0-25FF,
                 U+2600-26FF; /* Latin + box drawing + block elements + misc symbols */
}

@font-face {
  font-family: 'DOS437';
  src: local('Perfect DOS VGA 437'),
       url('../fonts/PerfectDOSVGA437.woff') format('woff');
  font-weight: bold;
  font-style:  normal;
  font-display: block;
}

/* Core ASCII/ANSI viewer — full terminal window chrome */
.ascii-viewer {
  background: var(--term-bg);
  border: 2px solid #000;
  box-shadow: var(--bevel-sunken),
              0 0 0 1px #1a1a1a;
  margin-bottom: 16px;
  position: relative;
}

.ascii-viewer-titlebar {
  background: var(--term-header);
  border-bottom: 1px solid #0d260d;
  padding: 3px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-dos);
  font-size: 0.75rem;
  color: var(--term-text-dim);
  user-select: none;
}

.ascii-viewer-controls {
  display: flex;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--term-text-dim);
}

/* The art itself */
.ascii-art,
.ascii-viewer pre,
.ascii-viewer .ascii-content {
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  line-height: var(--ascii-line-height);
  color: var(--term-white);
  background: var(--term-bg);
  padding: 16px;
  margin: 0;
  border: none;
  box-shadow: none;
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
  overflow-x: auto;
  overflow-y: visible;
  tab-size: 8;
  -moz-tab-size: 8;
  /* Use the system scrollbar styled to match Win95 */
  scrollbar-width: thin;
  scrollbar-color: var(--win-face) var(--term-bg);
}

/* Horizontal scroll indicator */
.ascii-viewer::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  pointer-events: none;
}

/* Scrollbar track inside ascii viewer */
.ascii-art::-webkit-scrollbar,
.ascii-viewer pre::-webkit-scrollbar {
  height: 14px;
  width: 14px;
}
.ascii-art::-webkit-scrollbar-track,
.ascii-viewer pre::-webkit-scrollbar-track {
  background: var(--term-bg);
  border-top: 1px solid #1a1a1a;
}
.ascii-art::-webkit-scrollbar-thumb,
.ascii-viewer pre::-webkit-scrollbar-thumb {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
}

/* ANSI color classes — standard 16 CGA/ANSI palette */
.ansi-black   { color: #000000; } .ansi-bg-black   { background: #000000; }
.ansi-red     { color: #aa0000; } .ansi-bg-red     { background: #aa0000; }
.ansi-green   { color: #00aa00; } .ansi-bg-green   { background: #00aa00; }
.ansi-yellow  { color: #aa5500; } .ansi-bg-yellow  { background: #aa5500; }
.ansi-blue    { color: #0000aa; } .ansi-bg-blue    { background: #0000aa; }
.ansi-magenta { color: #aa00aa; } .ansi-bg-magenta { background: #aa00aa; }
.ansi-cyan    { color: #00aaaa; } .ansi-bg-cyan    { background: #00aaaa; }
.ansi-white   { color: #aaaaaa; } .ansi-bg-white   { background: #aaaaaa; }
/* Bright variants */
.ansi-bright-black   { color: #555555; } .ansi-bg-bright-black   { background: #555555; }
.ansi-bright-red     { color: #ff5555; } .ansi-bg-bright-red     { background: #ff5555; }
.ansi-bright-green   { color: #55ff55; } .ansi-bg-bright-green   { background: #55ff55; }
.ansi-bright-yellow  { color: #ffff55; } .ansi-bg-bright-yellow  { background: #ffff55; }
.ansi-bright-blue    { color: #5555ff; } .ansi-bg-bright-blue    { background: #5555ff; }
.ansi-bright-magenta { color: #ff55ff; } .ansi-bg-bright-magenta { background: #ff55ff; }
.ansi-bright-cyan    { color: #55ffff; } .ansi-bg-bright-cyan    { background: #55ffff; }
.ansi-bright-white   { color: #ffffff; } .ansi-bg-bright-white   { background: #ffffff; }
.ansi-bold  { font-weight: bold; }
.ansi-blink { animation: blink-cursor 1s step-start infinite; }

/* ASCII post card excerpt — mini terminal window preview */
.ascii-excerpt-wrapper {
  margin-bottom: 8px;
  box-shadow: var(--bevel-sunken);
}

.ascii-excerpt-titlebar {
  background: var(--term-header);
  border-bottom: 1px solid var(--term-border);
  padding: 2px 8px;
  font-family: var(--font-dos);
  font-size: 0.7rem;
  color: var(--term-text-dim);
  display: flex;
  justify-content: space-between;
  user-select: none;
}

.ascii-excerpt-preview {
  background: var(--term-bg);
  color: var(--term-white);
  font-family: var(--font-dos);
  font-size: 11px;
  line-height: 1.2;
  padding: 8px 10px;
  margin: 0;
  white-space: pre;              /* preserve spaces + newlines */
  overflow-x: auto;              /* scroll wide art horizontally */
  overflow-y: hidden;
  max-height: 106px;             /* 8 lines × 11px × 1.2 */
  display: block;
  position: relative;
}

/* Fade bottom edge */
.ascii-excerpt-wrapper::after {
  content: '';
  display: block;
  height: 20px;
  background: linear-gradient(to bottom, transparent, var(--term-bg));
  margin-top: -20px;
  position: relative;
  pointer-events: none;
}

.ascii-post-badge {
  display: inline-block;
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-dos);
  font-size: 0.7rem;
  padding: 1px 6px;
  box-shadow: var(--bevel-sunken);
  margin-right: 6px;
  vertical-align: middle;
}

/* post-content: override all pre/code inside article body */
.post-content pre {
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  line-height: var(--ascii-line-height);
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
  overflow-x: auto;
  padding: 16px;
  background: var(--term-bg);
  color: var(--term-white);
  box-shadow: var(--bevel-sunken);
  border: none;
  tab-size: 8;
  -moz-tab-size: 8;
  margin: 1em 0;
}

.post-content .wp-block-code pre,
.post-content .wp-block-code {
  font-family: var(--font-dos);
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
}

/* ── Block Editor Styles ─────────────────────────────────── */

.wp-block-quote {
  border-left: 4px solid var(--win-shadow);
  padding: 0.5rem 1rem;
  background: var(--win-border);
  box-shadow: var(--bevel-sunken);
  font-style: italic;
}

.wp-block-code {
  background: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-mono);
  padding: 1rem;
  box-shadow: var(--bevel-sunken);
}

.wp-block-pullquote {
  border: 2px solid var(--win-shadow);
  padding: 1rem;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  text-align: center;
}

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--win-shadow);
  border-bottom: 1px solid var(--win-highlight);
}

.wp-block-button__link {
  background: var(--win-face);
  color: #000;
  box-shadow: var(--bevel-raised);
  border-radius: 0 !important;
  padding: 6px 20px;
  text-decoration: none;
}

.wp-block-button__link:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

.is-style-outline .wp-block-button__link {
  background: transparent;
  box-shadow: var(--bevel-sunken);
  color: #000;
}

.wp-block-table table { margin-bottom: 0; }

.wp-block-image img {
  box-shadow: var(--bevel-sunken);
}

.wp-block-cover {
  border: 2px solid var(--win-shadow);
}

/* ── Utility Classes ─────────────────────────────────────── */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--win-face);
  clip: auto !important;
  clip-path: none;
  height: auto;
  left: 6px;
  top: 6px;
  padding: 6px 12px;
  width: auto;
  z-index: 99999;
}

.alignleft {
  float: left;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.alignright {
  float: right;
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.alignwide {
  margin-left: -24px;
  margin-right: -24px;
}

.alignfull {
  margin-left: -32px;
  margin-right: -32px;
}

.has-text-align-center { text-align: center; }
.has-text-align-right  { text-align: right; }

.no-results {
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
}

/* ── Skip Link ───────────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 6px;
  z-index: 99999;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  padding: 6px 12px;
  text-decoration: none;
  color: #000;
  font-size: 0.875rem;
}

.skip-link:focus { top: 6px; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 1024px) {
  :root { --sidebar-width: 240px; }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-content {
    grid-template-columns: 1fr;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .site-footer-widgets {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav-inner {
    flex-direction: column;
  }

  .site-nav .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid var(--win-shadow);
  }

  .site-nav .menu.nav-open {
    display: flex;
  }

  .site-nav .menu .sub-menu {
    position: static;
    box-shadow: none;
    border-left: 16px solid var(--win-border);
    display: none;
  }

  .site-nav .menu li.menu-item-has-children.open > .sub-menu {
    display: block;
  }

  .hero-title { font-size: 1.4rem; }

  .hero-content { padding: 20px; }

  .site-header-titlebar { padding: 4px 8px; }

  .site-name { font-size: 0.875rem; }

  .post-navigation {
    flex-direction: column;
  }

  .nav-next { text-align: left; }

  .widget-area { order: -1; }

  .sidebar-window { position: static; }

  .alignwide,
  .alignfull {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .site-wrapper { padding: 8px; }

  .hero-title { font-size: 1.1rem; }

  .post-meta { gap: 6px; }

  .site-footer-statusbar { flex-direction: column; align-items: flex-start; }

  .footer-clock { margin-left: 0; }

  .pagination { gap: 2px; }
}

/* ── Clippi (paper clip assistant) ──────────────────────── */

#clippy-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  user-select: none;
  pointer-events: none; /* only children capture events */
}

/* Win95-style tooltip bubble */
#clippy-bubble {
  display: none;
  background: #ffffe1;
  border: 2px solid #000;
  padding: 7px 22px 7px 9px;
  font-family: var(--font-system);
  font-size: 0.75rem;
  color: #000;
  max-width: 190px;
  line-height: 1.4;
  box-shadow: 2px 2px 0 #000;
  position: relative;
  pointer-events: auto;
}

/* Tail pointing down-right toward Clippi */
#clippy-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 16px;
  border-right: 8px solid transparent;
  border-top: 9px solid #000;
}
#clippy-bubble::before {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 18px;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffffe1;
  z-index: 1;
}

#clippy-bubble-close {
  position: absolute;
  top: 1px;
  right: 2px;
  background: none;
  border: none;
  padding: 0;
  width: 18px;
  height: 18px;
  min-width: 0;
  box-shadow: none;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#clippy-char {
  cursor: pointer;
  pointer-events: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: clippy-bob 2.6s ease-in-out infinite;
  transform-origin: bottom center;
  /* drop shadow so Clippi is visible against any background */
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.5));
}

#clippy-char:hover {
  animation: clippy-bob 1.3s ease-in-out infinite;
  filter: drop-shadow(1px 2px 6px rgba(0,0,0,0.7));
}

/* Idle bob */
@keyframes clippy-bob {
  0%   { transform: translateY(0)    rotate( 0deg);  }
  30%  { transform: translateY(-6px) rotate(-2deg);  }
  65%  { transform: translateY(-3px) rotate( 1.5deg);}
  100% { transform: translateY(0)    rotate( 0deg);  }
}

/* Wave / excited (triggered by JS class) */
@keyframes clippy-wave {
  0%   { transform: translateY(0)     rotate(  0deg); }
  12%  { transform: translateY(-10px) rotate(-18deg); }
  28%  { transform: translateY(-6px)  rotate( 14deg); }
  44%  { transform: translateY(-10px) rotate(-10deg); }
  60%  { transform: translateY(-4px)  rotate(  7deg); }
  78%  { transform: translateY(-7px)  rotate( -4deg); }
  100% { transform: translateY(0)     rotate(  0deg); }
}

.clippy-waving {
  animation: clippy-wave 0.75s ease-in-out !important;
}

/* Blink — CSS-driven via the SVG overlay rects */
@keyframes clippy-blink {
  0%, 87%       { opacity: 0; }
  90%, 94%      { opacity: 1; }
  97%, 100%     { opacity: 0; }
}

.clippy-blink-l { animation: clippy-blink 3.8s infinite; }
.clippy-blink-r { animation: clippy-blink 3.8s 0.05s infinite; }

/* ── Berserk / God Mode ──────────────────────────────────── */

/* Frantic spin-twitch replaces idle bob */
@keyframes clippy-berserk-spin {
  0%   { transform: rotate(  0deg) scale(1.3)  translateY(  0px); }
  10%  { transform: rotate(-25deg) scale(1.45) translateY( -8px); }
  22%  { transform: rotate( 18deg) scale(1.25) translateY( -3px); }
  34%  { transform: rotate(-30deg) scale(1.5)  translateY(-10px); }
  48%  { transform: rotate( 22deg) scale(1.35) translateY( -5px); }
  60%  { transform: rotate(-15deg) scale(1.4)  translateY( -8px); }
  74%  { transform: rotate( 35deg) scale(1.2)  translateY( -2px); }
  88%  { transform: rotate(-20deg) scale(1.45) translateY( -9px); }
  100% { transform: rotate(  0deg) scale(1.3)  translateY(  0px); }
}

#clippy-char.clippy-berserk {
  animation: clippy-berserk-spin 0.45s ease-in-out infinite !important;
  filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.9))
          drop-shadow(0 0 20px rgba(255, 80, 0, 0.6))
          drop-shadow(1px 2px 3px rgba(0,0,0,0.5)) !important;
  cursor: crosshair;
}

/* Bloodshot veins — off by default, on in berserk */
.clippy-vein         { opacity: 0; transition: opacity 0.15s; }
.clippy-red-pupil-l,
.clippy-red-pupil-r  { opacity: 0; transition: opacity 0.15s; }
.clippy-scuff        { opacity: 0; transition: opacity 0.2s; }

#clippy-char.clippy-berserk .clippy-vein        { opacity: 1; }
#clippy-char.clippy-berserk .clippy-red-pupil-l,
#clippy-char.clippy-berserk .clippy-red-pupil-r { opacity: 0.9; }
#clippy-char.clippy-berserk .clippy-scuff       { opacity: 0.8; }

/* Suppress normal blink during berserk (eyes are already red) */
#clippy-char.clippy-berserk .clippy-blink-l,
#clippy-char.clippy-berserk .clippy-blink-r {
  animation: none !important;
  opacity: 0 !important;
}

/* Bubble gets a red tint during berserk */
#clippy-container:has(#clippy-char.clippy-berserk) #clippy-bubble {
  background: #fff0f0;
  border-color: #cc0000;
  box-shadow: 2px 2px 0 #990000;
}

@media print {
  #clippy-container { display: none; }
}

/* ── BIOS Boot Screen ────────────────────────────────────── */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000000;
  overflow: hidden;
  /* DOS font + VGA-style sizing */
  font-family: var(--font-dos);
  font-size: 14px;
  line-height: 1.45;
  color: #aaaaaa;
}

/* Energy Star logo — top-right corner */
#boot-logo {
  position: absolute;
  top: 10px;
  right: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: var(--font-dos);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre;
  /* suppress global pre styles */
  color: #55ff55;
  word-break: normal;
}

/* Logo colour spans */
.boot-logo-border { color: #55ff55; }   /* bright green outer box    */
.boot-logo-box    { color: #aaaaaa; }   /* white inner box + walls   */
.boot-logo-roof   { color: #ffff55; }   /* yellow roof lines         */
.boot-logo-star   { color: #ffff55; font-size: 16px; } /* yellow ★  */
.boot-logo-text   { color: #aaaaaa; }   /* dim "An Energy Star Ally" */

/* BIOS text area — top-left */
#boot-text {
  position: absolute;
  top: 10px;
  left: 20px;
  right: 260px; /* leave room for logo */
  white-space: pre;
}

#boot-text div {
  min-height: 1.45em;
}

/* Text colour classes */
.boot-cyan  { color: #55ffff; }
.boot-white { color: #aaaaaa; }
.boot-dim   { color: #555555; }

/* Fade-out animation */
@keyframes boot-fade-out {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

#boot-screen.boot-fadeout {
  animation: boot-fade-out 0.7s ease-in forwards;
  pointer-events: none;
}

/* ── Party Report Template ───────────────────────────────── */

.party-report-window {
  background: var(--term-bg);
  color: var(--term-white);
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  line-height: var(--ascii-line-height);
  box-shadow: var(--bevel-raised), 2px 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 16px;
}

.party-report-titlebar {
  background: linear-gradient(to right, var(--win-active-title) 0%, #1084d0 60%, #0058b0 100%);
  color: var(--win-title-text);
  padding: 3px 8px;
  font-family: var(--font-system);
  font-size: 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  user-select: none;
}

.party-report-titlebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.party-report-menubar {
  background: var(--term-header);
  border-bottom: 1px solid #0d260d;
}

.party-report-menubar .win95-menu-item {
  color: var(--term-text-dim);
  font-family: var(--font-system);
  font-size: 0.75rem;
  padding: 2px 10px;
}

.party-report-menubar .win95-menu-item:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

.party-report-body {
  padding: 0;
}

.party-report-content {
  padding: 20px 28px;
  min-height: 200px;
}

/* All typography inside party report uses DOS font + terminal colours */
.party-report-content,
.party-report-content p,
.party-report-content li {
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  line-height: 1.5;
  color: var(--term-white);
}

.party-report-content h1,
.party-report-content h2,
.party-report-content h3,
.party-report-content h4 {
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  color: var(--term-text);       /* green for headings */
  border-bottom: none;
  margin-top: 1.5em;
  margin-bottom: 0.25em;
  font-weight: bold;
}

.party-report-content a {
  color: var(--term-amber);
  text-decoration: none;
}

.party-report-content a:hover {
  color: var(--term-text);
  text-decoration: underline;
}

.party-report-content pre,
.party-report-content .ascii-viewer {
  background: transparent;
  color: var(--term-white);
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0.5em 0;
}

.party-report-content .ascii-viewer {
  border: none;
  background: transparent;
  margin-bottom: 8px;
}

.party-report-content table { width: auto; }

.party-report-content th {
  background: transparent;
  color: var(--term-text);
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  font-weight: bold;
  padding: 0 2em 0 0;
}

.party-report-content td {
  font-family: var(--font-dos);
  font-size: var(--ascii-font-size);
  color: var(--term-white);
  padding: 0 2em 0 0;
  border: none;
}

.party-report-content tr:nth-child(even) td { background: transparent; }
.party-report-content tr:hover td { background: rgba(51,255,51,0.06); }

.party-report-statusbar {
  background: var(--term-header);
  border-top: 1px solid #0d260d;
  font-family: var(--font-system);
  font-size: 0.7rem;
  display: flex;
  gap: 2px;
  padding: 2px 4px;
}

.party-report-statusbar .win95-statusbar-cell {
  color: var(--term-text-dim);
  box-shadow: none;
  border: 1px solid #1a3a1a;
}

.party-report-edit {
  padding: 6px 12px;
  border-top: 1px solid #1a3a1a;
  font-family: var(--font-system);
  font-size: 0.75rem;
}

.party-report-edit a { color: var(--term-text); }

/* ── Win95 Context Menu ──────────────────────────────────── */

#win95-context-menu {
  display: none;
  position: fixed;
  z-index: 99998;
  background: var(--win-face);
  box-shadow: var(--bevel-raised), 2px 2px 8px rgba(0,0,0,0.3);
  padding: 2px;
  min-width: 170px;
  font-family: var(--font-system);
  font-size: 0.8125rem;
}

.ctx-item {
  padding: 4px 24px 4px 28px;
  cursor: default;
  white-space: nowrap;
  color: #000;
  position: relative;
  user-select: none;
}

.ctx-item:hover {
  background: var(--win-selected);
  color: var(--win-title-text);
}

.ctx-item.ctx-disabled {
  color: var(--win-shadow);
  pointer-events: none;
}

/* Checkmark / arrow gutter on left */
.ctx-item::before {
  content: attr(data-check);
  position: absolute;
  left: 8px;
  font-size: 0.7rem;
}

.ctx-sep {
  height: 0;
  border-top: 1px solid var(--win-shadow);
  border-bottom: 1px solid var(--win-highlight);
  margin: 3px 4px;
}

/* ── Easter Egg: Fireworks Canvas ────────────────────────── */

#easter-canvas {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99997;
  pointer-events: none;
}

/* ── Category Disk-Label Badges ─────────────────────────── */

.cat-disk-label {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  box-shadow: var(--bevel-raised);
  overflow: hidden;
  vertical-align: middle;
  background: #f0f0f4;
  min-width: 44px;
  max-width: 100px;
  margin: 1px 2px;
  cursor: pointer;
}

.cat-disk-label-stripe {
  display: block;
  height: 5px;
  flex-shrink: 0;
}

.cat-disk-label-name {
  font-family: var(--font-system);
  font-size: 0.6rem;
  color: #000;
  line-height: 1.3;
  padding: 2px 5px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: block;
}

.cat-disk-label:hover {
  background: var(--win-hover);
  outline: 1px dotted #000;
  outline-offset: -2px;
}

.cat-disk-label:focus {
  outline: 1px dotted #000;
  outline-offset: -2px;
}

/* Large variant — used in archive header */
.cat-disk-label--large {
  min-width: 72px;
  max-width: 160px;
}

.cat-disk-label--large .cat-disk-label-stripe {
  height: 8px;
}

.cat-disk-label--large .cat-disk-label-name {
  font-size: 0.75rem;
  padding: 4px 10px 5px;
  font-weight: bold;
}

.archive-cat-label-row {
  margin-bottom: 10px;
}

.post-meta-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
}

/* ── Post File Size Badge ────────────────────────────────── */

.post-card-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-filesize {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--win-shadow);
  white-space: nowrap;
}

.post-filesize-ext {
  background: var(--win-window);
  box-shadow: var(--bevel-sunken);
  padding: 1px 5px;
  font-weight: bold;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: #000;
}

.post-filesize-kb {
  color: var(--win-shadow);
}

/* ── Blue Screen of Death ────────────────────────────────── */

#bsod-overlay {
  position: fixed;
  inset: 0;
  z-index: 999996;
  background: #0000aa;
  color: #aaaaaa;
  font-family: var(--font-dos);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
  cursor: pointer;
}

.bsod-inner {
  max-width: 660px;
  width: 100%;
}

.bsod-header {
  display: inline-block;
  background: #aaaaaa;
  color: #0000aa;
  padding: 1px 10px;
  margin-bottom: 20px;
  font-weight: bold;
  font-size: 14px;
}

.bsod-body {
  color: #aaaaaa;
}

.bsod-body strong { color: #ffffff; }

.bsod-continue { color: #ffffff; }

.bsod-cursor {
  display: inline-block;
  animation: blink-cursor 1s step-start infinite;
}

/* ── Desktop Overlay ─────────────────────────────────────── */

#desktop-overlay {
  position: fixed;
  inset: 0;
  z-index: 99984;
  background: var(--win-desktop);
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.03) 3px,
    rgba(0,0,0,0.03) 4px
  );
  overflow-y: auto;
  padding: 12px 12px 52px;
}

.desktop-icons {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  min-height: 80px;
  padding: 6px 4px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  border: 1px solid transparent;
}

.desktop-icon:hover,
.desktop-icon:focus {
  background: rgba(0, 0, 128, 0.45);
  border-color: rgba(255,255,255,0.4);
  outline: none;
}

.desktop-icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.desktop-icon-img img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  image-rendering: pixelated;
}

.desktop-icon-emoji {
  font-size: 32px;
  line-height: 1;
}

.desktop-icon-label {
  font-size: 0.68rem;
  font-family: var(--font-system);
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 1px #000, -1px -1px 1px #000,
               1px -1px 1px #000, -1px 1px 1px #000;
  line-height: 1.25;
  max-width: 76px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desktop-empty {
  color: #fff;
  font-family: var(--font-system);
  font-size: 0.875rem;
  padding: 24px;
  text-shadow: 1px 1px 1px #000;
}

#desktop-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: var(--win-face);
  box-shadow: var(--bevel-raised);
  border-top: 2px solid var(--win-highlight);
  display: flex;
  align-items: center;
  padding: 2px 6px;
  gap: 6px;
  z-index: 99985;
}

.desktop-close-btn {
  font-weight: bold;
  padding: 3px 10px;
  min-width: 0;
  white-space: nowrap;
}

.desktop-hint {
  font-size: 0.7rem;
  color: var(--win-shadow);
  white-space: nowrap;
}

.desktop-hint-right {
  margin-left: auto;
}

@media print {
  #bsod-overlay,
  #desktop-overlay { display: none; }
}

/* ── Last Login ──────────────────────────────────────────── */

.footer-lastlogin {
  box-shadow: var(--bevel-sunken);
  padding: 2px 10px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--win-shadow);
  white-space: nowrap;
}

/* Hide on very small screens where status bar stacks */
@media (max-width: 480px) {
  .footer-lastlogin { display: none; }
}

/* ── Disk Defragmenter Easter Egg ────────────────────────── */

#defrag-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0, 100, 100, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.defrag-window {
  width: 560px;
  max-width: 95vw;
}

.defrag-body {
  padding: 12px;
}

.defrag-info {
  font-size: 0.8125rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.defrag-drive {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  display: inline-block;
  padding: 2px 10px;
}

.defrag-grid-wrap {
  margin: 8px 0;
  padding: 4px;
  line-height: 0;
  overflow: hidden;
}

.defrag-grid {
  display: flex;
  flex-wrap: wrap;
}

.defrag-block {
  width: 13px;
  height: 9px;
  display: inline-block;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.defrag-block.db-used       { background: #0000aa; border-color: #0000cc; }
.defrag-block.db-optimized  { background: #5555ff; border-color: #7777ff; }
.defrag-block.db-free       { background: #ffffff; border-color: #c0c0c0; }
.defrag-block.db-unmovable  { background: #aa0000; border-color: #cc0000; }
.defrag-block.db-reading    { background: #ffffff; border-color: #000000;
                               outline: 1px solid #fff; }

.defrag-status {
  font-size: 0.8125rem;
  margin: 6px 0 4px;
  min-height: 1.4em;
  font-family: var(--font-system);
}

.defrag-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.7rem;
  margin: 8px 0;
  align-items: center;
}

.defrag-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.defrag-swatch {
  width: 13px;
  height: 9px;
  display: inline-block;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.defrag-swatch.db-used       { background: #0000aa; border-color: #0000cc; }
.defrag-swatch.db-optimized  { background: #5555ff; border-color: #7777ff; }
.defrag-swatch.db-free       { background: #ffffff; border-color: #c0c0c0; }
.defrag-swatch.db-unmovable  { background: #aa0000; border-color: #cc0000; }
.defrag-swatch.db-reading    { background: #ffffff; border-color: #000000; }

.defrag-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

@media print {
  #defrag-overlay { display: none; }
}

/* ── Print Styles ────────────────────────────────────────── */

@media print {
  body {
    background: white;
    color: black;
  }

  .site-nav,
  .widget-area,
  .site-footer,
  .post-navigation,
  .comment-respond,
  .nav-toggle {
    display: none;
  }

  .site-content {
    grid-template-columns: 1fr;
  }

  .post-content {
    box-shadow: none;
    padding: 0;
  }

  .win95-window,
  .post-card,
  .single-post-window {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
