/* Only keep the color settings, header styling, and footer removal */

/* ------------ GLOBAL STYLES ------------ */

/* Force dark mode */
[data-md-color-scheme="slate"] {
    --md-default-bg-color: #1a1a1a;
    --md-default-fg-color: #ffffff;
    --md-typeset-color: #ffffff;
    --md-primary-fg-color: #1a1a1a;

    /* --- Syntax Highlighting --- */

    /* Targeting YAML keys / HTML tags (often blue) */
    --md-code-hl-nt-color: #FF5252; /* Red */

    /* Keywords (often blue/purple) */
    --md-code-hl-kw-color: #FF5252; /* Red */

    /* Built-ins (often blue/cyan) */
    --md-code-hl-bi-color: #FF5252; /* Red */

    /* Function names (can be blueish) */
    --md-code-hl-nf-color: #FF5252; /* Red */

    /* Class names (can be blueish) */
    --md-code-hl-nc-color: #FF5252; /* Red */

    /* Strings (ensure they aren't overridden if desired) */
    /* --md-code-hl-str-color: #your_string_color; */

    /* --- Code Block Scrollbar --- */

    /* Set scrollbar track color */
    --md-scrollbar-track-color: hsla(0, 0%, 0%, 0.1); /* Darker transparent */

    /* Set scrollbar thumb color */
    --md-scrollbar-thumb-color: #4CAF50; /* Primary Green */

    /* Set scrollbar thumb color on hover/active */
    --md-scrollbar-thumb-hover-color: #2E7D32; /* Darker Menu Green */
}

/* Hide theme switcher */
.md-header__option {
    display: none !important;
}

/* ------------ HEADER STYLING ------------ */

/* Logo size */
.md-header__button.md-logo img {
    width: 150px !important;
    height: auto !important;
}

/* Site title font styling - match blog title font */
.md-header__title {
    font-family: var(--md-text-font-family) !important;
    font-weight: 400 !important;
    color: var(--md-primary-bg-color) !important;
}

/* ------------ CONTENT LINKS ------------ */

/* Make all links green with red hover */
.md-typeset a {
    color: #4CAF50 !important;
}

.md-typeset a:hover {
    color: #FF5252 !important;
}

/* Headings should remain white */
.md-typeset h1, 
.md-typeset h2, 
.md-typeset h3, 
.md-typeset h4, 
.md-typeset h5, 
.md-typeset h6 {
    color: #ffffff !important;
}

/* Change Category links to green */
.md-nav__link,
.md-typeset a,
.md-nav__item .md-nav__link--active,
.md-tabs__link--active,
.md-nav--primary .md-nav__link--active,
.md-sidebar--primary .md-nav__link--active,
.md-nav__item--active > .md-nav__link {
    color: #4CAF50 !important;
}

/* Change sidebar selected items to green */
.md-sidebar .md-nav__link--active {
    color: #4CAF50 !important;
    font-weight: 700;
}

/* Update hover color to white for better visibility */
.md-nav__link:hover,
.md-typeset a:hover,
.md-header__title:hover,
.md-header .md-icon:hover,
.md-tabs__link:hover,
.md-sidebar .md-nav__link:hover,
.md-post__category a:hover,
.md-post__meta .md-post__category a:hover,
.md-footer-nav__link:hover,
.md-footer-copyright a:hover,
.md-source:hover,
.md-source__repository:hover,
.md-search-result__link:hover {
    color: #ffffff !important;
}

/* Ensure blog category links are green too */
.md-post__category a,
.md-post__category {
    color: #4CAF50 !important;
}

.md-post__category a:hover {
    color: #ffffff !important;
}

/* Active tabs */
.md-tabs__link--active, 
.md-tabs__link--active:hover {
    color: #ffffff !important; /* Keep active tab white for visibility */
}

/* Ensure all remaining green links */
.md-footer-nav__link,
.md-footer-copyright a,
.md-source,
.md-source__repository,
.md-search-result__link {
    color: #4CAF50 !important;
}

.md-footer-nav__link:hover,
.md-footer-copyright a:hover,
.md-source:hover,
.md-source__repository:hover,
.md-search-result__link:hover {
    color: #ffffff !important;
}

