/* Embed Posts Grid
 *
 * Every selector is scoped to the plugin's own classes so nothing here can
 * restyle the host theme. Colors and spacing read prefixed custom properties
 * with built-in defaults; override them on .embed-posts-container, e.g.
 * .embed-posts-container { --rpe-card-background: #f7f7f7; }
 */

/* Grid Styles */
.embed-grid {
    padding: 2em;
    width: 100%;
    display: inline-grid;
    margin: 0;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
    .embed-grid {
        width: 100%;
        padding: 1em;
        margin: 1em 0;
    }
}

/* Posts Grid Layout */
.embed-posts-wrapper {
    display: grid;
    /* Column configuration is set dynamically via inline CSS */
    grid-gap: var(--rpe-grid-gap, 1em);
}

/* Individual Post Styles */
.embed-posts {
    padding: 1em;
    background: var(--rpe-card-background, #fff);
    box-shadow: var(--rpe-card-shadow, 0 5px 10px rgba(0, 0, 0, 0.1), 0 20px 20px rgba(0, 0, 0, 0.05));
    border-radius: 0.5em;
    border: solid 1px var(--rpe-card-border-color, rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.embed-posts:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 25px 25px rgba(0, 0, 0, 0.08);
}

/* Typography */
.embed-posts h3 {
    font-size: 1.4em;
    margin-bottom: 0.5em;
    color: #333;
    line-height: 1.3;
}

.embed-posts small {
    display: block;
    color: #666;
    margin-bottom: 0.5em;
    font-size: 0.9em;
}

/* Image Styles */
.embed-posts img {
    width: 100%;
    height: auto;
    border-radius: 0.3em;
    margin-bottom: 0.5em;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.embed-posts img:hover {
    opacity: 0.9;
}

/* Read More Link */
.embed-posts .read-more {
    display: inline-block;
    color: #0073a8;
    text-decoration: none;
    margin-top: 0.5em;
    font-weight: bold;
    transition: color 0.3s ease;
}

.embed-posts .read-more:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Load More button */
.embed-posts-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.5em;
}

.embed-posts-load-more {
    display: inline-block;
    padding: 0.7em 1.8em;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background: #0073a8;
    border: none;
    border-radius: 0.4em;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.embed-posts-load-more:hover {
    background: #005a87;
}

.embed-posts-load-more:disabled,
.embed-posts-load-more.is-loading {
    opacity: 0.7;
    cursor: default;
}

/* Alternative Layout: Inline Image Style */
.embed-posts-inline {
    width: 100%;
    margin: 2em 0 0;
}

.embed-posts-inline img {
    width: 35%;
    float: left;
    margin-right: 2em;
}

@media only screen and (max-width: 768px) {
    .embed-posts-inline img {
        width: 100%;
        float: none;
        margin-right: 0;
    }
}

/* Demo feed notice (shown to administrators only) */
.embed-posts-demo-notice {
    margin: 0 0 1em;
    padding: 0.75em 1em;
    border-left: 4px solid #dba617;
    background: #fcf9e8;
    color: #1d2327;
    font-size: 0.95em;
    line-height: 1.5;
}

.embed-posts-demo-notice p {
    margin: 0 0 0.4em;
}

.embed-posts-demo-notice p:last-child {
    margin-bottom: 0;
}

.embed-posts-demo-notice a {
    color: #2271b1;
    text-decoration: underline;
}

.embed-posts-demo-notice .embed-posts-demo-notice-meta {
    font-size: 0.9em;
    opacity: 0.75;
}
