/* TC Workbench : bureau retro. Couleurs : --tcwb-bg, --tcwb-accent. Polices embarquees (OFL), aucun appel externe. */

@font-face {
  font-family: "TCWB VT323";
  src: url("../fonts/vt323-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "TCWB Space Grotesk";
  src: url("../fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "TCWB Space Grotesk";
  src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ---------- Bouton de bascule (site classique) ---------- */
.tcwb-float {
  position: fixed;
  bottom: 16px;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px 6px 10px;
  background: #0055AA;
  color: #fff;
  border: 2px solid #000022;
  box-shadow: 3px 3px 0 #000022;
  font: 400 20px/1 "TCWB VT323", "Courier New", monospace;
  cursor: pointer;
}
.tcwb-float-right { right: 16px; }
.tcwb-float-left { left: 16px; }
.tcwb-float:hover { background: #FF8800; color: #000022; }
.tcwb-float:focus-visible,
.tcwb-toggle:focus-visible { outline: 3px dashed #FF8800; outline-offset: 3px; }
.tcwb-float svg { flex: 0 0 auto; }
@media (max-width: 600px) {
  .tcwb-float { padding: 6px 8px; }
  .tcwb-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Bureau ---------- */
.tcwb-app {
  --tcwb-bg: #0055AA;
  --tcwb-accent: #FF8800;
  --tcwb-ink: #000022;
  --tcwb-soft: #FFD9A8;
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  overflow: hidden;
  background: var(--tcwb-bg);
  color: #fff;
  font: 400 15px/1.55 "TCWB Space Grotesk", system-ui, sans-serif;
  text-align: left;
}
.tcwb-app *,
.tcwb-app *::before,
.tcwb-app *::after { box-sizing: border-box; }
.tcwb-app button { font: inherit; letter-spacing: normal; text-transform: none; }
.tcwb-app .a { fill: var(--tcwb-accent); }
.tcwb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.tcwb-screenbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  background: #fff;
  color: var(--tcwb-bg);
  border-bottom: 2px solid var(--tcwb-ink);
  font: 400 22px/1 "TCWB VT323", "Courier New", monospace;
  white-space: nowrap;
  z-index: 5;
}
.tcwb-screentitle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tcwb-classic {
  height: 26px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-left: 2px solid var(--tcwb-ink);
  background: #fff;
  color: var(--tcwb-ink);
  font: 400 20px/1 "TCWB VT323", "Courier New", monospace !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tcwb-classic:hover,
.tcwb-classic:focus-visible { background: var(--tcwb-accent); }
.tcwb-classic:focus-visible { outline: 2px dashed var(--tcwb-ink); outline-offset: -4px; }

.tcwb-icons {
  position: absolute;
  right: 20px;
  top: 48px;
  bottom: 16px;
  width: 112px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap-reverse;
  align-content: flex-start;
  gap: 14px;
  z-index: 1;
}
.tcwb-icon {
  width: 112px;
  min-height: 44px;
  margin: 0;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: #fff;
  font: 400 20px/1.05 "TCWB VT323", "Courier New", monospace !important;
  text-align: center;
  cursor: pointer;
  word-break: break-word;
}
.tcwb-icon span { padding: 0 3px; }
.tcwb-icon:hover span,
.tcwb-icon:focus-visible span,
.tcwb-icon.is-open span { background: var(--tcwb-accent); color: var(--tcwb-ink); }
.tcwb-icon:focus-visible { outline: 2px dashed #fff; outline-offset: 2px; }

/* ---------- Fenetres ---------- */
.tcwb-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 60px);
  background: var(--tcwb-bg);
  border: 2px solid #fff;
  outline: 2px solid var(--tcwb-ink);
  box-shadow: 6px 6px 0 var(--tcwb-ink);
}
.tcwb-bar {
  flex: 0 0 30px;
  height: 30px;
  display: flex;
  align-items: stretch;
  background: #fff;
  color: var(--tcwb-bg);
  border-bottom: 2px solid var(--tcwb-ink);
  font: 400 22px/1 "TCWB VT323", "Courier New", monospace;
  cursor: move;
  touch-action: none;
  user-select: none;
}
.tcwb-win.is-active .tcwb-bar { background: var(--tcwb-accent); color: var(--tcwb-ink); }
.tcwb-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tcwb-title span { overflow: hidden; text-overflow: ellipsis; }
.tcwb-gadget {
  flex: 0 0 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tcwb-close { border-right: 2px solid var(--tcwb-ink); }
.tcwb-depth { border-left: 2px solid var(--tcwb-ink); }
.tcwb-close span { display: block; width: 10px; height: 10px; border: 2px solid var(--tcwb-ink); background: #fff; }
.tcwb-depth span { display: block; width: 12px; height: 9px; border: 2px solid var(--tcwb-ink); background: var(--tcwb-bg); }
.tcwb-gadget:focus-visible { outline: 2px dashed var(--tcwb-ink); outline-offset: -5px; }
.tcwb-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  overscroll-behavior: contain;
}
.tcwb-body:focus { outline: none; }
.tcwb-foot {
  flex: 0 0 auto;
  padding: 8px 20px;
  border-top: 2px solid var(--tcwb-ink);
  background: rgba(0, 0, 34, .25);
  font: 400 20px/1.2 "TCWB VT323", "Courier New", monospace;
}

/* ---------- Contenus ---------- */
.tcwb-content { color: #fff; }
.tcwb-content :where(p, li, dt, dd, figcaption, blockquote, td, th, span, strong, em, label) { color: inherit; }
.tcwb-content > :first-child { margin-top: 0; }
.tcwb-content > :last-child { margin-bottom: 0; }
.tcwb-content :where(p, ul, ol, figure, blockquote, table) { margin: 0 0 12px; }
.tcwb-content :where(h1, h2, h3, h4, h5, h6) {
  margin: 18px 0 8px;
  color: #fff;
  font-family: "TCWB VT323", "Courier New", monospace;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: none;
}
.tcwb-content h1, .tcwb-content h2 { font-size: 34px; }
.tcwb-content h3 { font-size: 26px; }
.tcwb-content :where(h4, h5, h6) { font-size: 22px; }
.tcwb-content a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.tcwb-content a:hover { color: var(--tcwb-soft); }
.tcwb-content a:focus-visible { outline: 2px dashed #fff; outline-offset: 2px; }
.tcwb-content img,
.tcwb-content video,
.tcwb-content iframe { max-width: 100%; height: auto; }
.tcwb-content iframe { aspect-ratio: 16 / 9; width: 100%; }
.tcwb-content :where(figure) { max-width: 100%; }
.tcwb-content code,
.tcwb-content pre { font-family: "TCWB VT323", "Courier New", monospace; font-size: 18px; background: rgba(0, 0, 34, .35); color: #fff; }
.tcwb-content pre { padding: 12px; overflow: auto; }
.tcwb-content blockquote { padding-left: 14px; border-left: 4px solid var(--tcwb-accent); }
.tcwb-content table { width: 100%; border-collapse: collapse; }
.tcwb-content td, .tcwb-content th { padding: 6px 8px; border-bottom: 1px solid #3F82C6; }
.tcwb-content .tcwb-sub { font: 400 22px/1.1 "TCWB VT323", "Courier New", monospace; color: var(--tcwb-soft); }
.tcwb-content .tcwb-big { font: 400 24px/1.1 "TCWB VT323", "Courier New", monospace; }
.tcwb-content .tcwb-meta { font: 400 18px/1 "TCWB VT323", "Courier New", monospace; color: var(--tcwb-soft); }
.tcwb-content .tcwb-cover { margin: -20px -20px 16px; }
.tcwb-content .tcwb-cover img { display: block; width: 100%; height: auto; }
.tcwb-content .tcwb-btn,
.tcwb-content .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  background: var(--tcwb-accent);
  color: var(--tcwb-ink);
  border: 2px solid var(--tcwb-ink);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--tcwb-ink);
  font: 400 22px/1 "TCWB VT323", "Courier New", monospace;
  text-decoration: none;
}
.tcwb-content .tcwb-btn:hover,
.tcwb-content .wp-block-button__link:hover { background: #fff; color: var(--tcwb-ink); }

.tcwb-list { list-style: none; margin: 0; padding: 0; }
.tcwb-list li { margin: 0; }
.tcwb-list a { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-bottom: 1px solid #3F82C6; color: #fff; text-decoration: none; }
.tcwb-list li:last-child a { border-bottom: 0; }
.tcwb-list a:hover,
.tcwb-list a:focus-visible { background: rgba(0, 0, 34, .3); color: #fff; }
.tcwb-item-title { font-weight: 600; }
.tcwb-item-text { font-size: 13px; color: var(--tcwb-soft); }
.tcwb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tcwb-grid a { padding: 0; border: 0; gap: 6px; }
.tcwb-grid a:hover,
.tcwb-grid a:focus-visible { background: transparent; }
.tcwb-grid a:hover .tcwb-item-title { text-decoration: underline; }
.tcwb-thumb { display: block; aspect-ratio: 16 / 10; background: #fff; border: 2px solid var(--tcwb-ink); overflow: hidden; }
.tcwb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tcwb-more { margin-top: 14px !important; font: 400 22px/1 "TCWB VT323", "Courier New", monospace; }

.tcwb-shell { font: 400 22px/1.3 "TCWB VT323", "Courier New", monospace; white-space: pre-wrap; }
.tcwb-cursor { display: inline-block; width: 10px; height: 18px; vertical-align: middle; background: var(--tcwb-accent); animation: tcwbblink 1s steps(1) infinite; }
@keyframes tcwbblink { 50% { opacity: 0; } }
.tcwb-loading { font: 400 22px/1 "TCWB VT323", "Courier New", monospace; }
@media (prefers-reduced-motion: reduce) {
  .tcwb-cursor { animation: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .tcwb-screenbar { font-size: 18px; }
  .tcwb-icons {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 84px;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    padding: 6px 4px;
    overflow-x: auto;
    background: var(--tcwb-bg);
    border-top: 2px solid #fff;
  }
  .tcwb-icon { flex: 0 0 84px; width: 84px; font-size: 16px !important; gap: 2px; }
  .tcwb-icon svg { width: 40px; height: 32px; }
  .tcwb-win {
    left: 0 !important;
    top: 28px !important;
    width: 100vw !important;
    max-height: none;
    height: calc(100vh - 28px - 84px);
    height: calc(100dvh - 28px - 84px);
    box-shadow: none;
    outline: 0;
    border-width: 2px 0;
  }
  .tcwb-bar { cursor: default; }
  .tcwb-body { padding: 16px; }
  .tcwb-content .tcwb-cover { margin: -16px -16px 16px; }
}
