/** Styles **/

/* Reset default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base styles with sticky footer setup */
html, body {
  height: 100%;
}

body {
  font-family: 'Spectral', serif;
  line-height: 1.6;
  color: rgba(0,0,0,.95);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Content containers */
header, main, footer {
  width: 100%;
}

/* Home page header */
header {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

header.home-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-header h1 {
  color: rgba(0,0,0,1);
  font-weight: 400;
}

.home-header h1:hover {
  color: #d875cd
}

.home-header p {
  font-weight: 200;
  font-size: 1rem;
  font-style: italic;
}

/* Post header */
header.post-header {
  max-width: none;
  padding: 0;
  margin: 0;
  position: relative;
  height: 400px;
  min-height: 400px; /* Minimum height */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 1rem;
  overflow: hidden;
  background-color: #000;  /* Black background while loading */
}

.post-header img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.75);
  transform: scale(1.1); /* Prevent blur from showing edges */
  opacity: 0;  /* Start transparent */
  transition: opacity 1s ease;  /* Smooth fade in */
}

.post-header img.loaded {
    opacity: 1;  /* Fully visible when loaded. requires js to set loaded class */
}

.post-header-content {
  max-width: 720px;
  width: 100%;
  padding: 2rem;
  position: relative;
  z-index: 3;
}

.post-header-meta {
  font-size: 1rem;
  margin-bottom: 1rem;
  margin-top: 0.75rem;
}

.post-meta {
  line-height: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.post-link {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.5rem;
  margin-bottom: 1rem;
}

.post-byline {
  font-size: 0.9rem;
  line-height: 1.75rem;
  display: block;
  margin-top: 0;
  margin-bottom: 1.75rem;
}

main {
  flex: 1 0 auto;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

article {
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

/* Add styles for images within articles */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  border-radius: 4px;  /* Slight rounding of corners */
}

.profile {
  width: 300px;           /* Fixed size - adjust as needed */
  height: 300px;          /* Same as width to maintain circle */
  border-radius: 50%;     /* Makes it circular */
  object-fit: cover;      /* Ensures image fills circle without distortion */
}

.tags {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 200;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'JetBrains Mono', monospace;
  margin: 2rem 0 1rem;
  line-height: 1.3;
  font-weight: 300;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 2rem;
  font-size: 1.25rem;
}

ol, ul {
  margin-bottom: 1.5rem;
  margin-left: 1.25rem;
  font-size: 1.25rem;
}

blockquote {
  border-left: 4px solid #e0e0e0;
  margin: 0;
  padding: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
}

/* refs */
#refs li {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;  /* Add space between references */
}

#refs code {
  font-size: 0.9rem;
}

/* Code blocks */
pre, code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  border-radius: 4px;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0;
  background: transparent;
  color: inherit;
}

p:has(+ pre) {
  margin-bottom: 0;
}

p+pre {
  margin-top: 5px;
}

pre {
  color: #ccc;
  border-top: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  background-color: #111;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

p>code,
a>code,
h1>code,
h2>code,
h3>code,
h4>code,
h5>code,
li>code {
  font-weight: bold;
}

/* Links */
a {
  color: rgba(0,0,0,1);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #d875cd
}

article a {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* Footer styles */
footer {
  flex-shrink: 0;
  border-top: 1px solid #eaeaea;
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

footer nav {
  margin-bottom: 0.2rem;
}

footer a {
  margin: 0 0.5rem;
  color: #666;
}

footer p {
  font-family: 'JetBrains Mono', monospace;
  margin: 0.8rem;
  font-size: 0.75rem;
  font-weight: 300;
}

hr {
  border-top: 1.5px solid #000000;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}
