.aces-intro-section {
    --aces-intro-gradient-start: var(--wp-main-color, var(--wp-play-now-color, #0f172a));
    --aces-intro-gradient-end: var(--wp-second-color, #1d4ed8);
    --aces-intro-overlay-opacity: 0;
    background: linear-gradient(135deg, var(--aces-intro-gradient-start), var(--aces-intro-gradient-end));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    padding: clamp(1.5rem, 3.5vw, 2.3rem) clamp(1.3rem, 3vw, 2.2rem);
    padding-top: clamp(1.5rem, 3.5vw, 2.3rem);
    margin-top: clamp(2rem, 4vw, 3.5rem);
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.2);
    position: relative;
    overflow: visible;
}

.aces-intro-section::after,
.aces-intro-section::before {
    display: none;
}

.aces-intro-section--has-overlay::before,
.aces-intro-section--has-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.aces-intro-section--has-overlay::before {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 60%);
    z-index: 0;
}

.aces-intro-section--has-overlay::after {
    background: linear-gradient(135deg, rgba(15, 23, 42, var(--aces-intro-overlay-opacity)) 0%, rgba(15, 23, 42, calc(var(--aces-intro-overlay-opacity) * 0.25)) 60%);
    z-index: 0;
}

.aces-intro-section__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(1.4rem, 3vw, 2.4rem);
    max-width: 1080px;
    margin: 0 auto;
    z-index: 1;
}

.aces-intro-section__copy {
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.35rem);
}

.aces-intro-section__heading {
    margin: 0;
    margin-top: clamp(-1rem, -2vw, -0.5rem);
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.aces-intro-section__text {
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    line-height: 1.7;
    width: 100%;
}

.aces-intro-section__text p {
    margin: 0 0 1em;
}

.aces-intro-section__text p:last-child {
    margin-bottom: 0;
}

.aces-intro-section__text-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.aces-intro-section__text--collapsible {
    --aces-intro-collapsed-height: 160;
    --aces-intro-collapsed-lines: 7;
    position: relative;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.aces-intro-section__text--collapsible::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.6rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.82));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.aces-intro-section__text--collapsible.is-collapsed {
    max-height: calc(var(--aces-intro-collapsed-height) * 1px);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--aces-intro-collapsed-lines);
    line-clamp: var(--aces-intro-collapsed-lines);
    text-overflow: ellipsis;
}

.aces-intro-section__text--collapsible.is-collapsed::after {
    opacity: 1;
}

.aces-intro-section__text--collapsible:not(.is-collapsed) {
    max-height: none;
    display: block;
}

.aces-intro-section__text--collapsible:not(.is-collapsed)::after {
    opacity: 0;
}

.aces-intro-section__readmore {
    display: flex;
    align-items: center;
    margin-top: 0.75rem;
    color: #fff;
    font-size: 0.95rem;
}

.aces-intro-section__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(10, 14, 32, 0.65);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 1;
    box-shadow: 0 6px 16px rgba(8, 11, 26, 0.18);
}

.aces-intro-section__toggle:hover,
.aces-intro-section__toggle:focus {
    background: rgba(10, 14, 32, 0.82);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

.aces-intro-section__toggle::after {
    content: '';
    width: 6px;
    height: 6px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    margin-top: 2px;
    transition: transform 0.3s ease;
}

.aces-intro-section__toggle[aria-expanded="true"]::after {
    transform: rotate(135deg);
    margin-top: -2px;
}

@media (max-width: 600px) {
    .aces-intro-section__text--collapsible {
        --aces-intro-collapsed-height: 130;
        --aces-intro-collapsed-lines: 6;
    }

    .aces-intro-section__text--collapsible::after {
        height: 2.2rem;
    }
}

.aces-intro-section__authors {
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(6px);
    padding: clamp(1.25rem, 2vw, 1.75rem) clamp(1.25rem, 2vw, 1.75rem) clamp(0.9rem, 1.5vw, 1.25rem);
}

.aces-intro-section__authors .aces-authors-block,
.aces-intro-section__authors .mercury-author-box {
    color: inherit;
}

.aces-intro-section__authors .space-page-content-meta,
.aces-intro-section__authors .mercury-loop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px !important;
    row-gap: 6px !important;
    padding: 0;
    margin: 0;
    align-items: center;
    color: #fff;
}



.aces-intro-section__authors .space-page-content-meta-icon,
.aces-intro-section__authors .mercury-loop-meta i,
.aces-intro-section__authors .space-page-content-meta i {
    font-size: 0.75rem !important;
    width: auto;
    height: auto;
    line-height: 1;
    margin-right: 5px !important;
    color: #fff !important;
}

.aces-intro-section__authors .space-page-content-meta span,
.aces-intro-section__authors .mercury-loop-meta span,
.aces-intro-section__authors .space-page-content-meta time,
.aces-intro-section__authors .mercury-loop-meta time,
.aces-intro-section__authors .space-page-content-meta-author-role,
.aces-intro-section__authors .space-page-content-meta-author-title {
    font-size: 0.78rem;
    color: #fff !important;
}

.aces-intro-section__authors .space-page-content-meta-author-block .space-page-content-meta-author,
.aces-intro-section__authors .mercury-loop-meta .space-page-content-meta-author {
    font-weight: 600;
    color: #fff !important;
    align-self: center;
    align-items: center;
    cursor: pointer;
}

