/* Updated CSS Variables section for theme switching */
:root {
  --accent: #800080;
  --secondary: #e3dee8;
  --background: #fffffe;
  --color: #292029;
  --card-background: #faf9fc; /* Slightly off-white for cards */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 5rem;
  
  /* Accessibility enhancement - focus outline color */
  --focus-outline: #0056b3;
  --focus-outline-width: 3px;
}

/* Dark theme styles */
html[data-theme="dark"] {
  --accent: #dd66ff;
  --background: #191119;
  --color: #fefefe;
  --secondary: #3a2a3a;
  --card-background: #241824; /* Slightly lighter than background */
  /* Dark mode focus outline needs higher contrast */
  --focus-outline: #58a6ff;
}

/* System preference dark mode (as fallback) */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --accent: #dd66ff;
    --background: #191119;
    --color: #fefefe;
    --secondary: #3a2a3a;
    --card-background: #241824; /* Slightly lighter than background */
    /* Dark mode focus outline needs higher contrast */
    --focus-outline: #58a6ff;
  }
  
  /* Reduce brightness of images in dark mode for visual comfort */
  html:not([data-theme="light"]) img {
    filter: brightness(0.9);
  }
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem 1rem;
  background-color: var(--background);
  color: var(--accent);
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.3s;
  border: 1px solid var(--secondary);
  border-radius: 0 0 0.25rem 0;
  text-decoration: none;
  font-weight: bold;
}

.skip-link:focus {
  transform: translateY(0);
  outline: var(--focus-outline-width) solid var(--focus-outline);
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
  height: 100%;
}

/* Add reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--background);
  scrollbar-width: thin;
  scrollbar-color: rgba(41, 41, 41, 0.9) var(--background);
  height: 100%;
  font-size: var(--text-lg);
  line-height: 1.54;
  color: var(--color);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga", "tnum", "calt", "zero", "ss01", "locl", "calt";
  font-variant-ligatures: contextual;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
    Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif;
}

*,
:after,
:before {
  box-sizing: inherit;
  border: 0 solid;
  margin: 0;
  padding: 0;
}

audio,
canvas,
embed,
iframe,
img,
object,
video {
  display: block;
}

audio,
iframe,
img,
video {
  width: 100%;
  max-width: 100%;
  margin-top: 1rem;
}

/* Add proper alt text styling */
img:not([alt]) {
  border: 2px dashed #e74c3c;
}

/* Improve video/iframe accessibility with proper aspect ratio */
.video, iframe.video {
  aspect-ratio: 16 / 9;
  width: 100%;
}

hr {
  width: 100%;
  border: none;
  background: rgba(41, 41, 41, 0.1);
  height: 1px;
  margin-top: 2rem;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: all 0.2s linear;
}

/* Improved focus states for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline);
  outline-offset: 2px;
  text-decoration: none;
}

p a {
  text-decoration: underline;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
}

ol {
  list-style-position: inside;
}

ol ol {
  list-style-type: lower-alpha;
}

ol > li::marker {
  font-weight: bold;
}

ul {
  list-style-type: square;
  list-style-position: inside;
}

b,
strong {
  font-weight: 600;
}

/* Improve table accessibility */
table {
  border-collapse: collapse;
  caption-side: bottom;
  overflow-x: auto;
  min-width: 100%;
  border: 1px solid rgba(41, 41, 41, 0.3);
}

table,
table caption {
  margin-top: 1rem;
}

/* Make table captions more visible for screen readers */
caption {
  font-weight: bold;
  padding: 0.5rem 0;
  text-align: left;
}

td,
th {
  border: 1px solid rgba(41, 41, 41, 0.3);
  padding: 0.5rem;
  text-align: left;
}

th {
  font-weight: 500;
}

td:only-child {
  text-align: center;
}

* + h1,
* + h2 {
  margin-top: 1.5rem;
}

* + h3,
* + h4,
* + h5 {
  margin-top: 3rem;
}

* + p {
  margin-top: 2rem;
}

h2 + p,
h3 + p,
h4 + p {
  margin-top: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.3;
  font-weight: 400;
  color: var(--color);
}

