* {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
}

:root {
  --font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --color-bg-0: #fffcf4;
  --color-bg-1: #efeadc;
  --color-bg-2: #d6ceb8;
  --color-bg-3: #bfb497;
  --color-theme-0: #007aff;
  --color-theme-1: #1565c0;
  --color-text: rgba(0, 0, 0, 0.7);

  /* Legacy variables for compatibility */
  --background-color: var(--color-bg-0);
  --subtle-emphasis-color: var(--color-bg-1);
  --text-color: var(--color-text);
  --table-header: #ccc;
  --link-color: var(--color-theme-1);
  --link-visited-color: #528;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #222;
    --subtle-emphasis-color: #444;
    --text-color: #eee;
    --table-header: #666;
    --link-color: #7cf;
    --link-visited-color: #c7f;
    font-size: large;
    font-weight: lighter;
  }

  h1,h2,h3,h4 {
    font-weight: normal
  }
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    margin: 0;
    background-attachment: fixed;
    background-color: var(--color-bg-0);
    background-size: 100vw 100vh;
    background-image:
        radial-gradient(
            50% 50% at 50% 50%,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(255, 255, 255, 0.5) 100%
        ),
        linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 50%, var(--color-bg-2) 100%);
}

a {
  color: var(--link-color);
}

a:visited {
  color: var(--link-visited-color);
}

header {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 60px;
}

#header-items {
    margin-left: auto;
    margin-right: auto;
    max-width: 1000px;
    min-height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}


#header-items ul {
  color: var(--color-theme-1);
  display: inline-block;
  vertical-align: middle;
  padding: 0px;
  margin: 0px;
}

#header-items li {
  display:inline-block;
  vertical-align:middle;
}

#header-items a {
  display: block;
  line-height: 1.5em;
  text-decoration: none;
  padding: 5px 20px;
  font-size: 0.875rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

#header-items a:hover,
#header-items a:focus {
  background: var(--subtle-emphasis-color);
}

#header-items a, 
#header-items a:visited,
#header-items a:hover,
#header-items a:active {
  color: currentColor;  /* Remove default link coloring */
  text-decoration: none;  /* Remove the underline */
}

#content {
    margin-left: auto;
    margin-right: auto;
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 100px;
    max-width: 1000px;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;        /* Remove extra space above headings */
  margin-bottom: 0.5em; /* Space below each heading for readability */
  padding-left: 0;      /* No padding by default */
  font-weight: bold;    /* Consistent bold style */
  line-height: 1.2;     /* Good line height for headings */
}

/* Specific font sizes for hierarchy */
h1 {
  font-size: 2.5rem;
  margin-top: 2rem
}

h2 {
  font-size: 2rem;
  margin-top: 1.5rem;
}

h3 {
  font-size: 1.75rem;
  margin-top: 1.5rem;
}

h4 {
  font-size: 1.5rem;
  margin-top: 1.25rem;
}

p {
  margin-top: 1em;
  margin-bottom: 1em;
  padding: 0;
}

ul, ol {
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 40px; /* or padding-inline-start for logical properties */
}

li {
  padding-left: 0; /* or increased if more gap needed */
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
}

table.striped thead {
  background-color: var(--table-header);
}

table.striped td,
table.striped th {
  padding: .4em .4em;
  border-left: 1px solid #888;
}

table.striped td:first-child,
table.striped th:first-child {
  border-left-width: 0;
}

table.striped th, 
table.striped th:empty {
border-bottom: 1px solid #888;
}

table.striped tbody tr:nth-child(even) {
  background-color: var(--background-color); 
}
table.striped tbody tr:nth-child(odd) {
  background-color: var(--subtle-emphasis-color);
}

pre {
    margin-left: 2em;
    padding: 1em;
    background-color: var(--color-bg-1);
}

/* styles for section headers (they're permalinks but we don't want them to look like links) */
a.heading-link {
  color: unset;
  text-decoration: none;
}

a.heading-link:hover {
  text-decoration: underline;
}

/* Essay box styles - similar to feature boxes */
.essay-box {
  display: block;
  text-decoration: none;
  background: var(--color-bg-1);
  border: 2px solid lightgrey;
  border-radius: 1rem;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.essay-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--color-theme-1);
  text-decoration: none;
}

.essay-box .essay-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.essay-box .essay-title {
  color: var(--color-theme-1);
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
  flex-grow: 1;
  text-align: left;
}

.essay-box .essay-date {
  color: #666;
  font-size: 0.9rem;
  flex-shrink: 0;
  text-align: right;
  margin-right: 1rem;
}

.essay-box:visited .essay-title {
  color: var(--color-theme-1);
}

/* Remove list styling for essay boxes */
#recent_posts ul {
  list-style: none;
  padding-left: 0;
}

#recent_posts li {
  margin-bottom: 0;
}