/* ==========================================================
   BlindCricket.org.uk – общ стил
   Работи с ТЕКУЩИЯ HTML код, без да се променя нищо в страниците.
   Само добави в <head> на всяка страница:
   <link rel="stylesheet" href="/style.css">
   ========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  --navy: #000099;
  --navy-deep: #00006b;
  --page: #0a0a2a;
  --paper: #fbfaf7;
  --ink: #16162e;
  --rule: #d9d8e3;
  --tint: #f0eff6;
  --ball: #b3261e;
  --link: #0000b8;
  --focus: #ffd600;
  --font: "Atkinson Hyperlegible", Verdana, Arial, Helvetica, sans-serif;
  --max: 960px;
}

/* ---------- Основа ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;                 /* държи футъра най-долу */
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  text-align: center;
  font-family: var(--font);
}

body, td, p, pre, font, strong, b {
  font-family: var(--font);
}

/* старите <br> между таблиците само пречат */
body > br { display: none; }

img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ==========================================================
   1. ХЕДЪР  (първата таблица в страницата)
   ========================================================== */
body > table:nth-of-type(1) {
  width: 100%;
  height: auto;
  border-spacing: 0;
  background: var(--navy);
  border-bottom: 4px solid var(--ball);
}
body > table:nth-of-type(1) > tbody > tr > td {
  height: auto;
  padding: 16px 20px 10px;
}

/* вътрешната таблица (800px) – вече е центрирана и гъвкава */
table.contentLink {
  width: 100%;
  max-width: var(--max);
  height: auto;
  margin: 0 auto;
  background: none;
  border-spacing: 0;
  text-align: left;
}
table.contentLink td { height: auto; padding: 0; }

/* празната колона отляво и разделителите "|" */
table.contentLink > tbody > tr > td[rowspan] { display: none; }
table.contentLink table td:not(:has(a)) { display: none; }

/* заглавие на сайта */
table.contentLink > tbody > tr:first-child font { font-size: 28px; line-height: 1.2; }
table.contentLink > tbody > tr:first-child td { padding-bottom: 8px; }

/* менюто – на ред, който се пренася на малки екрани */
table.contentLink table,
table.contentLink table > tbody {
  display: block;
  width: auto;
}
table.contentLink table tr {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
table.contentLink table td {
  width: auto;
  height: auto;
  padding: 0;
}
table.contentLink table font { font-size: 16px; }

table.contentLink table a,
body > table:nth-of-type(3) a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
}
table.contentLink table a:hover,
body > table:nth-of-type(3) a:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================
   2. СЪДЪРЖАНИЕ  (втората таблица)
   ========================================================== */
body > table:nth-of-type(2) {
  width: min(var(--max), calc(100% - 32px));
  height: auto;
  margin: 32px auto 32px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  overflow: hidden;
  text-align: left;
}
body > table:nth-of-type(2) td {
  height: auto;
  text-align: left;
  vertical-align: top;
}

/* лентата със заглавието на страницата */
body > table:nth-of-type(2) > tbody > tr:first-child td {
  padding: 14px 24px;
  background: var(--navy);
}
body > table:nth-of-type(2) > tbody > tr:first-child td:first-child { display: none; }
body > table:nth-of-type(2) > tbody > tr:first-child font {
  font-size: 24px;
  line-height: 1.3;
}

/* колоната-разделител и празния последен ред */
body > table:nth-of-type(2) > tbody > tr:nth-child(2) > td:first-child { display: none; }
body > table:nth-of-type(2) > tbody > tr:nth-child(2) > td {
  padding: 28px clamp(18px, 4vw, 40px) 12px;
}
body > table:nth-of-type(2) > tbody > tr:last-child td { padding: 0; height: 16px; }

/* текст */
body > table:nth-of-type(2) font[size="2"] {
  font-size: 18px;
  line-height: 1.7;
}
body > table:nth-of-type(2) b,
body > table:nth-of-type(2) strong { font-weight: 400; }

body > table:nth-of-type(2) p {
  margin: 0 0 1.1em;
  max-width: 46em;
}

/* заглавия на статиите */
body > table:nth-of-type(2) > tbody > tr:nth-child(2) font[size="3"] {
  display: block;
  margin: 40px 0 10px;
  padding-left: 14px;
  border-left: 5px solid var(--ball);
  color: var(--navy);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  clear: both;
}
body > table:nth-of-type(2) a[name],
body > table:nth-of-type(2) a[name] * {
  color: var(--navy);
  text-decoration: none;
}
body > table:nth-of-type(2) u { text-decoration: none; }

/* линкове */
body > table:nth-of-type(2) a:link,
body > table:nth-of-type(2) a:visited {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
body > table:nth-of-type(2) a:hover { color: var(--ball); }
body > table:nth-of-type(2) a[href*="developmentarchive"] { font-weight: 700; }

/* снимката */
body > table:nth-of-type(2) img {
  max-width: min(320px, 45%);
  height: auto;
  margin: 4px 0 16px 28px;
  border-radius: 4px;
}

/* <pre> – пренася се и не разширява таблицата */
body > table:nth-of-type(2) pre {
  max-width: 100%;
  margin: 0 0 1.4em;
  padding: 16px 20px;
  background: var(--tint);
  border-left: 5px solid var(--navy);
  border-radius: 0 4px 4px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.8;
}
body > table:nth-of-type(2) pre font { font-size: 16px; }

/* ==========================================================
   3. Стария ред "site designed by" – скрит.
      Показва се вътре във футъра (виж по-долу).
   ========================================================== */
body > font { display: none; }

/* ==========================================================
   4. ФУТЪР  (третата таблица) – центриран
   ========================================================== */
body > table:nth-of-type(3) {
  width: 100%;
  height: auto;
  margin-top: auto;              /* залепва футъра за долния край */
  border-spacing: 0;
  background: var(--navy-deep);
  border-top: 4px solid var(--ball);
}
body > table:nth-of-type(3) > tbody > tr > td {
  padding: 32px 20px 28px;
  text-align: center;
  background: var(--navy-deep);
}

/* менюто във футъра – центрирано, не "align=left" */
body > table:nth-of-type(3) table {
  display: block;
  float: none;
  width: auto;
  margin: 0 auto;
}
body > table:nth-of-type(3) table > tbody { display: block; }
body > table:nth-of-type(3) table tr {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
}
body > table:nth-of-type(3) table td {
  width: auto;
  height: auto;
  padding: 0;
}
body > table:nth-of-type(3) table td:not(:has(a)) { display: none; }
body > table:nth-of-type(3) font { font-size: 16px; }

/* редът с кредита – вътре във футъра, под менюто */
body > table:nth-of-type(3) > tbody > tr > td::after {
  content: "Site designed by 3dhead";
  display: block;
  max-width: 420px;
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: #c9c9ea;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Малки екрани ---------- */
@media (max-width: 640px) {
  table.contentLink > tbody > tr:first-child font { font-size: 22px; }
  body > table:nth-of-type(2) font[size="2"] { font-size: 17px; }
  body > table:nth-of-type(2) img {
    float: none;
    display: block;
    max-width: 100%;
    margin: 0 0 16px;
  }
}

/* ---------- Печат ---------- */
@media print {
  body { display: block; background: #fff; }
  body > table:nth-of-type(1),
  body > table:nth-of-type(3) { display: none; }
  body > table:nth-of-type(2) { width: 100%; margin: 0; }
}