/*
 * Frontend Styles: Related Posts AI by VPNDeals
 * Purpose: Styling for the related posts section (Card, List, Carousel, Hero, Minimal, Magazine).
 */

.vdrpai-related-posts {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.vdrpai-related-posts h2 {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--vdrpai-accent, #3498db); /* Placeholder color */
    padding-bottom: 5px;
    display: inline-block;
}

/* --- Layout: Card (Default) --- */
.vdrpai-layout-card .vdrpai-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.vdrpai-related-card {
    background: #ffffff; /* Light theme base */
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.vdrpai-related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.vdrpai-card-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: block;
}
/* Removed vdrpai-img-responsive CSS (as img is no longer used for display) */

.vdrpai-card-content {
    padding: 15px;
}
.vdrpai-card-title {
    font-size: 1.1em;
    margin: 0 0 5px 0;
    color: #333;
    line-height: 1.4;
}
.vdrpai-card-excerpt {
    font-size: 0.9em;
    color: #777;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Layout: List --- */
.vdrpai-layout-list .vdrpai-items-container {
    display: block;
    border: 1px solid #eee;
    padding: 10px 20px;
    border-radius: 6px;
}
.vdrpai-related-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #f0f0f0;
}
.vdrpai-related-list:last-child a {
    border-bottom: none;
}
.vdrpai-list-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0;
    color: #222;
}
.vdrpai-list-date {
    font-size: 0.8em;
    color: #aaa;
}

/* --- Layout: Carousel (Minimal setup, relies on JS) --- */
.vdrpai-layout-carousel .vdrpai-items-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 15px;
}
.vdrpai-layout-carousel .vdrpai-related-card {
    flex: 0 0 280px; /* Fixed width for carousel items */
    margin-right: 15px;
    scroll-snap-align: start;
}

/* ================================================================= */
/* --- NEW LAYOUTS --- */
/* ================================================================= */

/* --- Layout: Hero Spotlight --- */
.vdrpai-layout-hero-spotlight .vdrpai-items-container {
    display: block; /* Ensure it takes full width */
}
.vdrpai-related-hero a {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    text-decoration: none;
}
.vdrpai-related-hero a:hover {
    transform: scale(0.99);
}
.vdrpai-hero-inner {
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center;
}
.vdrpai-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    color: #fff;
}
.vdrpai-hero-title {
    font-size: 2em;
    margin: 0 0 10px 0;
    line-height: 1.2;
    color: #fff;
}
.vdrpai-hero-excerpt {
    font-size: 1em;
    color: #ccc;
    margin: 0 0 15px 0;
}
.vdrpai-hero-button {
    display: inline-block;
    background: #3498db;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 700;
}

/* --- Layout: Minimal Grid (Text-only) --- */
.vdrpai-layout-minimal-grid .vdrpai-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.vdrpai-related-minimal a {
    display: block;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    transition: background-color 0.2s, border-color 0.2s;
    text-decoration: none;
    height: 100%;
}
.vdrpai-related-minimal a:hover {
    background-color: #f9f9f9;
    border-color: #3498db;
}
.vdrpai-minimal-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #222;
}
.vdrpai-minimal-category {
    font-size: 0.8em;
    font-weight: 700;
    color: #3498db;
    text-transform: uppercase;
}

/* --- Layout: Magazine Split (Horizontal Row) --- */
.vdrpai-layout-magazine-split .vdrpai-items-container {
    display: block;
}
.vdrpai-related-magazine {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.vdrpai-related-magazine a {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.vdrpai-related-magazine:last-child {
    border-bottom: none;
}
.vdrpai-related-magazine a:hover {
    background-color: #fafafa;
    padding-left: 10px;
}
.vdrpai-magazine-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
}
.vdrpai-magazine-content {
    flex-grow: 1;
}
.vdrpai-magazine-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 3px 0;
    color: #222;
}
.vdrpai-magazine-date {
    font-size: 0.85em;
    color: #777;
}

/* ================================================================= */
/* --- GENERAL & DARK MODE (updated) --- */
/* ================================================================= */

.vdrpai-credit {
    margin-top: 20px;
    font-size: 0.8em;
    color: #bbb;
    text-align: right;
}

/* Dark mode basic support */
@media (prefers-color-scheme: dark) {
    .vdrpai-related-posts h2 {
        color: #fff;
        border-bottom-color: var(--vdrpai-accent, #5d9cec);
    }
    /* Card (existing) */
    .vdrpai-related-card {
        background: #2c2c2c;
        border-color: #444;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    .vdrpai-card-title {
        color: #f1f1f1;
    }
    .vdrpai-card-excerpt {
        color: #bbb;
    }
    /* List (existing) */
    .vdrpai-layout-list .vdrpai-items-container {
        background: #2c2c2c;
        border-color: #444;
    }
    .vdrpai-related-list a {
        border-bottom-color: #444;
    }
    .vdrpai-list-title {
        color: #f1f1f1;
    }
    .vdrpai-list-date {
        color: #888;
    }

    /* Hero Spotlight (new) */
    .vdrpai-related-hero a:hover {
        transform: scale(1.01);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }
    
    /* Minimal Grid (new) */
    .vdrpai-related-minimal a {
        background: #2c2c2c;
        border-color: #444;
    }
    .vdrpai-related-minimal a:hover {
        background-color: #3a3a3a;
        border-color: #5d9cec;
    }
    .vdrpai-minimal-title {
        color: #f1f1f1;
    }
    .vdrpai-minimal-category {
        color: #5d9cec;
    }
    
    /* Magazine Split (new) */
    .vdrpai-related-magazine {
        border-bottom-color: #444;
    }
    .vdrpai-related-magazine a:hover {
        background-color: #3a3a3a;
        padding-left: 10px;
    }
    .vdrpai-magazine-title {
        color: #f1f1f1;
    }
    .vdrpai-magazine-date {
        color: #bbb;
    }
}