/*
 * DV Feed Cards v2.0.1
 * Template-agnostic, mobile-first, CSS custom properties.
 * No !important. No framework dependencies.
 *
 * @author Elisabeth J. Bertrand - HDM
 * (c) 2026 DV Extensions / HDM
 */

/* ── Module box wrap (shared pattern) ───────────────────── */

.dv-module-wrap {
    box-sizing: border-box;
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
}

.container-sidebar-right .dv-module-wrap {
    margin: 0;
}

/* ── Custom properties ──────────────────────────────────── */

.dvfc {
    --dvfc-font: inherit;
    --dvfc-radius: 6px;
    --dvfc-gap: 1rem;
    --dvfc-border: 1px solid #e0e0e0;
    --dvfc-bg: #fff;
    --dvfc-text: #222;
    --dvfc-link: #111;
    --dvfc-link-hover: #555;
    --dvfc-meta-color: #777;
    --dvfc-meta-size: 0.8rem;
    --dvfc-excerpt-color: #555;
    --dvfc-img-aspect: 3 / 2;
    --dvfc-img-height: 100%;
    --dvfc-more-color: #333;
}

/* ── Base reset ─────────────────────────────────────────── */

.dvfc {
    font-family: var(--dvfc-font);
    color: var(--dvfc-text);
    box-sizing: border-box;
}

.dvfc *, .dvfc *::before, .dvfc *::after {
    box-sizing: inherit;
}

.dvfc a {
    color: var(--dvfc-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

.dvfc a:hover,
.dvfc a:focus-visible {
    color: var(--dvfc-link-hover);
}

/* ── Meta (shared) ──────────────────────────────────────── */

.dvfc-meta {
    font-size: var(--dvfc-meta-size);
    color: var(--dvfc-meta-color);
}

.dvfc-meta + .dvfc-meta::before {
    content: "\00B7";
    margin: 0 0.35em;
}

/* ═══════════════════════════════════════════════════════════
   CARDS layout (default)
   ═══════════════════════════════════════════════════════════ */

.dvfc--cards {
    display: flex;
    flex-direction: column;
    gap: var(--dvfc-gap);
}

.dvfc-card {
    display: flex;
    flex-direction: column;
    background: var(--dvfc-bg);
    border: var(--dvfc-border);
    border-radius: var(--dvfc-radius);
    overflow: hidden;
}

.dvfc-card__thumb {
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    aspect-ratio: var(--dvfc-img-aspect);
}

.dvfc-card__img {
    width: 100%;
    height: var(--dvfc-img-height);
    object-fit: cover;
    display: block;
}

.dvfc-card__body {
    padding: 0.85rem 1rem;
    flex: 1;
}

.dvfc-card__title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    line-height: 1.35;
}

.dvfc-card__meta {
    margin-bottom: 0.35rem;
}

.dvfc-card__excerpt {
    font-size: 0.88rem;
    color: var(--dvfc-excerpt-color);
    line-height: 1.5;
    margin: 0.3rem 0 0;
}

.dvfc-card__more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dvfc-more-color);
}

@media (min-width: 640px) {
    .dvfc-card {
        flex-direction: row;
    }

    .dvfc-card__thumb {
        width: 220px;
        aspect-ratio: auto;
    }

    .dvfc-card__img {
        height: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   GRID layout
   ═══════════════════════════════════════════════════════════ */

.dvfc--grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--dvfc-gap);
}

@media (min-width: 480px) {
    .dvfc--grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 860px) {
    .dvfc--grid {
        grid-template-columns: repeat(var(--dvfc-cols, 3), 1fr);
    }
}

.dvfc-tile {
    display: flex;
    flex-direction: column;
    background: var(--dvfc-bg);
    border: var(--dvfc-border);
    border-radius: var(--dvfc-radius);
    overflow: hidden;
}

.dvfc-tile__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: var(--dvfc-img-aspect);
}

.dvfc-tile__img {
    width: 100%;
    height: var(--dvfc-img-height);
    object-fit: cover;
    display: block;
}

.dvfc-tile__body {
    padding: 0.75rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dvfc-tile__title {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    line-height: 1.35;
}

.dvfc-tile__meta {
    margin-bottom: 0.3rem;
}

.dvfc-tile__excerpt {
    font-size: 0.85rem;
    color: var(--dvfc-excerpt-color);
    line-height: 1.45;
    margin: 0.25rem 0 0;
}

.dvfc-tile__more {
    display: inline-block;
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dvfc-more-color);
}

/* ═══════════════════════════════════════════════════════════
   LIST layout
   ═══════════════════════════════════════════════════════════ */

.dvfc--list {
    display: flex;
    flex-direction: column;
    gap: var(--dvfc-gap);
}

.dvfc-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: var(--dvfc-gap);
    border-bottom: var(--dvfc-border);
}

.dvfc-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dvfc-row__thumb {
    display: block;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--dvfc-radius);
    overflow: hidden;
}

.dvfc-row__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dvfc-row__body {
    flex: 1;
    min-width: 0;
}

.dvfc-row__title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.dvfc-row__meta {
    margin-bottom: 0.2rem;
}

.dvfc-row__excerpt {
    font-size: 0.85rem;
    color: var(--dvfc-excerpt-color);
    line-height: 1.4;
    margin: 0.15rem 0 0;
}

@media (min-width: 480px) {
    .dvfc-row__thumb {
        width: 110px;
        height: 80px;
    }
}

/* ═══════════════════════════════════════════════════════════
   MINIMAL layout
   ═══════════════════════════════════════════════════════════ */

.dvfc--minimal {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dvfc-min {
    padding: 0.4rem 0;
    border-bottom: var(--dvfc-border);
}

.dvfc-min:last-child {
    border-bottom: none;
}

.dvfc-min__title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

.dvfc-min__meta {
    display: block;
    margin-top: 0.15rem;
}

/* ═══════════════════════════════════════════════════════════
   No-image modifiers
   ═══════════════════════════════════════════════════════════ */

.dvfc-card--no-img .dvfc-card__body,
.dvfc-row--no-img .dvfc-row__body {
    padding-left: 1rem;
}