h1 {
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
  font-weight: 700;
  font-size: var(--text-5xl);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

h2 {
  font-weight: 600;
  font-size: var(--text-3xl);
  margin-top: 3.5rem;
}

h3 {
  font-weight: 600;
  font-size: var(--text-xl);
}

h4,
h5,
p {
  font-size: var(--text-lg);
}

/* Improve definition list spacing */
dt {
  font-weight: 600;
  text-align: left;
  margin-top: 1.2rem;
  margin-bottom: .5rem;
}

blockquote {
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
}

blockquote,
pre {
  margin-top: 1rem;
}

pre {
  white-space: pre-wrap;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  font-size: 0.95rem;
  border: 1px solid rgba(41, 41, 41, 0.1);
  padding: 1rem;
  overflow: auto;
  max-width: 90vw;
  margin-left: auto;
  margin-right: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(41, 41, 41, 0.8);
}

code,
kbd {
  font-feature-settings: normal;
  background: var(--secondary);
  color: var(--accent);
  padding: 1px 6px;
  margin: 0 2px;
  font-size: 0.95rem;
}

code,
pre {
  font-family: Inconsolata, monospace;
}

mark {
  background: var(--accent);
  color: var(--background);
  padding: 1px 6px;
  margin: 0 2px;
  font-size: 0.95rem;
}

div.twitter-tweet {
  margin-left: auto;
  margin-right: auto;
}

main ol,
main ul {
  padding-top: 1.5rem;
}

main ol li,
main ul li {
  padding-bottom: 1rem;
}

.main {
  display: flex;
  padding-bottom: 4rem;
  flex-direction: column;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  min-width: auto;
  max-width: 60rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 700px) {
  .main {
    padding-inline: 1rem;
  }
}

.layout-wrapper {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100%;
}

.intro {
  display: grid;
  grid-gap: 3vmin;
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 1000px) {
  .intro {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .intro {
    grid-template-columns: 1fr;
    grid-gap: 40px;
  }
}

.intro-text {
  position: relative;
  flex: 1 1 450px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background-size: cover;
  word-break: break-word;
  border-radius: 0.5rem;
  margin-right: 1.5rem;
}

figure.feature-pic {
  position: relative;
  flex: 1 1 450px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background-size: cover;
  word-break: break-word;
}

figure.feature-pic .feature-pic-image {
  position: relative;
  flex: 1 1 301px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: var(--secondary);
  border-radius: 0.5rem;
}

figure.heroimage {
  margin: 1rem auto 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  width: 100%;
  height: 50vh;
  height: clamp(8rem, 40vh, 40rem);
}

@media (min-width: 700px) {
  figure.heroimage {
    height: clamp(8rem, 60vh, 40rem);
  }
}

/* Improve share link accessibility */
#share-link {
  width: 1rem;
  height: 1.25rem;
  background-image: url(https://cdn.glitch.global/c4e475b2-a54e-47e0-973c-ed0bd1b46262/share.svg?v=1669877640411);
  background-repeat: no-repeat;
  background-position: bottom;
  background-color: transparent;
  float: right;
  /* Added aria attributes in HTML, adding padding for touch target */
  padding: 0.5rem;
  margin: -0.5rem;
}

/* Style the RSS icon to match link color */
#rss-icon {
  filter: invert(13%) sepia(64%) saturate(5710%) hue-rotate(282deg) brightness(88%) contrast(108%);
  transition: filter 0.2s linear;
  margin: 0;
  vertical-align: middle;
  width: 1rem;
  height: 1rem;
}

/* Match hover state of other links */
a:hover #rss-icon {
  filter: invert(19%) sepia(48%) saturate(5023%) hue-rotate(284deg) brightness(95%) contrast(122%);
}

/* Dark mode adjustment */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #rss-icon {
    filter: invert(66%) sepia(82%) saturate(1622%) hue-rotate(246deg) brightness(100%) contrast(106%);
  }
  
  html:not([data-theme="light"]) a:hover #rss-icon {
    filter: invert(74%) sepia(34%) saturate(1115%) hue-rotate(242deg) brightness(101%) contrast(101%);
  }
}

