/* === Root Variables for Themes === */
:root {
  --bg: #fdfcf7;
  --text: #222;
  --accent: #21918c;
  --link: #35b779;
  --heading: #90d743;
  --strong: #3b528b;
  --panel-bg: rgba(255, 255, 255, 0.95);
  --tile: url('./assets/hexagon-tile.png');
  --indent-bg: rgba(144, 215, 67, 0.1); /* Light green tint for light mode */
  --indent-border: #90d743;
}

[data-theme="dark"] {
  --bg: #2c2c59;
  --text: #fde725;
  --accent: #21918c;
  --link: #90d743;
  --heading: #fde725;
  --strong: #35b779;
  --panel-bg: rgba(68, 1, 84, 0.95);
  --tile: url('./assets/hexagon-tile-dark.png');
  --indent-bg: rgba(253, 231, 37, 0.08); /* Subtle yellow tint for dark mode */
  --indent-border: #fde725;
}

/* === General Styles === */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  line-height: 1.7;
  font-size: 18px;
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem;
  background-image: var(--tile);
  background-repeat: repeat;
  border-left: 4px solid var(--heading);
}

main {
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem;
  background-color: var(--panel-bg);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* Clock and theme toggle */
#clock-container {
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 999;
  font-family: monospace;
  font-size: 0.95em;
  color: var(--text);
}

#toggle-theme {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: var(--text);
}

/* Headings and emphasis */
h1, h2, h3 {
  color: var(--heading);
  font-family: Georgia, serif;
  margin-top: 2rem;
  text-transform: uppercase;
}

a {
  color: var(--link);
  text-decoration: underline dotted;
}

a:hover {
  color: #fde725;
  background-color: #3b528b;
  transition: 0.2s ease-in;
}

strong {
  color: var(--strong);
  font-weight: bold;
}

ul {
  list-style: square;
  color: var(--heading);
  padding-left: 2rem;
}

hr {
  border: none;
  border-top: 1px dashed var(--strong);
  margin: 2rem 0;
}

/* Themed indent blocks for paragraphs with strong elements */
p:has(strong) {
  background-color: var(--indent-bg);
  padding: 0.75rem;
  border-left: 3px solid var(--indent-border);
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
}

/* Special styling for h3 + paragraph with strong combinations */
h3 + p:has(strong) {
  background-color: var(--indent-bg);
  padding: 1rem;
  border-left: 4px solid var(--indent-border);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0 6px 6px 0;
  position: relative;
}

/* Add a subtle top border for h3 + p blocks */
h3 + p:has(strong)::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  right: 0;
  height: 2px;
  background-color: var(--indent-border);
  opacity: 0.3;
}

@media screen and (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 1.5rem;
  }
  h1 {
    font-size: 1.8em;
  }
  
  p:has(strong), h3 + p:has(strong) {
    padding: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
}