/* YouTube Gallery Custom Styles - Carmalite OCD Fathers */

:root {
    --ayg-accent: #dfb162;
    --ayg-bg: #ffffff;
    --ayg-text: #787878;
    --ayg-heading: #242424;
    --ayg-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
    --ayg-font-serif: 'Rufina', serif;
    --ayg-font-sans: 'Open Sans', sans-serif;
}

.automatic-youtube-gallery.ayg {
    padding: 20px 0 40px;
}

/* Player Styling */
.ayg-player {
    /*background: #0f0f0f;*/
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: var(--ayg-shadow);
}

.ayg-player-container {
    border: 2px solid var(--ayg-accent);
    border-radius: 4px;
    overflow: hidden;
}

.ayg-player-caption {
    padding: 25px 0 10px;
    color: #ffffff;
}

.ayg-player-title {
    font-family: var(--ayg-font-serif);
    font-size: 28px;
    line-height: 1.3em;
    color: var(--ayg-accent) !important;
    margin-bottom: 15px;
    font-weight: 700;
}

.ayg-player-description {
    font-size: 15px;
    line-height: 1.6em;
    color: #cccccc !important;
    overflow: scroll;
    height: 200px;
    display: none;
}

.ayg-player-description-toggle-btn {
    color: var(--ayg-accent) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    margin-top: 10px;
    display: inline-block;
}

/* Gallery / Thumbnails Grid */
.ayg-videos.ayg-gallery.ayg-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 0 !important;
}

.ayg-video {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    flex: 0 0 100% !important;
}

.ayg-thumbnail {
    position: relative;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    transition: all 0.4s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ayg-thumbnail:hover {
    box-shadow: var(--ayg-shadow);
    transform: translateY(-5px);
    border-color: var(--ayg-accent);
}

.ayg-thumbnail-media {
    position: relative;
    overflow: hidden;
}

.ayg-thumbnail-media img {
    transition: transform 0.6s ease;
    width: 100% !important;
    height: auto !important;
}

.ayg-thumbnail:hover .ayg-thumbnail-media img {
    transform: scale(1.05);
}

/* Play Icon Overlay */
.ayg-thumbnail-icon-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

.ayg-thumbnail:hover .ayg-thumbnail-icon-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ayg-thumbnail-icon-play path {
    fill: var(--ayg-accent) !important;
}

/* Caption Styling */
.ayg-thumbnail-caption {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ayg-thumbnail-title {
    font-family: var(--ayg-font-serif);
    font-size: 17px;
    line-height: 1.4em;
    color: var(--ayg-heading);
    font-weight: 700;
    margin-bottom: 10px;
    transition: color 0.3s ease;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ayg-thumbnail:hover .ayg-thumbnail-title {
    color: var(--ayg-accent);
}

.ayg-thumbnail-excerpt {
    font-size: 13px;
    color: var(--ayg-text);
    line-height: 1.5em;
}

/* Active State */
.ayg-video.ayg-active .ayg-thumbnail {
    border-color: var(--ayg-accent);
    background: #fff9f0;
}

.ayg-thumbnail-now-playing {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ayg-accent);
    color: #242424;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
    padding: 4px 0;
    letter-spacing: 1px;
    display: block !important;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .ayg-videos.ayg-gallery.ayg-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ayg-player-title {
        font-size: 24px;
    }
}

@media (max-width: 575px) {
    .ayg-videos.ayg-gallery.ayg-row {
        grid-template-columns: repeat(1, 1fr);
    }

    .ayg-player {
        padding: 10px;
    }

    .ayg-player-title {
        font-size: 20px;
    }
}