@font-face {
    font-family: 'OldEngravers'; /* Replace with a name for your font */
    src: url('OPTIEngraversOldEnglish.otf') format('opentype'); /* Replace with the path to your .otf file */
    font-weight: normal; /* Adjust as needed */
    font-style: normal; /* Adjust as needed */
}


body {
  font-family: "Georgia", serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Ensure body takes full viewport height */
}

header {
  background-color: #222;
  color: #fff;
  padding: 20px 0;
  text-align: center;
  border-bottom: 5px solid #a00;
}

header h1 {
  margin: 0;
  font-size: 3em;
  font-family: "Times New Roman", serif;
}

header p {
  margin: 5px 0 0;
  font-style: italic;
}

main {
  flex-grow: 1; /* Allow main content to take available space */
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

#search-container {
  margin-bottom: 20px;
  padding: 10px;
  background-color: #eee;
  border-radius: 8px;
  display: flex;
  justify-content: center;
}

#search-input {
  width: 100%;
  max-width: 500px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box; /* Include padding in width */
}

#search-input::placeholder {
  color: #888;
}

#tabs-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #eee;
  border-bottom: 1px solid #ddd;
  border-radius: 8px;
}

.tab-button {
  background-color: #ddd;
  color: #333;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap; /* Prevent text wrapping */
}

.tab-button:hover {
  background-color: #ccc;
}

.tab-button.active {
  background-color: #a00;
  color: #fff;
  font-weight: bold;
}

#articles-display-area {
  flex-grow: 1; /* Allow this area to take remaining space */
  position: relative; /* For absolute positioning of source sections */
  min-height: 300px; /* Minimum height for the display area */
}

.source-section {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  height: 100%; /* Take full height of parent */
  overflow-y: auto; /* Make it scrollable */
  position: absolute; /* Position over each other */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none; /* Hidden by default */
}

.source-section.active {
  display: block; /* Show active section */
}

.source-section h2.source-title {
  color: #222;
  font-size: 1.8em;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid #a00;
  padding-bottom: 10px;
  font-family: "Times New Roman", serif;
}

.newspaper-article {
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.newspaper-article h3 {
  /* Changed from h2 to h3 for article titles within source sections */
  color: #a00;
  font-size: 1.6em;
  margin-top: 0;
  margin-bottom: 10px;
  font-family: "Times New Roman", serif;
}

.newspaper-article .date {
  font-style: italic;
  color: #666;
  margin-bottom: 15px;
  display: block;
  border-bottom: 1px dashed #eee;
  padding-bottom: 10px;
}

.newspaper-article .content {
  white-space: pre-wrap; /* Preserves whitespace and line breaks */
  font-size: 1.1em;
  text-align: justify;
}

footer {
  text-align: center;
  padding: 20px;
  margin-top: auto; /* Push footer to the bottom */
  background-color: #222;
  color: #fff;
  font-size: 0.9em;
}

.loading-message {
  text-align: center;
  font-style: italic;
  color: #777;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.no-search-results {
  text-align: center;
  font-style: italic;
  color: #a00;
  margin-top: 20px;
}

#headline{
  font-family: "OldEngravers";
}

#game-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.overlay-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.overlay-content h2 {
  margin-top: 0;
}

.buy-button {
  display: inline-block;
  margin-top: 1rem;
  background-color: #0078ff;
  color: white;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

.buy-button:hover {
  background-color: #005fcc;
}

.dismiss-button {
  margin-top: 1rem;
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
}
