*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Smooth scrolling when navigating to anchors. */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  line-height: 1.5;
  background: #eee;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  color: #333;
  scrollbar-color: #888 #eee;
  scrollbar-width: thin;
}

::selection {
  background: #ddd;
  color: #000;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
  background: #eee;
}

::-webkit-scrollbar-thumb {
  background: #888;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, #888 80%, white);
}

b, strong {
  color: #333;
}

i, em {
  color: #333;
}

a {
  color: #777;
  text-decoration: none;
}

a:hover {
  color: #999;
}

/* Make link children (e.g., icons) inherit the link color */
a > *, a:hover > * { color: inherit; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

input, textarea {
  padding: 8px;
  border: 1px solid #ccc;
  background: #fff;
  color: #000;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: #999;
  opacity: 1;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  padding: 8px 16px;
  border: 1px solid #888;
  background: #555;
  color: #fff;
  cursor: pointer;
  text-align: center;
  display: inline-block;
}

button:hover {
  background-color: #444;
}

/* Ensures a consistent style for text fields and buttons across browsers. */
button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
}

button,
[type=button],
[type=reset],
[type=submit] {
  -webkit-appearance: button;
  appearance: button;
}

button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
  cursor: pointer;
}

/* Normalize heading spacing and style. */
h6, h5, h4, h3, h2, h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
  color: #333;
}

h1 {
  font-size: 16pt;
}

h2 {
  font-size: 13pt;
}

/* Avoids extra bottom whitespace. */
img {
  display: block;
}

/* Prevent overflow. */
img, video {
  max-width: 100%;
  height: auto;
}

/* Keeps list indentation consistent. */
ul, ol {
  padding-left: 1.25rem;
}

blockquote {
  background: #f9f9f9;
  color: #000;
  border-left: 10px solid #ccc;
  margin: 1rem 10px;
  padding: 0.5rem 10px;
}

#container {
  margin: 0 auto;
  width: 100%;
  max-width: 1100px;
}

#topbar {
  background: #333;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#logo {
  font-size: 15pt;
  font-weight: bold;
  color: #fff;
  display: inline-block;
}

#topmenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}

#topmenu a {
  color: #fff;
}

#topmenu a:hover {
  color: #999;
}

#header {
  background: url('images/header.png');
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 250px;
}

/* Positions the sidebars and content */
#main-row {
  display: flex;
  width: 100%;
}

#content {
  background: #fff;
  color: #000;
  padding: 15px;
  flex: 1; /* Forces the content to use the remaining width */
}

.sidebar {
  background: #ddd;
  padding: 15px;
  width: 250px;
}

.sidebar .links {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  gap: 3px;
}

.sidebar .links.side-by-side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.sidebar a {
  display: block;
  background: #eee;
  padding: 5px 10px;
  color: #777;
}

.sidebar a:hover {
  background: #ccc;
  color: #333;
}

#footer {
  background: #222;
  color: #fff;
  padding: 15px;
  text-align: center;
}

/* Responsive CSS (phones and tablets) */
@media (max-width: 768px) {
  #main-row {
    flex-direction: column;
  }

  #topbar {
    flex-direction: column;
  }

  #topmenu {
    margin-top: 10px;
  }

  .sidebar {
    width: 100%;
    order: 2; /* Positions the sidebar after the content */
  }
}