/* ============================================
   DIGITAL MASS — INSIGHTS PAGE
   ============================================ */

/* --- Duotone Image Treatment (grayscale + teal overlay) --- */
/* Applied to any container with .dm-green-overlay, plus all card image containers */
.dm-green-overlay,
.dm-insight-card__image,
.dm-work-card__image,
.dm-featured-card__image,
.dm-post__feature-image {
    position: relative;
    overflow: hidden;
}

.dm-green-overlay::after,
.dm-insight-card__image::after,
.dm-work-card__image::after,
.dm-featured-card__image::after,
.dm-post__feature-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(var(--dm-teal-rgb), 0.55) 0%,
        rgba(var(--dm-teal-rgb), 0.35) 40%,
        rgba(10, 25, 30, 0.75) 100%
    );
    mix-blend-mode: multiply;
    z-index: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.dm-green-overlay img,
.dm-insight-card__image img,
.dm-work-card__image img,
.dm-featured-card__image img,
.dm-post__feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.15) brightness(0.95);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

/* Hover: soften the effect to reveal a hint of color */
a:hover .dm-green-overlay::after,
a:hover .dm-insight-card__image::after,
a:hover .dm-work-card__image::after,
a:hover .dm-featured-card__image::after,
.dm-post__feature-image:hover::after {
    opacity: 0.4;
}

a:hover .dm-green-overlay img,
a:hover .dm-insight-card__image img,
a:hover .dm-work-card__image img,
a:hover .dm-featured-card__image img,
.dm-post__feature-image:hover img {
    transform: scale(1.05);
    filter: grayscale(40%) contrast(1.05) brightness(1);
}

/* --- Image Placeholder (for posts without featured images) --- */
.dm-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 180px;
    background: linear-gradient(145deg, rgba(var(--dm-teal-rgb), 0.15), var(--bg-tertiary) 40%, rgba(var(--dm-teal-rgb), 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.dm-image-placeholder__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--dm-teal-rgb), 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--dm-teal-rgb), 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black, transparent);
}

.dm-image-placeholder__title {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: rgba(var(--dm-teal-rgb), 0.35);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding: var(--space-md);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Insights Hero --- */
.dm-insights-hero {
    position: relative;
    padding: calc(var(--space-3xl) + 100px) 0 var(--space-2xl);
    overflow: hidden;
}

.dm-insights-hero__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.dm-insights-hero .dm-page__title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin: var(--space-md) 0;
}

.dm-insights-hero .dm-page__excerpt {
    max-width: 600px;
    color: var(--text-muted);
    font-size: var(--text-lg);
    line-height: 1.6;
}

