/**
 * WPBakery RSS Parser Frontend Styles
 */

.enym-rss-parser-wrapper {
    width: 100%;
    margin-bottom: 30px;
}

.enym-rss-parser-grid {
    display: grid;
    width: 100%;
    box-sizing: border-box;
}

.enym-rss-parser-item {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.enym-rss-parser-item>.wpex-card,
.enym-rss-parser-item>.enym-rss-card-link {
    width: 100%;
    height: 100%;
}

.enym-rss-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.enym-rss-card-link:hover {
    text-decoration: none;
    color: inherit;
    opacity: 0.95;
}

.enym-rss-card-link:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 3px;
    border-radius: 4px;
}

.enym-rss-card-link>.wpex-card {
    width: 100%;
    height: 100%;
}

.enym-rss-parser-notice {
    padding: 15px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: #64748b;
    line-height: 1.5;
    text-align: center;
}

/* =========================================================
   RSS Field Specific Styles
   ========================================================= */

.enym-rss-field-wrap {
    box-sizing: border-box;
    max-width: 100%;
}

/* Titles */
.enym-rss-title {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.3;
}

.enym-rss-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.enym-rss-title a:hover {
    color: #0073aa;
}

/* Image Field with Aspect Ratio */
.enym-rss-image-wrap,
.enym-rss-image-link {
    display: block;
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
}

.enym-rss-image {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.enym-rss-image-link:hover .enym-rss-image {
    transform: scale(1.03);
}

/* Links & Buttons */
.enym-rss-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

button.enym-rss-modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    padding: 0;
}

/* Modal Overlay & Dialog */
.enym-rss-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.enym-rss-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.enym-rss-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.enym-rss-modal-card {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: enymRssModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes enymRssModalIn {
    from {
        transform: scale(0.95) translateY(12px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.enym-rss-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    padding-right: 60px;
}

.enym-rss-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
}

.enym-rss-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    z-index: 5;
}

.enym-rss-modal-close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.enym-rss-modal-body {
    padding: 28px;
    overflow-y: auto;
    line-height: 1.75;
    box-sizing: border-box;
}

.enym-rss-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 15px 0;
}

.enym-rss-modal-body iframe,
.enym-rss-modal-body video {
    max-width: 100%;
}

/* Category & Meta */
.enym-rss-category {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 8px;
}

.enym-rss-date,
.enym-rss-creator {
    display: inline-block;
    margin-bottom: 8px;
}

/* Description / Excerpt */
.enym-rss-description {
    /*margin-bottom: 16px;*/
}

.enym-rss-description p:last-child {
    margin-bottom: 0;
}

/* Responsive columns fallback */
@media (max-width: 959px) {

    .enym-rss-parser-grid.enym-rss-cols-4,
    .enym-rss-parser-grid.enym-rss-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .enym-rss-parser-grid {
        grid-template-columns: 1fr !important;
    }

    .enym-rss-modal-card {
        max-height: 92vh;
    }

    .enym-rss-modal-body {
        padding: 18px;
    }
}