/**
 * Auto Table of Contents - Frontend Styles
 * Layout 1: Breadcrumbs + Dropdown
 * Layout 2: Background Image
 * Layout 3: Background + Featured Image
 */

/* Base TOC Container */
.auto-toc-container {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border-radius: 0;
    --toc-title-color: #333333;
    --toc-link-color: #007cba;
    --toc-layout1-bg-color: #f8f9fa;
    --toc-layout1-breadcrumb-color: #495057;
    --toc-layout1-dropdown-button-color: #007cba;
    --toc-layout1-dropdown-button-text-color: #ffffff;
    --toc-layout1-dropdown-button-text-hover-color: #ffffff;
    --toc-layout1-dropdown-button-font-size: 14px;
    --toc-reading-time-color: #333333;
    --toc-reading-time-font-size: 14px;
    --toc-reading-time-font-style: italic;
    --toc-layout2-bg-color: #e9ecef;
    --toc-layout3-bg-color: #e9ecef;
}


/* Layout 1: Breadcrumbs + Dropdown */
.auto-toc-container.auto-toc-layout1 {
    display: block;
    width: 100%;
}

/* Blog auto-insert: edge-to-edge bar below the site header */
.auto-toc-blog-auto-wrap {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Break out of narrow columns until inline script relocates the bar below the hero */
.auto-toc-blog-auto-wrap.auto-toc-in-content-column {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.auto-toc-container.auto-toc-blog-auto {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.auto-toc-container.auto-toc-blog-auto > .auto-toc-layout1 {
    padding-left: 20px;
    padding-right: 20px;
}

.auto-toc-container > .auto-toc-layout1 {
    background: var(--toc-layout1-bg-color);
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    padding: 10px 5px 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    min-height: min-content;
    width: 100%;
}

.auto-toc-container > .auto-toc-layout1.auto-toc-is-sticky {
    box-sizing: border-box;
    margin: 0;
    min-height: min-content;
    overflow: visible;
}

.auto-toc-container > .auto-toc-layout1.auto-toc-is-sticky .auto-toc-dropdown {
    overflow: visible;
}

.auto-toc-container > .auto-toc-layout1.auto-toc-is-sticky .auto-toc-dropdown-content.active {
    z-index: 2147483001;
}

/* Sticky root is full-bleed on body — keep styles, avoid measured shrink */
body > .auto-toc-container.auto-toc-is-sticky-root,
body > .auto-toc-blog-auto-wrap.auto-toc-is-sticky-root {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 2147483000 !important;
}

body > .auto-toc-blog-auto-wrap.auto-toc-is-sticky-root .auto-toc-container,
body > .auto-toc-container.auto-toc-is-sticky-root {
    width: 100%;
    max-width: none;
}

body > .auto-toc-is-sticky-root .auto-toc-layout1 {
    width: 100%;
}

.auto-toc-sticky-spacer {
    display: block;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
}

.auto-toc-breadcrumbs {
    color: var(--toc-layout1-breadcrumb-color);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 0px 10px 20px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auto-toc-breadcrumbs a {
    color: var(--toc-link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auto-toc-breadcrumbs a:hover {
    color: var(--toc-link-hover-color, #005a87);
    text-decoration: underline;
}

.auto-toc-layout1 .auto-toc-reading-time,
.auto-toc-layout2 .auto-toc-reading-time,
.auto-toc-layout3 .auto-toc-reading-time,
.auto-toc-layout4 .auto-toc-reading-time {
    color: var(--toc-reading-time-color, var(--toc-title-color));
    font-size: var(--toc-reading-time-font-size, 14px);
    font-style: var(--toc-reading-time-font-style, italic);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.auto-toc-layout1 .auto-toc-reading-time::after,
.auto-toc-layout2 .auto-toc-reading-time::after,
.auto-toc-layout3 .auto-toc-reading-time::after,
.auto-toc-layout4 .auto-toc-reading-time::after {
    content: ':';
}

.auto-toc-layout1 .auto-toc-reading-time {
    margin: 0;
    white-space: nowrap;
}

.auto-toc-layout2 .auto-toc-reading-time,
.auto-toc-layout3 .auto-toc-reading-time,
.auto-toc-layout4 .auto-toc-reading-time {
    margin: 0 0 8px;
}

.auto-toc-native-reading-time-hidden {
    display: none !important;
}

.auto-toc-dropdown-group {
    align-items: center;
    align-self: center;
    display: flex;
    flex-shrink: 0;
    gap: 24px;
    margin-left: auto;
}

.auto-toc-dropdown {
    position: relative;
    flex-shrink: 0;
}

.auto-toc-dropdown-toggle {
    background: var(--toc-layout1-dropdown-button-color);
    color: var(--toc-layout1-dropdown-button-text-color);
    border: none;
    padding: 0.714em 1.429em;
    border-radius: 0;
    cursor: pointer;
    font-size: var(--toc-layout1-dropdown-button-font-size);
    font-weight: 500;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 250px;
    height: auto;
    max-height: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    margin-left: 0;
}

.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-group {
    height: auto;
    max-height: none;
    min-height: 0;
}

/* No breadcrumbs: keep the TOC button on the right.
   If reading time is also shown, place it on the left and the button on the right. */
.auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-dropdown-group {
    justify-content: flex-end;
    margin: 0;
    margin-left: auto;
    width: 100%;
}

.auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-dropdown-group:has(.auto-toc-reading-time) {
    justify-content: space-between;
}

.auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-reading-time {
    padding-left: 20px;
}

.auto-toc-dropdown-toggle:hover,
.auto-toc-dropdown-toggle:focus,
.auto-toc-dropdown-toggle:focus-visible,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle:hover,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle:focus,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle:focus-visible,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle[aria-expanded="true"] {
    background: var(--toc-layout1-dropdown-button-hover-color, #005a87);
    color: var(--toc-layout1-dropdown-button-text-hover-color, var(--toc-layout1-dropdown-button-text-color, #ffffff));
    outline: none;
}

.auto-toc-dropdown-toggle[aria-expanded="true"] .auto-toc-chevron {
    transform: rotate(180deg);
}

.auto-toc-chevron {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
    height: 12px;
    justify-content: center;
    transition: transform 0.2s ease;
    width: 12px;
}

.auto-toc-chevron::before {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    box-sizing: border-box;
    content: '';
    display: block;
    height: 6px;
    transform: rotate(45deg) translateY(-1px);
    width: 6px;
}

.auto-toc-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-width: 400px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

/* Force Layout 1 and Layout 4 More dropdown content to remain white background */
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content {
    background: #ffffff !important;
}

.auto-toc-dropdown-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 1001;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

.auto-toc-dropdown-content.auto-toc-dropdown-scrollable {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.auto-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auto-toc-list li {
    margin: 0;
    padding-bottom: 10px;
}

.auto-toc-link {
    display: block;
    padding: 8px 15px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

/* Force Layout 1 and Layout 4 More dropdown links to remain black text */
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content .auto-toc-link,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link {
    color: #000000 !important;
}

.auto-toc-link:hover {
    color: var(--toc-link-hover-color, #005a87);
}

/* Layout 1 and Layout 4 More dropdown links: hover and keyboard focus match */
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content .auto-toc-link:hover,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content .auto-toc-link:focus,
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content .auto-toc-link:focus-visible,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link:hover,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link:focus,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link:focus-visible {
    background: #e9ecef !important;
    border-left-color: #000000 !important;
    color: #000000 !important;
    outline: none;
    text-decoration: none !important;
}

/* Active link highlighting - Layout 1 and Layout 4 More dropdown */
.auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-content .auto-toc-link.active,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link.active {
    background: #f0f0f0 !important;
    color: #000000 !important;
    border-left-color: #000000 !important;
    font-weight: 500;
}

/* Layout 2: Background Image */
.auto-toc-layout2 {
    background: var(--toc-layout2-bg-color);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    min-height: 300px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-toc-layout2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

/* Ensure background image spans entire container */
.auto-toc-container.auto-toc-layout2 {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
}

.auto-toc-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 40px 20px;
    max-width: 600px;
    width: 100%;
    background: transparent;
}

/* Layout 2 specific overlay padding */
.auto-toc-layout2 .auto-toc-overlay {
    padding: 75px 40px;
}

/* Show title for all layouts */

.auto-toc-layout1 .auto-toc-title,
.auto-toc-layout2 .auto-toc-title,
.auto-toc-layout3 .auto-toc-title,
.auto-toc-layout4 .auto-toc-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: var(--toc-title-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    /* Prevent highlighting when jumplinks are clicked */
    outline: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Prevent any focus, active, or hover states on TOC title */
.auto-toc-layout1 .auto-toc-title:focus,
.auto-toc-layout1 .auto-toc-title:active,
.auto-toc-layout1 .auto-toc-title:hover,
.auto-toc-layout2 .auto-toc-title:focus,
.auto-toc-layout2 .auto-toc-title:active,
.auto-toc-layout2 .auto-toc-title:hover,
.auto-toc-layout3 .auto-toc-title:focus,
.auto-toc-layout3 .auto-toc-title:active,
.auto-toc-layout3 .auto-toc-title:hover,
.auto-toc-layout4 .auto-toc-title:focus,
.auto-toc-layout4 .auto-toc-title:active,
.auto-toc-layout4 .auto-toc-title:hover {
    outline: none !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--toc-title-color) !important;
}

.auto-toc-layout2 .auto-toc-list {
    list-style: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.auto-toc-layout2 .auto-toc-list li {
    list-style: none !important;
}

.auto-toc-layout2 .auto-toc-link {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0;
    color: var(--toc-link-color);
    text-decoration: underline;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: inline-block;
}

.auto-toc-layout2 .auto-toc-link:hover {
    color: var(--toc-link-hover-color, #005a87);
}

/* Layout 3: Background + Featured Image */
.auto-toc-layout3 {
    background: var(--toc-layout3-bg-color);
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: stretch;
    padding: 0;
    width: 100%;
}

.auto-toc-layout3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.auto-toc-featured-image {
    position: relative;
    z-index: 2;
    flex: 0 0 45%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auto-toc-content {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 75px 40px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.auto-toc-layout3 .auto-toc-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.auto-toc-layout3 .auto-toc-link {
    background: none;
    border: none;
    border-radius: 0;
    padding: 2px 0;
    color: var(--toc-link-color);
    text-decoration: underline;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
    text-align: left;
}

.auto-toc-layout3 .auto-toc-link:hover {
    color: var(--toc-link-hover-color, #005a87);
}

/* Layout 4: Pills */
.auto-toc-container > .auto-toc-layout4 {
    box-sizing: border-box;
    margin: 20px 0;
    padding: 0 20px;
    width: 100%;
}

/* Full-width blog auto-insert: inset pills to match centered page content */
.auto-toc-container.auto-toc-blog-auto > .auto-toc-layout4 {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    padding-left: max(20px, calc((100vw - min(100vw, 93.75rem)) / 2 + 20px));
    padding-right: max(20px, calc((100vw - min(100vw, 93.75rem)) / 2 + 20px));
}

.auto-toc-layout4 {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.auto-toc-layout4 .auto-toc-title {
    margin: 0 0 16px;
}

.auto-toc-layout4 .auto-toc-pills {
    max-width: 100%;
    width: 100%;
}

.auto-toc-layout4 .auto-toc-pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

body:not(.wp-admin) .auto-toc-layout4 .auto-toc-pills-list:not([data-auto-toc-pills-ready]),
body:not(.wp-admin) .auto-toc-layout4 .auto-toc-pills-list.auto-toc-pills-measuring {
    visibility: hidden;
}

.auto-toc-layout4 .auto-toc-pills-item {
    margin: 0;
    padding: 0;
}

.auto-toc-layout4 .auto-toc-pill {
    align-items: center;
    background: var(--toc-layout4-pill-bg, #ffffff);
    border: none;
    border-radius: 999px;
    box-sizing: border-box;
    color: var(--toc-link-color, #007cba);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: var(--toc-layout4-pill-font-size, 13px);
    font-weight: 500;
    gap: 7px;
    line-height: 1.3;
    padding: 6px 12px 6px 10px;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.auto-toc-layout4 .auto-toc-pill::before {
    background: var(--toc-layout4-pill-accent, #fab005);
    border-radius: 50%;
    content: "";
    flex-shrink: 0;
    height: 6px;
    transition: background-color 0.2s ease;
    width: 6px;
}

.auto-toc-layout4 .auto-toc-pill:hover,
.auto-toc-layout4 .auto-toc-pill:focus,
.auto-toc-layout4 .auto-toc-pill[aria-expanded="true"] {
    background: var(--toc-layout4-pill-bg-hover, #f8f9fa);
    color: var(--toc-link-hover-color, #005a87);
    text-decoration: none;
}

.auto-toc-layout4 .auto-toc-pill:hover::before,
.auto-toc-layout4 .auto-toc-pill:focus::before,
.auto-toc-layout4 .auto-toc-pill[aria-expanded="true"]::before {
    background: var(--toc-layout4-pill-accent-hover, #f59f00);
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown {
    display: inline-flex;
    overflow: visible;
    position: relative;
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill {
    align-items: center;
    background: var(--toc-layout4-pill-bg, #ffffff);
    border: none;
    border-radius: 999px;
    box-sizing: border-box;
    color: var(--toc-link-color, #007cba);
    display: inline-flex;
    font-family: inherit;
    font-size: var(--toc-layout4-pill-font-size, 13px);
    font-weight: 500;
    gap: 7px;
    height: auto;
    justify-content: center;
    line-height: 1.3;
    margin-left: 0;
    max-height: none;
    min-width: 0;
    padding: 6px 12px 6px 10px;
    transition: color 0.2s ease, background-color 0.2s ease;
    white-space: nowrap;
    width: auto;
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill:hover,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill:focus,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill[aria-expanded="true"] {
    background: var(--toc-layout4-pill-bg-hover, #f8f9fa);
    color: var(--toc-link-hover-color, #005a87);
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-chevron {
    color: var(--toc-layout4-pill-accent, #fab005);
    transition: color 0.2s ease;
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill:hover .auto-toc-chevron,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill:focus .auto-toc-chevron,
.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-toggle.auto-toc-pill[aria-expanded="true"] .auto-toc-chevron {
    color: var(--toc-layout4-pill-accent-hover, #f59f00);
}

/* TOC Block Error and Placeholder Styles */
.auto-toc-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
}

.auto-toc-placeholder {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
    font-style: italic;
}

/* Back to Top Button - Using high specificity selector to prevent theme overrides */
body .auto-toc-back-to-top,
html body .auto-toc-back-to-top {
    position: fixed;
    bottom: 10px;
    right: 10px;
    left: auto;
    top: auto;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #50575e, #3c434a);
    color: white;
    border: none;
    border-radius: 50%;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
    flex-basis: auto;
    aspect-ratio: 1;
    font-size: 18px;
    font-weight: bold;
    font-family: inherit;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(80, 87, 94, 0.3);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.2s ease;
    z-index: 1000;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    pointer-events: none;
    overflow: visible;
    outline: none;
}

body .auto-toc-back-to-top.position-bottom-left,
html body .auto-toc-back-to-top.position-bottom-left {
    right: auto;
    left: 10px;
}

body .auto-toc-back-to-top.show,
html body .auto-toc-back-to-top.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

body .auto-toc-back-to-top.show:hover,
html body .auto-toc-back-to-top.show:hover {
    filter: brightness(0.9);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(29, 35, 39, 0.4);
}

body .auto-toc-back-to-top.show:active,
html body .auto-toc-back-to-top.show:active {
    filter: brightness(0.95);
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(29, 35, 39, 0.35);
}

/* Arrow styles — soft SVG masks */
body .auto-toc-back-to-top::before,
html body .auto-toc-back-to-top::before {
    background-color: currentColor !important;
    border: none !important;
    content: '' !important;
    display: block !important;
    font-size: 0 !important;
    height: 24px;
    line-height: 0 !important;
    margin: 0;
    padding: 0;
    width: 24px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 18.5V8.75M8 13.25 12 9l4 4.25' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 18.5V8.75M8 13.25 12 9l4 4.25' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

body .auto-toc-back-to-top.arrow-arrow::before,
html body .auto-toc-back-to-top.arrow-arrow::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 18.5V8.75M8 13.25 12 9l4 4.25' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 18.5V8.75M8 13.25 12 9l4 4.25' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body .auto-toc-back-to-top.arrow-chevron::before,
html body .auto-toc-back-to-top.arrow-chevron::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7.25 15 12 10.25 16.75 15' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7.25 15 12 10.25 16.75 15' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body .auto-toc-back-to-top.arrow-caret::before,
html body .auto-toc-back-to-top.arrow-caret::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7.25 18.1 17.35c.18.3-.05.65-.45.65H6.35c-.4 0-.63-.35-.45-.65L12 7.25z' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 7.25 18.1 17.35c.18.3-.05.65-.45.65H6.35c-.4 0-.63-.35-.45-.65L12 7.25z' fill='%23000'/%3E%3C/svg%3E");
}

/* Responsive Design */
@media (max-width: 768px) {
    .auto-toc-container.auto-toc-blog-auto > .auto-toc-layout1 {
        padding-left: 15px;
        padding-right: 15px;
    }

    .auto-toc-container.auto-toc-blog-auto > .auto-toc-layout4 {
        padding-left: max(15px, calc((100vw - min(100vw, 93.75rem)) / 2 + 15px));
        padding-right: max(15px, calc((100vw - min(100vw, 93.75rem)) / 2 + 15px));
    }

    .auto-toc-container:not(.auto-toc-blog-auto) > .auto-toc-layout4 {
        padding-left: 15px;
        padding-right: 15px;
    }

    .auto-toc-container.auto-toc-blog-auto {
        width: 100%;
    }

    body .auto-toc-back-to-top,
    html body .auto-toc-back-to-top {
        bottom: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
        max-width: 45px;
        max-height: 45px;
        margin: 0;
        padding: 0;
        font-size: 16px;
    }
    
    body .auto-toc-back-to-top.position-bottom-left,
    html body .auto-toc-back-to-top.position-bottom-left {
        right: auto;
        left: 10px;
    }
    
    body .auto-toc-back-to-top.arrow-arrow::before,
    html body .auto-toc-back-to-top.arrow-arrow::before,
    body .auto-toc-back-to-top.arrow-chevron::before,
    html body .auto-toc-back-to-top.arrow-chevron::before,
    body .auto-toc-back-to-top.arrow-caret::before,
    html body .auto-toc-back-to-top.arrow-caret::before,
    body .auto-toc-back-to-top::before,
    html body .auto-toc-back-to-top::before {
        height: 21px;
        margin: 0;
        padding: 0;
        width: 21px;
    }
    
    .auto-toc-container > .auto-toc-layout1 {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 0;
        gap: 0;
    }
    
    .auto-toc-container > .auto-toc-layout1 .auto-toc-breadcrumbs {
        width: 100%;
        text-align: center;
        padding: 15px 20px;
        box-sizing: border-box;
    }
    
    .auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-group {
        align-items: stretch;
        box-sizing: border-box;
        flex-direction: column;
        gap: 10px;
        margin-left: 0;
        padding: 0 20px 15px;
        width: 100%;
    }

    .auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-dropdown-group,
    .auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-dropdown-group:has(.auto-toc-reading-time) {
        justify-content: flex-start;
        margin: 0;
    }

    .auto-toc-container > .auto-toc-layout1.no-breadcrumbs .auto-toc-reading-time {
        padding-left: 0;
    }

    .auto-toc-container > .auto-toc-layout1 .auto-toc-reading-time {
        white-space: normal;
        width: 100%;
    }

    .auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown {
        flex: none;
        width: 100%;
    }

    .auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle {
        justify-content: space-between;
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 15px 20px;
        box-sizing: border-box;
    }
    
    .auto-toc-dropdown-content {
        right: auto;
        left: 0;
        transform: translateY(-10px);
        min-width: 100%;
        width: 100%;
    }
    
    .auto-toc-dropdown-content.active {
        transform: translateY(0);
    }
    
    .auto-toc-dropdown-content .auto-toc-list {
        text-align: left;
    }
    
    .auto-toc-dropdown-content .auto-toc-link {
        text-align: left;
    }

    .auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content {
        left: auto;
        max-width: 400px;
        min-width: 250px;
        right: 0;
        width: auto;
    }
    
    
    .auto-toc-layout2 .auto-toc-list {
        grid-template-columns: 1fr;
    }
    
    .auto-toc-layout3 {
        flex-direction: column;
        text-align: center;
        padding: 0;
    }
    
    .auto-toc-layout3 .auto-toc-featured-image {
        flex: none !important;
        max-width: none !important;
        margin: 0 0 20px 0 !important;
        display: block !important;
        position: relative !important;
        z-index: 2 !important;
        height: 400px !important;
        width: 100% !important;
        min-height: 400px !important;
        background-size: cover !important;
        background-position: top center !important;
        background-repeat: no-repeat !important;
    }
    
    .auto-toc-layout3 .auto-toc-content {
        padding: 20px;
    }
    
    .auto-toc-layout3 .auto-toc-list {
        text-align: center !important;
        align-items: center !important;
    }
    
    .auto-toc-layout3 .auto-toc-link {
        text-align: center !important;
    }
    
    
    .auto-toc-layout3 .auto-toc-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auto-toc-container {
        margin: 15px 0;
    }
    
    .auto-toc-container > .auto-toc-layout1 {
        padding: 0;
        gap: 0;
    }
    
    .auto-toc-container > .auto-toc-layout1 .auto-toc-breadcrumbs {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
        font-size: 13px;
        box-sizing: border-box;
    }
    
    .auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-group {
        padding: 0 15px 12px;
    }

    .auto-toc-container > .auto-toc-layout1 .auto-toc-dropdown-toggle {
        justify-content: space-between;
        min-width: 0;
        width: 100%;
        margin: 0;
        padding: 12px 15px;
        font-size: 13px;
        box-sizing: border-box;
    }
    
    .auto-toc-layout2,
    .auto-toc-layout3 {
        min-height: 250px;
        padding: 20px 15px;
    }
    
    .auto-toc-layout3 {
        padding: 0 !important;
    }
    
    .auto-toc-layout3 .auto-toc-featured-image {
        display: block !important;
        max-width: none !important;
        margin: 0 0 15px 0 !important;
        flex: none !important;
        position: relative !important;
        z-index: 2 !important;
        height: 400px !important;
        width: 100% !important;
        min-height: 400px !important;
        background-size: cover !important;
        background-position: top center !important;
        background-repeat: no-repeat !important;
    }
    
    .auto-toc-layout3 .auto-toc-content {
        padding: 15px;
    }
    
    .auto-toc-layout3 .auto-toc-list {
        text-align: center !important;
        align-items: center !important;
    }
    
    .auto-toc-layout3 .auto-toc-link {
        text-align: center !important;
    }
    
    
    .auto-toc-featured-image {
        max-width: 200px;
    }
}

/* Smooth Scroll Enhancement */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility - match hover state */
.auto-toc-link:focus {
    color: var(--toc-link-hover-color, #005a87);
    outline: none;
}

.auto-toc-layout2 .auto-toc-link:focus {
    color: var(--toc-link-hover-color, #005a87);
    outline: none;
}

.auto-toc-layout3 .auto-toc-link:focus {
    color: var(--toc-link-hover-color, #005a87);
    outline: none;
}

/* Shortcode text alignment (align="left|center|right") */
.auto-toc-container.auto-toc-align-left .auto-toc-title,
.auto-toc-container.auto-toc-align-left .auto-toc-reading-time,
.auto-toc-container.auto-toc-align-left .auto-toc-dropdown-group,
.auto-toc-container.auto-toc-align-left .auto-toc-overlay,
.auto-toc-container.auto-toc-align-left .auto-toc-content,
.auto-toc-container.auto-toc-align-left .auto-toc-dropdown-content,
.auto-toc-container.auto-toc-align-left .auto-toc-pills {
    text-align: left !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-title,
.auto-toc-container.auto-toc-align-center .auto-toc-reading-time,
.auto-toc-container.auto-toc-align-center .auto-toc-dropdown-group,
.auto-toc-container.auto-toc-align-center .auto-toc-overlay,
.auto-toc-container.auto-toc-align-center .auto-toc-content,
.auto-toc-container.auto-toc-align-center .auto-toc-dropdown-content,
.auto-toc-container.auto-toc-align-center .auto-toc-pills {
    text-align: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-title,
.auto-toc-container.auto-toc-align-right .auto-toc-reading-time,
.auto-toc-container.auto-toc-align-right .auto-toc-dropdown-group,
.auto-toc-container.auto-toc-align-right .auto-toc-overlay,
.auto-toc-container.auto-toc-align-right .auto-toc-content,
.auto-toc-container.auto-toc-align-right .auto-toc-dropdown-content,
.auto-toc-container.auto-toc-align-right .auto-toc-pills {
    text-align: right !important;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout4 {
    align-items: flex-start !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout4 {
    align-items: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout4 {
    align-items: flex-end !important;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout4 .auto-toc-pills {
    width: 100%;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout4 .auto-toc-pills,
.auto-toc-container.auto-toc-align-right .auto-toc-layout4 .auto-toc-pills {
    width: auto;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout4 .auto-toc-pills-list {
    justify-content: flex-start !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout4 .auto-toc-pills-list {
    justify-content: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout4 .auto-toc-pills-list {
    justify-content: flex-end !important;
}

.auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content .auto-toc-link {
    text-align: left !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content,
.auto-toc-container.auto-toc-align-right .auto-toc-layout4 .auto-toc-pills-more .auto-toc-dropdown-content {
    text-align: left !important;
}


.auto-toc-container.auto-toc-align-left .auto-toc-layout2 {
    justify-content: flex-start !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout2 {
    justify-content: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout2 {
    justify-content: flex-end !important;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout2 .auto-toc-list,
.auto-toc-container.auto-toc-align-left .auto-toc-layout3 .auto-toc-list {
    align-items: flex-start !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout2 .auto-toc-list,
.auto-toc-container.auto-toc-align-center .auto-toc-layout3 .auto-toc-list {
    align-items: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout2 .auto-toc-list,
.auto-toc-container.auto-toc-align-right .auto-toc-layout3 .auto-toc-list {
    align-items: flex-end !important;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout3 .auto-toc-content {
    align-items: flex-start !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout3 .auto-toc-content {
    align-items: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout3 .auto-toc-content {
    align-items: flex-end !important;
}

.auto-toc-container.auto-toc-align-left .auto-toc-layout2 .auto-toc-link,
.auto-toc-container.auto-toc-align-left .auto-toc-layout3 .auto-toc-link {
    text-align: left !important;
}

.auto-toc-container.auto-toc-align-center .auto-toc-layout2 .auto-toc-link,
.auto-toc-container.auto-toc-align-center .auto-toc-layout3 .auto-toc-link {
    display: inline-block;
    max-width: 100%;
    text-align: center !important;
}

.auto-toc-container.auto-toc-align-right .auto-toc-layout2 .auto-toc-link,
.auto-toc-container.auto-toc-align-right .auto-toc-layout3 .auto-toc-link {
    display: inline-block;
    max-width: 100%;
    text-align: right !important;
}

/* Print styles */
@media print {
    .auto-toc-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .auto-toc-dropdown-content {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .auto-toc-dropdown-toggle {
        display: none;
    }
}

