/* Grid Container Library Elements */
.my-posts, .resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
    align-items: start;
}

/* Resource Card Base */
.resource-card, .news-card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-rc);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.news-card-wrapper{
	display: block;      
    text-decoration: none; 
    color: inherit;      
    height: 100%;
}
.resource-card:hover, .news-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }

/* --- Media Preview Base (16:9) --- */
.resource-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Default */
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* The "Floating" gap */
    box-sizing: border-box;
}

/* --- Specific Ratios --- */

/* Books (A4 Ratio) */
.resource-preview.is-book {
    aspect-ratio: 1 / 1.41; 
}

/* Vertical Videos (Social/Phone Ratio) */
.resource-preview.is-vertical {
    aspect-ratio: 9 / 16; 
}

/* --- Inner Media Styling --- */
/* This handles the rounding and ensures the "floating" gap is respected */
.resource-preview img, 
.resource-preview video, 
.resource-preview iframe,
.resource-preview .video-container {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    /* Remove position absolute to allow padding to work */
    position: relative; 
}

/* Fix for YouTube iframes to ensure they fill the rounded box */
.resource-preview iframe {
    position: absolute; /* Iframes usually need absolute to fill containers */
    width: calc(100% - 20px); /* Account for the 10px padding on both sides */
    height: calc(100% - 20px);
}

.news-preview{
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-preview img {
    width: 100%; height: 100%; object-fit: cover; 
}


/* Special Case: Apps (Centered Square) */
.resource-app .resource-preview { background: var(--white); }
.app-icon {
    width: 120px !important; height: 120px !important;
    border-radius: 22%; position: static !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.app-store-wrapper { display: flex; width: 100%; height: 100%; justify-content: center; align-items: center; }

/* Video Play Overlay */
.video-container { position: relative; width: 100%; height: 100%; }
.play-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0, 64, 133, 0.7); color: white;
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; pointer-events: none;
}

/* News Card */
.news-card { padding: 20px;}
.resource-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.resource-content h3 { margin-bottom: 15px; font-size: 1.1em; line-height: 1.3; }
.news-card h3 {}