/*
 * Stylizacja dla dynamicznego pokazu slajdów postów (Feat Posts)
 *
 * KLUCZOWE POPRAWKI:
 * 1. Ustalona wysokość 350px dla całego modułu (.slideshow-grid).
 * 2. Wymuszony układ Flexbox w podglądach (.preview-link)
 * w celu ułożenia miniatury obok tytułu i kategorii.
 */

/*OPCJE*/
/* KATEGORIA I TYTUŁ POSTA WYŚRODKOWANE W PIONIE WZGLĘDEM THUMBNAILA */
/*1. W .preview-content włącz (odkomentuj) linijkę: justify-content: center
2. W .preview-link  włącz (odkomentuj) linijkę: align-items: flex-start */
/*---------------------------------------------------------------------*/
/*ZAOKRĄGLONE RAMKI CAŁEGO FEAT POSTS i THUMBNAILI*/
/*1. W .dynamic-slideshow-wrapper włącz (odkomentuj) linijkę: border-radius: 8px;*/
/*2. W .preview-thumbnail włącz (odkomentuj) linijkę: border-radius: 4px; */
/*---------------------------------------------------------------------*/

:root {
 /*----------JASNY MOTYW------------------   
    --title-hover: #8e2c8e;
    --active-border:#8e2c8e;
    --category: #8e2c8e;
    --background: #eeeced;
    --item-tlo: #fff;
    --item-active: #f2e9f2;
    --item-hover: #eeeced;
    --item-border: #eeeced;
    --text: #eeeced;
    --item-title: black;
    

 -------------------------------------*/

/*----------CIEMNY MOTYW------------------  */ 
    --title-hover: #8e2c8e;
    --active-border:#8e2c8e;
    --category: #999999;
    --background: #333333;
    --item-tlo: #333333;
    --item-active: #5a5959;
    --item-hover: #666666;
    --item-border: #333333;
    --text: #eeeced;
    --item-title: #eeeced;

  /*  -------------------------------------*/
}

/* Kontener główny */
.dynamic-slideshow-wrapper {
    width: 100%;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: var(--background);
    overflow: hidden; 
}

/* Układ Grid (dwie nierówne kolumny) */
.slideshow-grid {
    display: grid;
    /* Duża kolumna (ok. 70%) | Mała kolumna (ok. 30%) */
    grid-template-columns: 3fr 1fr; 
    gap: 1px;
    align-items: stretch;
    /* WYMUSZENIE STAŁEJ WYSOKOŚCI MODUŁU */
    height: 350px !important; 
}

/* Duża kolumna (Główny Post) */
.main-slide-area {
    position: relative;
    overflow: hidden;
    background-color: var(--background);
    height: 100% !important;
}

.main-slide-area .main-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%; 
}

.main-slide-image {
    width: 100%;
    height: 350px !important; /* Stała wysokość */
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-in-out;
}

/* Nakładka z tytułem i fragmentem treści */
.main-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.35); /* Ciemne tło, 55% krycia */
    height: 116px;
}

.main-slide-area .main-link:hover .main-slide-image {
    transform: scale(1.03);
}

.main-slide-title {
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0 0 5px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.main-slide-area .main-link:hover .main-slide-title {
    color: var(--title-hover);
    transition: color 0.3s ease-in-out;

}

.main-slide-excerpt {
    font-size: 0.9rem;
    margin: 0;
}

/* Mała Kolumna (Podglądy) */
.preview-column-area {
    display: flex;
    flex-direction: column;
    gap: 1px; 
    background-color: var(--item-border);
    height: 100% !important; 
}

.preview-item {
    background-color: var(--item-tlo);
    padding: 10px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    flex-grow: 1 !important; 
    min-height: auto; 
}

.preview-item:hover {
    background-color: var(--item-hover);
}

.preview-item.active-preview {
    background-color: var(--item-active); 
    border-left: 3px solid var(--active-border);
    padding-left: 7px;
}

/* Kontener flex dla treści i miniatury */
.preview-link {
    display: flex !important;
    /* Tekst ma zaczynać się od góry */
    align-items: flex-start !important; 
    justify-content: space-between; 
    width: 100%;
    height: 100% !important; 
    text-decoration: none;
    color: inherit;
    gap: 10px; 
}

.preview-content {
    flex-grow: 1;
    display: flex; 
    flex-direction: column; 
    margin-right: 10px;
    min-width: 0; 
}

.preview-category {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--category);
    margin-bottom: 2px;
}

.preview-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--item-title);
}

/* KLUCZOWA POPRAWKA: Wyśrodkowanie pionowe miniatury */
.preview-thumbnail {
    flex-shrink: 0; 
    width: 80px;
    height: 80px;
    object-fit: cover;
    /* WŁAŚCIWOŚĆ CENTRUJĄCA W PIONIE (w kontekście .preview-link) */
    margin: auto 0;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    .slideshow-grid {
        grid-template-columns: 1fr; 
        height: auto !important; 
    }
    
    .main-slide-image {
        height: 250px;
    }

    .preview-column-area {
        height: auto !important;
        flex-direction: row; 
        overflow-x: scroll;
        padding: 5px 0;
    }
    
    .preview-item {
        flex-grow: 0;
        flex-shrink: 0;
        width: 180px;
        margin-right: 10px;
    }
}