/* eggdrop.org.ru — the look of the 2004 site (black, monospace, ANSI colours, grey frames),
   rebuilt with modern CSS: grid layout, responsive, no tables. */

:root {
  --bg: #000;
  --panel: #3e3e3e;
  --frame: #808080;
  --text: #fff;
  --white: #c8c8c8;
  --hwhite: #e8e8e8;
  --yellow: #c8c800;
  --hyellow: #ff0;
  --blue: #00c8c8;
  --green: #00c800;
  --red: #e80000;
  --link: #c8c800;
  --link-hover: #c8c8c8;
  --link-visited: #c800c8;
  --mono: "Lucida Console", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, ui-monospace, monospace;
  --fs: 13.5px;
  --pad: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 8px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: var(--fs)/1.2 var(--mono);
}

a:link { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); text-decoration: none; }
a:hover, a:focus-visible { color: var(--link-hover); }
a:focus-visible { outline: 1px dotted var(--link-hover); outline-offset: 2px; }

h1, h2, h3 { font: inherit; margin: 0; }
p { margin: 0 0 .6em; }
img { max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ANSI-ish colour classes, same values as the old col_* classes */
.c-red { color: var(--red); }
.c-yellow { color: var(--yellow); }
.c-blue { color: var(--blue); }
.c-green { color: var(--green); }
.c-white { color: var(--white); }
.c-hwhite { color: var(--hwhite); }
.c-hhwhite { color: #fff; }

/* ::[ Title ]:: decoration */
.deco { white-space: nowrap; }
.d1 { color: #4f4f00; }
.d2 { color: #6f6f00; }
.d3 { color: #afaf00; }
.hy { color: var(--hyellow); }
.hw { color: #fff; }

/* ---- masthead ---- */
.masthead { text-align: center; margin-bottom: 10px; }
.masthead-link, .masthead-link:visited { color: inherit; display: inline-block; max-width: 100%; }
.masthead-link:hover { color: inherit; }
.tagline { white-space: nowrap; overflow: hidden; font-size: min(var(--fs), 2.6vw); }
.g1 { color: #004f00; } .g2 { color: #006f00; } .g3 { color: #00af00; } .g4 { color: #0f0; } .g5 { color: #00c800; }

.logo {
  margin: 4px auto 0;
  font: inherit;
  /* the 80-column banner shrinks to fit narrow screens instead of scrolling */
  font-size: min(var(--fs), 1.55vw);
  line-height: 1.25;
  text-align: left;
  display: inline-block;
}
.l-w { color: #fff; }
.l-b { color: #00f; }
.l-r { color: #f00; }

/* ---- page grid ---- */
.page {
  flex: 1;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--pad);
  align-items: start;
  align-content: start;
}

.box { border: 1px solid var(--frame); }
.box-head { border-bottom: 1px solid var(--frame); padding: 3px var(--pad); }
.box-head.center { text-align: center; }
.box-body { padding: var(--pad); }

.nav ul { list-style: none; margin: 0; padding: 3px var(--pad) 6px; }
.nav li { white-space: nowrap; padding-left: 1ch; }
.nav a[aria-current="page"] { color: var(--link-hover); }
.nav a[aria-current="page"]::before { content: "» "; color: var(--hyellow); margin-left: -2ch; }

/* ---- items (news, catalog entries) ---- */
.item {
  border: 1px solid var(--frame);
  margin: 14px 0 0;
}
.item:first-child { margin-top: 4px; }
/* News: only the title row is grey, the text sits on black; every item is preceded by one empty line. */
.item.news, .item.news:first-child { margin-top: calc(1.2em + 6px); }

.item-head {
  background: var(--panel);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--frame);
}
.item-head .item-title { padding: 3px var(--pad); border-right: 1px solid var(--frame); }
.item-meta { padding: 3px var(--pad); white-space: nowrap; }
.item-text { padding: 3px var(--pad) 4px; overflow-wrap: anywhere; }

.group { margin-bottom: 6px; }
.group-title { color: var(--hyellow); text-align: center; margin: 18px 0 4px; }
.group:first-child .group-title { margin-top: 6px; }

.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin-top: 3px; background: var(--panel); }
.entry-main { padding: 3px var(--pad) 6px; min-width: 0; }
.entry-links { border-left: 1px solid var(--frame); }
.entry-desc { padding: 2px 0 0 2ch; text-align: justify; hyphens: auto; overflow-wrap: anywhere; }
.entry-facts { margin: .3em 0 0; }
.entry-facts div { display: flex; gap: 1ch; }
.entry-facts dt, .entry-facts dd { margin: 0; }
.entry-links {
  list-style: none;
  margin: 0;
  padding: 1.1em 2ch;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 13ch;
}

.pager { text-align: center; margin: 18px 0 6px; color: var(--yellow); }
.pager-info { color: var(--frame); margin-left: 1ch; }
.empty { color: var(--frame); text-align: center; padding: 1em; }

/* error pages: the broken egg */
.oops { text-align: center; padding: 1.2em 0 .6em; }
.egg { display: inline-block; text-align: left; margin: 0 auto; font: inherit; line-height: 1.15; max-width: 100%; overflow-x: auto; }
.egg .sh { color: #e8e8e8; }
.egg .shard { color: #808080; }
.egg .wh { color: #c8c8c8; }
.egg .yk { color: #ffff00; }
.oops-code { font-size: 3.2em; line-height: 1; color: #3e3e3e; margin: .3em 0 .1em; letter-spacing: .15em; }
.oops-title { margin: 0 0 .5em; }
.oops-text { max-width: 60ch; margin: 0 auto .8em; }
.oops-irc { color: var(--frame); overflow-wrap: anywhere; }
.oops-home { margin-top: 1.2em; }

.footer { text-align: center; padding: 26px 0 6px; }

/* ---- small screens: the menu goes on top as a bar ---- */
@media (max-width: 720px) {
  :root { --fs: 13px; }
  body { padding: 6px; }
  .page { grid-template-columns: minmax(0, 1fr); }
  .nav .box-head { display: none; }
  .nav ul { display: flex; flex-wrap: wrap; gap: 2px 2ch; justify-content: center; padding: 4px; }
  .nav li { padding: 0; }
  .nav a[aria-current="page"]::before { content: ""; margin: 0; }
  .nav a[aria-current="page"] { text-decoration: underline; }
  .item-head { grid-template-columns: minmax(0, 1fr); }
  .item-head .item-title { border-right: 0; }
  .item-meta { border-top: 1px dotted var(--frame); white-space: normal; }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-links { flex-direction: row; flex-wrap: wrap; gap: 2ch; padding: 3px var(--pad) 6px 4ch; border-left: 0; border-top: 1px dotted var(--frame); }
  .entry-desc { text-align: left; }
}

@media print {
  html, body { background: #fff; color: #000; }
  .nav, .footer a { display: none; }
}
