/* Import the pixelated retro font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Reset and base styles */
html, body {
  height: 100%;
  margin: 0;
  background: #004400; /* dark green */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1em;
  box-sizing: border-box;
  font-family: 'Press Start 2P', monospace;
  color: black;
  overflow: hidden; /* Avoid body scroll */
}

/* Main container shared style */
.screen, .blog-container {
  background-color: #00FF00; /* bright green */
  color: black;
  font-family: 'Press Start 2P', monospace;
  width: 32ch;
  max-width: 90vw;
  font-size: calc(min(100vw / 32, 100vh / 18));
  line-height: 1;
  position: relative;

  /* Pixelated text */
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;

  border-radius: 0.25em;
  box-sizing: border-box;
  padding-left: 1ch;
  white-space: pre;
}

/* Screen specifically */
.screen {
  height: 18em;
  max-height: 100vh;

  /* Flex center vertically/horizontally */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;  /* left align text lines */
  overflow: hidden;
}

/* Blog container scrollable with hidden scrollbar */
.blog-container {
  width: 90vw;
  max-width: 800px;
  max-height: 80vh;
  padding: 1.5em 2em;
  font-size: 1.1rem;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-y: auto;

  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE and Edge */
}

.blog-container::-webkit-scrollbar {
  display: none;              /* Chrome, Safari, Opera */
}

/* Links style */
a {
  color: black;
  text-decoration: none;
  width: 100%;
  display: block;
  position: relative;
  padding-left: 1ch;
}

a:hover, a:focus {
  color: #555;
  text-decoration: none;
  outline: none;
  background-color: #aaffaa;
}

/* Line style */
.line {
  display: block;
  width: 100%;
  position: relative;
}

/* Cursor blinking */
.cursor {
  display: inline-block;
  width: 1ch;
  height: 1em;
  background-color: black;
  vertical-align: bottom;
  animation: blink 1s steps(2, start) infinite;
  position: relative;
  z-index: 4;
}

@keyframes blink {
  0%, 50% { background-color: black; }
  50.01%, 100% { background-color: transparent; }
}

/* Headings for blog */
h1, h2, h3 {
  margin-top: 0;
}

/* Links in blog */
.blog-container a {
  text-decoration: underline;
}

.blog-container a:hover,
.blog-container a:focus {
  color: #555;
  text-decoration: none;
}
