/* General Body Styling */
main {
  max-width: 1000px;
  margin: 20px auto; /* Automatically center horizontally with vertical spacing */
}

/* General Paragraph Styling */
p {
  color: var(--text-color); /* Matches the page's text color */
  transition: color 0.3s ease; /* Smooth color transition */
}

/* Paragraphs Styled as Links */
p a {
  color: var(--link-color); /* Matches link color for clickable text */
  text-decoration: none; /* Removes underlining by default */
}

p a:hover {
  color: var(--link-hover-color); /* Matches link hover color */
  text-decoration: underline; /* Adds underlining on hover */
}

h2 {
  border-bottom: 1px solid var(--table-border-color);
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}

/* Header Styling */
header {
  background: #f8f9fa;
  padding: 10px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
}

header a{
  font-size: 30px;
}

header img {
  max-width: 50px;
  max-height: 50px;
  margin-right: 20px;
}

img {
  max-width: 70vw;
  max-height: 500px;
}

article img {
  display: block; /* Treat the image as a block-level element */
  margin: 20px auto; /* Automatically center horizontally with vertical spacing */
  max-height: 70vh;
  max-width: 100%; /* Prevent the image from exceeding the container width */
  height: auto; /* Maintain the image's aspect ratio */
}

header h1 {
  margin: 0;
  font-size: 24px;
}

header a {
  text-decoration: none;
  color: #000;
}

#search {
  padding: 5px;
  font-size: 16px;
  width: 200px;
}

/* Main Content Styling */
main {
  padding: 20px;
}

/* Footer Styling */
footer {
  text-align: center;
  padding: 10px;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
}

/* Page Banner Replacement */
.page-banner {
  max-width: 80vw;
  width: 80%; /*  Full width to replace the banner */
  margin: 0 auto; /* Center alignment */
  margin-top: 25px;
  background-color: var(--table-of-contents-bg);
  color: var(--text-color); /* Ensures text matches the mode */
  border: 1px solid var(--table-border-color);
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.page-banner img {
  display: block; /* Ensures the image is treated as a block-level element */
  margin: 0 auto; /* Centers the image horizontally */
  max-height: 50vh;
  max-width: 80vw; /* Ensures the image resizes to fit within the banner */
  height: auto; /* Maintains the image's aspect ratio */
}

.page-banner h3 {
  margin: 0 0 15px 0;
  font-size: 2em;
  background-color: var(--banner-background);
  padding: 10px 20px;
  border-radius: 6px;
  display: inline-block;
  color: var(--text-color); /* Matches the mode's text color */
}

.page-banner ul {
  list-style-type: none;
  padding: 0;
  display: inline-block; /* Keeps the list inline with the header */
  margin: 0;
  color: var(--text-color); /* Ensures list text matches the mode */
}

.page-banner li {
  margin: 5px 0;
  text-align: left;
  color: var(--text-color); /* Matches text with the mode */
}

.page-banner li strong {
  color: var(--link-color); /* Highlights key text using the mode's link color */
}

/* Adjust responsiveness */
@media (max-width: 768px) {
  .page-banner {
    text-align: center;
  }

  .page-banner ul {
    display: block;
    margin-top: 15px;
  }
}

/* Default (Light Theme) Variables */
:root {
  --background-color: white;
  --text-color: black;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --header-footer-bg: #f8f9fa;
  --table-of-contents-bg: #ffffff;
  --table-border-color: #ddd;
}

/* Dark Theme Variables */
body {
  --background-color: #121212;
  --text-color: #e0e0e0;
  --link-color: #90caf9;
  --link-hover-color: #42a5f5;
  --header-footer-bg: #1e1e1e;
  --table-of-contents-bg: #232323;
  --table-border-color: #333;
}

/* Apply Variables */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background-color: var(--header-footer-bg);
  color: var(--text-color);
  padding: 15px 20px;
  border-bottom: 1px solid var(--table-border-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

header a {
  color: var(--link-color);
}

header a:hover {
  color: var(--link-hover-color);
}

/* Table of Contents Styling */
#table-of-contents {
  background-color: var(--table-of-contents-bg);
  color: var(--text-color);
  border: 1px solid var(--table-border-color);
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Table of Contents Header */
#table-of-contents h2 {
  margin: 0 0 10px 0;
  font-size: 1.5em;
  color: var(--text-color);
  border-bottom: 1px solid var(--table-border-color);
  padding-bottom: 5px;
}

/* Remove Bullet Points from Links */
#table-of-contents ul {
  list-style-type: none; /* Remove bullets */
  padding: 0; /* Remove default padding */
  margin: 0; /* Remove default margin */
}

/* Align Links Consistently */
#table-of-contents li {
  margin: 5px 0;
  line-height: 1.4;
  font-size: 0.95em;
}

/* Match Link Colors */
#table-of-contents li a {
  color: var(--link-color);
  text-decoration: none;
}