/* Blog post metadata links (including category and date) */
.md-post__meta a,
.md-post__meta .md-post__category,
.md-post__meta .md-post__date,
.md-post__meta .md-post__link {
    color: #4CAF50 !important;
}

.md-post__meta a:hover,
.md-post__meta .md-post__category:hover,
.md-post__meta .md-post__link:hover {
    color: #ffffff !important;
}

/* Blog tags styling */
.md-post-tag {
    background-color: rgba(76, 175, 80, 0.1) !important;
    border: 1px solid #4CAF50 !important; 
    color: #4CAF50 !important;
}

.md-post-tag:hover {
    background-color: rgba(255, 82, 82, 0.1) !important;
    border-color: #FF5252 !important;
    color: #FF5252 !important;
}

/* Clean styling for blog post metadata */
.md-post__meta {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ------------ EMAIL SUBSCRIPTION FORM ------------ */

/* ------------ FOOTER ADJUSTMENTS ------------ */

/* Hide the default "Made with Material for MkDocs" copyright div */
.md-footer .md-copyright {
  display: none !important;
}

/* --- Reduce vertical space around default footer content --- */

/* Target the first (default) meta block within the footer */
.md-footer > .md-footer-meta:first-of-type {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* Target the inner grid of the first meta block */
.md-footer > .md-footer-meta:first-of-type > .md-footer-meta__inner {
  padding-top: 0;
  padding-bottom: 0;
  align-items: center !important; /* Override vertical stretching */
}

/* Remove margins from the social icons container itself */
.md-footer .md-social {
  margin: 0 !important; 
  padding: 0 !important; /* Ensure no padding */
  line-height: 1 !important; /* Reduce line height */
  min-height: unset !important; /* Override default min-height */
  height: auto !important; /* Allow height to shrink */
}

/* Ensure links have no extra padding/margin */
.md-footer .md-social .md-social__link {
  margin: 0 !important; /* Only keep minimal horizontal spacing */
  padding: 0 !important;
  display: inline-flex !important; /* Use flex to center content */
  align-items: center; /* Vertically center SVG */
  justify-content: center; /* Horizontally center SVG */
  height: auto !important; /* Override fixed height */
  width: auto !important; /* Override fixed width */
  min-height: unset !important; /* Override min-height */
  min-width: unset !important; /* Override min-width */
  line-height: 1 !important; /* Collapse line height */
  vertical-align: middle; /* Keep vertical align */
}

/* Optional: slightly smaller icons */
.md-footer .md-social .md-social__link svg {
  height: 1rem !important; /* Reiterate size with !important */
  width: 1rem !important;
  display: block; /* Prevent extra space below SVG */
}

/* Adjust spacing for injected form if needed */
.md-footer > .md-footer-meta:last-of-type {
  margin-top: 0 !important;
  padding-top: 0 !important; /* Keep a small padding, or set to 0 */
  border-top: none !important; /* Remove the border we added earlier */
}

/* Sticky Footer Implementation - Keep this if you want the footer sticky */
.md-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 100 !important; /* Ensure it stays on top */
  background-color: #151515 !important; /* Slightly darker than #1a1a1a */
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* Add padding to main content to avoid overlap with fixed footer */
.md-main {
  padding-bottom: 85px !important; /* Adjust this based on final footer height */
}

.md-footer-meta__inner {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0.5rem 0.2rem 0.5rem 0.2rem !important; /* Increased top padding from 0.1rem */
  display: block !important;
  text-align: center !important;
}

/* Force center the subscribe form */
.md-footer-subscribe {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important; /* Remove bottom margin */
  display: flex !important;
  justify-content: center !important;
}

/* Thank you message styling */
#thank-you-message {
  text-align: center !important;
  padding: 0.5rem 0 !important;
}

#thank-you-message p {
  font-size: 0.9rem !important;
  color: #ffffff !important;
  margin: 0 !important;
  padding: 0.5rem 0 !important;
}

/* Constrain form width on wider screens and center it */
.md-footer-subscribe__form {
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  align-items: stretch !important;
}

