/**
 * Staff Members Widget Styles
 *
 * @package KB_Local_Business_Schema
 */

/* Wrapper */
.kb-staff-wrapper {
    width: 100%;
}

/* Grid Layout */
.kb-staff-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* List Layout */
.kb-staff-layout-list .kb-staff-grid {
    grid-template-columns: 1fr;
}

.kb-staff-layout-list .kb-staff-item {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    text-align: left;
}

.kb-staff-layout-list .kb-staff-image {
    flex-shrink: 0;
    margin-bottom: 0;
}

.kb-staff-layout-list .kb-staff-content {
    flex: 1;
}

/* Staff Item */
.kb-staff-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kb-staff-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Staff Image */
.kb-staff-image {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.kb-staff-item.kb-staff-image-circle .kb-staff-image,
.kb-staff-item.kb-staff-image-circle .kb-staff-image img {
    border-radius: 50%;
}

.kb-staff-item.kb-staff-image-square .kb-staff-image,
.kb-staff-item.kb-staff-image-square .kb-staff-image img {
    border-radius: 0;
}

.kb-staff-item.kb-staff-image-rounded .kb-staff-image,
.kb-staff-item.kb-staff-image-rounded .kb-staff-image img {
    border-radius: 12px;
}

.kb-staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Image Placeholder */
.kb-staff-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdbdbd;
    border-radius: inherit;
}

.kb-staff-image-placeholder svg {
    width: 60%;
    height: 60%;
}

/* Staff Content */
.kb-staff-content {
    flex: 1;
}

