/* ============================================
   Blog Cards – palette‑driven shapes & colors
   ============================================ */

/* Base card */
.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* ---------- Article card ---------- */
.card--article {
    background: var(--color-primary-100);
    border-left: 4px solid var(--bronze);
}

/* ---------- Video card ---------- */
.card--video {
    background: var(--color-primary-300);
    border-top: 4px solid var(--bronze);
}

/* ---------- Image wrappers ---------- */
.featured-image,
.card-image {
    position: relative;
    margin: 0;
    overflow: hidden;
}

.featured-image img,
.card-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: white;
    opacity: 0.85;
    pointer-events: none;
}

/* Body */
.featured-body,
.card-body {
    padding: var(--padding-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.featured-title,
.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.featured-title a,
.card-title a {
    text-decoration: none;
    color: var(--color-text-primary);
}

.featured-title a:hover,
.card-title a:hover {
    color: var(--color-link);
}

.featured-excerpt,
.card-excerpt {
    font-size: var(--font-size-md);
    color: var(--color-text-primary);
    line-height: var(--line-height-md);
    flex: 1;
}

.featured-date,
.card-date {
    font-size: var(--font-size-sm);
    color: var(--color-primary-700);
    font-weight: var(--font-weight-medium);
}

/* Badge */
.badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: var(--gap-xs) var(--gap-sm);
    border-radius: var(--radius-pill);
    color: white;
    background: var(--color-primary-500);
}

.badge--article { background: var(--color-primary-600); }
.badge--video   { background: var(--color-success); }
.badge--tweet   { background: var(--color-info); }
.badge--gold {
    background: var(--gold);
    color: #1e1e1e;
    font-weight: var(--font-weight-bold);
}

/* ============================================
   Featured Grid – centre large card layout
   ============================================ */

/* Make the centre card span two rows */
.featured-card--large {
    grid-column: 2;                /* second column */
    grid-row: 1 / 3;               /* from row 1 to row 3 (span 2 rows) */
}

/* Ensure the large card’s image is taller */
.featured-card--large .featured-image img {
    aspect-ratio: 4 / 3;
}

/* Adjust the large card’s body to use more space */
.featured-card--large .featured-body {
    padding: var(--padding-lg);
}

.featured-card--large .featured-title {
    font-size: var(--font-size-2xl);
}

.featured-card--large .featured-excerpt {
    font-size: var(--font-size-md);
    line-height: var(--line-height-lg);
}

/* On small screens, stack everything */
@media (max-width: 767.98px) {
    .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .featured-card--large {
        grid-column: auto;
        grid-row: auto;
    }
}

/* ============================================
   Video Wide Card – clickable rectangle, text overlay
   ============================================ */

.card--video-wide {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    background: var(--color-primary-300);   /* fallback if image fails */
    border-top: none;                       /* remove the previous top accent */
}

.card--video-wide:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.video-card-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Image fills the card, keeps 16:9 */
.video-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    display: block;
}

/* Centred play button (can be large) */
.card--video-wide .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: white;
    opacity: 0.9;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.card--video-wide:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Gradient overlay at bottom for text readability */
.video-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--padding-md);
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.video-card-overlay .badge {
    margin-bottom: var(--margin-xs);
}

.video-card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: white;
    margin-bottom: var(--margin-xs);
}

.video-card-excerpt {
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.9);
    line-height: var(--line-height-md);
    margin-bottom: var(--margin-sm);
}

.video-card-date {
    font-size: var(--font-size-xs);
    color: rgba(255,255,255,0.7);
    font-weight: var(--font-weight-medium);
}

/* ============================================
   Tweet Card – Twitter‑style design
   ============================================ */

.card--tweet {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-primary-100);
    border-radius: var(--radius-md);
    box-shadow: none;
    padding: var(--padding-md);
}

.tweet-header {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-bottom: var(--margin-sm);
}

.tweet-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.tweet-meta {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    line-height: var(--line-height-sm);
}

.tweet-name {
    display: block;
    font-weight: var(--font-weight-bold);
}

.tweet-handle {
    color: var(--color-primary-700);
    font-weight: var(--font-weight-medium);
}

.tweet-embed {
    overflow: hidden;
}