.md-footer-subscribe__input-container {
  width: 100% !important;
  display: flex !important;
  height: 40px !important;
  align-items: stretch !important;
  margin-bottom: 0 !important; /* Added */
}

.md-footer-subscribe__label {
  color: #ffffff;
  font-size: 0.9rem;
  margin-right: 1rem;
  display: flex;
  align-items: center;
}

.md-footer-subscribe__input {
  flex: 1;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.9rem;
  min-width: 300px;
  box-sizing: border-box;
  line-height: 40px !important;
}

.md-footer-subscribe__input:focus {
  outline: none;
  box-shadow: none;
}

.md-footer-subscribe__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  opacity: 1; /* Ensure the color isn't overridden by browser default opacity */
}

.md-footer-subscribe__button {
  height: 100%;
  padding: 0 1.5rem;
  border: 1px solid #4CAF50 !important; /* Added border */
  border-radius: 4px !important; /* Changed from 0 4px 4px 0 */
  background-color: transparent !important; /* Changed from #4CAF50 */
  color: #4CAF50 !important; /* Changed from #ffffff */
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s; /* Added color/border transitions */
  white-space: nowrap;
  box-sizing: border-box;
}

.md-footer-subscribe__button:hover {
  background-color: #388E3C !important; /* Keep dark green background */
  color: #ffffff !important; /* Added white text color */
  border-color: #388E3C !important; /* Added border color match */
}