/* Staff Name */
.kb-staff-name {
    margin: 0 0 8px 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Staff Position */
.kb-staff-position {
    margin: 0 0 12px 0;
    font-size: 0.95em;
    color: #666666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Staff Bio */
.kb-staff-bio {
    margin: 0 0 15px 0;
    font-size: 0.9em;
    color: #555555;
    line-height: 1.6;
}

/* Contact Info */
.kb-staff-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.kb-staff-layout-list .kb-staff-contact {
    justify-content: flex-start;
}

.kb-staff-contact a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #555555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.kb-staff-contact a:hover {
    color: #0073aa;
}

.kb-staff-contact svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Contact Style: Icons Only */
.kb-staff-contact.kb-contact-style-icons a span {
    display: none;
}

/* Contact Style: Text Only */
.kb-staff-contact.kb-contact-style-text svg {
    display: none;
}

/* Contact Style: Both (default styling, no hiding) */
.kb-staff-contact.kb-contact-style-both a {
    padding: 5px 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

.kb-staff-contact.kb-contact-style-both a:hover {
    background: #e8e8e8;
}

/* No Data Message */
.kb-staff-no-data {
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .kb-staff-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .kb-staff-grid {
        grid-template-columns: 1fr;
    }

    .kb-staff-item {
        padding: 25px 20px;
    }

    .kb-staff-image {
        width: 120px;
        height: 120px;
    }

    .kb-staff-layout-list .kb-staff-item {
        flex-direction: column;
        text-align: center;
    }

    .kb-staff-layout-list .kb-staff-image {
        margin-bottom: 15px;
    }

    .kb-staff-layout-list .kb-staff-contact {
        justify-content: center;
    }

    /* Contact with text: stack on mobile */
    .kb-staff-contact.kb-contact-style-text,
    .kb-staff-contact.kb-contact-style-both {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animation for items */
@keyframes kb-staff-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kb-staff-item {
    animation: kb-staff-fade-in 0.5s ease forwards;
}

.kb-staff-item:nth-child(2) { animation-delay: 0.1s; }
.kb-staff-item:nth-child(3) { animation-delay: 0.2s; }
.kb-staff-item:nth-child(4) { animation-delay: 0.3s; }
.kb-staff-item:nth-child(5) { animation-delay: 0.4s; }
.kb-staff-item:nth-child(6) { animation-delay: 0.5s; }
.kb-staff-item:nth-child(n+7) { animation-delay: 0.6s; }

/* Schema.org compatible hidden data */
.kb-staff-schema-data {
    display: none;
}

/* ------------------------------------------------------------------
   Schlagworte (Spezialgebiete)
   ------------------------------------------------------------------ */
.kb-staff-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.kb-staff-layout-list .kb-staff-tags {
    justify-content: flex-start;
}

.kb-staff-tag {
    margin: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #333333;
    font-size: 0.8em;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
   Social-Icons (Stil wie das Social-Media-Widget)
   ------------------------------------------------------------------ */
.kb-staff-social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    margin: 15px 0 0;
    padding: 0;
}

.kb-staff-layout-list .kb-staff-social {
    justify-content: flex-start;
}

.kb-staff-social-item {
    margin: 0;
    padding: 0;
}

.kb-staff-social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #555555;
    text-decoration: none;
    border: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.kb-staff-social-link:hover,
.kb-staff-social-link:focus-visible {
    color: #0073aa;
}

.kb-staff-social-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.kb-staff-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.kb-staff-social-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.kb-staff-social-style-framed .kb-staff-social-icon,
.kb-staff-social-style-stacked .kb-staff-social-icon {
    width: 2.2em;
    height: 2.2em;
    border: 2px solid currentColor;
}

.kb-staff-social-style-framed .kb-staff-social-link,
.kb-staff-social-style-stacked .kb-staff-social-link {
    border-color: transparent;
}

.kb-staff-social-style-stacked .kb-staff-social-icon {
    background: currentColor;
}

.kb-staff-social-style-stacked .kb-staff-social-icon i,
.kb-staff-social-style-stacked .kb-staff-social-icon svg {
    color: #ffffff;
    fill: #ffffff;
}

.kb-staff-social-shape-circle .kb-staff-social-icon { border-radius: 50%; }
.kb-staff-social-shape-rounded .kb-staff-social-icon { border-radius: 8px; }
.kb-staff-social-shape-square .kb-staff-social-icon { border-radius: 0; }

.kb-staff-social-label {
    font-size: 0.9em;
}

/* ------------------------------------------------------------------
   Link-Button
   ------------------------------------------------------------------ */
.kb-staff-link {
    margin-top: 15px;
}

.kb-staff-link-button {
    display: inline-block;
    padding: 8px 18px;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 0.9em;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.kb-staff-link-button:hover,
.kb-staff-link-button:focus-visible {
    opacity: 0.85;
    color: #ffffff;
}

.kb-staff-link-button:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
   Karussell (Scroll-Snap; Pfeile/Punkte/Autoplay ergänzt staff-carousel.js)
   ------------------------------------------------------------------ */
.kb-staff-carousel {
    --kb-sc-n: 3;
    --kb-sc-n-t: 2;
    --kb-sc-n-m: 1;
    --kb-sc-gap: 24px;
    --kb-sc-active: var(--kb-sc-n);
    position: relative;
    width: 100%;
}

@media (max-width: 1024px) {
    .kb-staff-carousel {
        --kb-sc-active: var(--kb-sc-n-t);
    }
}

@media (max-width: 767px) {
    .kb-staff-carousel {
        --kb-sc-active: var(--kb-sc-n-m);
    }
}

.kb-staff-carousel-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 6px 20px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.kb-staff-carousel-viewport::-webkit-scrollbar {
    display: none;
}

.kb-staff-carousel-viewport:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.kb-staff-carousel-track {
    display: flex;
    gap: var(--kb-sc-gap);
}

.kb-staff-carousel-slide {
    flex: 0 0 calc((100% - (var(--kb-sc-active) - 1) * var(--kb-sc-gap)) / var(--kb-sc-active));
    min-width: 0;
    scroll-snap-align: start;
    box-sizing: border-box;
}

.kb-staff-carousel-slide > .kb-staff-item {
    height: 100%;
    box-sizing: border-box;
}

.kb-staff-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

@media (max-width: 767px) {
    /* Viele Punkte stehen in einer eigenen Zeile unter den Pfeilen. */
    .kb-staff-carousel-dots {
        order: 10;
        flex: 0 0 100%;
    }
}

.kb-staff-carousel:not([data-kb-ready]) .kb-staff-carousel-controls {
    display: none;
}

.kb-staff-carousel-controls [hidden] {
    display: none;
}

.kb-staff-carousel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    background: transparent;
    color: #1a1a1a;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.kb-staff-carousel-btn:hover:not(:disabled),
.kb-staff-carousel-btn:focus-visible {
    background: #1a1a1a;
    color: #ffffff;
}

.kb-staff-carousel-btn:focus-visible,
.kb-staff-carousel-dot:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.kb-staff-carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.kb-staff-carousel-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

/* Klickfläche 24 px (WCAG 2.2: Zielgröße), sichtbarer Punkt 12 px. */
.kb-staff-carousel-dot {
    position: relative;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
}

.kb-staff-carousel-dot::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.kb-staff-carousel-dot[aria-current="true"]::before {
    background: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .kb-staff-carousel-viewport {
        scroll-behavior: auto;
    }

    .kb-staff-carousel .kb-staff-item {
        animation: none;
        transition: none;
    }
}
