/* y2k.css - the shared look of Merlin's own pages. v1.3, 2026-11-27 (v1.1: the banner stays blue once visited;
   v1.2: .log, a scrolling story-so-far box, and details/summary, for The Fool's Table;
   v1.3: .grid, two tiles across, for the homepage and the tailnet apps page;
   v1.4: img.photo, a page's own picture kept inside its box, for the about page).
   Rules and components: claude/merlin-style-guide.md (the style guide).
   Plain CSS only: no web fonts, no external URLs, no animation. Every image is a
   slot in /y2k/img/ (ASSETS.tsv); replace a slot by dropping in a GIF of the
   same name. Pages carry no inline styles (their CSP forbids them). ASCII only. */

html { background: #cfe8ff url(img/tile.gif); }
body {
  margin: 0; padding: 40px 8px 24px;
  color: black; font-family: "Times New Roman", Times, serif;
  font-size: 16px; line-height: 1.3;
}
a { color: blue; font-weight: bold; }
a:visited { color: purple; }
a:hover, a:focus { color: red; }

/* one narrow centred column; wide for tables and logs */
.page { max-width: 420px; margin: 0 auto; }
.page.wide { max-width: 640px; }

/* the banner: the page's name, a link home */
/* the banner stays blue once visited (it is a heading as much as a link; v1.1) */
.banner, .banner:visited { display: block; text-align: center; text-decoration: none; color: blue; }
.banner h1 { margin: 0 0 32px; font-size: 32px; }
.banner:hover { color: red; }

/* a menu row: a 64px icon with its name, and a note in a double-ruled corner */
.menu { display: flex; align-items: center; gap: 16px; margin: 0 0 32px; }
.menu > a {
  display: flex; flex-direction: column; align-items: center;
  flex: none; width: 92px; text-align: center; overflow-wrap: anywhere;
}
.menu .note {
  flex: 1; color: blue; font-weight: bold;
  border-left: 3px double darkblue; border-bottom: 3px double darkblue;
  padding: 16px 12px;
}
.icon { width: 64px; height: 64px; image-rendering: pixelated; }
.icon.small { width: 32px; height: 32px; vertical-align: middle; }

/* a grid (v1.3): two tiles across, each an icon above its name; the note under the name
   hides on a phone, where the name alone is enough (HL, 2026-11-27). A tile that goes nowhere
   is an <a class="stale"> with no href. */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 24px; }
.grid .cell { background: white; border: 3px double darkblue; padding: 8px 4px; text-align: center; }
.grid .cell > a { display: block; overflow-wrap: anywhere; }
.grid .cell .icon { display: block; margin: 0 auto 4px; }
.grid .cell .note { display: block; margin-top: 4px; font-size: 13px; color: #333333; }

/* a page's own picture (v1.4): content, not a slot (the about page's images in site/img/);
   never wider than its box nor taller than 300px, however large the file (HL: less scrolling). */
img.photo { display: block; max-width: 100%; max-height: 300px; width: auto; height: auto; margin: 8px 0 0; border: 2px solid darkblue; }

hr.rule { border: 0; border-top: 2px dotted darkblue; max-width: 400px; margin: 24px auto; }

/* boxes */
.box { background: white; border: 3px double darkblue; padding: 8px 12px; margin: 0 0 24px; }
.box h2 { margin: 0 0 8px; font-size: 20px; color: darkblue; }
.readout {
  background: black; color: lime; border: 3px inset white;
  padding: 4px 8px; margin: 0 0 24px;
  font-family: "Courier New", Courier, monospace; font-size: 13px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.readout .warn { color: yellow; }
.notice {
  background: #ffffcc; color: #990000; font-weight: bold;
  border: 3px double red; padding: 8px 12px; margin: 0 0 24px;
}
.stale { color: gray; }

/* the log (v1.2): a framed, scrolling box that opens at its newest entry with no script.
   The page writes its entries newest first; column-reverse shows them oldest at the top,
   and a column-reverse box starts scrolled to its end. 60% of the window (HL, 2026-11-27). */
.log {
  display: flex; flex-direction: column-reverse;
  max-height: 60vh; overflow-y: auto;
  background: white; border: 3px double darkblue; padding: 8px 12px; margin: 0 0 24px;
}
.log .entry { flex: none; border-bottom: 2px dotted darkblue; padding: 0 0 8px; margin: 0 0 8px; }
.log .entry:first-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.log h3 { margin: 4px 0 8px; font-size: 18px; color: darkblue; }
.log .readout, .log .box, .log p { margin: 0 0 8px; }

/* folded-away sections (v1.2): a <details> needs no script to open */
details { background: white; border: 3px double darkblue; padding: 4px 12px; margin: 0 0 24px; }
summary { font-weight: bold; color: darkblue; cursor: pointer; }
.ok { color: green; font-weight: bold; }
.bad { color: red; font-weight: bold; }

/* tables */
table.plain { border-collapse: collapse; width: 100%; background: white; margin: 0 0 24px; }
table.plain th, table.plain td {
  border: 1px solid darkblue; padding: 2px 6px; text-align: left; vertical-align: top;
}
table.plain th { background: #ddddff; }

/* forms keep the browser's own controls */
form p { margin: 8px 0; }
label { font-weight: bold; color: darkblue; }
input, select, button { font-family: inherit; font-size: 16px; }

/* the footer: 88x31 buttons, then small print */
.badges { text-align: center; margin: 32px 0 8px; }
.badges img { width: 88px; height: 31px; image-rendering: pixelated; }
.foot { text-align: center; font-size: 13px; color: #333333; }

@media (max-width: 480px) {
  .grid .cell .note { display: none; }
  .menu { gap: 8px; }
  .menu .note { padding: 8px; }
}