/* Dark theme explicit styles (overrides system preference) */
html[data-theme="dark"] #rss-icon {
  filter: invert(66%) sepia(82%) saturate(1622%) hue-rotate(246deg) brightness(100%) contrast(106%);
}

html[data-theme="dark"] a:hover #rss-icon {
  filter: invert(74%) sepia(34%) saturate(1115%) hue-rotate(242deg) brightness(101%) contrast(101%);
}

.tags > * {
  margin-right: 1rem;
  margin-top: 0.5rem;
}

.tags {
  margin-top: 1rem;
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}

.tags a {
  text-decoration: none;
  color: var(--accent);
}

.post-feed {
  display: block;
  max-width: 80vw;
}

/* Improve form accessibility */
form#search {
  align-items: center;
  display: flex;
  width: 30rem;
  margin: 2rem auto 1rem auto;
}

form#search label {
  display: none;
  font-weight: 500;
  margin: 0 10px 0 0;
}

/* Updated search input styles for dark mode compatibility */
form#search input {
  border: 1px solid var(--accent);
  border-radius: 3px;
  flex: 1;
  font-size: var(--text-lg);
  font-weight: 600;
  height: 33px;
  margin: 0;
  min-width: 30rem;
  padding: .5rem;
  -webkit-appearance: textfield;
  background-color: var(--background); /* Use theme background */
  color: var(--color); /* Use theme text color */
}

/* Make input focus state more visible */
form#search input:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline);
  outline-offset: 0;
  border-color: transparent;
}

form#search button {
  border: none;
  cursor: pointer;
  height: 33px;
  padding: 0;
  /* Add tooltip or aria-label in HTML */
}

form#search svg {
  background-color: #26882e;
  border-radius: 0 2px 2px 0;
  fill: white;
  height: 33px;
  min-width: 2.5rem;
  padding: 0 7px;
  width: 2.5rem;
}

form#search svg:hover {
  background-color: #1d6823;
  fill: white;
}

/* Improved color contrast for form focus */
form#search button:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline);
  outline-offset: 2px;
}

@media all and (min-width: 500px) {
  form#search label {
    display: inline;
  }  
  form#search input::placeholder {
    opacity: 0;
  }  
}
/* ==========================================================================
   COMPACT NEWSLETTER BANNER STYLES
   Add these styles to your existing styles.css file
   ========================================================================== */

/* Newsletter signup banner */
.newsletter-banner {
  background: rgba(128, 0, 128, 0.03);
  border-bottom: 1px solid rgba(128, 0, 128, 0.08);
  padding: 0.4rem 0;
  min-height: auto;
  margin-bottom: 2rem;
}

.newsletter-content {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 2rem;
}

.newsletter-text {
  font-size: 0.85rem;
  color: var(--color);
  opacity: 0.8;
  margin: 0;
  font-weight: 400;
  white-space: nowrap;
}

.newsletter-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.newsletter-form input[type="email"] {
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(128, 0, 128, 0.15);
  border-radius: 3px;
  background: var(--background);
  color: var(--color);
  font-size: 0.85rem;
  width: 180px;
  height: 1.8rem;
  transition: border-color 0.2s ease;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--color);
  opacity: 0.5;
}

.newsletter-form button {
  padding: 0.35rem 0.75rem;
  background: var(--accent);
  color: var(--background);
  border: none;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  height: 1.8rem;
}

.newsletter-form button:hover {
  background: color-mix(in srgb, var(--accent) 90%, black);
}

.newsletter-form button:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline);
  outline-offset: 2px;
}

/* Dismiss button */
.newsletter-dismiss {
  position: absolute;
  top: 0.2rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--color);
  opacity: 0.5;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 50%;
  transition: opacity 0.2s ease;
  height: 1.6rem;
  width: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.newsletter-dismiss:hover {
  opacity: 0.8;
}

.newsletter-dismiss:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

/* Make newsletter banner relative for dismiss button positioning */
.newsletter-banner {
  position: relative;
}

