/* ============================================= */
/*               THEME VARIABLES                 */
/* ============================================= */
:root {
  /* Brand colors - NOW GREEN */
  --md-primary-fg-color: #2A0A2A;
  --md-accent-fg-color: #388E3C;

  /* Dark theme colors (unchanged) */
  --md-default-bg-color: #2A0A2A;
  --md-header-bg-color: #160516;
  --md-default-fg-color: #e6e6e6;
}

:root > * {
  /* Link colors - now uses green primary */
  --md-typeset-a-color: var(--md-primary-fg-color);
}

/* ============================================= */
/*               GLOBAL STYLES                   */
/* ============================================= */

body {
    background-color: #2A0A2A !important;
    color: var(--md-default-fg-color) !important;
}

/* ============================================= */
/*               LAYOUT COMPONENTS               */
/* ============================================= */
.md-main {
    background-color: #2A0A2A !important;
}

.md-content {
  background-color: white !important;
  color: #333;
}

/* Header section */
.md-header {
  background-color: var(--md-header-bg-color) !important;
}

.md-header__title {
  font-weight: bold !important;
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

.md-header__title > .md-ellipsis {
  font-weight: inherit !important;
}

/* ============================================= */
/*               NAVIGATION STYLES               */
/* ============================================= */
.md-sidebar {
  color: var(--md-default-fg-color);
}

/* .md-nav {
    background-color: #160516 !important;
} */

.md-nav__item {
    background-color: #2A0A2A !important;
}

.md-nav__list {
    background-color: #2A0A2A !important;
}

.md-nav__link {
  color: #e6e6e6;
}

.md-nav__link--active {
  color: var(--md-accent-fg-color) !important; /* Now green */
}

.md-nav__link:hover,
.md-nav__link--active {
    background-color: #1e1e1e !important;
    color: #ffffff !important;
}

.md-nav__title,
.md-nav__link,
.md-nav__item {
    background-color: #2A0A2A !important;
    box-shadow: none !important;
    border: none !important;
}

.md-nav__scrollwrap::-webkit-scrollbar-thumb {
    background-color: #333 !important;
}

.md-sidebar--secondary {
  border-left: 1px solid #444;
}

/* ============================================= */
/*               CONTENT ELEMENTS                */
/* ============================================= */
.md-content h1,
.md-content h2 {
  color: var(--md-primary-fg-color) !important; /* Now green */
  border-bottom: 1px solid #eee;
}

/* ============================================= */
/*               TABLE ROW FIXES                 */
/* ============================================= */
.md-typeset {
  table {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #e1e1e1 !important;
  }

  table th {
    background-color: #f5f5f5 !important;
    color: #121212 !important;
    border-bottom: 2px solid #ddd !important;
  }

  table .row-odd {
    background-color: #fff !important;
  }

  table .row-even {
    background-color: #f9f9f9 !important;
  }

  table td {
    border-top: 1px solid #eee !important;
    padding: 0.5em 1em !important;
  }
}

/* Code Blocks */
.md-typeset pre > code {
  background-color: #ddd;
  color: #333 !important;
  border-radius: 4px;
}

.md-content pre {
  background-color: #ddd;
}

/* Admonitions */
.md-typeset .admonition {
  background-color: rgba(76, 175, 80, 0.1); /* Updated to green */
  border-left: 4px solid var(--md-primary-fg-color);
}

.md-typeset .admonition-title {
  background-color: rgba(76, 175, 80, 0.2); /* Updated to green */
}

/* ============================================= */
/*               SEARCH COMPONENT                */
/* ============================================= */
.md-search__input {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* ============================================= */
/*         UNIVERSAL DARK CODE BLOCK STYLING     */
/* ============================================= */

/* ============================================= */
/*         UNIVERSAL CODE BLOCK STYLING          */
/* ============================================= */

/* Target ALL pre-formatted blocks regardless of class */
pre,
pre[class*="language-"],
pre[class*="text"],
pre.text,
div.highlight pre {
  background-color: #ddd !important;
  color: #222 !important;
  border-radius: 6px;
  padding: 1.2em;
  margin: 1.5em 0;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8em;
  line-height: 1.5;
  border-left: 4px solid #aaa !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;

  /* Critical formatting preservation */
  white-space: pre !important;
  tab-size: 4 !important;
  word-break: normal !important;
}

/* Target ALL code elements inside pre blocks */
pre code,
pre[class*="language-"] code,
pre[class*="text"] code,
pre.text code,
div.highlight pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  font-size: inherit !important;
  font-family: inherit !important;
  white-space: pre !important;
}

/* Plain text blocks specific styling */
pre.text,
pre[class*="text"] {
  color: #e8e8e8 !important;
  font-family: inherit;
}

/* Neutralise Pygments token colours — the bash lexer misfires on IPs and shell constructs */
div.highlight span[class] {
  color: inherit !important;
}

/* Inline code (single backticks) */
:not(pre) > code {
  background-color: #ede7f6 !important;
  color: #333 !important;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8em;
  border: 1px solid #c5b3e6 !important;
  white-space: normal;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  pre {
    border-radius: 0 !important;
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 1rem !important;
  }
}

/* ============================================= */
/*               IMAGE CENTERING                 */
/* ============================================= */
.md-content img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.md-content figure {
  text-align: center;
  margin: 1.5em auto;
}

.md-content figcaption {
  font-style: italic;
  margin-top: 0.5em;
}

/* FOOTER */

.md-footer-meta {
  background-color: #160516 !important;
}

.md-footer {
  background-color: #160516 !important;
}

.md-source-file__fact {
  color: #666 !important;
}

.md-footer-nav__link {
    font-size: 1.4em !important;
}

.md-footer__title,
.md-footer__direction {
    font-size: 1.4em !important;
}

.md-footer-copyright__highlight {
    display: none !important;
}

/* ============================================= */
/*         CUSTOM INLINE TOP NAV LINKS           */
/* ============================================= */

/* Make the links inline and remove bullet points */
.md-header__links .md-nav {
    display: flex;              /* Use flexbox to align the items horizontally */
    list-style: none;           /* Remove bullet points from the list */
    margin: 0;                  /* Remove any default margin */
    padding: 0;                 /* Remove any default padding */
}

/* Style for each individual link */
.md-header__links .md-nav li {
    margin-right: 20px;         /* Space out the list items */
}

/* Style for the anchor tags to adjust their appearance */
.md-header__links .md-nav a {
    display: inline-block;      /* Ensure the links are inline */
    text-decoration: none;      /* Remove underline */
    padding: 8px 15px;          /* Add padding for clickable area */
    font-size: 16px;            /* Default font size, adjust this value to change the link size */
    font-weight: 500;           /* Slightly bold text */
    border-radius: 4px;         /* Optional: Rounded corners */
    transition: background-color 0.3s, color 0.3s; /* Smooth hover effect */
}

/* Optional: Hover effect for the links */
.md-header__links .md-nav a:hover {
    background-color: purple;  /* Hover background color */
    color: white;               /* Text color on hover */
}

.page__article {
  text-align: center;
  margin: 1rem auto;
}

.md-typeset a {
  color: #6A1B9A;
  word-break: break-word;
}

.md-typeset a:hover {
  color: #800080;
  word-break: break-word;
}

.page-post-card__link {
  display: block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius, 0.375rem);
  background: #0A1A2A;
  text-align: center;
  max-width: 30rem;
  margin: 2rem auto;
  transition: transform 0.2s ease;
  border: none;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.page-post-card__link2 {
  display: block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius, 0.375rem);
  background: transparent;
  text-align: center;
  max-width: 30rem;
  margin: 2rem auto;
  transition: transform 0.2s ease;
  border: none;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.page-post-card__link:hover {
  transform: translateY(-5px);
}

.page-post-card__link a {
  text-decoration: none;
  color: white;
  display: block;
  width: 100%;
  height: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .page-post-card__link {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    max-width: 90%; /* Changed from fixed max-width to percentage */
    margin: 1.5rem auto;
  }
}

@media (max-width: 480px) {
  .page-post-card__link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    max-width: 95%; /* More flexible on very small screens */
    margin: 1rem auto;
  }
}