/* --- Hero Featured Card (next to hero text) --- */
.dm-hero-featured {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.dm-hero-featured:hover {
    border-color: rgba(var(--dm-teal-rgb), 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dm-hero-featured__image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.dm-hero-featured__body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.dm-hero-featured__meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-hero-featured__meta span:not(:last-child)::after {
    content: '\00b7';
    margin-left: var(--space-sm);
}

.dm-hero-featured__title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin: var(--space-2xs) 0;
}

.dm-hero-featured__excerpt {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .dm-insights-hero__layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

/* --- Featured Card (legacy, kept for other pages) --- */
.dm-insights-featured {
    padding: 0 0 var(--space-xl);
}

.dm-featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.dm-featured-card:hover {
    border-color: rgba(var(--dm-teal-rgb), 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dm-featured-card__image {
    min-height: 400px;
}

.dm-featured-card__image img,
.dm-featured-card__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dm-featured-card__placeholder {
    background: linear-gradient(135deg, rgba(var(--dm-teal-rgb), 0.15), var(--bg-tertiary));
}

/* Featured card without image — single column with accent */
.dm-featured-card--no-image {
    grid-template-columns: 1fr;
    border-top: 3px solid var(--dm-teal);
}

.dm-featured-card--no-image .dm-featured-card__body {
    padding: var(--space-2xl);
}

.dm-featured-card__body {
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-sm);
}

.dm-tag--featured {
    background: var(--dm-teal);
    color: var(--bg-primary);
    padding: var(--space-2xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.dm-featured-card__meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.dm-featured-card__meta span:not(:last-child)::after {
    content: '\00b7';
    margin-left: var(--space-sm);
}

.dm-featured-card__title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin: var(--space-xs) 0;
}

.dm-featured-card__excerpt {
    color: var(--text-muted);
    font-size: var(--text-md);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-featured-card__author {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

.dm-featured-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Filter Bar --- */
.dm-insights-filters {
    padding: var(--space-md) 0;
    position: sticky;
    top: 64px;
    z-index: 10;
    background: rgba(6, 13, 19, 0.85);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border-color);
}

.dm-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dm-filter-bar__pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 4px 0;
    mask-image: linear-gradient(to right, transparent 0, black 0, black calc(100% - 32px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 0, black calc(100% - 32px), transparent 100%);
}

.dm-filter-bar__pills::-webkit-scrollbar {
    display: none;
}

.dm-filter-pill {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    border: 1px solid rgba(var(--dm-teal-rgb), 0.12);
    background: rgba(var(--dm-teal-rgb), 0.04);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.dm-filter-pill:hover {
    color: var(--text-primary);
    background: rgba(var(--dm-teal-rgb), 0.1);
    border-color: rgba(var(--dm-teal-rgb), 0.3);
    transform: translateY(-1px);
}

.dm-filter-pill--active {
    background: var(--dm-teal);
    color: var(--bg-primary);
    border-color: var(--dm-teal);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(var(--dm-teal-rgb), 0.3), 0 2px 8px rgba(var(--dm-teal-rgb), 0.15);
}

.dm-filter-pill--active:hover {
    background: var(--dm-teal-light);
    border-color: var(--dm-teal-light);
    transform: none;
}

.dm-filter-bar__search {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    border: 1px solid rgba(var(--dm-teal-rgb), 0.12);
    border-radius: var(--radius-full);
    background: rgba(var(--dm-teal-rgb), 0.04);
    min-width: 200px;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.dm-filter-bar__search:focus-within {
    border-color: var(--dm-teal);
    background: rgba(var(--dm-teal-rgb), 0.08);
    box-shadow: 0 0 0 3px rgba(var(--dm-teal-rgb), 0.1);
}

.dm-filter-bar__input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    width: 100%;
}

.dm-filter-bar__input::placeholder {
    color: var(--text-muted);
}

/* --- Insights Grid --- */
.dm-insights-grid-section {
    padding-top: var(--space-xl);
}

.dm-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* Enhanced insight cards for the listing */
.dm-insight-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.dm-insight-card:hover {
    border-color: rgba(var(--dm-teal-rgb), 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.dm-insight-card__image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

/* Insight card without image — teal accent bar on top */
.dm-insight-card--no-image::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--dm-teal), rgba(var(--dm-teal-rgb), 0.2));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dm-insight-card--no-image .dm-insight-card__body {
    padding: var(--space-lg) var(--space-md) var(--space-md);
}

.dm-insight-card__body {
    padding: var(--space-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.dm-insight-card__meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-insight-card__tag {
    color: var(--dm-teal);
    font-weight: 600;
}

.dm-insight-card__title {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: 1.3;
    margin: var(--space-2xs) 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-insight-card__excerpt {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dm-insight-card__author {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: auto;
    padding-top: var(--space-sm);
}

.dm-insight-card__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* --- Insights Empty --- */
.dm-insights-empty {
    text-align: center;
    padding: var(--space-3xl) 0;
    color: var(--text-muted);
}

.dm-insights-empty h3 {
    margin: var(--space-md) 0 var(--space-xs);
    color: var(--text-primary);
}

/* --- Newsletter CTA --- */
.dm-newsletter-cta__inner {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.dm-newsletter-cta__title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.dm-newsletter-cta__text {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto var(--space-lg);
}

.dm-newsletter-cta__form {
    display: flex;
    gap: var(--space-sm);
    max-width: 460px;
    margin: 0 auto;
}

.dm-newsletter-cta__input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-md);
    outline: none;
}

.dm-newsletter-cta__input:focus {
    border-color: var(--dm-teal);
}

/* --- Pagination override --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) 0 0;
}

.pagination a,
.pagination span {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--dm-teal);
    color: var(--dm-teal);
}

.page-number {
    color: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .dm-insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dm-featured-card {
        grid-template-columns: 1fr;
    }

    .dm-featured-card__image {
        min-height: 250px;
    }
}

@media (max-width: 640px) {
    .dm-insights-grid {
        grid-template-columns: 1fr;
    }

    .dm-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .dm-filter-bar__search {
        min-width: unset;
    }

    .dm-newsletter-cta__form {
        flex-direction: column;
    }

    .dm-featured-card__body {
        padding: var(--space-md);
    }
}

/* --- Infinite Scroll --- */
.dm-infinite-sentinel {
    text-align: center;
    padding: var(--space-xl) 0;
}

.dm-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dm-spinner__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dm-teal);
    animation: dm-bounce 1.4s ease-in-out infinite both;
}

.dm-spinner__dot:nth-child(1) { animation-delay: -0.32s; }
.dm-spinner__dot:nth-child(2) { animation-delay: -0.16s; }
.dm-spinner__dot:nth-child(3) { animation-delay: 0s; }

@keyframes dm-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
