/* Custom gradients for the website */
:root {
  --gradient-primary: linear-gradient(135deg, #DD333C 0%, #FF5E8B 100%);
  --gradient-secondary: linear-gradient(135deg, #FF5E8B 0%, #E10098 100%);
  --gradient-tertiary: linear-gradient(135deg, #E10098 0%, #DD333C 100%);
}

.gradient-primary {
  background: var(--gradient-primary);
}

.gradient-secondary {
  background: var(--gradient-secondary);
}

.gradient-tertiary {
  background: var(--gradient-tertiary);
}

.gradient-text {
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  background-image: var(--gradient-primary);
}/* Base content styles */
:root {
  --header-height: 7rem;
  --scroll-margin: calc(var(--header-height) + 2rem);
}

/* Heading scroll margins */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  scroll-margin-top: var(--scroll-margin);
  scroll-behavior: smooth;
}

/* Ensure smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Article typography customization */
.prose {
  /*padding-top: var(--header-height); */
  font-size: 1.125rem;
  line-height: 1.8;
  color: rgb(var(--color-text) / 0.9);
}

.prose :where(h1, h2, h3, h4) {
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: 1em;
}

.prose :where(h1) {
  font-size: 2.5rem;
  margin-top: 0;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -moz-background-clip: text; /* Mozilla prefix for Firefox (if needed) */
  -o-background-clip: text; /* Opera prefix (historically used) */
  -ms-background-clip: text; /* Microsoft prefix (if needed) */
  -webkit-text-fill-color: transparent;
}

.prose :where(h2) {
  font-size: 2rem;
  border-bottom: 1px solid rgb(var(--color-primary-500) / 0.2);
  padding-bottom: 0.5em;
}

.prose :where(h3) {
  font-size: 1.5rem;
}

.prose :where(h4) {
  font-size: 1.25rem;
}

.prose :where(p, ul, ol) {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.prose :where(ul, ol) {
  padding-left: 1.5em;
}

.prose :where(li) {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.prose :where(blockquote) {
  border-left: 4px solid rgb(var(--color-primary-500));
  padding-left: 1.5em;
  margin-left: 0;
  margin-right: 0;
  font-style: italic;

}

.prose :where(code) {
  font-family: JetBrains Mono, monospace;
  font-size: 0.875em;
  background: rgb(var(--color-primary-500) / 0.1);
  padding: 0.2em 0.4em;
  border-radius: 0.25em;
}

.prose :where(pre) {
  background: rgb(var(--color-surface) / 0.8);
  padding: 1.5em;
  border-radius: 0.5em;
  overflow-x: auto;
  border: 1px solid rgb(var(--color-primary-500) / 0.2);
}

.prose :where(pre code) {
  background: none;
  padding: 0;
  font-size: 0.875em;
  color: inherit;
}

.prose :where(img) {
  border-radius: 0.5em;
  margin: 2em 0;
}

.prose :where(hr) {
  border: none;
  border-top: 1px solid rgb(var(--color-primary-500) / 0.2);
  margin: 3em 0;
}

.prose :where(a) {
  position: relative;
    text-decoration: none;
    border-bottom: solid 3px aquamarine;
    display: inline-block;
    color: #F45174;
    padding: 0 1px;
    transition: color ease 0.3s;
}


.prose :where(a:hover) {
  color: #00B388;

}

.main-content a::after {
    content: '';
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 5%;
    left: 0;
    bottom: 0;
    background-color: #00B388;
    transition: all ease 0.3s;
    transform: scaleX(0);
    transform-origin: bottom right;
  }

  .main-content a:hover {
    color: #00B388;
  }

  .main-content a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
  }
/* Dark mode adjustments */
.dark .prose {
  color: rgb(var(--color-text-dark) / 0.9);
}

.dark .prose :where(blockquote) {
  color: rgb(var(--color-text-dark) / 0.8);
}

.dark .prose :where(pre) {
  background: rgb(var(--color-surface-dark) / 0.8);
}

/* High contrast mode support */
@media (forced-colors: active) {
  .prose :where(a) {
    color: LinkText;
  }

  .prose :where(blockquote) {
    border-color: CanvasText;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .prose :where(a) {
    transition: none;
  }
}
dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
  }

  dialog[open] {
    animation: slide-in 0.2s ease-out;
  }

  @keyframes slide-in {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .toc-item a.active {
  background-color: rgb(221 51 60 / 0.05);
  --tw-text-opacity: 1;
  color: rgb(221 51 60 / var(--tw-text-opacity, 1));
}

  .toc-item a.active:is(.dark *) {
  --tw-text-opacity: 1;
  color: rgb(226 89 97 / var(--tw-text-opacity, 1));
}

  .breadcrumbs {
    /* Ensure consistent height to prevent CLS */
    min-height: 2rem;
  }

  /* High contrast mode support */
  @media (forced-colors: active) {
    .breadcrumbs {
      border-color: CanvasText;
    }
  }
  .author-bio {
    /* Reserve space to prevent CLS */
    min-height: 300px;
    container-type: inline-size;
  }

  /* High contrast mode support */
  @media (forced-colors: active) {
    .author-bio {
      border-color: CanvasText;
    }
  }
  .related-posts {
    /* Reserve space to prevent layout shifts */
    min-height: calc(var(--image-height) + 200px);
  }
