/*
 * SmolWeb CSS Grade B Stylesheet
 * Only uses Grade A and Grade B properties
 *
 * SIMPLIFIED COLOR PALETTE:
 * Foreground/Text/Borders:
 *   - #1e293b (dark text)
 *   - #64748b (muted text)
 *   - #2563eb (accent/links)
 *
 * Backgrounds:
 *   - #ffffff (white)
 *   - #f8fafc (light gray)
 *   - #e2e8f0 (border gray)
 */

/* ===== Grade A: Base Styles ===== */

html {
  font-size: 100%;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  max-width: 65em;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Color Groupings ===== */

/* Primary dark text: #1e293b */
body,
h1, h2, h3, h4, h5, h6,
code, pre,
th,
input, textarea, select, button,
a:hover,
a:visited:hover {
  color: #1e293b;
}

/* Muted text: #64748b */
header p,
blockquote,
time,
footer,
footer a,
nav a,
.lang-switcher a,
.lang-switcher span,
.post-summary,
article time {
  color: #64748b;
}

/* Accent color: #2563eb */
a,
a:visited,
nav a:hover,
.lang-switcher a:hover,
article h2 a:hover,
footer a:hover,
header strong a:hover {
  color: #2563eb;
}

/* White backgrounds: #ffffff */
header,
main,
article,
input, textarea, select, button {
  background-color: #ffffff;
}

/* Light gray backgrounds: #f8fafc */
body,
code,
pre,
blockquote,
th,
tr:nth-child(even) td,
footer,
aside,
article:hover {
  background-color: #f8fafc;
}

/* Border color: #e2e8f0 */
header,
hr,
code,
pre,
blockquote,
table,
th, td,
input, textarea, select, button,
article,
aside {
  border-color: #e2e8f0;
}

/* Special border colors */
pre,
blockquote,
article,
aside {
  border-left-color: #64748b;
}

article:hover {
  border-left-color: #2563eb;
}

a:hover,
a:visited:hover {
  border-bottom-color: #1e293b;
}

nav a:hover {
  border-bottom-color: #2563eb;
}

/* Button backgrounds */
button,
input[type="submit"] {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

button:hover,
input[type="submit"]:hover {
  background-color: #1e293b;
  border-color: #1e293b;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.75em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.5em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h4, h5, h6 {
  font-size: 1.1rem;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

p {
  margin-top: 0;
  margin-bottom: 1.2em;
  line-height: 1.7;
}

/* Links */
a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

/* Lists */
ul, ol {
  margin-top: 0;
  margin-bottom: 1.2em;
  padding-left: 2em;
  line-height: 1.7;
}

li {
  margin-bottom: 0.5em;
}

/* Code */
code, kbd, samp {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  padding: 0.15em 0.4em;
  border: 1px solid;
  font-size: 0.9em;
}

pre {
  padding: 1.2em;
  white-space: pre;
  margin-top: 0;
  margin-bottom: 1.5em;
  border: 1px solid;
  border-left: 4px solid;
  line-height: 1.5;
  /* overflow-x: auto; */ /* Grade C but could be activated */
}

pre code {
  background-color: transparent;
  padding: 0;
  border: 0;
}

/* Blockquote */
blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 1.5em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-left: 4px solid;
  font-style: italic;
}

/* Tables */
table {
  border: 1px solid;
  margin-top: 0;
  margin-bottom: 1.5em;
  width: 100%;
}

th, td {
  padding: 0.75em 1em;
  border: 1px solid;
  text-align: left;
}

th {
  font-weight: 600;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border: 0;
}

/* Forms */
input, textarea, select, button {
  font-family: inherit;
  font-size: 100%;
  padding: 0.6em 0.8em;
  border: 1px solid;
  margin-bottom: 0.5em;
}

button, input[type="submit"] {
  font-weight: 500;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 2px solid;
  margin-top: 2.5em;
  margin-bottom: 2.5em;
}

/* Layout elements */
header {
  padding: 1.5em 1.5em 1.2em;
  margin-bottom: 2em;
  border-bottom: 1px solid;
}

header strong {
  font-size: 1.4rem;
  font-weight: 700;
}

header strong a {
  border-bottom: 0;
}

header p {
  margin-top: 0.3em;
  margin-bottom: 1em;
  font-size: 0.95rem;
}

footer {
  margin-top: 3em;
  padding: 1.5em 1.5em;
  border-top: 1px solid;
  font-size: 0.9rem;
}

main {
  padding: 0 1.5em 1em;
  margin-bottom: 2em;
  min-height: 60vh;
}

article {
  margin-bottom: 1em;
}

section {
  margin-top: 1em;
  margin-bottom: 1em;
}

aside {
  margin-top: 1em;
  margin-bottom: 1em;
  padding: 1.2em;
  border-left: 4px solid;
  border: 1px solid;
}

/* Time elements */
time {
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.4em;
}


/* Time elements */
nav.term-links {
  display: block;
  margin-bottom: 0.4em;
}
nav.term-links a {
  font-size: 0.9rem;
  font-weight: 500;
}



/* Navigation */
nav ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

nav li {
  display: inline-block;
  margin-right: 1.5em;
  margin-bottom: 0.5em;
}

nav li:last-child {
  margin-right: 0;
}

nav a {
  font-weight: 500;
  padding: 0.3em 0;
  border-bottom: 2px solid transparent;
}

/* Language switcher */
.lang-switcher {
  margin-top: 0.8em;
  font-size: 0.85rem;
}

.lang-switcher a,
.lang-switcher span {
  font-weight: 400;
  padding: 0.4em;
  border-bottom: 0;
}

.lang-switcher a:hover {
  border-bottom: 1px solid;
}

.lang-switcher .lang-current {
  font-weight: 600;
}

/* Post list styling */

section article {
  padding: 1.5em;
  margin-bottom: 1.5em;
  border: 1px solid;
  border-left: 4px solid;
}

article h2 {
  margin-top: 0;
  margin-bottom: 0.6em;
  font-size: 1.4rem;
}

article h2 a {
  border-bottom: 0;
}

article time {
  font-size: 0.85rem;
  margin-bottom: 0.6em;
}

.post-summary {
  margin-top: 0.6em;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Pagination */
.pagination {
  padding-left: 0;
  list-style-type: none;
  margin-top: 2em;
  margin-bottom: 2em;
  text-align: center;
}

.pagination li {
  display: inline-block;
  margin-right: 0.5em;
  margin-bottom: 0.5em;
}

.pagination li strong {
  padding: 0.5em 0.8em;
  font-weight: 600;
}

.pagination li a {
  padding: 0.5em 0.8em;
  border: 1px solid;
  display: inline-block;
}

/* ===== Grade B: Responsive Design ===== */

/* Small screens - phones */
@media (max-width: 50em) {
  header {
    padding: 1em;
  }

  header strong {
    font-size: 1.2rem;
  }

  main {
    padding: 0 1em 1em;
  }

  footer {
    padding: 1em;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  nav li {
    display: block;
    margin-bottom: 0;
    margin-right: 0;
  }

  nav a {
    display: block;
    padding: 0.4em 0;
  }

  article {
    padding: 1em;
    margin-bottom: 1em;
  }

  article h2 {
    font-size: 1.2rem;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.5em 0.6em;
  }
}

/* Medium screens - tablets and small laptops */
@media (min-width: 50em) and (max-width: 75em) {
  header {
    padding: 1.5em;
  }

  main {
    padding: 0 1.5em 1em;
  }

  footer {
    padding: 1.5em;
  }
}

/* Large screens - desktops */
@media (min-width: 75em) {
  body {
    padding-top: 0;
  }

  header {
    padding: 2em 2em 1.5em;
  }

  main {
    padding: 0 2em 1em;
  }

  footer {
    padding: 2em;
  }

  article {
    padding: 2em;
  }
}

@media (prefers-color-scheme: dark) {
  /* Dark mode color palette:
   * Foreground/Text:
   *   - #f8fafc (light text)
   *   - #94a3b8 (muted light text)
   *   - #60a5fa (accent/links - lighter blue for contrast)
   *
   * Backgrounds:
   *   - #0f172a (dark background)
   *   - #1e293b (content background)
   *   - #334155 (border gray)
   */

  /* Light text: #f8fafc */
  body,
  h1, h2, h3, h4, h5, h6,
  code, pre,
  th,
  input, textarea, select, button,
  a:hover,
  a:visited:hover {
    color: #f8fafc;
  }

  /* Muted light text: #94a3b8 */
  header p,
  blockquote,
  time,
  footer,
  footer a,
  nav a,
  .lang-switcher a,
  .lang-switcher span,
  .post-summary,
  article time {
    color: #94a3b8;
  }

  /* Light accent color: #60a5fa */
  a,
  a:visited,
  nav a:hover,
  .lang-switcher a:hover,
  article h2 a:hover,
  footer a:hover,
  header strong a:hover {
    color: #60a5fa;
  }

  /* Dark backgrounds: #0f172a */
  body,
  footer {
    background-color: #0f172a;
  }

  /* Content backgrounds: #1e293b */
  header,
  main,
  article,
  code,
  pre,
  blockquote,
  th,
  tr:nth-child(even) td,
  aside,
  article:hover,
  input, textarea, select, button {
    background-color: #1e293b;
  }

  /* Border color: #334155 */
  header,
  hr,
  code,
  pre,
  blockquote,
  table,
  th, td,
  input, textarea, select, button,
  article,
  aside {
    border-color: #334155;
  }

  /* Special border colors */
  pre,
  blockquote,
  article,
  aside {
    border-left-color: #94a3b8;
  }

  article:hover {
    border-left-color: #60a5fa;
  }

  a:hover,
  a:visited:hover {
    border-bottom-color: #f8fafc;
  }

  nav a:hover {
    border-bottom-color: #60a5fa;
  }

  /* Button backgrounds */
  button,
  input[type="submit"] {
    background-color: #60a5fa;
    color: #0f172a;
    border-color: #60a5fa;
  }

  button:hover,
  input[type="submit"]:hover {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #f8fafc;
  }
}

/* Print styles - Grade A only */
@media print {
  body {
    color: #000000;
    background-color: #ffffff;
    padding: 0;
    max-width: none;
    font-size: 12pt;
  }

  header {
    border-bottom: 2px solid #000000;
    background-color: transparent;
  }

  footer {
    border-top: 2px solid #000000;
    background-color: transparent;
  }

  a {
    color: #000000;
    text-decoration: underline;
    border-bottom: 0;
  }

  nav {
    display: none;
  }

  article {
    border: none;
    background-color: transparent;
  }

  pre {
    border: 1px solid #000000;
    background-color: transparent;
  }
}
