/* ==========================================================
   DELIOX POST CARDS — v2.4.0
   A vertical stack of post cards. Each card is laid out
   horizontally (image left, text right) or vertically
   (image top, text bottom).
========================================================== */

.dlx-cards-section {
    position: relative;
    width: 100%;
}

.dlx-cards-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.dlx-cards-item { width: 100%; }

.dlx-cards-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.dlx-cards-link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 16px; }

/* ── Card base ───────────────────────────────────────── */
.dlx-cards-card {
    position: relative;
    display: flex;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow .25s ease;
    width: 100%;
    box-sizing: border-box;
    border: 0 solid transparent;
}

/* ══════════════ HORIZONTAL ══════════════
   Image on the left, body on the right. */
.dlx-cards-section.orientation-horizontal .dlx-cards-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 160px;
}
.dlx-cards-section.orientation-horizontal .dlx-cards-img-wrap {
    flex: 0 0 40%;
    max-width: 40%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: rgba(0,0,0,0.04);
}
.dlx-cards-section.orientation-horizontal .dlx-cards-body {
    flex: 1 1 auto;
    min-width: 0;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ══════════════ VERTICAL ══════════════
   Image on top, body below. */
.dlx-cards-section.orientation-vertical .dlx-cards-card {
    flex-direction: column;
}
.dlx-cards-section.orientation-vertical .dlx-cards-img-wrap {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
    background: rgba(0,0,0,0.04);
}
.dlx-cards-section.orientation-vertical .dlx-cards-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

/* ── Image ───────────────────────────────────────────── */
.dlx-cards-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}
.dlx-cards-section.image-zoom .dlx-cards-card:hover .dlx-cards-img {
    transform: scale(1.06);
}

/* ── Image sizing modes ───────────────────────────────
   FIXED: wrap has an explicit height; object-fit decides how
          the image fills it (cover/contain/fill).
   AUTO:  wrap and image have NO fixed height — the image shows
          at its natural proportions, never cropped.
   RATIO: wrap is locked to an aspect-ratio box; object-fit
          decides how the image sits in that box.            */

/* AUTO — the image flows at its real size, nothing is cropped. */
.dlx-cards-section.fit-auto .dlx-cards-img-wrap {
    height: auto !important;
}
.dlx-cards-section.fit-auto .dlx-cards-img {
    height: auto !important;
    width: 100%;
    object-fit: contain; /* irrelevant without a fixed box, but safe */
}
/* In horizontal + auto, align the row to the top so the text
   doesn't float oddly beside a tall natural image. */
.dlx-cards-section.orientation-horizontal.fit-auto .dlx-cards-card {
    align-items: flex-start;
}

/* RATIO — the wrap is an aspect-ratio box; the image fills it
   according to object-fit (default cover, overridable). */
.dlx-cards-section.fit-ratio .dlx-cards-img-wrap {
    height: auto;
}
.dlx-cards-section.fit-ratio .dlx-cards-img {
    height: 100%;
    width: 100%;
}

/* Make sure CONTAIN actually leaves the image whole even inside a
   fixed-height box — the wrap keeps its height, the image fits
   inside it without cropping. (object-fit comes from the control
   with !important so it always wins over the base cover rule.) */
.dlx-cards-img-wrap { display: flex; align-items: center; justify-content: center; }

/* ── Text ────────────────────────────────────────────── */
.dlx-cards-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
    color: #1a1a1a;
}
/* Optional line clamp — only applied when the widget sets a line
   count via --dlx-title-lines. Unset = no clamp = title grows freely. */
.dlx-cards-title.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: var(--dlx-title-lines, 3);
    line-clamp: var(--dlx-title-lines, 3);
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dlx-cards-excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: #555555;
    margin: 0;
}
.dlx-cards-excerpt.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: var(--dlx-excerpt-lines, 4);
    line-clamp: var(--dlx-excerpt-lines, 4);
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Arrow icon ──────────────────────────────────────── */
.dlx-cards-arrow {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2196F3;
    line-height: 1;
    z-index: 2;
    pointer-events: none;
}
.dlx-cards-arrow svg {
    width: 22px;
    height: 22px;
    transition: transform .25s ease;
}
.dlx-cards-section.arrow-bottom-right .dlx-cards-arrow { bottom: 16px; right: 18px; }
.dlx-cards-section.arrow-top-right    .dlx-cards-arrow { top: 16px;    right: 18px; }
.dlx-cards-section.arrow-bottom-left  .dlx-cards-arrow { bottom: 16px; left: 18px; }

/* The arrow lives inside .dlx-cards-body which has overflow:visible.
   For horizontal cards the body has padding, so we offset the arrow
   relative to the CARD edge, not the body edge. */
.dlx-cards-card { /* relative is already set above */ }

/* ── Hover motion ────────────────────────────────────── */
.dlx-cards-section.motion-lift  .dlx-cards-card:hover { transform: translateY(-4px); }
.dlx-cards-section.motion-scale .dlx-cards-card:hover { transform: scale(1.02); }
.dlx-cards-section.motion-none  .dlx-cards-card:hover { transform: none; }

/* ── Template-based card cleanup ─────────────────────── */
/* When the user picks an Elementor template as the card layout,
   strip our internal flex/padding rules so the template renders
   naturally inside the card surface. */
.dlx-cards-card.dlx-cards-card-template {
    display: block;
    padding: 0;
}

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 768px) {
    .dlx-cards-section.orientation-horizontal .dlx-cards-img-wrap {
        flex: 0 0 35%;
        max-width: 35%;
        height: 160px;
    }
    .dlx-cards-section.orientation-horizontal .dlx-cards-body { padding: 16px 18px; }
    .dlx-cards-section.orientation-vertical .dlx-cards-img-wrap { height: 220px; }
    .dlx-cards-title { font-size: 15px; }
    .dlx-cards-excerpt { font-size: 13px; }
    .dlx-cards-excerpt.is-clamped { -webkit-line-clamp: var(--dlx-excerpt-lines-mobile, var(--dlx-excerpt-lines, 3)); line-clamp: var(--dlx-excerpt-lines-mobile, var(--dlx-excerpt-lines, 3)); }
}
@media (max-width: 480px) {
    /* On phones, horizontal cards stack vertically so the image isn't
       crushed to a thumbnail. The widget's orientation choice is still
       respected on desktop and tablet. */
    .dlx-cards-section.orientation-horizontal .dlx-cards-card {
        flex-direction: column;
        min-height: 0;
    }
    .dlx-cards-section.orientation-horizontal .dlx-cards-img-wrap {
        flex: none;
        max-width: 100%;
        width: 100%;
        height: 200px;
    }
    .dlx-cards-section.orientation-horizontal .dlx-cards-body { padding: 16px 18px; }
    .dlx-cards-section.orientation-vertical   .dlx-cards-img-wrap { height: 200px; }
    /* Touch targets: arrow becomes bigger and the card has a comfortable tap area */
    .dlx-cards-arrow svg { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .dlx-cards-card,
    .dlx-cards-img,
    .dlx-cards-arrow svg {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
