/* ============================================================
   panic.blue — Layout styles
   ============================================================ */

/* Links inside BSOD inherit color unless overridden */
.bsod a { color: inherit; }
.bsod a.label-cyan { color: var(--dos-lcyan); }
[data-theme="dark"] .bsod a.label-cyan { color: #78dce8; }

/* Homepage post grid — responsive */
@media (max-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 3-pane post layout */
.post-layout {
  display: flex;
  position: absolute;
  inset: 12px 12px 44px 12px;
  gap: 12px;
}
.post-layout .pane-toc {
  width: 246px;
  flex-shrink: 0;
}
.post-layout .pane-content {
  flex: 1;
  min-width: 0;
}
.post-layout .pane-props {
  width: 256px;
  flex-shrink: 0;
}
.post-layout .pane-toc > .w98-window,
.post-layout .pane-content > .w98-window,
.post-layout .pane-props > .w98-window {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* TOC tree items */
.toc-item {
  padding: 1px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.toc-item:hover {
  background: #e0e0e0;
}
.toc-item.active {
  background: #000080;
  color: #fff;
}
.toc-item .num {
  color: #888;
}
.toc-item.active .num {
  color: #fff;
}

/* Post body inside BSOD */
.post-body {
  padding: 28px 40px;
  font-size: 15px;
  line-height: 1.55;
}
.post-body h2 {
  font-size: 18px;
  color: var(--dos-yellow);
  margin: 20px 0 8px;
}
.post-body h2::before {
  content: "## ";
  color: var(--dos-grey);
}
.post-body h3 {
  font-size: 16px;
  color: var(--dos-yellow);
  margin: 16px 0 6px;
}
.post-body h3::before {
  content: "### ";
  color: var(--dos-grey);
}
.post-body p {
  margin: 8px 0;
}
.post-body ul, .post-body ol {
  padding-left: 22px;
  margin: 6px 0;
}
.post-body img {
  max-width: 100%;
  image-rendering: auto;
}
.post-body a {
  color: var(--dos-lcyan);
  text-decoration: underline;
}
.post-body code:not(pre code) {
  color: var(--dos-yellow);
  background: rgba(255,255,85,0.1);
  padding: 0 3px;
}
.post-body blockquote {
  border-left: 3px solid var(--dos-grey);
  margin: 8px 0;
  padding-left: 12px;
  color: var(--dos-grey);
}

/* DOS code block (flat panel) */
.post-body pre {
  margin: 14px 0;
  border: 1px solid #555;
  background: #000;
  position: relative;
}
.post-body pre code {
  display: block;
  padding: 10px 12px;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: auto;
  color: var(--dos-grey);
  background: transparent;
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--w98-face);
  border-top: 2px solid var(--w98-light);
  box-shadow: inset 0 1px 0 #fff;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 4px;
  z-index: 10;
}
.taskbar .start-btn {
  min-width: 0;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.taskbar .start-logo {
  background: linear-gradient(135deg, #ff0000 0, #ff0000 25%, #00ff00 25%, #00ff00 50%, #0000ff 50%, #0000ff 75%, #ffff00 75%);
  width: 16px;
  height: 16px;
  display: inline-block;
  image-rendering: pixelated;
  clip-path: polygon(0 0, 50% 0, 50% 50%, 100% 50%, 100% 100%, 0 100%);
}
.taskbar .divider {
  width: 2px;
  align-self: stretch;
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-light);
  margin: 2px;
}
.taskbar .task-btn {
  min-width: 130px;
  padding: 2px 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.taskbar .task-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taskbar .task-btn.active {
  border-color: var(--w98-dark) var(--w98-light) var(--w98-light) var(--w98-dark);
  box-shadow: inset 1px 1px 0 var(--w98-shadow), inset -1px -1px 0 var(--w98-hilite);
  background: repeating-linear-gradient(45deg, #c0c0c0 0 2px, #a8a8a8 2px 4px);
}
.taskbar .clock {
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

/* Properties pane tabs */
.prop-tabs {
  display: flex;
  border-bottom: 1px solid var(--w98-shadow);
  margin-bottom: 8px;
  margin-top: 2px;
}
.prop-tab {
  padding: 3px 10px;
  font-size: 12px;
  border: 1.5px solid;
  cursor: pointer;
}
.prop-tab.active {
  background: var(--w98-face);
  border-color: var(--w98-light) var(--w98-dark) transparent var(--w98-light);
  margin-bottom: -1px;
  position: relative;
}
.prop-tab:not(.active) {
  background: var(--w98-shadow);
  border-color: var(--w98-light) var(--w98-dark) var(--w98-shadow) var(--w98-light);
  position: relative;
  top: 1px;
}

/* Task manager modal */
.task-manager-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.task-manager-overlay.visible {
  display: flex;
}

/* Responsive: collapse side panes on small screens */
@media (max-width: 1024px) {
  .post-layout .pane-toc,
  .post-layout .pane-props {
    display: none;
  }
  .post-layout {
    inset: 4px 4px 44px 4px;
  }
}