/* Dark theme support */
html[data-theme="dark"] .newsletter-banner {
  background: rgba(221, 102, 255, 0.03);
  border-bottom: 1px solid rgba(221, 102, 255, 0.08);
}

/* Mobile adjustments */
@media (max-width: 700px) {
  .newsletter-content {
    padding: 0 1rem;
    gap: 0.5rem;
    height: auto;
    min-height: 2rem;
  }

  .newsletter-text {
    font-size: 0.8rem;
  }

  .newsletter-form input[type="email"] {
    width: 140px;
    font-size: 0.8rem;
  }

  .newsletter-form button {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
}

/* Extra compact for very small screens */
@media (max-width: 500px) {
  .newsletter-banner {
    padding: 0.3rem 0;
    margin-bottom: 1.5rem;
  }

  .newsletter-content {
    height: 1.8rem;
    gap: 0.4rem;
  }

  .newsletter-text {
    display: none; /* Hide text on very small screens to save space */
  }

  .newsletter-form input[type="email"] {
    width: 120px;
    height: 1.6rem;
    font-size: 0.75rem;
  }

  .newsletter-form button {
    height: 1.6rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .newsletter-dismiss {
    top: 0.1rem;
    right: 0.3rem;
    height: 1.4rem;
    width: 1.4rem;
    font-size: 0.9rem;
  }
}

/* Media query for small screens */
@media (max-width: 600px) {
  form#search {
    width: 100%;
    max-width: 90vw;
  }
  
  form#search input {
    min-width: auto;
    width: 100%;
  }
}

