/**
 * ChinaExpoHub Feed – Styles v2
 *
 * Based on v1. Additions:
 *   - .ceh-feed__card-series  : expo series label above the event title
 */

/* ─── Feed wrapper ────────────────────────────────────────────── */
.ceh-feed {
    --ceh-feed-cols:       3;
    --ceh-feed-gap:        24px;
    --ceh-card-bg:         #ffffff;
    --ceh-card-radius:     6px;
    --ceh-card-shadow:     0 1px 4px rgba(0,0,0,.08);
    --ceh-card-title-size: 1rem;
    --ceh-card-meta-size:  0.8125rem;
    --ceh-card-meta-color: #666666;
    --ceh-load-more-color: #111111;
    --ceh-load-more-bg:    #f5f5f5;

    width: 100%;
}

/* ─── Grid ────────────────────────────────────────────────────── */
.ceh-feed__grid {
    display: grid;
    grid-template-columns: repeat( var(--ceh-feed-cols), minmax(0, 1fr) );
    gap: var(--ceh-feed-gap);
}

@media (max-width: 900px) {
    .ceh-feed__grid {
        grid-template-columns: repeat( min(var(--ceh-feed-cols), 2), minmax(0, 1fr) );
    }
}

@media (max-width: 540px) {
    .ceh-feed__grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Card ────────────────────────────────────────────────────── */
.ceh-feed__card {
    background:     var(--ceh-card-bg);
    border-radius:  var(--ceh-card-radius);
    box-shadow:     var(--ceh-card-shadow);
    overflow:       hidden;
    transition:     box-shadow 0.18s ease, transform 0.18s ease;
    display:        flex;
    flex-direction: column;
}

.ceh-feed__card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.13);
    transform:  translateY(-2px);
}

.ceh-feed__card-link {
    display:         flex;
    flex-direction:  column;
    flex:            1;
    text-decoration: none;
    color:           inherit;
}

/* Thumbnail */
.ceh-feed__card-thumb {
    width:            100%;
    aspect-ratio:     16 / 9;
    overflow:         hidden;
    background-color: #f0f0f0;
    flex-shrink:      0;
}

.ceh-feed__card-img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: transform 0.25s ease;
}

.ceh-feed__card:hover .ceh-feed__card-img {
    transform: scale(1.04);
}

.ceh-feed__card-thumb--placeholder {
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.ceh-feed__card-thumb-icon {
    font-size: 2.5rem;
    opacity:   0.35;
}

/* Card body */
.ceh-feed__card-body {
    padding:        14px 16px 16px;
    flex:           1;
    display:        flex;
    flex-direction: column;
    gap:            4px;
}

/* ─── Series label (v2 addition) ──────────────────────────────── */
/* Shown above the event title — links to the expo taxonomy archive */
.ceh-feed__card-series {
    margin:      0;
    font-size:   0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color:       #888888;
    line-height: 1.3;
}

.ceh-feed__card-series-link {
    color:           inherit;
    text-decoration: none;
}

.ceh-feed__card-series-link:hover {
    text-decoration: underline;
}

/* ─── Card title & meta ───────────────────────────────────────── */
.ceh-feed__card-title {
    font-size:   var(--ceh-card-title-size);
    font-weight: 600;
    line-height: 1.35;
    margin:      0;
    color:       inherit;
}

.ceh-feed__card-meta {
    font-size:   var(--ceh-card-meta-size);
    color:       var(--ceh-card-meta-color);
    margin:      0;
    line-height: 1.4;
    display:     flex;
    flex-wrap:   wrap;
    gap:         4px 10px;
}

.ceh-feed__card-date::before     { content: '📅 '; }
.ceh-feed__card-city::before     { content: '📍 '; }
.ceh-feed__card-industry::before { content: '🏭 '; }

/* ─── Load more ───────────────────────────────────────────────── */
.ceh-feed__load-more-wrap {
    margin-top: 32px;
    text-align: center;
}

.ceh-feed__load-more {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             0.5em;
    padding:         0.6em 2em;
    min-height:      44px;
    color:           var(--ceh-load-more-color);
    background:      var(--ceh-load-more-bg);
    border:          1px solid #d0d0d0;
    border-radius:   4px;
    font-size:       0.9375rem;
    cursor:          pointer;
    transition:      background 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance:      none;
}

.ceh-feed__load-more:hover:not(:disabled) {
    background:   #e8e8e8;
    border-color: #b0b0b0;
}

.ceh-feed__load-more:active:not(:disabled) {
    transform: scale(0.97);
}

.ceh-feed__load-more:disabled,
.ceh-feed__load-more.is-loading {
    opacity:        0.6;
    pointer-events: none;
    cursor:         default;
}

.ceh-feed__spinner {
    display:       inline-block;
    width:         14px;
    height:        14px;
    border:        2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation:     ceh-spin 0.7s linear infinite;
    flex-shrink:   0;
}

@keyframes ceh-spin {
    to { transform: rotate(360deg); }
}

/* ─── Term list ───────────────────────────────────────────────── */
.ceh-feed__term-list {
    list-style: none;
    margin:     0;
    padding:    0;
}

.ceh-feed__term-item {
    padding: 4px 0;
}

.ceh-feed__term-badge {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
}

.ceh-feed__term-link {
    text-decoration: none;
    color:           inherit;
    font-weight:     500;
}

.ceh-feed__term-link:hover {
    text-decoration: underline;
}

.ceh-feed__term-count {
    font-size: 0.8125em;
    color:     #888888;
}

/* ─── Empty & guest states ────────────────────────────────────── */
.ceh-feed--empty,
.ceh-feed--guest {
    padding: 32px 0;
}

.ceh-feed__empty-msg,
.ceh-feed__guest-msg {
    margin:    0;
    color:     #555;
    font-size: 0.9375rem;
}

.ceh-feed__login-link {
    margin-left:     8px;
    font-weight:     600;
    text-decoration: underline;
}

/* ─── Skeleton / editor preview ───────────────────────────────── */
.ceh-feed--preview .ceh-feed__card--skeleton {
    border:     1px solid #e8e8e8;
    box-shadow: none;
}

.ceh-feed__skeleton-block {
    background:      linear-gradient(90deg, #ececec 25%, #f8f8f8 50%, #ececec 75%);
    background-size: 200% 100%;
    animation:       ceh-shimmer 1.5s infinite;
    border-radius:   4px;
    display:         block;
    width:           100%;
}

@keyframes ceh-shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

.ceh-follow-preview-note {
    margin:     8px 0 0;
    font-size:  11px;
    color:      #888;
    font-style: italic;
}
