/* Avada Overrides */
html,
body,
#boxed-wrapper,
#wrapper,
.fusion-wrapper,
#main,
#main.custom-blog-layout,
.custom-blog-layout,
.custom-blog-layout .fusion-row,
.custom-blog-layout #content,
.custom-blog-layout .content-wrapper {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

#boxed-wrapper,
#wrapper,
.fusion-wrapper {
  transform: none !important;
  will-change: auto !important;
  perspective: none !important;
}

.custom-blog-layout #main {
  padding: 0 !important;
  overflow: visible !important;
}

.custom-blog-layout .fusion-row {
  max-width: 95% !important;
}

.col {
  flex-direction: column;
}

/* Blog Header */
.blog-header-section {
  max-width: 1400px;
  margin: 0 auto 3rem auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.blog-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.blog-img,
.blog-img img {
  border-radius: 20px;
  max-width: 100%;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  color: #000;
}

.blog-meta .spacer {
  padding: 16px 0;
}

/* Content Wrapper */
.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  display: flex !important;
  gap: 2rem;
  align-items: flex-start !important;
  position: relative;
}

/* Table of Contents - Sticky */
.table-of-contents {
  flex: 0 0 250px;
  padding: 0 1rem;
  border-radius: 8px;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 180px !important;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  align-self: flex-start !important;
  z-index: 100;
}

.table-of-contents-header {
  font-weight: bold;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #9214f2;
}

.headings {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 2px solid #9214f2;
}

.headings li {
  padding: 0;
}