/* Ensure the author hover triggers work in the intro section */
.aces-intro-section__authors .author-hover-trigger,
.aces-intro-section__authors .space-page-content-meta-avatar {
    cursor: pointer;
    z-index: 10;
    position: relative;
}

/* Force white color on all author-related text */
.aces-intro-section__authors .space-page-content-meta-author-role,
.aces-intro-section__authors .space-page-content-meta-author-title,
.aces-intro-section__authors .space-page-content-meta div,
.aces-intro-section__authors .mercury-loop-meta div {
    color: #fff !important;
}

.aces-intro-section__authors .space-page-content-meta-author-block .space-page-content-meta-author a,
.aces-intro-section__authors .mercury-loop-meta .space-page-content-meta-author a {
    color: #fff !important;
    text-decoration: none;
}

.aces-intro-section__authors .space-page-content-meta-avatar,
.aces-intro-section__authors .mercury-loop-meta .space-page-content-meta-avatar {
    display: inline-block;
    width: auto !important;
    height: auto !important;
    flex: none !important;
    line-height: 0;
}

.aces-intro-section__authors .space-page-content-meta-avatar img,
.aces-intro-section__authors .mercury-loop-meta .space-page-content-meta-avatar img {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    object-fit: cover;
    object-position: center;
    display: inline-block;
    cursor: pointer;
    width: 40px !important;
    height: 40px !important;
    max-width: none !important;
    max-height: none !important;
}

.aces-intro-section__toc {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    padding: clamp(0.7rem, 1.6vw, 1rem);
    backdrop-filter: blur(5px);
    align-self: stretch;
}

.aces-intro-toc {
    margin: 0;
    border: none;
    padding: 0;
}

.aces-intro-toc__summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0;
}

.aces-intro-toc__summary::-webkit-details-marker {
    display: none;
}

.aces-intro-toc__summary-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aces-intro-toc__indicator {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}

.aces-intro-toc[open] .aces-intro-toc__indicator {
    transform: rotate(180deg);
}

.aces-intro-toc__indicator::before {
    content: '';
    width: 7px;
    height: 7px;
    border-left: 1.4px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1.4px solid rgba(255, 255, 255, 0.8);
    transform: rotate(-45deg);
    margin-top: -2px;
}

.aces-intro-toc__nav {
    margin-top: 0.45rem;
}

.aces-intro-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.12rem;
}

.aces-intro-toc__item a {
    color: #fff !important;
    text-decoration: none;
    display: inline-block;
    transition: color 0.25s ease, transform 0.25s ease;
    line-height: 1.12;
    padding: 0.08rem 0;
    font-size: 0.9rem;
}

.aces-intro-toc__item {
    border-radius: 6px;
    transition: background 0.2s ease;
    padding: 0 0.2rem;
}

.aces-intro-toc__item.is-active {
    background: rgba(255, 255, 255, 0.12);
}

.aces-intro-toc__item.is-active a {
    font-weight: 600;
}

.aces-intro-toc__item--level-3,
.aces-intro-toc__item--level-4 {
    padding-left: 0;
}

.aces-intro-toc__item a:hover,
.aces-intro-toc__item a:focus {
    color: #fff !important;
    transform: translateX(4px);
}

.aces-intro-toc--empty {
    display: none;
}

@media (max-width: 959px) {
    .aces-intro-section {
        border-radius: 20px;
    }
}

@media (max-width: 600px) {
    .aces-intro-section {
        padding: clamp(1.1rem, 4vw, 1.6rem) clamp(0.9rem, 3.5vw, 1.4rem);
        padding-top: clamp(1.1rem, 4vw, 1.6rem);
        margin-top: clamp(1.5rem, 4vw, 2.5rem);
    }

    .aces-intro-section__heading {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    .aces-intro-section__authors,
    .aces-intro-section__toc {
        padding: clamp(0.7rem, 3.5vw, 0.95rem);
    }
    
    /* Ensure avatar size stays consistent on mobile */
    .aces-intro-section__authors .space-page-content-meta-avatar img,
    .aces-intro-section__authors .mercury-loop-meta .space-page-content-meta-avatar img {
        width: 40px !important;
        height: 40px !important;
    }
}

.aces-toc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 19;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    background: #fff;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.aces-toc-header.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.aces-toc-header__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.6rem 0;
    max-width: 1080px;
    margin: 0 auto;
    color: #333;
}

.aces-toc-header__nav {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.aces-toc-header__nav::-webkit-scrollbar {
    display: none;
}

.aces-toc-header__list {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
    min-width: 100%;
}

.aces-toc-header__item a {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), padding 0.3s ease, font-size 0.3s ease;
    white-space: nowrap;
    transform: scale(0.85);
}

.aces-toc-header__item.is-active a {
    background: var(--aces-intro-gradient-end, var(--wp-second-color, #1d4ed8));
    border-color: var(--aces-intro-gradient-end, var(--wp-second-color, #1d4ed8));
    color: #fff;
    font-weight: 600;
    transform: scale(1);
    padding: 0.38rem 0.9rem;
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .aces-toc-header__title {
        font-size: 0.76rem;
        letter-spacing: 0.06em;
    }

    .aces-toc-header__item a {
        padding: 0.26rem 0.65rem;
        font-size: 0.7rem;
    }

    .aces-toc-header__item.is-active a {
        padding: 0.32rem 0.75rem;
        font-size: 0.76rem;
    }
}

