/* Override user agent style margins, taken from Chase McCoy*/

:root {
  --color-body-bg: #fff;
  --color-text: #333;
  --color-h1-link: #000;
  --color-time: #666;
  --color-code-bg: #eee;
  --color-img-bg: #e0e0e0;
  --color-pagination-border: black;
  --color-footer: #333;
  --shadow-bottom: #777;
  --shadow-top: #fff;
}

[data-theme="dark"] {
  --color-body-bg: #262626;
  --color-text: #ccc;
  --color-h1-link: #e8e8e8;
  --color-time: #999;
  --color-code-bg: #2a2a2a;
  --color-img-bg: #333;
  --color-pagination-border: #666;
  --color-footer: #999;
  --shadow-bottom: #888;
  --shadow-top: #262626; /* must match --color-body-bg so shadow fades into background */
}

body, h1, h2, h3, h4, h5, h6, p, blockquote, code, pre, ol, ul, li, dl, dt, dd, img, figure, figcaption, audio, video, canvas, iframe, details, summary, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
  margin: 0;
  margin-block-start: 0;
  margin-block-end: 0;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  }

/* Departure Mono */

@font-face{
  font-family: 'Departure Mono';
  src: url('../font/departuremono.woff2');
  font-weight: normal;
  font-style: normal;
}

/* HTML */

body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 18px;
  color: var(--color-text);
  background-color: var(--color-body-bg);
  padding: 2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  margin-bottom: 0.67em;
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h1 a {
  color: var(--color-h1-link);
  text-decoration: none;
}

h1.blog-title{
  position: relative;
  z-index: 2; /* This brings it on top of the shadow */
}

h1.post-title {
  font-size: 1.67rem;
  margin-top: 0.33rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
    font-size: 1.17rem;
}

h4 {
    font-size: 1rem;
}

h5 {
    font-size: 0.83rem;
}

h6 {
    font-size: 0.67rem;
}


p, ul, ol {
  margin: 0.67rem 0;
  line-height: 1.5rem;
}

li + li {
  margin-top: 0.5rem;
}

time {
  color: var(--color-time);
}

blockquote {
  padding-left: 2.5em;

}

a, a:visited, a:hover, a:focus, a:active {
  color: inherit;
  text-underline-offset: 0.125rem;
  text-decoration-thickness: 1.5px;
}

code {
  font-family: "Departure Mono", monospace;
  font-size: 14px;
  background-color: var(--color-code-bg);
  padding: 3px;
}

img {
  display: block;
  width: 100%;
  margin: 1rem auto;
  height: auto;
  background-color: var(--color-img-bg);
}

/* Site-wide elements */

.wrapper {
  margin: 0 auto;
  max-width: 40em;
}

.header {
  display: block;
  margin-top: -2rem;
  width: 8rem;
  margin-left: auto;
  margin-right: auto;
}

  /*Bringing the subtitle closer to the blog title.*/

.header .blog-title {
  margin: 0;
}

.sub-title {
  font-size: 0.8rem;
  line-height: 1rem;
  margin-bottom: -0.5rem;
}

.header .sub-title p {
  margin: 0 0 0.67rem 0;
}

  /* Horizontal navigation list */

.nav-list {
  display: inline-block;
  margin: -1.5rem 0;
  padding: 0;
  font-size: 1rem;
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

.nav li {
  display: inline-block;
  margin-right: 10px;
  list-style-type: none;
}

.nav a {
  text-decoration: none;
}
  
  /* Contents */

.content {
  margin-top: 3rem;
}

.content-icon {
  font-size: 0.8rem;
  display: inline-block;
  margin-left: -1.25em;
}

.post {
  margin: 2rem 0;
}

.post time {
  font-size: 0.83rem;
}

.post p, ul, ol {
  font-family: "Newsreader", "Times New Roman", serif;
}

.post .halmos {
  display: float;
  color: var(--color-text);
}

.log {
  font-size: 14px;
  margin: 2rem 0;
}

.log time {
  font-size: 0.83rem;
}

.log p {
  line-height: 1rem;
}

.asterism {
  margin: 1rem auto;
  width: 10%;
}

.pagination-nav, .post-nav {
  font-size: 13px;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-pagination-border);
}

.footer {
  width: 75px;
  margin: auto;
  font-size: 12px;
  color: var(--color-footer);
}

/* Dark mode toggle — icon visibility */

.sky-body {
  cursor: pointer;
}

/* Hide both icons by default; CSS reveals selectively */
.sky-body .ph-sun,
.sky-body .ph-moon {
  display: none;
}

/* Icon reflects theme, not sky state: light mode = sun, dark mode = moon */
html[data-theme="light"] .sky-body .ph-sun  { display: inline; }
html[data-theme="dark"]  .sky-body .ph-moon { display: inline; }

/* Hover: preview of target mode — only on devices that support true hover (not touch/iOS) */
@media (hover: hover) {
  html[data-theme="light"] .sky-body:hover .ph-sun  { display: none; }
  html[data-theme="light"] .sky-body:hover .ph-moon { display: inline; }

  html[data-theme="dark"] .sky-body:hover .ph-moon { display: none; }
  html[data-theme="dark"] .sky-body:hover .ph-sun  { display: inline; }
}