.md-footer-subscribe__message {
  font-size: 0.8rem;
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.md-footer-subscribe__message.success {
  color: #4CAF50;
}

.md-footer-subscribe__message.error {
  color: #FF5252;
}

/* Mobile adjustments for consent checkbox */
@media (max-width: 76.1875em) {
  .md-footer-subscribe__input-container {
    flex-direction: column !important;
    height: auto !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
   
  .md-footer-subscribe__input {
    width: 100% !important;
    border-radius: 4px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    line-height: 40px !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    font-size: 16px !important;
    -webkit-appearance: none !important;
  }
   
  .md-footer-subscribe__button {
    width: 100% !important;
    border-radius: 4px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    line-height: 40px !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    font-size: 16px !important;
  }
  
  .md-footer-subscribe__consent {
    margin-top: 0.1rem !important; /* Reduced top margin */
    padding: 0 !important;
    width: 100% !important;
    text-align: left !important;
    font-size: 0.65rem !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin-bottom: 0 !important;
  }
  
  /* Reduce top margin for the wrapper on mobile */
  .md-footer-subscribe__consent-social-wrapper {
    margin-top: 0.1rem !important; /* Reduced from 0.5em (general rule) */
  }
}

/* Center the copyright */
.md-footer-copyright {
  width: 100% !important;
  text-align: center !important;
  margin: 0 0 0 0 !important; 
  padding-bottom: 0 !important; /* Ensure no extra padding */
  white-space: normal; /* Allow wrapping */
}

/* Update homepage button alignment */
.md-typeset .md-button {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  margin-right: 1rem;
}

.md-typeset p + .md-button {
  margin-top: 2rem;
}

/* Button styling */
.md-button {
    color: #4CAF50 !important; 
    border: 1px solid #4CAF50 !important; /* Assuming 1px border, adjust if needed */
    background-color: transparent !important; /* Explicitly transparent */
    padding: 0.5em 1em; /* Add some default padding if missing */
    text-decoration: none; /* Ensure no underline */
    display: inline-block; /* Ensure proper block behavior */
    border-radius: 4px; /* Add default radius */
}

.md-button:hover {
  color: #ffffff !important;
  background-color: #388E3C !important; 
  border-color: #388E3C !important; 
}

/* Keep .md-button--primary rules as they are */
.md-button--primary {
    /* Revert to outline style */
    color: #4CAF50 !important;
    background-color: transparent !important;
    border: 1px solid #4CAF50 !important; /* Overwrite user edit and ensure border */
}

.md-button--primary:hover {
  /* Keep existing hover: fill with dark green */
  background-color: #388E3C !important; 
  border-color: #388E3C !important; 
  color: #ffffff !important; 
}

/* Button container styling */
.button-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.button-container .md-button {
  margin: 0.5rem; /* Changed from margin: 0 to add space around buttons */
}

/* Increase menu bar font size */
.md-tabs__link {
  font-size: 1rem !important; /* Increased from default */
}

/* Table of contents (right sidebar) specific size */
.md-nav--secondary .md-nav__link {
  font-size: 0.9rem !important; /* Slightly smaller than left sidebar but still larger than default */
}

/* ------------ NAVIGATION FONT SIZES ------------ */

/* Main navigation (left sidebar) */
.md-nav--primary .md-nav__link {
  font-size: 0.8rem !important; /* Reduced from 0.85rem */
}

.md-nav--primary .md-nav__title {
  font-size: 0.9rem !important; /* Reduced from 0.95rem */
}

/* Table of contents (right sidebar) */
.md-nav--secondary .md-nav__link {
  font-size: 0.8rem !important; /* Reduced from 0.9rem */
}

/* Category headers in navigation */
.md-nav__item--section > .md-nav__link[for] {
  font-size: 0.95rem !important; /* Reduced from 1.1rem */
  font-weight: 500 !important;
}

/* Blog categories and metadata in sidebar */
.md-nav__item .md-nav__link,
.metadata-item,
.post-metadata span,
.sidebar-category
{
  font-size: 0.8rem !important; /* Reduced from 0.85rem */
}

/* Fix menu bar container height if needed */
.md-tabs {
  /* Let MkDocs handle it */
}

/* Table of contents (right sidebar) */
.md-nav--secondary .md-nav__title,
.md-nav--secondary .md-nav__link {
  font-size: 0.8rem !important;
}

/* Site name dot styling */
.site-dot {
  color: #FF5252 !important; /* Red color */
  font-size: 3rem !important; /* Bigger than the regular text */
  font-weight: bold !important;
  position: relative !important;
  top: 0.1rem !important; /* Slight vertical adjustment */
  margin: 0 0.05rem !important; /* Add a bit of spacing around the dot */
}

/* Consent checkbox styling */
.md-footer-subscribe__consent {
  margin-top: 0.8rem !important; /* Reduced from 1.2rem */
  width: 100% !important;
  text-align: left !important;
  font-size: 0.7rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

.md-footer-subscribe__consent input[type="checkbox"] {
  margin-right: 0.5rem !important;
  min-width: 16px !important; /* Make checkbox bigger */
  width: 16px !important; /* Make checkbox bigger */
  height: 16px !important; /* Make checkbox bigger */
  cursor: pointer !important;
  flex-shrink: 0 !important; /* Prevent checkbox from shrinking */
}

.md-footer-subscribe__consent label {
  cursor: pointer !important;
  flex: 0 1 auto !important; /* Don't stretch the label too wide */
  white-space: nowrap !important; /* Keep text on one line */
  overflow: visible !important; /* Allow text to be visible */
  line-height: 1.2 !important;
  text-align: left !important; /* Left-align the text */
}

/* Style the checked state of the consent checkbox */
.md-footer-subscribe__consent input[type="checkbox"]:checked {
  accent-color: #4CAF50; /* Use project green */
}

/* Mobile adjustments for consent checkbox */
@media (max-width: 76.1875em) {
  .md-footer-subscribe__input-container {
    flex-direction: column !important;
    height: auto !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
   
  .md-footer-subscribe__input {
    width: 100% !important;
    border-radius: 4px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    line-height: 40px !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    font-size: 16px !important;
    -webkit-appearance: none !important;
  }
   
  .md-footer-subscribe__button {
    width: 100% !important;
    border-radius: 4px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    line-height: 40px !important;
    padding: 0 1rem !important;
    margin: 0 !important;
    font-size: 16px !important;
  }
  
  .md-footer-subscribe__consent {
    margin-top: 0.1rem !important; /* Reduced top margin */
    padding: 0 !important;
    width: 100% !important;
    text-align: left !important;
    font-size: 0.65rem !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin-bottom: 0 !important;
  }
  
  /* Reduce top margin for the wrapper on mobile */
  .md-footer-subscribe__consent-social-wrapper {
    margin-top: 0.1rem !important; /* Reduced from 0.5em (general rule) */
  }
}

/* Center the copyright */
.md-footer-copyright {
  width: 100% !important;
  text-align: center !important;
  margin: 0 0 0 0 !important; 
  padding-bottom: 0 !important; /* Ensure no extra padding */
  white-space: normal; /* Allow wrapping */
}

/* Update homepage button alignment */
.md-typeset .md-button {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Turnstile widget styling */
.md-footer-turnstile {
  margin-top: 0.5rem;
  transition: opacity 0.3s ease, height 0.3s ease;
  height: auto;
  opacity: 1;
  overflow: hidden;
}

.md-footer-turnstile[style*="display: none"] {
  height: 0;
  opacity: 0;
  margin: 0;
}

/* Make sure the message area has a consistent height to prevent layout shifts */
.md-footer-message {
  min-height: 1.5rem;
  margin: 0.5rem 0;
  font-size: 0.8rem;
}

.md-footer-message.error {
  color: #f44336;
}

.md-footer-message.success {
  color: #4caf50;
}

.md-footer-message.info {
  color: #2196f3;
}

/* Clean up any old styles to avoid conflicts */
.md-sidebar--primary .md-sidebar__inner {
  position: sticky !important;
  top: 72px !important; /* Match header height */
  height: calc(100vh - 72px) !important; /* Viewport height minus header */
  overflow-y: auto !important;
  scrollbar-width: thin !important;
}

/* ------------ AUTHOR STYLING ------------ */

/* ONLY essential styling for the sidebar author avatar */
.md-sidebar__inner .md-profile .md-author--long img,
.md-sidebar__inner .md-author img,
.md-sidebar__inner .md-author__avatar {
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* Set link colors to green with red hover effects */
a {
    color: #4CAF50; /* Updated from #45a163 */
}

a:hover {
    color: #FF5252; /* Kept red hover as per original spec */
}

/* Make sure headings are white in dark mode */
.md-typeset h1, 
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
    color: white !important;
}

/* Hover colors for nav items */
.md-tabs__link:hover, 
.md-nav__link:hover {
    color: white !important;
}

/* Nav arrow icon color */
.md-nav__icon svg {
    fill: white;
}

/* Site title font styling - match blog title font */
.md-header__topic {
    font-family: var(--md-text-font-family) !important;
    font-weight: 400 !important;
    color: var(--md-primary-bg-color) !important;
    font-size: 2rem !important; /* Match H1 font size */
}

/* Remove Navigation bar background override */
.md-tabs {
    /* Let MkDocs handle it */
}

/* Remove white color override for non-active tab links */
.md-tabs__link {
    /* Let MkDocs handle it */
}

/* ------------ SIDEBAR SCROLLBAR STYLING ------------ */

/* Set scrollbar color for Firefox */
.md-sidebar--primary .md-sidebar__scrollwrap {
  scrollbar-color: #4CAF50 #1a1a1a; /* thumb color track color */
}

/* Set scrollbar styles for Webkit browsers (Chrome, Safari) */
.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 8px; /* Width of the scrollbar */
}

.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-track {
  background: #1a1a1a; /* Color of the track */
}

.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background-color: #4CAF50; /* Color of the thumb */
  border-radius: 4px; /* Roundness of the thumb */
  border: 2px solid #1a1a1a; /* Creates padding around thumb */
}

.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
  background-color: #388E3C; /* Slightly darker green on hover */
}

/* Custom Syntax Highlighting & Scrollbars for Slate Scheme */
[data-md-color-scheme="slate"] {
  /* --- Syntax Highlighting --- */

  /* Targeting YAML keys / HTML tags (often blue) */
  --md-code-hl-nt-color: #FF5252; /* Red */

  /* Keywords (often blue/purple) */
  --md-code-hl-kw-color: #FF5252; /* Red */

  /* Built-ins (often blue/cyan) */
  --md-code-hl-bi-color: #FF5252; /* Red */

  /* Function names (can be blueish) */
  --md-code-hl-nf-color: #FF5252; /* Red */

  /* Class names (can be blueish) */
  --md-code-hl-nc-color: #FF5252; /* Red */

  /* Strings (ensure they aren't overridden if desired) */
  /* --md-code-hl-str-color: #your_string_color; */

  /* --- Code Block Scrollbar (Keeping Green) --- */

  /* Set scrollbar track color */
  --md-scrollbar-track-color: hsla(0, 0%, 0%, 0.1); /* Darker transparent */

  /* Set scrollbar thumb color */
  --md-scrollbar-thumb-color: #4CAF50; /* Primary Green */

  /* Set scrollbar thumb color on hover/active */
  --md-scrollbar-thumb-hover-color: #2E7D32; /* Darker Menu Green */
}

/* More specific scrollbar styling for Webkit browsers (Chrome, Safari, Edge) */
/* Targets scrollbars specifically within code blocks */
pre ::-webkit-scrollbar {
  height: 8px; /* Adjust height */
  width: 8px;  /* Adjust width */
}

pre ::-webkit-scrollbar-track {
  background-color: hsla(0, 0%, 0%, 0.1);
  border-radius: 4px;
}

pre ::-webkit-scrollbar-thumb {
  background-color: #4CAF50; /* Primary Green */
  border-radius: 4px;
}

pre ::-webkit-scrollbar-thumb:hover {
  background-color: #2E7D32; /* Darker Menu Green */
}

/* Optional: Styling for Firefox scrollbars (requires newer Firefox versions) */
/* Targets scrollbars specifically within code blocks */
pre {
  scrollbar-width: thin; /* Or "auto" or "none" */
  scrollbar-color: #4CAF50 hsla(0, 0%, 0%, 0.1); /* thumb color, track color */
}

/* Illustration Gallery for side-by-side images */
.illustration-gallery {
  display: flex;          /* Enable flexbox layout */
  flex-wrap: nowrap;       /* Force items onto a single line */
  gap: 1em;               /* Space between images */
  margin: 2em 0;          /* Vertical margin for the container */
  overflow-x: auto;       /* Add horizontal scroll on very small screens */
}

/* Updated styles for individual illustrations within the gallery */
.illustration-image {
  /* flex: 1; - Replaced */
  flex-grow: 1;           /* Allow items to grow */
  flex-shrink: 1;         /* Allow items to shrink */
  flex-basis: 0;          /* Start with no assumed width */
  width: calc(25% - 0.75em); /* Distribute width (100%/4) minus gap space (3 gaps * 1em / 4 items) */
  min-width: 150px;       /* Prevent shrinking too much on small screens */
  border-radius: 8px;
  height: auto;
  object-fit: contain;
}

/* Responsive adjustments for illustration gallery */
@media screen and (max-width: 959px) { /* Adjust breakpoint as needed */
  .illustration-gallery {
    flex-wrap: wrap;        /* Allow wrapping */
    justify-content: center; /* Center items when wrapped */
    overflow-x: visible;    /* Remove horizontal scroll */
  }

  .illustration-image {
    /* Adjust width for 2 columns, considering gap */
    width: calc(50% - 0.5em); 
    min-width: 180px;       /* Adjust min-width if needed for 2-column layout */
  }
}

/* Add top margin to the subscription form container */
.md-footer-subscribe {
  margin-top: 1em;
}

/* Layout for Consent Checkbox and Social Icons wrapper */
.md-footer-subscribe__consent-social-wrapper {
  display: flex;
  /* justify-content: space-between; Pushes consent left, social right */
  justify-content: flex-start; /* Align items to the start */
  align-items: baseline;
  margin-top: 0.5em; /* Added back margin for vertical space */
  width: 100%; /* Ensure wrapper takes full width of its container (the form) */
}

/* Ensure consent checkbox has no extra top margin inside the wrapper */
.md-footer-subscribe__consent-social-wrapper .md-footer-subscribe__consent {
  margin-top: 0 !important; /* Added */
}

/* Ensure social icons have no extra top margin inside the wrapper */
.md-footer-subscribe__consent-social-wrapper .md-social {
  margin-top: 0 !important; /* Added */
  margin-left: auto; /* Push social icons to the right within the wrapper */
}

/* Optional: Ensure social icons don't have extra margins */
.md-footer-subscribe__consent-social-wrapper .md-social__link {
  margin: 0 0.3em;
}

/* Hide the duplicate social icons block rendered directly by the theme footer */
.md-footer-meta__inner > .md-social {
  display: none !important;
}

/* Add top margin to the subscription form container WHEN VISIBLE */
#subscription-container:not(.hidden-by-subscription) {
  margin-top: 1em;
}

/* Remove bottom margin from the input/button line */
.md-footer-subscribe__input-container {
  margin-bottom: 0 !important; /* Added */
}

/* Add this block for styling blog post charts */
.blog-chart {
  display: block; /* Needed for margin auto */
  margin-top: 1.5em;  /* Space above the image */
  margin-bottom: 1.5em; /* Space below the image */
  margin-left: auto;
  margin-right: auto;
  max-width: 100%; /* Responsive */
  width: 650px;  /* Adjust this width as desired */
  /* padding: 10px; Removed padding as filter/border-radius is applied directly to img */
  border-radius: 20px; /* Increased rounding */
  /* Since the image bg isn't transparent, we add padding */
  /* No explicit background-color needed, will show image bg */
  filter: brightness(0.85); /* Slightly dim the image to reduce starkness */
}

/* Optional: Style for captions if you add them later */
.blog-chart + em {
    display: block;
    text-align: center;
    /* margin-top: -1em; Adjust if needed now padding is removed */
    margin-top: 0.5em; /* Add space after dimmed image */
    margin-bottom: 1.5em;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7); /* Adjust color to match theme */
}