.bull {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.post {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-feed .post {
  flex-direction: row;
}

.post__details {
  opacity: 0.8;
  font-size: 0.9rem;
  padding: 1rem 0;
/*
  1rem;
  border-bottom: 1px solid #e6e6e6;
*/
}

.post__header {
  max-width: 90vw;
}

header.post__header h1 {
  font-size: var(--text-6xl);
  text-align: center;
  margin: 2rem 5% 2rem 5%;
  letter-spacing: -0.01em;
  line-height: 125%;
}

@media (max-width: 700px) {
  header.post__header h1 {
    font-size: var(--text-4xl);
    margin: 1rem 0;
    line-height: 110%;
  }
}

.post__details > * + * {
  margin-left: 0.5rem;
}

.post__content {
  margin-top: 1rem;
  word-wrap: break-word;
  /* Improve readability with optimal line length */
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

.post__aside {
  margin-top: 2rem;
}

.post__tags {
  opacity: 0.8;
  font-size: var(--text-sm);
  display: inline;
}

.post-list {
  list-style: none;
}

.post-list__wrapper {
  max-width: 90vw;
  margin-top: 1.5rem;
}

.post__pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post__pagination > :only-child {
  margin-right: auto;
  margin-left: auto;
}

.post__pagination a {
  display: flex;
  align-items: center;
}

.post__pagination span {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.post__tags a {
  text-decoration: none;
  color: var(--color);
}

.post__tags a:hover {
  color: var(--accent);
}

.post__tags * + * {
  margin-left: 0.5rem;
}

.post-list__tags {
  display: inline;
  text-decoration: none;
  font-size: var(--text-sm);
  margin-top: 0.5rem;
}

.post-list__tags a {
  text-decoration: none;
  color: var(--accent);
}

.post-list__tags a:hover {
  color: var(--accent);
}

.post-list__tags > * + * {
  margin-left: 0.5rem;
}

.post-list__excerpt {
  margin-top: 1rem;
  color: rgba(0, 0, 0, 0.8);
}

.post-list__meta {
  font-size: var(--text-sm);
  margin-top: 0.15rem;
  color: var(--accent);
}

/* Additional posts list styling */
.additional-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--secondary);
  width: 100%;
  max-width: 80vw;
  margin-left: auto;
  margin-right: auto;
}

.additional-posts h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: var(--text-2xl);
}

.post-list-compact {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.post-list-item {
  position: relative;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: var(--card-background);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 3px solid var(--accent);
}

.post-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.post-list-item a {
  text-decoration: none;
  color: var(--color);
  display: block;
}

.post-list-item a:hover .post-list-title {
  color: var(--accent);
}

.post-list-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.post-list-date {
  font-size: var(--text-sm);
  color: var(--accent);
  margin-top: 0.5rem;
  display: block;
}

@media (max-width: 767px) {
  .post-list-compact {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .additional-posts {
    max-width: 90vw;
  }
}

/* Make post cards consistent height with subtle background distinction */
.post-card {
  display: flex;
  flex-direction: row;
  height: 200px;
  background-color: var(--card-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--secondary);
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Subtle hover effect for cards */
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card-image-link {
  width: 30rem;
  max-width: 35%;
  height: 100%;
  overflow: hidden;
  border-radius: 0.5rem 0 0 0.5rem;
  background-color: var(--secondary);
  flex-shrink: 0;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin-top: 0;
}

.post-card-content {
  flex-grow: 1;
  margin: 0.75rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-card-header {
  margin-bottom: 0.5rem;
}

/* Change hover style to use color instead of underline */
.post-card-content-link {
  color: var(--color);
  text-decoration: none;
  transition: color 0.2s;
}

.post-card-content-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-card-content-link:hover .post-card-title {
  color: var(--accent);
}

.post-card-title {
  font-size: var(--text-2xl);
  margin-top: 0;
  margin-bottom: 0.5rem;
  /* Limit to 2 lines with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.post-card-excerpt {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.post-card-excerpt p {
  font-size: var(--text-base);
  color: var(--color);
  opacity: 0.8;
  margin: 0;
  /* Create a smooth fade-out effect at the bottom */
  max-height: 3em;
  overflow: hidden;
  position: relative;
  line-height: 1.5;
}

.post-card-excerpt p::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 70%;
  height: 1.5em;
  background: linear-gradient(to right, transparent, var(--card-background) 80%);
}

/* Dark mode card styles */
html[data-theme="dark"] .post-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .post-card-excerpt p::after {
  background: linear-gradient(to right, transparent, var(--card-background) 80%);
}

/* Mobile adjustments for cards */
@media (max-width: 767px) {
  /* Reset all problematic properties */
  .post-card {
    display: block !important;
    flex-direction: column;
    height: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }
  
  .post-card-image-link {
    width: 100%;
    max-width: 100%;
    height: 180px;
    border-radius: 0.5rem 0.5rem 0 0;
  }
  
  .post-card-content {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    padding: 0.75rem;
    margin: 0;
    width: 100%;
  }
  
  .post-card-title {
    text-align: center;
    -webkit-line-clamp: 2;
  }
  
  .post-card-excerpt {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    margin: 0.75rem 0;
  }
  
  .post-card-excerpt p {
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    position: static !important;
    color: var(--color) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    margin: 0.75rem 0 !important;
    padding: 0 0.5rem !important;
  }
  
  /* Remove the fade effect on mobile */
  .post-card-excerpt p::after {
    display: none !important;
  }
  
  /* Fix hidden metadata */
  .post-card-meta {
    display: block !important;
    margin-top: 0.75rem !important;
    text-align: center !important;
  }
  
  .post-list__meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .bull {
    display: none; /* Hide bullet on mobile */
  }
  
  .post-list__tags {
    margin-top: 0.25rem !important;
  }
  
  /* Make sure overflow isn't hidden at any level */
  .post-feed, .post-list__wrapper {
    overflow: visible !important;
  }
  
  /* Fix for mobile text issues in dark mode */
  html[data-theme="dark"] .post-card-excerpt p {
    color: var(--color) !important;
  }
}

/* Improve display at even smaller mobile sizes */
@media (max-width: 480px) {
  .post-card-image-link {
    height: 150px;
  }
  
  .post-feed {
    max-width: 95vw;
  }
  
  .post-list__wrapper {
    max-width: 95vw;
  }
}

.header {
  max-width: none;
  width: 100%;
  /*
  margin-bottom: 2rem;
  */
}

.header__content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 60rem;
  padding: 0 2.5rem;
  margin-top: 1rem;
  /*
  border-bottom: 1px solid #e6e6e6;
  */
}

@media (max-width: 700px) {
  .header__content {
    padding: 0 1rem;
  }
}

.header__content h1 {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
  Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif;
}

.site-title {
  font-size: var(--text-xl);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.site-title a {
  color: var(--accent);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--color);
}

.nav__list {
  display: flex;
  justify-content: space-around;
  list-style: none;
  font-size: var(--text-base);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.nav__list a {
  color: var(--accent);
  text-decoration: none;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Improve navigation accessibility with enhanced focus and current page state */
.nav__list a[aria-current="page"] {
  font-weight: bold;
  text-decoration: underline;
}

.nav__list li {
  margin-right: 2rem;
}

.nav__list li:last-child {
  margin-right: 0;
}

.nav__list a:hover {
  color: var(--color);
}

/* Improve touch targets for mobile */
@media (max-width: 700px) {
  .nav__list a {
    padding: 0.5rem;
    margin: -0.5rem;
  }
}

/* Hide breadcrumbs visually while keeping them in the DOM for SEO */
.breadcrumbs {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.footer {
  padding-bottom: 4rem;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: none;
  width: 100%;
}

.footer__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 60rem;
  width: 100%;
  font-size: var(--text-base);
  border-top: 1px solid #e6e6e6;
}

/* Copyright in footer */
.copyright {
  text-align: center;
  font-size: var(--text-xs);
  margin-top: 1rem;
  padding-bottom: 1rem;
  color: var(--color);
  opacity: 0.7;
}

/* Ensure footer border is visible in dark mode */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .footer__content {
    border-top: 1px solid #333333;
  }
}

html[data-theme="dark"] .footer__content {
  border-top: 1px solid #333333;
}

.footer__content > * {
  margin-top: 2rem;
  width: 100%;
}

/* Use flex for centered navigation with spacing */
.footer nav {
  width: 100%;
  display: flex;
  justify-content: center;
}

.footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  width: auto;
  max-width: 100%;
  padding: 0;
  margin: 0;
  gap: 2.5rem; /* Consistent spacing between items */
}

.footer li {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Improve footer navigation for mobile */
@media (max-width: 600px) {
  .footer ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-left: 1rem; /* Add left padding to align better */
  }
  
  .footer li {
    justify-content: flex-start;
    width: 100%; /* Make each item take full width */
  }
  
  .theme-toggle-container {
    /* Align the toggle button with text on mobile */
    justify-content: flex-start;
    margin-left: 0; /* Remove any margin that might offset alignment */
  }
  
  .theme-toggle {
    margin-left: -0.5rem; /* Offset the padding */
  }
  
  .copyright {
    text-align: left; /* Align copyright text to left on mobile */
    padding-left: 1rem; /* Match padding with navigation */
  }
}

/* Theme toggle styling */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 1.2rem;
  position: relative;
  border-radius: 9999px;
  color: var(--accent);
  width: 2.5rem;
  height: 2.5rem;
  transition: background-color 0.2s;
  /* Remove extra margins that might affect alignment */
  margin: 0;
}

.theme-toggle:hover {
  background-color: var(--secondary);
}

.theme-toggle:focus {
  outline: var(--focus-outline-width) solid var(--focus-outline);
  outline-offset: 2px;
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Match height of other footer items */
  height: 2.5rem;
}

/* Show/hide sun and moon based on current theme */
.theme-toggle .theme-toggle-light,
.theme-toggle .theme-toggle-dark {
  position: absolute;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Light mode (default) */
.theme-toggle .theme-toggle-light {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

.theme-toggle .theme-toggle-dark {
  opacity: 0;
  transform: translateY(10px) rotate(90deg);
}

/* Dark mode */
html[data-theme="dark"] .theme-toggle .theme-toggle-light {
  opacity: 0;
  transform: translateY(-10px) rotate(-90deg);
}

html[data-theme="dark"] .theme-toggle .theme-toggle-dark {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

/* Disable transitions when prefers-reduced-motion is enabled */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle .theme-toggle-light,
  .theme-toggle .theme-toggle-dark {
    transition: none;
  }
}