/**
 * VC Accessible YouTube - Frontend Styles
 */

/* ==========================================================================
   Skip Link
   Hidden by default. Only visible when body has .is-tabbing (keyboard nav)
   AND the link itself has focus.
   ========================================================================== */

.vc-a11y-youtube__skip-link {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    padding: 0;
    border: 0;
    word-wrap: normal !important;
}

.is-tabbing .vc-a11y-youtube__skip-link:focus {
    clip: auto;
    position: relative !important;
    display: inline-block;
    height: auto;
    width: auto;
    overflow: visible;
    padding: 0.5em 1em;
    margin-bottom: 0.5em;
    background-color: #005a9c;
    color: #ffffff;
    font-size: 0.875em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    outline: 2px solid #005a9c;
    outline-offset: 2px;
    z-index: 10;
}

/* ==========================================================================
   Responsive Video Wrapper
   Intrinsic ratio technique using padding-bottom.
   ========================================================================== */

.vc-a11y-youtube__video-wrap {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.vc-a11y-youtube__video-wrap--16-9 {
    padding-bottom: 56.25%; /* 9 / 16 */
}

.vc-a11y-youtube__video-wrap--4-3 {
    padding-bottom: 75%; /* 3 / 4 */
}

.vc-a11y-youtube__video-wrap--21-9 {
    padding-bottom: 42.857%; /* 9 / 21 */
}

.vc-a11y-youtube__video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   Transcript Section
   ========================================================================== */

.vc-a11y-youtube__transcript {
    margin-top: 1em;
    display: none;
}

.is-tabbing .vc-a11y-youtube__transcript {
    display: block;
}

.vc-a11y-youtube__transcript:focus {
    outline: 2px solid #005a9c;
    outline-offset: 2px;
}

/* Collapsible heading (button variant) */
.vc-a11y-youtube__transcript-heading {
    margin: 0 0 0 0;
    padding: 0;
    font-size: 1em;
}

.vc-a11y-youtube__transcript-heading button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6em 0.75em;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #f3f4f6;
    color: #1f2937;
    cursor: pointer;
    font-size: 0.875em;
    font-weight: 600;
    text-align: left;
    line-height: 1.4;
}

.vc-a11y-youtube__transcript-heading button:hover {
    background: #e5e7eb;
}

.vc-a11y-youtube__transcript-heading button:focus-visible {
    outline: 2px solid #005a9c;
    outline-offset: -2px;
}

/* Chevron rotation */
.vc-a11y-youtube__chevron {
    flex-shrink: 0;
    margin-left: 0.5em;
    transition: transform 0.2s ease;
}

.vc-a11y-youtube__transcript-heading button[aria-expanded="true"] .vc-a11y-youtube__chevron {
    transform: rotate(180deg);
}

/* Static heading (always-visible variant) */
.vc-a11y-youtube__transcript-heading--static {
    padding: 0.6em 0.75em;
    background: #f3f4f6;
    font-size: 0.875em;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

/* When button is expanded, square off the bottom corners so it connects to content */
.vc-a11y-youtube__transcript-heading button[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

/* Transcript content */
.vc-a11y-youtube__transcript-content {
    padding: 0.75em;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.6;
    font-size: 0.875em;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.vc-a11y-youtube__transcript-content[hidden] {
    display: none;
}

.vc-a11y-youtube__transcript-content--visible {
    display: block;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* Content typography */
.vc-a11y-youtube__transcript-content p {
    margin: 0 0 1em;
}

.vc-a11y-youtube__transcript-content p:last-child {
    margin-bottom: 0;
}

/* Error state */
.vc-a11y-youtube__error {
    padding: 1em;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .vc-a11y-youtube__chevron {
        transition: none;
    }
}