/* Add padding to account for sticky footer */
.md-sidebar--secondary .md-sidebar__inner {
  padding-bottom: 6rem; /* Adjust as needed based on actual footer height */
}

/* Hide auto-generated title on directory page */
.md-content article h1:first-child { display: none; }

/* No results message */
.no-results-container {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.8);
  grid-column: 1 / -1; /* Span full width in grid */
}
.no-results-container h3 {
  color: #fff;
  margin: 0 0 12px 0;
  font-size: 24px;
}
.no-results-container p {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px 0;
}
.clear-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}
.clear-btn:hover {
  background: #66BB6A;
}
.suggestions {
  margin-top: 24px;
  padding: 16px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 8px;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.suggestions p {
  margin: 8px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}
.suggestions strong {
  color: #4CAF50;
}

/* ---- Directory filters & cards ---- */
#dir-filters { 
  display: grid; 
  grid-template-columns: 2fr 1fr; 
  grid-template-rows: auto auto;
  gap: 12px; 
  margin: 20px 0 24px; 
  align-items: end;
}

#dir-filters #q { grid-column: 1; grid-row: 1; }
#dir-filters #platform { grid-column: 2; grid-row: 1; }
#dir-filters #frequency { grid-column: 1; grid-row: 2; }
#dir-filters #suggest-button { grid-column: 2; grid-row: 2; }

