:root {
  --sprite: url(images/sprite.png);
  --text: #444;
  --link: #334466;
  --board-title: #d97b33;
  --row-light: #f0f4f7;
  --row-dark: #e7eaef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 14px Helvetica, Arial, sans-serif;
  color: var(--text);
  background: url(images/sky.png) repeat-x, #222 url(images/stone.png);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p,
h2,
h3 {
  margin: 0;
}

img {
  border: 0;
}

.page {
  width: min(980px, 100% - 32px);
  margin: 0 auto;
  padding-top: 5px;
}

/* Sprite bars: the transparent left border shows the rounded left cap,
   the padding box shows the right end of the same sprite row. */
.cat-bar,
.title-bar {
  display: block;
  height: 34px;
  padding: 0 9px 3px 0;
  border-left: 9px solid transparent;
  overflow: hidden;
  font: bold 1.1em/32px Arial, Helvetica, sans-serif;
  color: #fff;
  background:
    var(--sprite) 100% var(--sprite-row) no-repeat padding-box,
    var(--sprite) 0 var(--sprite-row) no-repeat border-box;
}

.cat-bar {
  --sprite-row: -160px;
}

.title-bar {
  --sprite-row: -120px;
}

.cat-bar a {
  color: #fff;
}

/* Header */

.site-header {
  min-height: 188px;
}

.header-grid {
  display: grid;
  grid-template-columns: 323fr 403fr 248fr;
  padding: 3px;
  color: #000;
}

.logo img {
  display: block;
  margin-top: -5px;
}

.login p {
  padding: 4px 0;
}

.search-news {
  line-height: 1.2em;
}

.search-news h2 {
  font-size: 1em;
  color: #000;
}

.news {
  height: 50px;
}

input,
select,
button {
  font: 95%/115% Verdana, Helvetica, sans-serif;
  color: #000;
  border: 1px solid #7f9db9;
  padding: 2px;
  background: #fff;
}

input[type="search"] {
  appearance: none;
}

select {
  padding: 0;
}

button {
  border-color: #aaa;
  background: #cde7ff url(images/button.png) no-repeat;
  cursor: pointer;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  height: 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0 15px;
  font-size: 15px;
  font-weight: bold;
  line-height: 38px;
  color: #fff;
  text-shadow: #000 0 2px 2px;
}

/* Content box */

.content {
  min-height: 400px;
  padding: 17px 10px;
  background: #fff;
  border-radius: 7px;
  box-shadow: #000 0 0 5px;
}

.banner {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: -10px auto 0;
  padding-bottom: 8px;
}

.banner img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Board index */

.board-index {
  display: grid;
  gap: 14px;
  padding: 2px 2px 14px;
}

.category {
  display: grid;
  gap: 2px;
}

.board-index .cat-bar {
  height: 32px;
}

.board {
  display: grid;
  grid-template-columns: 6% 1fr 15% 24%;
  grid-template-areas: "icon info stats lastpost";
  gap: 2px;
}

.board:has(.subboards) {
  grid-template-areas:
    "icon info stats lastpost"
    "icon sub sub sub";
}

.board > * {
  padding: 0.3em 0.7em;
  align-content: center;
}

.board-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  background: var(--row-dark);
}

.board-info {
  grid-area: info;
  background: var(--row-light);
}

.board-name {
  font-size: 110%;
  font-weight: bold;
  color: var(--board-title);
}

.moderators {
  font: 0.8em Verdana, sans-serif;
}

.board-stats {
  grid-area: stats;
  font-size: 90%;
  text-align: center;
  color: #000;
  background: var(--row-dark);
}

.board-lastpost {
  grid-area: lastpost;
  font-size: 85%;
  line-height: 1.3em;
  background: var(--row-light);
}

.board > .subboards {
  grid-area: sub;
  padding: 5px;
  font-size: 85%;
  color: #555;
  background: var(--row-dark);
}

.legend {
  display: flex;
  margin: 0 0 14px;
  padding: 0 14px 7px;
  list-style: none;
  font-size: 0.8em;
  line-height: 14px;
}

.legend img {
  margin-left: 4ex;
  vertical-align: middle;
}

/* Info center */

.info-box::before,
.info-box::after {
  content: "";
  display: block;
  height: 12px;
  border-left: 20px solid transparent;
  background:
    var(--sprite) 100% var(--sprite-row) no-repeat padding-box,
    var(--sprite) 0 var(--sprite-row) no-repeat border-box;
}

.info-box::before {
  --sprite-row: -90px;
}

.info-box::after {
  --sprite-row: -102px;
}

.info-center {
  padding: 0 10px;
  background: #f5f5f5;
  border-inline: 1px solid #c5c5c5;
}

.info-center summary {
  cursor: pointer;
  list-style: none;
}

.info-center summary::-webkit-details-marker {
  display: none;
}

.info-center summary img {
  float: right;
  margin: 10px 5px 0 0;
}

.title-bar img {
  float: left;
  margin: 5px 8px 0 0;
}

.info-center p {
  padding: 0.5em;
}

.info-center .small {
  font: 0.85em Verdana, sans-serif;
}

.birthdays {
  color: #920ac4;
}

.group-green {
  color: #00aa55;
}

.group-orange {
  color: #df5f01;
}

.group-gold {
  color: #c68e17;
}

.group-blue {
  color: #0000ff;
}

/* Footer */

.site-footer {
  padding: 10px 0 30px 20px;
  text-align: center;
  color: #666;
}

.site-footer p {
  font-size: 0.8em;
}

.site-footer .credits {
  font-family: Verdana, Arial, sans-serif;
}

.site-footer a {
  color: #999;
}

/* Small screens: the nav already links to search and login,
   so the quick forms make room for the logo and menu. */

@media (max-width: 1012px) {
  .site-header {
    min-height: 0;
    margin-bottom: 20px;
  }

  .header-grid {
    display: block;
    min-height: 94px;
  }

  .logo img {
    max-width: 100%;
    height: auto;
  }

  .login,
  .search-news {
    display: none;
  }

  .main-nav ul {
    height: auto;
  }

}

@media (max-width: 700px) {
  .main-nav a {
    padding: 0 10px;
  }

  .board {
    grid-template-columns: 57px 1fr;
    grid-template-areas:
      "icon info"
      "icon stats"
      "icon lastpost";
  }

  .board:has(.subboards) {
    grid-template-areas:
      "icon info"
      "icon stats"
      "icon lastpost"
      "sub sub";
  }

  .board-stats {
    text-align: left;
  }

  .legend {
    flex-wrap: wrap;
  }
}
