/* ══════════════════════════════════════════════
 * Modern Blog — blog.css
 * Styles for blog archive + [mc_blog_feed] shortcode
 * ══════════════════════════════════════════════ */

/* ── Skeleton shimmer ── */
@keyframes mcb-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.mcb-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: mcb-shimmer 1.5s ease-in-out infinite;
    z-index: 0;
}

.mcb-archive--dark .mcb-skeleton,
.mcb-card--dark .mcb-skeleton,
.mcb-horiz--dark .mcb-skeleton {
    background: linear-gradient(90deg, #1f1f2e 25%, #2a2a3d 50%, #1f1f2e 75%);
    background-size: 200% 100%;
    animation: mcb-shimmer 1.5s ease-in-out infinite;
}

/* Hide skeleton once image loads */
.mcb-loaded .mcb-skeleton { display: none; }
.mcb-loaded img { opacity: 1; }

/* Image starts invisible, fades in */
.mcb-card__image img,
.mcb-horiz__thumb img {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mcb-card__image.mcb-loaded img,
.mcb-horiz__thumb.mcb-loaded img {
    opacity: 1;
}

/* Placeholder (no featured image) hides skeleton */
.mcb-card__placeholder { z-index: 1; position: relative; }

/* ── Archive wrapper ── */
.mcb-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.mcb-archive--dark { background: #0f0f14; color: #e5e7eb; }
.mcb-archive--light { background: transparent; color: #111827; }

/* ── Archive header ── */
.mcb-archive__header { text-align: center; margin-bottom: 40px; }

.mcb-archive__title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: inherit;
}
.mcb-archive--dark .mcb-archive__title { color: #f9fafb; }

.mcb-archive__desc {
    font-size: 15px; color: #6b7280; margin: 0;
    max-width: 520px; margin-left: auto; margin-right: auto;
}

/* ── Feed heading (shortcode) ── */
.mcb-feed__heading {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 20px;
    color: inherit;
}
.mcb-archive--dark .mcb-feed__heading { color: #f3f4f6; }
.mcb-feed__heading--left   { text-align: left; }
.mcb-feed__heading--center { text-align: center; }
.mcb-feed__heading--right  { text-align: right; }

/* ── Grid ── */
.mcb-grid { display: grid; gap: 24px; }
.mcb-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mcb-grid--2 { grid-template-columns: repeat(2, 1fr); }
.mcb-grid--1 { grid-template-columns: 1fr; }
.mcb-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .mcb-grid--3, .mcb-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .mcb-grid--2, .mcb-grid--3, .mcb-grid--4 { grid-template-columns: 1fr; }
    .mcb-archive { padding: 24px 16px 40px; }
    .mcb-archive__title { font-size: 24px; }
}

/* ══════════════════════════════════════════════
 * GRID / LIST — Full card with image
 * ══════════════════════════════════════════════ */
.mcb-card {
    border-radius: var(--mcb-radius, 16px);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.mcb-card--light { background: #ffffff; border: 1px solid #e5e7eb; }
.mcb-card--dark  { background: #1a1a24; border: 1px solid #2a2a3a; }

.mcb-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.mcb-card--dark:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    border-color: #3a3a4a;
}

.mcb-card__link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex; flex-direction: column; height: 100%;
}

/* Image */
.mcb-card__image {
    overflow: hidden;
    border-radius: var(--mcb-radius, 16px) var(--mcb-radius, 16px) 0 0;
    background: #f3f4f6;
    flex-shrink: 0;
    position: relative;
}
.mcb-card--dark .mcb-card__image { background: #13131a; }

.mcb-card__image img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.35s ease, opacity 0.3s ease;
}
.mcb-card:hover .mcb-card__image img { transform: scale(1.04); }

.mcb-card__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #d1d5db;
}
.mcb-card--dark .mcb-card__placeholder { color: #4b5563; }

/* Body */
.mcb-card__body {
    padding: 18px 20px 20px;
    display: flex; flex-direction: column; flex: 1; gap: 6px;
}

/* Category pill (shared across layouts) */
.mcb-card__cat {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: #4338ca;
    background: #eef2ff;
    padding: 3px 10px; border-radius: 20px;
    width: fit-content; line-height: 1.4;
}
.mcb-card--dark .mcb-card__cat,
.mcb-compact--dark .mcb-card__cat,
.mcb-horiz--dark .mcb-card__cat {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.18);
}

/* Title */
.mcb-card__title {
    font-size: 17px; font-weight: 700; line-height: 1.35; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: #111827;
}
.mcb-card--dark .mcb-card__title { color: #f3f4f6; }
.mcb-card:hover .mcb-card__title { color: var(--mcb-accent, #6366f1); }

/* Excerpt */
.mcb-card__excerpt {
    font-size: 13.5px; line-height: 1.6; color: #6b7280; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-card--dark .mcb-card__excerpt { color: #9ca3af; }

/* Meta row (shared) */
.mcb-card__meta {
    display: flex; align-items: center; gap: 12px;
    font-size: 12px; color: #6b7280;
    margin-top: auto; padding-top: 10px; flex-wrap: wrap;
}
.mcb-card--dark .mcb-card__meta,
.mcb-compact--dark .mcb-card__meta,
.mcb-horiz--dark .mcb-card__meta { color: #9ca3af; }

.mcb-card__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.mcb-card__author { display: inline-flex; align-items: center; gap: 6px; }
.mcb-card__avatar { width: 20px; height: 20px; border-radius: 50%; }

.mcb-card__date::before,
.mcb-card__read-time::before { content: '·'; margin-right: 2px; color: #9ca3af; }
.mcb-card__meta > span:first-child::before { display: none; }
.mcb-card__date:first-child::before { display: none; }

/* ══════════════════════════════════════════════
 * COMPACT — No image, text-only card (in a row)
 * ══════════════════════════════════════════════ */
.mcb-compact {
    padding: 18px 20px;
    border-radius: var(--mcb-radius, 12px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}
.mcb-compact--light { background: #fff; border: 1px solid #e5e7eb; }
.mcb-compact--dark  { background: #1a1a24; border: 1px solid #2a2a3a; }
.mcb-compact--light:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.07); }
.mcb-compact--dark:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); border-color: #3a3a4a; }

.mcb-compact__link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex; flex-direction: column; gap: 5px; height: 100%;
}

.mcb-compact__title {
    font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0;
    color: #111827;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-compact--dark .mcb-compact__title { color: #f3f4f6; }
.mcb-compact:hover .mcb-compact__title { color: var(--mcb-accent, #6366f1); }

.mcb-compact__excerpt {
    font-size: 13px; line-height: 1.5; color: #6b7280; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-compact--dark .mcb-compact__excerpt { color: #9ca3af; }

.mcb-compact .mcb-card__meta { padding-top: 6px; margin-top: auto; }
.mcb-compact .mcb-card__cat { font-size: 10px; padding: 2px 8px; margin-bottom: 2px; }

/* ══════════════════════════════════════════════
 * MINI — Small title + date card (in a row)
 * ══════════════════════════════════════════════ */
.mcb-mini {
    padding: 14px 16px;
    border-radius: var(--mcb-radius, 10px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}
.mcb-mini--light { background: #fff; border: 1px solid #e5e7eb; }
.mcb-mini--dark  { background: #1a1a24; border: 1px solid #2a2a3a; }
.mcb-mini--light:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.mcb-mini--dark:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); border-color: #3a3a4a; }

.mcb-mini__link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex; flex-direction: column; gap: 6px; height: 100%;
}

.mcb-mini__title {
    font-size: 14px; font-weight: 600; color: #111827;
    line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-mini--dark .mcb-mini__title { color: #e5e7eb; }
.mcb-mini:hover .mcb-mini__title { color: var(--mcb-accent, #6366f1); }

.mcb-mini__date {
    font-size: 12px; color: #6b7280; margin-top: auto;
}
.mcb-mini--dark .mcb-mini__date { color: #9ca3af; }

/* ══════════════════════════════════════════════
 * HORIZONTAL — Thumbnail + text row
 * ══════════════════════════════════════════════ */
.mcb-horiz {
    border-radius: var(--mcb-radius, 12px);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mcb-horiz--light { background: #fff; border: 1px solid #e5e7eb; }
.mcb-horiz--dark  { background: #1a1a24; border: 1px solid #2a2a3a; }

.mcb-horiz:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.mcb-horiz--dark:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: #3a3a4a;
}

.mcb-horiz__link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex; align-items: stretch; gap: 0;
}

.mcb-horiz__thumb {
    width: 120px; min-height: 100px; flex-shrink: 0;
    overflow: hidden; position: relative;
    background: #f3f4f6;
}
.mcb-horiz--dark .mcb-horiz__thumb { background: #13131a; }

.mcb-horiz__thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.mcb-horiz:hover .mcb-horiz__thumb img { transform: scale(1.05); }

.mcb-horiz__body {
    padding: 14px 18px;
    display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0;
}

.mcb-horiz__title {
    font-size: 15px; font-weight: 600; line-height: 1.35; margin: 0;
    color: #111827;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-horiz--dark .mcb-horiz__title { color: #f3f4f6; }
.mcb-horiz:hover .mcb-horiz__title { color: var(--mcb-accent, #6366f1); }

.mcb-horiz__excerpt {
    font-size: 12.5px; line-height: 1.5; color: #6b7280; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-horiz--dark .mcb-horiz__excerpt { color: #9ca3af; }

.mcb-horiz .mcb-card__meta { padding-top: 4px; font-size: 11px; }
.mcb-horiz .mcb-card__cat { font-size: 10px; padding: 2px 8px; }

@media (max-width: 480px) {
    .mcb-horiz__thumb { width: 90px; min-height: 80px; }
    .mcb-horiz__body { padding: 10px 14px; }
    .mcb-horiz__title { font-size: 14px; }
}

/* ══════════════════════════════════════════════
 * HEADLINE — Bold title-focused card, no image
 * ══════════════════════════════════════════════ */
.mcb-headline {
    padding: 22px 24px;
    border-radius: var(--mcb-radius, 14px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    border-left: 3px solid var(--mcb-accent, #6366f1);
}
.mcb-headline--light { background: #fff; border-top: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.mcb-headline--dark  { background: #1a1a24; border-top: 1px solid #2a2a3a; border-right: 1px solid #2a2a3a; border-bottom: 1px solid #2a2a3a; }
.mcb-headline--light:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.mcb-headline--dark:hover  { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border-color: #3a3a4a; border-left-color: var(--mcb-accent, #6366f1); }

.mcb-headline__link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex; flex-direction: column; gap: 8px; height: 100%;
}

.mcb-headline__title {
    font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0;
    color: #111827;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mcb-headline--dark .mcb-headline__title { color: #f3f4f6; }
.mcb-headline:hover .mcb-headline__title { color: var(--mcb-accent, #6366f1); }

.mcb-headline__date {
    font-size: 12px; color: #6b7280; margin-top: auto;
}
.mcb-headline--dark .mcb-headline__date { color: #9ca3af; }

.mcb-headline .mcb-card__cat { font-size: 10px; padding: 2px 8px; }

/* ══════════════════════════════════════════════
 * Pagination
 * ══════════════════════════════════════════════ */
.mcb-pagination {
    margin-top: 40px;
    display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
}

.mcb-pagination .page-numbers,
.mcb-pagination a,
.mcb-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    text-decoration: none;
    border: 1px solid #e5e7eb; color: #374151; background: #fff;
    transition: all 0.15s ease;
}

.mcb-archive--dark .mcb-pagination .page-numbers,
.mcb-archive--dark .mcb-pagination a,
.mcb-archive--dark .mcb-pagination span {
    background: #1a1a24; border-color: #2a2a3a; color: #d1d5db;
}

.mcb-pagination .page-numbers.current,
.mcb-pagination .current {
    background: var(--mcb-accent, #6366f1);
    color: #fff; border-color: var(--mcb-accent, #6366f1);
}

.mcb-pagination .page-numbers:hover:not(.current),
.mcb-pagination a:hover:not(.current) {
    border-color: var(--mcb-accent, #6366f1);
    color: var(--mcb-accent, #6366f1);
}

/* Load More */
.mcb-pagination--load-more { justify-content: center; }

.mcb-load-more-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 32px; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    border: 1px solid #e5e7eb; background: #fff; color: #374151;
    cursor: pointer; transition: all 0.15s ease;
}
.mcb-archive--dark .mcb-load-more-btn {
    background: #1a1a24; border-color: #2a2a3a; color: #d1d5db;
}
.mcb-load-more-btn:hover {
    border-color: var(--mcb-accent, #6366f1);
    color: var(--mcb-accent, #6366f1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.mcb-load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── No posts ── */
.mcb-no-posts {
    text-align: center; color: #9ca3af; font-size: 15px;
    padding: 60px 20px; grid-column: 1 / -1;
}

/* ── Shortcode feed wrapper ── */
.mcb-feed { margin: 0; }

/* ── Feed action buttons (Load More + Explore) ── */
.mcb-feed__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.mcb-feed__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none !important;
    line-height: 1.4;
}

.mcb-feed__btn--load {
    background: var(--mcb-accent, #6366f1);
    color: #fff;
    border: 1px solid var(--mcb-accent, #6366f1);
}
.mcb-feed__btn--load:hover {
    opacity: 0.9;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.mcb-feed__btn--load:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mcb-feed__btn--explore {
    background: transparent;
    color: var(--mcb-accent, #6366f1);
    border: 1px solid var(--mcb-accent, #6366f1);
}
.mcb-feed__btn--explore:hover {
    background: var(--mcb-accent, #6366f1);
    color: #fff !important;
}

.mcb-archive--dark .mcb-feed__btn--explore {
    color: var(--mcb-accent, #6366f1);
    border-color: var(--mcb-accent, #6366f1);
}
.mcb-archive--dark .mcb-feed__btn--explore:hover {
    background: var(--mcb-accent, #6366f1);
    color: #fff !important;
}

/* ── Fallback for older browsers ── */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .mcb-horiz--dark .mcb-card__cat { background: rgba(99, 102, 241, 0.18); }
}