@media screen and (min-width: 768px) {
  #dir-filters {
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    grid-template-rows: auto;
  }
  
  #dir-filters #q { grid-column: 1; grid-row: 1; }
  #dir-filters #platform { grid-column: 2; grid-row: 1; }
  #dir-filters #frequency { grid-column: 3; grid-row: 1; }
  #dir-filters #suggest-button { grid-column: 4; grid-row: 1; }
}

#suggest-button {
  background: #4CAF50 !important;
  color: #000 !important;
  border: 1px solid #4CAF50;
  border-radius: 8px;
  padding: 7px 12px;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

#suggest-button:hover {
  background: #45a049 !important;
  border-color: #45a049;
}

#dir-filters input, #dir-filters select { 
  background:#222; 
  color:#fff; 
  border:1px solid #4CAF50; 
  border-radius:8px; 
  padding:10px 16px 10px 12px; 
  font-size: 14px;
  transition: border-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
#dir-filters select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%234CAF50' viewBox='0 0 16 16'%3e%3cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
#dir-filters input:focus, #dir-filters select:focus {
  outline: none;
  border-color: #66BB6A;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}
@media (max-width: 768px) {
  #dir-filters { 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 8px; 
  }
}
/* Legacy styles - replaced by newer ones below */
@media (min-width: 1000px) { .dir-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; } }

