/**
 * Speakers Manager - Frontend Styles
 *
 * Base frontend styles for the speakers display.
 * These complement the block-specific styles in the block's build folder.
 *
 * @package SpeakersManager
 * @since 1.0.0
 */

/* ==========================================================================
   Speaker Card Interactive States
   ========================================================================== */

.speaker-card.speaker-has-modal {
    cursor: pointer;
}

.speaker-card.speaker-has-modal:focus {
    outline: 2px solid var(--wp-admin-theme-color, #0073aa);
    outline-offset: 2px;
}

.speaker-card.speaker-has-modal:focus:not(:focus-visible) {
    outline: none;
}

.speaker-card.speaker-has-modal:focus-visible {
    outline: 2px solid var(--wp-admin-theme-color, #0073aa);
    outline-offset: 2px;
}

/* ==========================================================================
   Speaker Archive Page Styles
   ========================================================================== */

.post-type-archive-speaker .site-content,
.tax-speaker_category .site-content,
.tax-speaker_tag .site-content {
    max-width: var(--wp--style--global--wide-size, 1200px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ==========================================================================
   Single Speaker Page Styles
   ========================================================================== */

.single-speaker .speaker-featured-image {
    max-width: 300px;
    margin: 0 auto 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.single-speaker .speaker-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-speaker .entry-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.single-speaker .speaker-role {
    text-align: center;
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

.single-speaker .speaker-content {
    max-width: 720px;
    margin: 0 auto;
}

/* ==========================================================================
   Speaker Taxonomy Term Lists
   ========================================================================== */

.speaker-categories,
.speaker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1rem 0;
}

.speaker-categories a,
.speaker-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.speaker-categories a:hover,
.speaker-tags a:hover {
    background: #0073aa;
    color: #fff;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.speakers-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.speakers-loading::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: speakersSpinAnimation 0.8s linear infinite;
}

@keyframes speakersSpinAnimation {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link for modals */
.speakers-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    z-index: 1000000;
    text-decoration: none;
}

.speakers-skip-link:focus {
    top: 0;
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .speaker-card {
        border: 2px solid currentColor;
    }
    
    .speaker-hidden-badge {
        border: 2px solid currentColor;
    }
    
    .speakers-modal-close {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .speaker-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .speakers-carousel-nav,
    .speakers-carousel-dots {
        display: none;
    }
    
    .speakers-container-carousel {
        display: block;
    }
    
    .speakers-container-carousel .speaker-card {
        display: inline-block;
        width: 30%;
        margin: 1%;
    }
}
