/*======================================================================
  style.css
  • Horizontal padding for every block of text
  • Automatic dark‑mode (prefers‑color‑scheme)
  • Light, clean default look
======================================================================*/

/*--------------------------------------------------------------
  1️⃣  CSS RESET – keep things consistent across browsers
--------------------------------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;          /* ← No vertical padding yet */
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
                "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

/*--------------------------------------------------------------
  2️⃣  THEME VARIABLES – all the colors that can be swapped
--------------------------------------------------------------*/
:root {
  /* light theme (default) */
  --primary-color:   #0066cc;
  --secondary-color: #333333;
  --bg-color:        #ffffff;
  --text-color:      #222222;
  --muted-color:     #666666;
  --border-color:    #e0e0e0;
  --code-bg:         #f8f8f8;
  --code-text:       #c7254e;
  --max-width:       800px;
}

/*--------------------------------------------------------------
  3️⃣  AUTOMATIC DARK‑MODE
--------------------------------------------------------------*/
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color:        #121212;
    --text-color:      #e0e0e0;
    --secondary-color: #f0f0f0;
    --primary-color:   #66b0ff;
    --muted-color:     #999999; 
    --border-color:    #333333;
    --code-bg:         #1e1e1e;
    --code-text:       #f8f8f2;
  }
}

/*--------------------------------------------------------------
  4️⃣  LAYOUT – central container & spacing
--------------------------------------------------------------*/
.container {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1rem;      /* ← horizontal padding inside the container */
}

/*--------------------------------------------------------------
  5️⃣  BODY – overall horizontal padding for *any* content
--------------------------------------------------------------*/
body {
  /* 1rem on each side so text never touches the very edge */
  padding-left: 1rem;
  padding-right: 1rem;
}

/*--------------------------------------------------------------
  6️⃣  TYPOGRAPHY
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--secondary-color);
  /* optional – extra space on the sides of headings
  padding-left: 1rem;
  padding-right: 1rem;  */
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/*--------------------------------------------------------------
  7️⃣  LINKS & BUTTONS
--------------------------------------------------------------*/
a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
}

button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  color: #fff;
  background: var(--primary-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}
button:hover, .btn:hover {
  filter: brightness(90%);
}

/*--------------------------------------------------------------
  8️⃣  LISTS
--------------------------------------------------------------*/
ul, ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 2rem;
}
ul li, ol li {
  margin-bottom: 0.5rem;
}

/*--------------------------------------------------------------
  9️⃣  BLOCKQUOTE & CODE
--------------------------------------------------------------*/
blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--code-bg);
  border-left: 4px solid var(--primary-color);
  color: var(--muted-color);
  font-style: italic;
}

code {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 3px;
}
pre {
  overflow-x: auto;
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

/*--------------------------------------------------------------
  🔟  IMAGES
--------------------------------------------------------------*/
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 4px;
}

/*--------------------------------------------------------------
  🔑  HORIZONTAL SEPARATORS (hr)
--------------------------------------------------------------*/
hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

/*--------------------------------------------------------------
  🔑  RESPONSIVE HELPERS
--------------------------------------------------------------*/
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

/*--------------------------------------------------------------
  Optional – manual dark‑mode override
--------------------------------------------------------------*/
body.manual-dark {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --border-color: #333333;
  --code-bg: #1e1e1e;
  --code-text: #f8f8f2;
}

