/* Light mode styles */
.header-box a.external {
  background-image: none;
}

.header-box p {
  font-size: inherit;
  margin: 0.25em 0;
}

.header-box {
  background: #f7f9fc;
  border: 1px solid #d7dde6;
  border-left: 4px solid #004080;
  padding: 0.75em 1em;
  color: #111;
  text-align: center;
}

.crw-button {
  background: #004080;
  color: #fff;
  padding: 0.45em 0.9em;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
}

.crw-button:hover,
.crw-button:focus {
  background: #0b5aa5;
  outline: none;
}

.crw-button.secondary {
  background: #eef2f7;
  color: #111;
  border: 1px solid #d7dde6;
}

.crw-button.secondary:hover,
.crw-button.secondary:focus {
  background: #e6edf6;
  outline: none;
}

.content-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1em;
  overflow: hidden;
  min-width: 0;
}

@media screen and (min-width: 720px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.content-header {
  font-size: 1.5em;
  font-weight: bold;
  color: #0f2e4d;
  border-bottom: 2px solid rgba(0, 64, 128, 0.22);
  padding-bottom: 0.25em;
  margin-bottom: 0.6em;
  margin-top: 0 !important;
}

.content-section {
  background: #ffffff;
  border: 1px solid #d7dde6;
  padding: 1em;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
  color: #111;
}

.content-section.wide {
  grid-column: 1 / -1;
}

.content-section > div:first-child {
  font-size: 1.5em;
  font-weight: bold;
  color: #0f2e4d;
  border-bottom: 2px solid rgba(0, 64, 128, 0.22);
  padding-bottom: 0.25em;
  margin-top: 0.25em;
}

/* Forced dark mode */
@media screen {
  html.skin-theme-clientpref-night .header-box {
    background: #121c32;
    border-color: #273244;
    border-left-color: #004080;
    color: #e5e7eb;
  }

  html.skin-theme-clientpref-night .content-section {
    background: #121c32;
    border-color: #273244;
    color: #e5e7eb;
  }

  html.skin-theme-clientpref-night .crw-button {
    background: #004080;
    color: #fff;
  }

  html.skin-theme-clientpref-night .crw-button:hover,
  html.skin-theme-clientpref-night .crw-button:focus {
    background: #0b5aa5;
    outline: none;
  }

  html.skin-theme-clientpref-night .crw-button.secondary {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(229, 231, 235, 0.22);
  }

  html.skin-theme-clientpref-night .crw-button.secondary:hover,
  html.skin-theme-clientpref-night .crw-button.secondary:focus {
    background: rgba(229, 231, 235, 0.08);
    outline: none;
  }

  html.skin-theme-clientpref-night .content-section > div:first-child {
    color: #eaf2ff;
    border-color: rgba(0, 64, 128, 0.35);
  }

  html.skin-theme-clientpref-night .content-header {
    color: #eaf2ff;
    border-bottom-color: rgba(0, 64, 128, 0.35);
  }

  html.skin-theme-clientpref-os .content-header {
    color: #eaf2ff;
    border-bottom-color: rgba(0, 64, 128, 0.35);
  }
}

/* OS dark mode */
@media screen and (prefers-color-scheme: dark) {
  html.skin-theme-clientpref-os .header-box {
    background: #121c32;
    border-color: #273244;
    border-left-color: #004080;
    color: #e5e7eb;
  }

  html.skin-theme-clientpref-os .content-section {
    background: #121c32;
    border-color: #273244;
    color: #e5e7eb;
  }

  html.skin-theme-clientpref-os .crw-button {
    background: #004080;
    color: #fff;
  }

  html.skin-theme-clientpref-os .crw-button:hover,
  html.skin-theme-clientpref-os .crw-button:focus {
    background: #0b5aa5;
    outline: none;
  }

  html.skin-theme-clientpref-os .crw-button.secondary {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(229, 231, 235, 0.22);
  }

  html.skin-theme-clientpref-os .crw-button.secondary:hover,
  html.skin-theme-clientpref-os .crw-button.secondary:focus {
    background: rgba(229, 231, 235, 0.08);
    outline: none;
  }

  html.skin-theme-clientpref-os .content-section > div:first-child {
    color: #eaf2ff;
    border-color: rgba(0, 64, 128, 0.35);
  }

  html.skin-theme-clientpref-os .content-header {
    color: #eaf2ff;
    border-bottom-color: rgba(0, 64, 128, 0.35);
  }
}


/* Category buttons */
.cat-but-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
  gap: 0.5em;
}

.cat-but {
  display: flex;
  align-items: center;
  gap: 0.5em;

  padding: 0.65em 0.9em;
  border-radius: 8px;

  background: #ffffff;
  border: 1px solid #d6dbe3;

  color: #004080;
  font-weight: 700;
  text-decoration: none;

  box-sizing: border-box;
}

.cat-but-icon {
  font-size: 1.05em;
  line-height: 1;
}

.cat-but-label {
  line-height: 1.1;
}

/* Hover */
.cat-but:hover {
  background: #f3f6fb;
  border-color: #004080;
}

/* Dark mode */
html.skin-theme-clientpref-night .cat-but,
html.skin-theme-clientpref-os .cat-but {
  background: #0f1a2b;
  border-color: #24314a;
  color: #ffffff;
}

html.skin-theme-clientpref-night .cat-but:hover,
html.skin-theme-clientpref-os .cat-but:hover {
  background: #16223a;
  border-color: #3a5a9a;
}


/* Testing */
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.header-title {
  font-size: 2em;
  font-weight: 800;
}

.header-tagline {
  font-size: 1.35em;
  font-style: italic;
  margin: 0.4em 0 0.9em;
}

.header-stats {
  font-size: 1.2em;
  margin: 0.25em 0 0.75em;
}

.header-actions {
  margin: 0.75em auto 0;
  max-width: 780px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5em;
  align-items: stretch;
}

.header-actions a {
  display: block;
  text-decoration: none;
}

.header-actions .crw-button {
  width: 100%;
  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  line-height: 1.15;

  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;

  padding: 0.55em 0.9em;
}

@media screen and (max-width: 900px) {
  .header-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 520px) {
  .header-actions {
    grid-template-columns: 1fr;
  }

  .header-tagline {
    font-size: 1.2em;
  }

  .header-stats {
    font-size: 1.05em;
  }
}

html.skin-theme-clientpref-night .header-tagline,
html.skin-theme-clientpref-night .header-stats,
html.skin-theme-clientpref-os .header-tagline,
html.skin-theme-clientpref-os .header-stats {
  color: inherit;
}