#table-of-contents li a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* Footer */
footer {
  background-color: var(--header-footer-bg);
  color: var(--text-color);
  text-align: center;
  padding: 10px 20px;
  border-top: 1px solid var(--table-border-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* General Theme Variables */
:root {
  --background-color: white;
  --text-color: black;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --header-footer-bg: #f8f9fa;
  --banner-bg: #e8e8e8;
  --section-bg: #ffffff;
}

/* Dark Theme Variables */
body.dark-theme {
  --background-color: #121212;
  --text-color: #e0e0e0;
  --link-color: #90caf9;
  --link-hover-color: #42a5f5;
  --header-footer-bg: #1e1e1e;
  --banner-bg: #232323;
  --section-bg: #1a1a1a;
}

/* Apply Variables */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background-color: var(--header-footer-bg);
  color: var(--text-color);
  padding: 15px 20px;
  border-bottom: 1px solid var(--link-color);
}

header a {
  color: var(--link-color);
  text-decoration: none;
}

header a:hover {
  color: var(--link-hover-color);
}

/* Section */
section {
  background-color: var(--section-bg);
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

section h3 {
  color: var(--text-color);
}

section a {
  color: var(--link-color);
}

section a:hover {
  color: var(--link-hover-color);
}

/* Footer */
footer {
  background-color: var(--header-footer-bg);
  color: var(--text-color);
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--link-color);
}

/* For video player YouTube */

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  max-height: 100%;
  /* animation: fadeIn 0.7s; */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (min-width: 1280px) {
  .video-container {
    width: 640px;
    height: 360px;
    padding-bottom: 0;
  }
}

.thumbnail {
  max-width: 200px;
  max-height: 200px;
}

/* Footer Navigation Blocks */
.footer-nav-blocks {
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Allows wrapping on smaller screens */
  gap: 20px;
  background-color: var(--header-footer-bg); /* Matches theme */
  padding: 20px;
  border-top: 2px solid var(--table-border-color);
  border-radius: 8px;
  margin-top: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Individual Navigation Categories */
.nav-category {
  flex: 1;
  min-width: 150px; /* Ensures a minimum size */
  max-width: 250px; /* Prevents excessive width */
  text-align: left;
}

/* Category Headers */
.nav-category h4 {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--text-color); /* Matches the theme */
  border-bottom: 1px solid var(--table-border-color);
  padding-bottom: 5px;
}

/* Links */
.nav-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-category li {
  margin-bottom: 8px;
}

.nav-category a {
  text-decoration: none;
  color: var(--link-color);
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-category a:hover {
  color: var(--link-hover-color);
}

/* Footer Text */
footer p {
  margin-top: 15px;
  color: var(--text-color);
  font-size: 0.9em;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .footer-nav-blocks {
    flex-direction: column;
    align-items: center;
  }

  .nav-category {
    text-align: center;
  }
}

/* Details Box Styling */
.details-box {
  background-color: var(--table-of-contents-bg); /* Matches theme */
  color: var(--text-color); /* Matches the current mode */
  border: 1px solid var(--table-border-color);
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, color 0.3s ease;
  max-width: 500px;
  margin: auto;
}

/* Details Box Header */
.details-box h2 {
  margin: 0 0 10px 0;
  font-size: 1.5em; /* Match the page header hierarchy */
  color: var(--text-color); /* Consistent with the current theme */
  border-bottom: 1px solid var(--table-border-color);
  padding-bottom: 5px;
}

/* Details List */
.details-box ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.details-box li {
  margin: 5px 0;
  line-height: 1.4;
  font-size: 0.95em;
}

/* Match Link Colors */
.details-box li a {
  color: var(--link-color);
  text-decoration: none;
}

.details-box li a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

.details-box li strong {
  font-weight: bold;
  color: var(--text-color); /* Same as the text color to avoid color clashes */
}

/* General Styling for Images and Captions */
.image-container {
  display: flex;
  flex-direction: column; /* Stacks the image and caption vertically */
  align-items: center; /* Centers the content */
  margin: 20px 0; /* Adds spacing around the container */
}

.image-container img {
  max-width: 100%; /* Ensures image scales with container */
  height: auto; /* Maintains aspect ratio */
  border: 1px solid var(--table-border-color); /* Optional border for visibility */
  border-radius: 4px; /* Slightly rounded corners */
}

.image-container figcaption {
  margin-top: 8px; /* Adds spacing between image and caption */
  font-size: 0.9em; /* Slightly smaller text for captions */
  color: var(--text-color); /* Matches the current theme */
  text-align: center; /* Centers the caption text */
  padding: 4px 8px; /* Adds some padding for readability */
  background-color: var(--header-footer-bg); /* Adds a subtle background to captions */
  border-radius: 4px; /* Rounds the caption background slightly */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Optional shadow for better visibility */
}
