/* Mac OS 8 "Platinum" look, colours from plugin/docs/UI_THEME.md. */

@font-face {
  font-family: "Olivetti";
  src: url("fonts/Ac437_OlivettiThin_9x16.ttf") format("truetype");
  font-display: swap;
}

:root {
  --desktop: #c9cff2;
  --platinum: #dddddd;
  --platinum-light: #eeeeee;
  --bevel-light: #fff;
  --bevel-shadow: #888;
  --bevel-dark: #555;
  --frame: #000;
  --paper: #fff;
  --ink: #222266;
  --highlight: #c8c8c8;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--desktop);
  color: #000;
  font: 16px/1.5 "Olivetti", ui-monospace, Menlo, monospace;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

h1, h2 { font: inherit; margin: 0; }

a { color: var(--ink); }

/* Menu bar: every title is the same height as the bar and highlights edge to edge. */
.menu-bar {
  display: flex;
  align-items: stretch;
  height: 24px;
  padding: 0 4px;
  background: var(--platinum);
  border-bottom: 1px solid var(--frame);
  box-shadow: inset 0 1px 0 var(--bevel-light);
}
/* "Credits" is a button, but looks exactly like the plain "Lemmy Adam" title until it's
   hovered, pressed or open. `all: unset` drops every browser default for buttons. */
.menu { all: unset; }
.menu-title, .menu {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font: inherit;
  line-height: 1;
  color: #000;
  cursor: default;
}
.menu:hover, .menu:active, .menu.open {
  background: var(--highlight);
}
.menu:focus-visible { outline: 1px dotted #000; outline-offset: -3px; }

/* A window opened from the menu bar (native popover, centred by the browser). */
.window.popover-window {
  inset: 0;
  margin: auto;
  padding: 0;
  height: fit-content;
  width: min(440px, calc(100vw - 32px));
  font: inherit;
  color: #000;
}
.popover-window::backdrop { background: transparent; }
.popover-window .window-body p { margin: 0 0 0.5em; }
.popover-window .window-body p:last-child { margin-bottom: 0; }
.label { color: var(--bevel-dark); }

/* Desktop */
.desktop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px 16px;
}

/* Windows */
.window {
  width: 100%;
  max-width: 560px;
  background: var(--platinum);
  border: 1px solid var(--frame);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.title-bar {
  position: relative;
  height: 22px;
  margin: 3px;
  text-align: center;
  /* Pinstripes */
  background:
    repeating-linear-gradient(to bottom,
      var(--bevel-light) 0 1px,
      var(--bevel-shadow) 1px 2px,
      var(--platinum) 2px 3px) 0 4px / 100% 13px no-repeat,
    var(--platinum);
}
/* Close box: Platinum's small bevelled square at the left of the title bar, level with the
   stripes, with a gap of plain platinum around it. */
.close-box {
  all: unset;
  position: absolute;
  top: 4px;
  left: 9px;
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  background: var(--platinum);
  border: 1px solid var(--frame);
  box-shadow:
    inset 1px 1px 0 var(--bevel-light),
    inset -1px -1px 0 var(--bevel-shadow),
    0 0 0 2px var(--platinum);
  cursor: default;
}
.close-box:active {
  background: var(--bevel-shadow);
  box-shadow: inset 1px 1px 0 var(--bevel-dark), 0 0 0 2px var(--platinum);
}
.close-box:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }

.title-bar h1, .title-bar h2 {
  display: inline-block;
  padding: 0 10px;
  line-height: 22px;
  background: var(--platinum);
}

.window-body {
  margin: 0 3px 3px;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--bevel-dark);
  box-shadow: inset 1px 1px 0 var(--bevel-shadow);
}
.window-body p { margin: 0 0 1em; }
.window-body p:last-child { margin-bottom: 0; }
.lead { color: var(--ink); }

/* Footer */
.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 6px 12px;
  background: var(--platinum);
  border-top: 1px solid var(--frame);
}
