/* YouTube Shorts & News Widget Styles
   Ported from hatch/sm plugin (Fase 9 of migration).
*/

/* Popup Styles */
.hatch-yt-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.hatch-yt-popup-content {
    position: relative;
    width: 80vw;
    aspect-ratio: 9 / 16;
    max-width: 400px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.hatch-yt-popup-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.hatch-yt-close-popup {
    position: absolute;
    top: -30px;
    right: 0px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
    background: none;
    border: none;
    padding: 0;
}

.hatch-yt-close-popup:hover {
    color: #FF5100;
}

@media (max-width: 768px) {
    .hatch-yt-popup-content {
        width: 95%;
        padding-bottom: 56.25%;
    }
    .hatch-yt-close-popup {
        top: -25px;
        font-size: 25px;
    }
}

/* Desktop List Styles */
.youtube-shorts-list-desktop {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px 10px;
    justify-items: center;
}

.youtube-short-desktop {
    max-width: 200px;
    min-height: 430px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: none;
}

.youtube-short-desktop:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.youtube-short-desktop .image-container {
    width: 100%;
    height: 355px;
    overflow: hidden;
    position: relative;
    background-color: #e0e0e0;
}

.youtube-short-desktop .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.youtube-short-desktop:hover .image-container img {
    transform: scale(1.05);
}

.youtube-short-desktop .image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.youtube-short-desktop .image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.youtube-short-desktop:hover .image-container::before,
.youtube-short-desktop:hover .image-container::after {
    opacity: 1;
}

.youtube-short-desktop .title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
    padding: 0px 10px 10px 10px;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.3em;
    height: 3.9em;
    text-overflow: ellipsis;
}

/* Mobile List Styles */
.youtube-shorts-list-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.youtube-short-mobile {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.youtube-short-mobile .image-container {
    aspect-ratio: 2 / 3;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #e0e0e0;
}

.youtube-short-mobile .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.youtube-short-mobile .play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0.9;
}

.youtube-short-mobile .play-button-overlay:before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 12px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 3px;
}

.youtube-short-mobile .title {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 8px 5px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    height: 7.8em;
    margin-top: auto;
}

/* News Widget Styles */
.noticias-semana-widget {
    display: flex;
    justify-content: center;
}

.noticias-semana-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 210px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.noticias-semana-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.noticias-semana-item .image-container {
    width: 100%;
    aspect-ratio: 9 / 16;
    position: relative;
    overflow: hidden;
    background-color: #e0e0e0;
}

.noticias-semana-item .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.noticias-semana-item:hover .image-container img {
    transform: scale(1.05);
}

.noticias-semana-item .image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 25px solid white;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.noticias-semana-item .image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.noticias-semana-item:hover .image-container::before,
.noticias-semana-item:hover .image-container::after {
    opacity: 1;
}

.noticias-semana-item .title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
    padding: 10px 15px;
    text-align: center;
    white-space: normal;
    overflow: visible;
    line-height: 1.4em;
}

@media (max-width: 768px) {
    .noticias-semana-item {
        width: 80% !important;
    }
}
