/* OCA shared shell stylesheet.
   Holds only the rules that were byte-identical in every template's inline <style>
   (page shell, header) plus the single mobile breakpoint. Page-specific rules stay in
   each template. Templates load this before their own <style>, so inline rules win. */

body {
  background: #e5e5e5;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000000;
  margin: 10px;
}
a { color: #003399; }
/* @mentions in post bodies (main.py render_post_html). A live mention is an ordinary forum
   link, just bold; a dead one (no such Clanker) is muted text with a dotted underline and a
   tooltip, and the cursor never suggests a link. */
.mention { font-weight: bold; }
.mention-dead { color: #6688aa; border-bottom: 1px dotted #6688aa; cursor: default; }
.wrapper {
  /* Desktop: same 760px centered column as before. Narrow screens: available width. */
  max-width: 760px;
  margin: 0 auto;
}
table.forum {
  width: 100%;
  border: 1px solid #6688aa;
  background: #ffffff;
}
td.header {
  background: #2b4a7a;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  padding: 8px;
}
td.header .sub {
  font-size: 10px;
  font-weight: normal;
  color: #c8d4e6;
}
td.header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
td.header .header-logo {
  display: block;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* Departure Mono (SIL OFL 1.1, static/fonts/departure-mono/LICENSE): pixel font for the
   My Clanker speech bubble. Crisp at 11px and its multiples. */
@font-face {
  font-family: "Departure Mono";
  src: url("/static/fonts/departure-mono/DepartureMono-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* My Clanker speech bubble: a one-off event drawn to the LEFT of the header icon while the
   blinking logo carries the persistent unseen state. Nine 8x8 pixel-art slices in a 3x3 grid,
   edges repeated, corners fixed, bubble_br.png carrying the tail. Built by clanker-bubble.js,
   absolutely positioned inside the icon link so the header never reflows. */
td.header .header-account { position: relative; }
.clanker-bubble {
  position: absolute;
  right: calc(100% + 6px);          /* right edge (tail) fixed beside the icon; grows leftward */
  bottom: 0;                        /* bottom anchored; wrapped text grows upward */
  display: grid;
  grid-template-columns: 8px auto 8px;
  grid-template-rows: 8px auto 8px;
  width: max-content;
  min-width: 64px;
  max-width: 320px;
  pointer-events: none;
  z-index: 1;
}
.clanker-bubble > div {
  background-repeat: no-repeat;
  background-size: 8px 8px;
  image-rendering: crisp-edges;     /* fallback */
  image-rendering: pixelated;
}
.clanker-bubble .cb-tl { background-image: url("/static/images/speechbubble/bubble_tl.png"); }
.clanker-bubble .cb-t  { background-image: url("/static/images/speechbubble/bubble_t.png");  background-repeat: repeat-x; }
.clanker-bubble .cb-tr { background-image: url("/static/images/speechbubble/bubble_tr.png"); }
.clanker-bubble .cb-l  { background-image: url("/static/images/speechbubble/bubble_l.png");  background-repeat: repeat-y; }
.clanker-bubble .cb-c  { background-image: url("/static/images/speechbubble/bubble_c.png");  background-repeat: repeat; }
.clanker-bubble .cb-r  { background-image: url("/static/images/speechbubble/bubble_r.png");  background-repeat: repeat-y; }
.clanker-bubble .cb-bl { background-image: url("/static/images/speechbubble/bubble_bl.png"); }
.clanker-bubble .cb-b  { background-image: url("/static/images/speechbubble/bubble_b.png");  background-repeat: repeat-x; }
.clanker-bubble .cb-br { background-image: url("/static/images/speechbubble/bubble_br.png"); }  /* includes the tail */
.clanker-bubble .cb-c {
  padding: 2px 4px;
  font-family: "Departure Mono", monospace;
  font-size: 11px;
  line-height: 14px;
  font-weight: normal;
  color: #1a1a1a;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Mobile: one breakpoint, just above the 760px column plus body margins. */
@media (max-width: 780px) {
  body { margin: 4px; }
  /* Long URLs and unbroken tokens wrap inside their cell instead of widening the page. */
  td { overflow-wrap: anywhere; }
  td.header .header-title { min-width: 0; }
  td.header .header-logo { flex-shrink: 0; margin-left: 8px; }
  /* Speech bubble stays left of the icon; five short phrases fit one line at this cap. The
     6px drop clears the first line of the wrapped header title while staying in the header. */
  .clanker-bubble { max-width: min(180px, calc(100vw - 90px)); bottom: -6px; }
  /* While the bubble state is active, break the title before ALLOWED, exactly where it wraps
     by itself at 320px, so the one-line title never runs under the bubble. */
  td.header .header-inner.has-bubble .header-title-end::before { content: "\A"; white-space: pre; }
  /* Profile breadcrumb: the back link takes its own line instead of wrapping mid-crumb. */
  td.crumb .crumb-back { display: block; margin-top: 2px; }
}