.toc-link {
  display: block;
  padding: 0.75rem 0;
  color: #333;
  text-decoration: none !important;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.toc-link:hover {
  color: #9214f2;
  padding-left: 1.5rem;
}

.toc-link.active {
  font-weight: 900 !important;
}

/* Blog Content */
.blog-content {
  flex: 1;
  min-width: 0;
}

/* Subscribe CTA - Sticky */
.subscribe-cta {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  padding: 2rem;
  border-radius: 9px;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 180px !important;
  max-height: calc(100vh - 200px);
  align-self: flex-start !important;
  z-index: 100;
}

.subscribe-cta img {
  max-width: 100%;
  margin-bottom: 1rem;
}

.subscribe-cta p {
  text-align: center;
  font-weight: 700;
  font-family: Inter, sans-serif;
  line-height: 24px;
}

.subscribe-cta-btn {
  background-color: #d1f434;
  border: solid #d1f434;
  border-radius: 100px;
  padding: 8px 24px;
  font-weight: 600;
  text-transform: uppercase;
  color: black;
  text-decoration: none !important;
  transition: transform 0.2s;
  cursor: pointer;
}

.subscribe-cta-btn:hover {
  transform: scale(1.05);
}

.content .fusion-content-boxes .fusion-column {
  margin-bottom: 1rem;

  &:last-of-type {
    margin: 0;
  }
}

.content .col p {
  margin: 0 0 1rem;
}
/* Section Styles */
.section {
  margin-bottom: 2rem;
  scroll-margin-top: 180px;
}

h1 {
  text-transform: uppercase;
}

h2 {
  text-transform: capitalize !important;
}

.content-container {
  margin: 0 !important;
}

.text-section h2 {
  font-size: 30px;
  margin-bottom: 1.5rem;
  font-family: Oswald;
  text-transform: capitalize;
  scroll-margin-top: 180px;
}

.text-section h3 {
  font-size: 26px;
  text-transform: capitalize;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0;
}

.text-section .content {
  line-height: 1.8;
}

.text-section .content p {
  margin: 1em 0;
}

.text-section .content ul li {
  margin-bottom: 1em;
}

.text-section .content .fusion-content-boxes {
  margin: 0 !important;
}

/* Image and Header Section */
.image-and-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.image-and-header-img {
  max-height: 105px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.image-and-header-headline {
  margin: 0;
  font-size: 26px;
  text-transform: capitalize;
}

/* Image and Header — size variants */
.image-and-header-img.img-size-small {
  max-height: 50px;
}
.image-and-header-img.img-size-medium {
  max-height: 85px;
}
.image-and-header-img.img-size-large {
  max-height: 140px;
}

.image-and-header-img {
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* Split Content Section */
.split-content-section {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.split-text {
  flex: 1;
  min-width: 0;
}

.split-text h2 {
  font-size: 30px;
  margin-bottom: 1rem;
  font-family: Oswald;
  text-transform: capitalize;
}

.split-text .content {
  line-height: 1.8;
}

.split-text .content p {
  margin: 1em 0;
}

.split-image {
  flex: 0 0 45%;
  max-width: 45%;
}

.split-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

/* Stack vertically on tablet and below */
@media (max-width: 900px) {
  .split-content-section {
    flex-direction: column;
    gap: 1.5rem;
  }

  .split-image {
    flex: none;
    max-width: 100%;
    width: 100%;
  }
}

/* Quote Section */
.quote-section {
  background: #9214f21a;
  border: 2px solid #9214f2;
  color: #000;
  border-radius: 23px;
  padding: 3rem;
  margin: 2rem 0;
}

.quote-section .quote {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
  display: flex;
  flex-direction: column;

  img {
    width: 46px;
    margin: 0.5em 0;
  }
  img:nth-of-type(2) {
    align-self: end;
  }
}

.quote-attribution {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quote-headshot {
  width: 100%;
  max-width: 84px;
  height: auto;
  border-radius: 50%;
  object-fit: cover;

  img {
    vertical-align: center;
  }
}

.quote-name {
  margin: 0;
  color: #9214f2;
}

.quote-role {
  margin: 0;
  font-size: 0.9rem;
}

/* CTA Section */
.cta-section-wrapper {
  background-color: #212428;
  padding: 4%;

  .cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
    max-width: 900px;
    margin: 0 auto;
    color: white;
    text-align: center;

    .cta-headline {
      color: white;
      margin-bottom: 0;
    }

    .cta-content {
      font-weight: 600;
      font-size: 24px;
      text-align: center;
      a {
        text-decoration: underline;
        color: #d1f434;
        align-self: center;
      }
    }

    .cta-btn {
      color: #000;
      text-transform: uppercase;
      font-weight: 600;
      font-size: 16px;
      background-color: #d1f434;
      text-decoration: none !important;
      padding: 18px 34px;
      border-radius: 100px;
      &:hover {
        transform: scale(1.05);
        transition: all 0.3s linear;
      }
    }
  }
}

/* Related Blogs */
.related {
  background: url("/wp-content/uploads/2026/02/b2026871f83b935c9cdd80cc6619d673e94bc80f-scaled.png");
  object-fit: none;
  background-repeat: repeat;
  background-color: #fcfcfc;
  padding: 4%;
}

.related-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.related-heading {
  font-family: Oswald;
  font-weight: 700;
  font-size: 48px;
  margin-bottom: 2rem;
  color: #000;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem;
}

.related-card {
  background: linear-gradient(
    180deg,
    rgba(146, 20, 242, 0.3) 0%,
    #fcfcfc 53.77%
  );

  border-radius: 12px;
  overflow: hidden;
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: rgba(149, 157, 165, 0.3) 0px 8px 24px;
}

.related-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  border-radius: 14px;
}

.related-card:hover .related-card-img img {
  transform: scale(1.03);
}

.related-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  margin: 1rem;
  border: 2px solid #9214f2;
  border-radius: 14px;
}

.related-card-title {
  font-family: Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #000;
  line-height: 1.4;
  text-transform: capitalize;
}

.related-card-cta {
  font-weight: 600;
  font-size: 20px;
  text-transform: capitalize;
  text-decoration: underline;
  color: #9214f2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

.related-card-arrow {
  transition: transform 0.2s ease;
}

.related-card:hover .related-card-arrow {
  transform: translateX(4px);
}

/* Slider controls — hidden on desktop */
.related-slider-controls {
  display: none;
}

/* Admin bar offsets — desktop only */
@media (min-width: 1201px) {
  body:not(.admin-bar) .table-of-contents,
  body:not(.admin-bar) .subscribe-cta {
    top: 145px !important;
  }
}

/* =============================================
   Responsive — 1200px: stack layout
   ============================================= */
@media (max-width: 1200px) {
  .content-wrapper {
    flex-direction: column;
    align-items: stretch !important;
  }

  .table-of-contents,
  .subscribe-cta {
    position: relative !important;
    -webkit-position: relative !important;
    top: auto !important;
    left: auto !important;
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    align-self: auto !important;
    z-index: 1 !important;
    transform: none !important;
    float: none !important;
    box-sizing: border-box;
  }

  .table-of-contents {
    overflow-y: visible;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }

  .blog-content {
    width: 100%;
    position: relative;
    z-index: 0;
  }

  .subscribe-cta {
    margin-top: 2rem;
  }
}

/* =============================================
   Mobile — 900px: related posts slider
   ============================================= */
@media (max-width: 900px) {
  /* Switch grid to slider track */
  .related-grid {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 1.5rem;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .related-grid::-webkit-scrollbar {
    display: none;
  }

  .related-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  /* Show arrow controls */
  .related-slider-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .related-slider-btn {
    background: #fff;
    border: 2px solid #9214f2;
    color: #9214f2;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
      background 0.2s ease,
      color 0.2s ease;
    position: relative;
    z-index: 1;
  }

  .related-slider-btn:hover {
    background: #9214f2;
    color: #fff;
  }

  .related-slider-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
  }
}

/* =============================================
   Mobile — 768px: TOC accordion + subscribe order
   ============================================= */
@media (max-width: 768px) {
  /* Flexbox order: TOC (1) → Subscribe (2) → Content (3) */
  .content-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .table-of-contents {
    order: 1;
    position: relative !important;
    top: auto !important;
    flex: none;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding: 0;
    margin-bottom: 0;
    box-sizing: border-box;
  }

  .subscribe-cta {
    order: 2;
    position: relative !important;
    top: auto !important;
    flex: none;
    width: 100%;
    max-height: none;
    margin-top: 0;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
  }

  .blog-content {
    order: 3;
    width: 100%;
  }

  /* --- TOC <details> accordion --- */
  .toc-details {
    width: 100%;
  }

  /* Remove default browser disclosure triangle */
  .toc-details summary {
    list-style: none;
  }
  .toc-details summary::-webkit-details-marker {
    display: none;
  }

  /* Summary row: label left, chevron right */
  .toc-details > summary.table-of-contents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    color: #9214f2;
    padding: 0.85rem 0;
    margin: 0;
    user-select: none;
    border-bottom: 2px solid #9214f2;
  }

  /* Chevron via pseudo-element */
  .toc-details > summary.table-of-contents-header::after {
    content: "▾";
    font-size: 1.2rem;
    color: #9214f2;
    transition: transform 0.25s ease;
    display: inline-block;
    flex-shrink: 0;
  }

  /* Rotate chevron when open */
  .toc-details[open] > summary.table-of-contents-header::after {
    transform: rotate(-180deg);
  }

  /* Remove the always-visible top border from .headings on mobile
     (the summary border-bottom serves as the divider instead) */
  .toc-details .headings {
    border-top: none;
  }

  /* Slide-in animation when opening */
  .toc-details[open] .headings {
    animation: tocSlideDown 0.2s ease;
  }

  @keyframes tocSlideDown {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Tighten TOC links on mobile */
  .toc-link {
    font-size: 0.95rem;
    padding: 0.6rem 0;
  }

  /* General typography tweaks */
  .blog-title {
    font-size: 2rem;
  }

  .blog-meta {
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  .blog-meta .spacer {
    display: none;
  }

  .text-section h2 {
    font-size: 28px;
  }

  .quote-section {
    padding: 2rem;
  }

  .quote-section .quote {
    font-size: 1.25rem;
  }
}

/* Admin bar offset adjustment for mobile */
@media screen and (max-width: 782px) {
  body.admin-bar .table-of-contents,
  body.admin-bar .subscribe-cta {
    top: unset;
  }
}

#main:not(.custom-blog-layout) {
  display: none;
}

.content-wrapper {
  gap: 0 !important;
  margin-top: 1rem;
}

#content > .content-wrapper {
  gap: 2em !important;
}
