/* ============================
   Desktop OS Block — Frontend CSS v2
   Windows 3.11 Aesthetic
   ============================ */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

/* ── Wrapper ── */
.dos-desktop-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 14px;
  cursor: default;
  user-select: none;
  box-sizing: border-box;
  /* height is always set via inline style (px or vh) */
}

/* ── Wallpaper Patterns ── */
.dos-wallpaper-pattern { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.dos-pattern-dots     { background-image: radial-gradient(circle,rgba(255,255,255,.15) 1px,transparent 1px); background-size: 16px 16px; }
.dos-pattern-grid     { background-image: linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px); background-size: 24px 24px; }
.dos-pattern-bricks   { background-image: linear-gradient(rgba(255,255,255,.06) 50%,transparent 50%),linear-gradient(90deg,rgba(255,255,255,.06) 50%,transparent 50%); background-size: 32px 16px; }
.dos-pattern-weave    { background-image: repeating-linear-gradient(45deg,rgba(255,255,255,.05) 0,rgba(255,255,255,.05) 2px,transparent 0,transparent 50%); background-size: 12px 12px; }
.dos-pattern-checkers { background-image: repeating-conic-gradient(rgba(255,255,255,.07) 0% 25%,transparent 0% 50%); background-size: 20px 20px; }

/* ── Desktop Area ── */
.dos-desktop-area {
  position: absolute;
  inset: 0;
  bottom: 36px;
  z-index: 1;
}
.dos-desktop-wrapper:not(:has(.dos-taskbar)) .dos-desktop-area {
  bottom: 0;
}

/* ── Window ── */
.dos-window {
  position: absolute;
  min-width: 180px;
  min-height: 80px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 2px 2px 0 #000;
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.dos-window.dos-active    { z-index: 100; }
.dos-window.dos-minimized .dos-window-body,
.dos-window.dos-minimized .dos-resize-handle { display: none; }
.dos-window.dos-minimized { min-height: auto !important; }
.dos-window.dos-maximized { left:0!important; top:0!important; width:100%!important; height:100%!important; min-height:0!important; }

/* ── Title Bar ── */
.dos-window-titlebar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  cursor: move;
  gap: 6px;
  flex-shrink: 0;
  user-select: none;
}
.dos-window-icon  { font-size: 10px; opacity: .8; }
.dos-window-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'VT323', monospace;
  font-size: 15px;
  letter-spacing: .05em;
}

/* ── Controls ── */
.dos-window-controls { display: flex; gap: 2px; flex-shrink: 0; }
.dos-window-controls button {
  width: 16px; height: 14px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  color: #000;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'VT323', monospace;
}
.dos-window-controls button:active { border-color: #808080 #ffffff #ffffff #808080; }

/* ── Window Body ── */
.dos-window-body {
  flex: 1;
  padding: 8px;
  overflow: auto;
  background: #ffffff;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  margin: 2px;
  font-family: 'VT323', monospace;
  font-size: 16px;
  line-height: 1.4;
  color: #000;
  user-select: text;
  cursor: default;
}
/* Rich content inside windows */
.dos-window-body p        { margin: 0 0 6px; }
.dos-window-body h1,.dos-window-body h2,
.dos-window-body h3,.dos-window-body h4 {
  font-family: 'VT323', monospace;
  margin: 4px 0 8px;
  line-height: 1.1;
}
.dos-window-body h1 { font-size: 2em; }
.dos-window-body h2 { font-size: 1.6em; }
.dos-window-body h3 { font-size: 1.3em; }
.dos-window-body img,
.dos-window-body video { max-width: 100%; height: auto; display: block; margin: 4px auto; }
.dos-window-body iframe { max-width: 100%; display: block; }
.dos-window-body ul,
.dos-window-body ol  { margin: 0 0 6px; padding-left: 20px; }
.dos-window-body a   { color: #000080; }
.dos-window-body blockquote {
  border-left: 3px solid #808080;
  margin: 6px 0;
  padding: 4px 10px;
  background: #e8e8e8;
  font-style: italic;
}
.dos-window-body figure { margin: 4px 0; }
.dos-window-body figcaption { font-size: 12px; text-align: center; color: #555; }
/* Video embed */
.dos-window-body .wp-block-embed__wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.dos-window-body .wp-block-embed__wrapper iframe { position: absolute; top:0; left:0; width:100%; height:100%; }

/* ── Resize Handle ── */
.dos-resize-handle {
  position: absolute; bottom: 0; right: 0;
  width: 12px; height: 12px;
  cursor: se-resize;
  background: linear-gradient(135deg,
    transparent 33%, #808080 33%, #808080 40%, transparent 40%,
    transparent 60%, #808080 60%, #808080 67%, transparent 67%,
    transparent 80%, #808080 80%, #808080 87%, transparent 87%
  );
}

/* ── Taskbar ── */
.dos-taskbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 36px;
  background: #c0c0c0;
  border-top: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  display: flex; align-items: center; padding: 2px 4px; gap: 6px;
  z-index: 200;
}
.dos-start-btn {
  display: flex; align-items: center; gap: 4px;
  background: #c0c0c0;
  border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  padding: 3px 8px;
  font-family: 'VT323', monospace;
  font-size: 15px; font-weight: bold;
  cursor: pointer; color: #000; white-space: nowrap;
}
.dos-start-btn:active { border-color: #808080 #ffffff #ffffff #808080; }
.dos-start-icon { font-size: 14px; }
.dos-taskbar-windows { flex: 1; display: flex; gap: 4px; overflow: hidden; align-items: center; }
.dos-taskbar-btn {
  background: #c0c0c0;
  border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  padding: 2px 8px;
  font-family: 'VT323', monospace; font-size: 13px;
  cursor: pointer; color: #000;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dos-taskbar-btn.active { border-color: #808080 #ffffff #ffffff #808080; background: #a0a0a0; }
.dos-taskbar-clock {
  background: #c0c0c0;
  border: 2px solid; border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 8px;
  font-family: 'VT323', monospace; font-size: 15px; white-space: nowrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .dos-window { max-width: calc(100% - 16px); }
  .dos-taskbar { height: 30px; }
  .dos-desktop-area { bottom: 30px; }
}
@media (max-width: 480px) {
  .dos-window { width: calc(100% - 24px) !important; left: 8px !important; }
}
