:root {
    --yt-main: #1C5807;
    --yt-dark: #1e3c24;
	--yt-second: #BE8A45;
    --yt-bg-light: #f4f4f4;
    --yt-text-dark: #223d28;
    --yt-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --yt-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.yt-gallery-pure-grid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    font-family: Roboto, Helvetica, Arial, sans-serif;
}

/* Сітка мініатюр */
.yt-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Картка відео */
.yt-item {
    cursor: pointer;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--yt-shadow);
    transition: var(--yt-transition);
    display: flex;
    flex-direction: column;
}

.yt-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

/* Контейнер зображення */
.yt-thumb-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.yt-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--yt-transition);
}

.yt-item:hover .yt-thumb-wrapper img {
    transform: scale(1.05);
}

/* Оверлей при наведенні */
.yt-play-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(164, 165, 164, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-item:hover .yt-play-overlay {
    opacity: 1;
}

/* Іконка Play */
.yt-play-overlay::after {
    content: '';
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: block;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.yt-play-overlay::before {
    content: '';
    position: absolute;
    z-index: 2;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent var(--yt-second);
    margin-left: 4px;
}

/* Заголовок відео */
.yt-title {
    margin: 12px 15px;
    font-size: inherit;
	font-family: 'Merriweather Sans', sans-serif;
    /* font-weight: 600; */
    color: var(--yt-text-dark);
    /* line-height: 1.4; */
    background: #fff;
    
    /* Фіксуємо висоту для 3-х рядків тексту, щоб картки були однаковими */
    min-height: 60px; 
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Показувати максимум 3 рядки */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    
    flex-grow: 1; /* Допомагає картці тримати форму */
}

/* Додатково: переконаємося, що сама картка тягнеться рівномірно */
.yt-item {
    display: flex;
    flex-direction: column;
    height: 100%; /* Усі картки в ряду будуть однієї висоти */
}

/* Кнопка "Завантажити ще" */
.yt-load-more-container {
    text-align: center;
    margin-top: 50px;
}

.yt-load-more-btn {
    background: var(--yt-main);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 18px;
    /* font-weight: bold; */
    /* text-transform: uppercase; */
    /* letter-spacing: 1px; */
    transition: var(--yt-transition);
    box-shadow: 0 4px 10px rgba(10, 47, 27, 0.3);
}

.yt-load-more-btn:hover {
    background: var(--yt-second);
    /* box-shadow: 0 6px 20px rgba(0, 174, 239, 0.4); */
}

/* МОДАЛЬНЕ ВІКНО */
.yt-modal {
    position: fixed;
    top: 0; 
	left: 0; 
	width: 100%; 
	height: 100%;
    z-index: 99999;
    display: none; /*flex;*/
    align-items: center;
    justify-content: center;
}

.yt-modal-overlay {
    position: absolute;
	top: 0; 
	left: 0; 
    width: 100%; 
	height: 100%;
    background: rgba(71, 87, 78, 0.528); /* Глибокий темний колір */
    backdrop-filter: blur(5px); /* Ефект розмиття фону */
}

.yt-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    /* aspect-ratio: 16/9; */
    background: #000;
    z-index: 100000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

/* Контейнер для збереження пропорцій 16:9 */
.yt-modal-video-container {
    position: relative;
    padding-bottom: 56.25%; /* Співвідношення 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.yt-modal-video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
    width: 100% !important; 
    height: 100% !important;
}

.yt-modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 45px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s;
	z-index: 1000001;
}

.yt-modal-close:hover {
    transform: scale(1.2) rotate(90deg);
}
.yt-gallery-info {
    font-size: inherit;
    /* font-weight: 700; */
    color: var(--yt-text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--yt-bg-light);
    /* text-transform: uppercase; */
    /* letter-spacing: 0.5px; */
}

.yt-total-count {
    color: var(--yt-main); /* Виділяємо число вашим фірмовим блакитним */
}

/* Мобільна адаптація */
@media (max-width: 768px) {
    .yt-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    .yt-modal-close {
        right: 10px;
        top: -60px;
    }
}
@media (max-width: 600px) {
    .yt-modal-content {
        width: 95%;
    }
    .yt-modal-close {
        top: -40px;
        right: 5px;
    }
}