/* Directory lists */
.dir-content ul { margin: 8px 12px; padding-left: 18px; }
.dir-content li { margin: 4px 0; }
/* Removed - padding defined in main summary rule */

/* Directory card container: single green border */
.dir-item { border: 1px solid #4CAF50; border-radius: 8px; overflow: hidden; margin: 4px 0; transition: border-color 0.2s ease; }
.dir-item:hover { border-color: #66BB6A; }
.dir-item:focus-within { border-color: #4CAF50; outline: none; }
.dir-item > summary { 
  border: none; 
  border-radius: 8px 8px 0 0; 
  background:#181818; 
  display:flex; 
  align-items:center; 
  gap:0; 
  padding: 12px 15px;
  margin: 0 !important; /* Override MkDocs default margins */
  list-style: none !important; /* Remove any list styling */
}
.dir-content { border: none; border-top: 1px solid #2a2a2a; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; }

/* Remove default left icon from details summary (blue circle) */
.md-typeset .dir-item > summary::before { display: none !important; }
.md-typeset .dir-more > summary::before { display: none !important; }

/* Color the right chevron arrow to green */
.md-typeset .dir-item > summary::after { color: #4CAF50 !important; }
.md-typeset .dir-more > summary::after { color: #4CAF50 !important; }

/* Override MkDocs default spacing for details */
.md-typeset .dir-item { margin: 4px 0 !important; }
.md-typeset .dir-item > summary { 
  margin: 0 !important; 
  padding-left: 15px !important; 
  text-indent: 0 !important;
}

/* Optional thumbnail/logo in summary */
.dir-thumb { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; border:1px solid #2a2a2a; flex:0 0 60px; margin-right: 15px; }
.dir-thumb--square { border-radius: 12px; }

/* Directory card content */
.dir-content { padding: 8px 12px 0; border: 1px solid #2a2a2a; border-top: none; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; background:#181818; }

/* Ensure last element in card content has no bottom margin */
.dir-content > :last-child { margin-bottom: 3px !important; }
.dir-item > summary { background:#181818; color:#fff; font-weight:600; display:flex; align-items:center; gap:6px; }
.dir-item > summary b { color:#fff; }
.dir-item > summary::marker { content:''; }
#dir-filters input::placeholder { color:#bbb; }

/* Directory meta and more */
.dir-meta { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 6px 12px 8px; }
.dir-meta dt { font-weight: 700; color:#fff; }
.dir-meta dd { margin: 0; }
.dir-more { margin: 4px 3px 0; background: transparent; }
.dir-more > summary { cursor:pointer; color:#4CAF50; margin-bottom: 6px; background: transparent; }
.dir-more[open] { margin-bottom: 0; }
.dir-more[open] > summary { margin-bottom: 4px; }

/* Specific spacing for More details as last element */
.dir-content > .dir-more:last-child { margin: 4px 6px 3px; }
.dir-content > .dir-more:last-child[open] { margin-bottom: 3px; }

/* Closed summary formatting */
.dir-item > summary { display:flex; align-items:center; gap:15px; }
.dir-item > summary > span:first-of-type { display:flex; flex-direction:column; gap:2px; flex:1; }
.dir-item > summary .dir-tags { opacity:0.85; font-weight:400; font-size:0.85em; }

/* Key-Value (definition list) inside directory cards */
.dir-kv { display:grid; grid-template-columns: 130px 1fr; gap:6px 12px; margin: 6px 12px 8px; }
.dir-kv dt { font-weight:700; color:#fff; margin:0; }
.dir-kv dd { margin:0; }
.dir-kv span { opacity:0.7; margin: 0 6px; }

/* Remove extra left gutter inside details content */
.dir-content { padding: 10px 12px; border: 1px solid #2a2a2a; border-top: none; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; background:#181818; }
.dir-item { margin: 8px 0; }

/* Tighter bullets inside 'More details' */
.dir-more ul { margin: 6px 0 0 14px !important; padding-left: 14px !important; }
.dir-more li { margin: 2px 0 !important; }

/* Recolor admonition (notes) borders only */
.md-typeset .admonition, .md-typeset details { border-color: #4CAF50 !important; }
.md-typeset .admonition > .admonition-title, .md-typeset details > summary { border-color: #4CAF50 !important; }

