/* Remove markdown-style # symbols from headers */
h1::before,
h2::before,
h3::before,
h4::before,
h5::before,
h6::before {
  content: '' !important;
}

/* Make link underlines thinner */
a {
  border-bottom: 1px solid var(--maincolor) !important;
}

/* Add spacing between research/curriculum list items */
.body ul li {
  margin-bottom: 1rem !important;
}

/* Responsive — stack on mobile */
@media (max-width: 768px) {
  div[style*="grid-template-columns"] {
    display: block !important;
  }
  div[style*="grid-template-columns"] > div {
    margin-bottom: 1.5rem;
  }

  /* Stack post + TOC sidebar vertically on mobile */
  .post-container {
    flex-direction: column !important;
  }
  .toc {
    max-width: 100% !important;
    margin-left: 0 !important;
    position: static !important;
    order: -1;
    margin-bottom: 1.5rem;
  }

  /* Long titles: scale down on small screens */
  .title h1 {
    font-size: 1.1rem;
    word-break: break-word;
  }

  /* Tighten body margin on mobile */
  body {
    margin: 4px !important;
  }
  .content {
    padding: 0 8px;
  }

  /* Code blocks: smaller font on mobile so more fits */
  pre {
    font-size: 13px;
    padding: 0.75em;
  }
}

/* Tables — horizontal scroll on mobile instead of breaking layout */
table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Prevent wide content from breaking mobile layout */
html, body {
  overflow-x: hidden;
  width: 100%;
}
.content {
  overflow-x: hidden;
}
.post-content {
  overflow-x: hidden;
  max-width: 100%;
}

/* Code blocks: scroll horizontally within their container */
pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  white-space: pre;
  word-break: normal;
}
pre code {
  word-break: normal;
  overflow-wrap: normal;
}

/* Inline code: allow wrapping */
:not(pre) > code {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Highlight wrapper must also constrain */
.highlight {
  max-width: 100%;
  overflow-x: auto;
}

/* Footer — override theme's horizontal flex to stack vertically */
footer {
  flex-direction: column !important;
  align-items: stretch !important;
}

/* Subscribe section — top of footer */
.subscribe-section {
  text-align: center;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--bordercl, #ddd);
}
.subscribe-form {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}
.subscribe-form input[type="email"] {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--bordercl, #ccc);
  border-radius: 4px;
  font-size: 0.9rem;
  width: 220px;
  font-family: inherit;
  background: var(--bgtwo, #fff);
  color: var(--fgcolor, #333);
}
.subscribe-form button {
  padding: 0.4rem 1rem;
  background: var(--maincolor, #1a1a2e);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}
.subscribe-form button:hover {
  opacity: 0.85;
}
.subscribe-note {
  font-size: 0.8rem;
  color: grey;
  margin: 0.4rem 0 0;
}

/* Footer bottom row — RSS, social, copyright */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-bottom: none !important;
  color: #ee802f;
  font-size: 0.85rem;
}
.rss-link:hover {
  color: #d06a1f;
}
.rss-link svg {
  stroke: #ee802f;
}
.rss-link:hover svg {
  stroke: #d06a1f;
}
.footer-info {
  font-size: 0.85rem;
  color: grey;
}

/* Mobile footer */
@media (max-width: 768px) {
  .subscribe-form {
    flex-direction: column;
  }
  .subscribe-form input[type="email"],
  .subscribe-form button {
    width: 100%;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Ecosystem card styling */
.ecosystem-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.ecosystem-card h3 {
  margin-top: 0;
}
.ecosystem-card a {
  font-weight: bold;
}
