/* Palette */
:root {
  --header-bg: #0f172a;
  --text-light: #f8fafc;
  --link-blue: #0284c7;
  --link-hover: #0369a1;
  --body-bg: #f1f5f9;
}

/* Universal Box-Sizing Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--body-bg);
  color: #334155;
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* 1. Header (Restricted strictly to the top bar) */
header {
  background-color: var(--header-bg);
  padding: 12px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
}

header h1 a {
  color: var(--text-light);
  text-decoration: none;
}

/* 2. Top Navigation Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: transparent;
  color: var(--text-light);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--header-bg);
  min-width: 250px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 100;
}

.dropdown-content a {
  color: var(--text-light);
  padding: 8px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: var(--link-blue);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* 3. Body Directory (Strips header styles, forces vertical list) */
main.body-menu {
  background: transparent;
  padding: 20px 40px;
}

main.body-menu header h1,
main.body-menu .dropbtn {
  display: none; /* Hide header text & toggle button in body */
}

main.body-menu .dropdown-content {
  display: block !important;
  position: static !important;
  background: transparent !important;
  box-shadow: none !important;
}

main.body-menu .dropdown-content a {
  display: block !important; /* Force separate lines */
  color: var(--link-blue);
  padding: 4px 0;
  font-size: 1.1rem;
}

main.body-menu .dropdown-content a:hover {
  color: var(--link-hover);
  background: transparent;
  text-decoration: underline;
}

main.body-menu header,
main.body-menu .dropdown {
  background: transparent !important;
  box-shadow: none !important;
}

/* 4. Center Image Container */
.image-container {
  position: relative;
  width: 360px;
  margin: 30px auto;
  text-align: center;
}
  
.image-container img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.image-container .top-img {
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease;
}

.image-container:hover .top-img {
  opacity: 0;
}

/* Readable Article Layout */
.content-container {
  max-width: 720px;          /* Optimal reading width (~65-75 chars per line) */
  margin: 40px auto;          /* Centers the column with vertical breathing room */
  padding: 0 20px;           /* Prevents text from touching screen edges on mobile */
}

/* Typography refinements */
.content-container p {
  font-size: 1.05rem;
  line-height: 1.6;          /* Generous line spacing for easy eye-scanning */
  margin-bottom: 1.25rem;
}

.content-container h1, 
.content-container h2, 
.content-container h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #0f172a;
}

/* Keeps code blocks nicely constrained within the reading column */
.content-container pre {
  max-width: 100%;
  overflow-x: auto;          /* Scrollbar inside pre tag if command line is long */
}