.tainacan-language-switcher {
    /* Mounted into Blocksy's desktop and mobile header CTA slots. */
    position: static !important;
    inset: auto !important;
    z-index: auto !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;

    margin: 0 !important;
    padding: 8px 12px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.tainacan-language-switcher button {
    appearance: none;
    border: 0 !important;
    background: transparent !important;

    padding: 3px 1px !important;
    margin: 0 !important;

    font: inherit;
    color: inherit !important;
    cursor: pointer;
    opacity: 0.65;
    text-decoration: none;
}

.tainacan-language-switcher button:hover {
    opacity: 1;
}

.tainacan-language-switcher button.is-active {
    opacity: 1;
    font-weight: 700;
}

.tainacan-language-switcher__separator {
    color: currentColor;
    opacity: 0.45;
}

/* The old standalone theme CTA is replaced by the switcher in its slot.
 * In the normal header the CTA can sit on a dark background, so inherit the
 * theme's button text color. Blocksy switches its sticky header to a white
 * background while scrolling; force dark text in that sticky container.
 */
.ct-header-cta .tainacan-language-switcher {
    color: var(--theme-button-text, #ffffff);
}

/* Blocksy's sticky header container uses a light/white background. */
.ct-sticky-container .ct-header-cta .tainacan-language-switcher,
.ct-sticky-container .tainacan-language-switcher {
    color: var(--theme-text-color, #1d2736) !important;
}

.ct-sticky-container .tainacan-language-switcher button {
    color: inherit !important;
}

.ct-sticky-container .tainacan-language-switcher__separator {
    color: currentColor;
}

@media (max-width: 768px) {
    .tainacan-language-switcher {
        gap: 5px;
        padding: 6px 8px !important;
        font-size: 12px;
    }
}


/* Prevent the Japanese series title from flashing before the English
 * translation has been applied. Visibility preserves the layout. */
html[data-archive-language="en"]:not(.tainacan-language-ready) .tainacan-collection-header h1.page-title,
html[data-archive-language="en"]:not(.tainacan-language-ready) .tainacan-collection-header .tasf-public-title-english,
html[data-archive-language="en"]:not(.tainacan-language-ready) .tainacan-metadata-label,
html[data-archive-language="en"]:not(.tainacan-language-ready) .tainacan-item-section__metadatum.metadata-type-taxonomy .tainacan-metadata-value,
html[data-archive-language="en"]:not(.tainacan-language-ready) .ct-breadcrumbs {
    visibility: hidden;
}


/*
 * On an English-first page load, hide only the series-card title text until
 * the language switcher has replaced it. Do not hide the link or its image
 * wrappers: the carousel thumbnails remain visible during initialization.
 */
html[data-archive-language="en"]:not(.tainacan-language-ready)
.wp-block-tainacan-carousel-terms-list a[id^="term-id-"] span {
    visibility: hidden;
}
