/*
 * PROJECT: Congress Speakers Grid
 * DESCRIPTION: Refactored CSS applying Clean Code principles and global theme CSS variables.
 * ARCHITECTURE: Removed '!important' flags, improved selector specificity, added RWD support.
 * UI/UX UPDATE: Applied visual hierarchy (scaling company up, position down) with transparent background.
 */

@import "../../FBK_Title_Style.css";
@import "spaker-grid-overrides2.css";

/* --- NEW & MAPPED VARIABLES --- */
/* Merged into the main :root scope. Fallbacks provided for graceful degradation. */
:root {
    /* Mapped to global general element border, with a fallback to original hex */
    --speaker-border-color: var(--element-general-border, #e2e8f0);
    --speaker-controls-border-color: #cbd5e1;
    
    /* Typography colors mapped to global info-text-color */
    --speaker-name-color: var(--speakers-info-text-color, #1a1a1a);
    --speaker-controls-text-color: #334155;
    
    /* Performance: Extracted shadows to variables to avoid repaints */
    --speaker-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --speaker-box-shadow-hover: 0 12px 20px -3px rgba(0, 0, 0, 0.1);
    
    /* --- TYPOGRAPHY SCALE VARIABLES --- */
    /* Position: De-emphasized */
    --speaker-position-font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    --speaker-position-font-weight: 400;
    --speaker-position-color: #64748b; /* Slate 500 - muted gray */

    /* Company: Emphasized */
    --speaker-company-font-size: clamp(1rem, 1.2vw, 1.2rem);
    --speaker-company-font-weight: 700;
    --speaker-company-color: var(--speaker-name-color, #0f172a); /* Dark matching the name */
}

/* --- LAYOUT & WRAPPER --- */
.speakers-grid-wrapper {
    width: 100%;
    margin: 30px 0;
    font-family: var(--font-primary);
    box-sizing: border-box;
}

/* --- CONTROLS --- */
.speakers-grid-wrapper .speakers-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    color: var(--p-text-color);
}

.speakers-grid-wrapper .speakers-controls select {
    padding: 8px 16px;
    border: 1px solid var(--speaker-controls-border-color);
    border-radius: 6px;
    background-color: var(--site-bg-color-defined, #ffffff);
    color: var(--p-text-color); /* Jasny tekst na kontrolce */
    outline: none;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: border-color 0.2s ease-in-out;
}

/* Stylowanie rozwiniętej listy (działa w przeglądarkach wspierających styling OS-level UI) */
.speakers-grid-wrapper .speakers-controls select option {
    color: var(--p-text-color); /* Powrót do jasnego tekstu zdefiniowanego dla strony */
    background-color: var(--site-bg-color-defined); /* Tło listy w głównym kolorze strony */
}

/* --- GRID CONTENT --- */
.speakers-grid-wrapper .speakers-grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    transition: opacity 0.3s ease;
}

/* --- SPEAKER BOX --- */
.speakers-grid-wrapper .speaker-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 35px 20px;
    background-color: var(--speakers-info-bg);
    border: 1px solid var(--speaker-border-color);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    /* Optimized animation performance */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--speaker-box-shadow);
    box-sizing: border-box;
}

.speakers-grid-wrapper .speaker-box:hover {
    transform: translateY(-6px);
    box-shadow: var(--speaker-box-shadow-hover);
    text-decoration: none;
}

/* --- IMAGE --- */
.speakers-grid-wrapper .speaker-img-wrapper {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 4px solid var(--site-light-bg-color);
    background-color: var(--high-contrast-bg-color, #ffffff);
}

.speakers-grid-wrapper .speaker-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.speakers-grid-wrapper .speaker-img-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--img-placeholder-bg);
}

/* --- TYPOGRAPHY --- */
.speakers-grid-wrapper .speaker-name { 
    color: var(--speaker-name-color); 
    font-size: var(--speaker-title-font-size);
    -webkit-text-fill-color: var(--speaker-name-color); 
    font-family: var(--font-primary);
    font-weight: var(--h3-font-weight, 600);
    margin: 0 0 10px 0;
}

/* Stanowisko (Zmniejszona waga wizualna) */
.speakers-grid-wrapper .speaker-position { 
    color: var(--speaker-position-color); 
    -webkit-text-fill-color: var(--speaker-position-color);
    font-family: var(--font-primary);
    font-size: var(--speaker-position-font-size);
    font-weight: var(--speaker-position-font-weight);
    line-height: var(--p-line-heght, 1.2);
    margin: 0 0 8px 0;
    opacity: 0.85; 
}

/* Firma (Zwiększona waga wizualna) */
.speakers-grid-wrapper .speaker-company { 
    color: var(--speaker-company-color); 
    -webkit-text-fill-color: var(--speaker-company-color);
    font-family: var(--font-primary);
    font-size: var(--speaker-company-font-size);
    font-weight: var(--speaker-company-font-weight);
    background-color: transparent;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- PAGINATION --- */
#speakers-pagination button.speaker-page-btn {
    background-color: var(--button-default-bg, #ffffff);
    color: var(--button-action-bg-color);
    border: 2px solid var(--button-action-bg-color);
    border-radius: var(--button-border-radius);
    padding: var(--button-padding);
    box-shadow: none;
    -webkit-text-fill-color: var(--button-action-bg-color); 
    margin-top: 20px;
    margin-right: 5px;
    font-family: var(--font-primary);
    font-weight: var(--button-font-weight);
    transition: var(--button-transition);
    cursor: var(--button-cursor);
}

#speakers-pagination button.speaker-page-btn:hover,
#speakers-pagination button.speaker-page-btn.active {
    background-color: var(--button-action-bg-color);
    color: var(--button-default-color);
    -webkit-text-fill-color: var(--button-default-color);
}

/* ==========================================================================
   MOBILE UI / RWD ADJUSTMENTS (Breakpoint: < 1191px)
   ========================================================================== */
@media screen and (max-width: 1191px) {
    .speakers-grid-wrapper .speakers-controls {
        justify-content: center;
        flex-direction: column;
    }

    .speakers-grid-wrapper .speaker-name {
        font-size: var(--mobile-h3-font-size);
    }
}