.texter-yt-gallery {
    margin: 0;
    clear: both;
}

.texter-yt-gallery__heading {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    line-height: 1.3;
}

.texter-yt-gallery__intro {
    margin: 0 0 1.25rem;
    line-height: 1.6;
}

.texter-yt-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 0.75rem;
}

.texter-yt-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.texter-yt-item--inline,
.texter-yt-item--popup {
    margin-bottom: 0;
}

.texter-yt-item__title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.texter-yt-item__description {
    line-height: 1.6;
}

.texter-yt-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.texter-yt-thumb__image-wrap {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
}

.texter-yt-thumb--popup .texter-yt-thumb__image-wrap,
.texter-yt-grid__thumb .texter-yt-thumb__image-wrap {
    background: transparent;
    border-radius: 0;
}

.texter-yt-popup-preview {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.texter-yt-popup-preview .texter-yt-embed--popup-preview {
    margin-bottom: 0;
}

.texter-yt-popup-preview .texter-yt-embed--popup-preview iframe {
    pointer-events: none;
}

.texter-yt-popup-preview__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
}

.texter-yt-popup-preview:hover .texter-yt-embed--popup-preview,
.texter-yt-popup-preview:focus-visible .texter-yt-embed--popup-preview {
    outline: 2px solid rgba(0, 0, 0, 0.12);
    outline-offset: 2px;
}

.texter-yt-thumb__image {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.texter-yt-thumb:hover .texter-yt-thumb__image,
.texter-yt-thumb:focus-visible .texter-yt-thumb__image {
    transform: scale(1.02);
}

.texter-yt-thumb__caption {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.35;
}

.texter-yt-carousel--scroll {
    width: 100%;
}

.texter-yt-carousel__viewport {
    width: 100%;
    overflow: visible;
}

.texter-yt-featured {
    width: 100%;
    margin-bottom: 1.25rem;
}

.texter-yt-featured .texter-yt-embed--featured {
    margin-bottom: 0.75rem;
}

.texter-yt-featured__title {
    margin-bottom: 0;
}

.texter-yt-carousel__track {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: min(52vw, 280px);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    align-items: start;
}

.texter-yt-carousel--medium .texter-yt-carousel__track {
    grid-auto-columns: min(52vw, 280px);
}

.texter-yt-carousel--big .texter-yt-carousel__track {
    grid-auto-columns: min(72vw, 360px);
}

.texter-yt-carousel__slide {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    scroll-snap-align: start;
}

.texter-yt-carousel__slide-title {
    margin-top: 0.65rem;
    font-size: 1rem;
}

.texter-yt-carousel__slide-desc {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

.texter-yt-gallery__grid--small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem 1.25rem;
    width: 100%;
}

.texter-yt-gallery__grid-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.texter-yt-gallery__grid-title {
    margin-top: 0.55rem;
    font-size: 0.95rem;
}

.texter-yt-gallery__grid-desc {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

.texter-yt-modal[hidden] {
    display: none !important;
}

.texter-yt-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.texter-yt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.texter-yt-modal__dialog {
    position: relative;
    max-width: 920px;
    width: calc(100% - 2rem);
    margin: 2rem auto;
    background: #fff;
    border-radius: 8px;
    padding: 2.75rem 1.25rem 1.25rem;
    max-height: calc(100vh - 4rem);
    overflow: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.texter-yt-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #f3f3f3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}

.texter-yt-modal__close:hover,
.texter-yt-modal__close:focus-visible {
    background: #e8e8e8;
}

.texter-yt-modal__close-icon {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
}

.texter-yt-modal__close-icon::before,
.texter-yt-modal__close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: #333;
    border-radius: 1px;
}

.texter-yt-modal__close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.texter-yt-modal__close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.texter-yt-modal__video {
    margin-top: 0.25rem;
}

.texter-yt-modal__video .texter-yt-embed {
    margin-bottom: 1rem;
}

.texter-yt-modal__title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}

.texter-yt-modal__description {
    line-height: 1.6;
}
