/* 
Component: Grid - Cards
Version: 1.0.0
Author: Live Design 
*/

/* --- Card grid --- */
.lvd-cm-grid-cards                                            {position: relative;}
    .lvd-cm-grid-cards .lvd-section-head .lvd-badge              {margin-bottom:16px;}
    .lvd-cm-grid-cards .lvd-section-intro.lvd-text-center        {margin-left:auto; margin-right:auto;}
    .lvd-cm-grid-cards .lvd-section-intro                        {max-width:80%;}

    .lvd-cm-grid-cards .lvd-grid                                 {--lvd-card-padding:32px;} /* single source for the card inset; breakpoints change only this */
    .lvd-cm-grid-cards .lvd-card                                 {display:flex; flex-direction: column; border-radius:var(--lvd-rounded); position:relative;}
        .lvd-cm-grid-cards .lvd-img                                  {position:relative;}
        .lvd-cm-grid-cards .lvd-img img                              {border-radius: var(--lvd-rounded-top);}
        .lvd-cm-grid-cards .lvd-img .lvd-badge                       {position:absolute; top:16px; left:16px;}

        .lvd-cm-grid-cards .lvd-content                              {display:flex; flex-direction: row; flex-wrap: wrap; flex-grow:0; padding:var(--lvd-card-padding);}
            .lvd-cm-grid-cards .lvd-details                              {width:100%;}
                .lvd-cm-grid-cards .lvd-keyword                              {margin-bottom:8px;}
                .lvd-cm-grid-cards .lvd-title                                {margin-bottom:16px;}
                .lvd-cm-grid-cards .lvd-content p                            {margin-bottom:16px;}
                /* no bottom margin on the last rich-text node (p/ul/ol) or last list item → clean gap before buttons */
                .lvd-cm-grid-cards .lvd-text > :last-child,
                .lvd-cm-grid-cards .lvd-text li:last-child                   {margin-bottom:0;}
        .lvd-cm-grid-cards .lvd-button-group                         {margin-bottom:0; align-self: start;}
        .lvd-cm-grid-cards .lvd-content .lvd-button-group            {margin-top:16px;} /* gap from the card text */

/* Image top */
.lvd-cm-grid-cards .lvd-image-top .lvd-img                   {order:1;}
.lvd-cm-grid-cards .lvd-image-top .lvd-content               {order:2;}

/* Image bottom */
.lvd-cm-grid-cards .lvd-image-bottom .lvd-card               {justify-content: space-between;}
.lvd-cm-grid-cards .lvd-image-bottom .lvd-img                {order:2;}
.lvd-cm-grid-cards .lvd-image-bottom .lvd-content            {order:1;}
.lvd-cm-grid-cards .lvd-image-bottom .lvd-img img            {border-radius: var(--lvd-rounded-bottom);}

/* Image middle — head / image / content. The card owns the padding and the gaps, so any missing
   block collapses cleanly; the image is inset (rounded on all corners) and its auto margins centre
   it in the free height, which keeps heads top-aligned and texts bottom-aligned across a row. */
.lvd-cm-grid-cards .lvd-image-middle                            {--lvd-card-image-max-height:320px;}
.lvd-cm-grid-cards .lvd-image-middle .lvd-card                  {padding:var(--lvd-card-padding); gap:24px;}
.lvd-cm-grid-cards .lvd-image-middle .lvd-content               {padding:0;}
.lvd-cm-grid-cards .lvd-content-head > :last-child,
.lvd-cm-grid-cards .lvd-content-head > :last-child .lvd-title   {margin-bottom:0;}
.lvd-cm-grid-cards .lvd-image-middle .lvd-img                   {align-self:center; margin-block:auto;}
.lvd-cm-grid-cards .lvd-image-middle .lvd-img img               {border-radius:var(--lvd-rounded); width:auto; max-height:var(--lvd-card-image-max-height);}
.lvd-cm-grid-cards .lvd-image-middle .lvd-content-head + .lvd-content {margin-top:auto;} /* no image → text still bottom-aligned */
.lvd-cm-grid-cards .lvd-image-middle .lvd-buttons-align .lvd-content {flex-grow:0;} /* growing content would eat the image's auto margins */

/*Button forced alignment*/
.lvd-cm-grid-cards .lvd-buttons-align .lvd-button-group      {align-self: end;} 
.lvd-cm-grid-cards .lvd-buttons-align .lvd-content           {flex-grow:1;}

/* Cards off — the image becomes a standalone block (radius on all corners);
   lvd-content loses the 32px box: only 8px on the sides + a gap on the side facing
   the image (image top → padding top only; image bottom → padding bottom only). */
.lvd-cm-grid-cards.lvd-cards-off .lvd-img img                    {border-radius: var(--lvd-rounded);}
.lvd-cm-grid-cards.lvd-cards-off .lvd-image-top .lvd-content     {padding: 24px 8px 0 8px;}
.lvd-cm-grid-cards.lvd-cards-off .lvd-image-bottom .lvd-content  {padding: 0 8px 24px 8px;}
/* middle: no box → no card padding; text keeps the 8px side inset, the image stays full width */
.lvd-cm-grid-cards.lvd-cards-off .lvd-image-middle .lvd-card         {padding:0;}
.lvd-cm-grid-cards.lvd-cards-off .lvd-image-middle .lvd-content-head,
.lvd-cm-grid-cards.lvd-cards-off .lvd-image-middle .lvd-content      {padding-inline:8px;}

/* Animation */
/* initial state */
.lvd-cm-grid-cards.lvd-animate-on-scroll .lvd-section-title,
.lvd-cm-grid-cards.lvd-animate-on-scroll .lvd-section-intro, 
.lvd-cm-grid-cards.lvd-animate-on-scroll .lvd-card                        {opacity: 0; transform: translateY(16px); transition-property: opacity, transform; transition-duration: 1s;
 transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);} 
/* animated */
.lvd-cm-grid-cards.lvd-is-visible .lvd-section-title,
.lvd-cm-grid-cards.lvd-is-visible .lvd-section-intro,
.lvd-cm-grid-cards.lvd-is-visible .lvd-card                               {opacity: 1; transform: none;} /* none, not translateY(0): a lingering transform isolates the card and kills image blending on cards-off */
/* delay */
.lvd-cm-grid-cards.lvd-is-visible .lvd-section-title                      {transition-delay: 0s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-section-intro                      {transition-delay: 0.15s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(1)                  {transition-delay: 0.3s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(2)                  {transition-delay: 0.45s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(3)                  {transition-delay: 0.6s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(4)                  {transition-delay: 0.75s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(5)                  {transition-delay: 0.9s;}
.lvd-cm-grid-cards.lvd-is-visible .lvd-card:nth-child(6)                  {transition-delay: 1.15s;}

/* --- Bm --- */
@media (min-width:1px) and (max-width:767px)
{
.lvd-cm-grid-cards, 
.lvd-cm-grid-cards.lvd-px, 
.lvd-cm-grid-cards.lvd-pxy                          {padding-left:16px; padding-right:16px;}
.lvd-cm-grid-cards .lvd-section-intro               {max-width: calc(100% - 24px);}
.lvd-cm-grid-cards .bm-lvd-grid-col-2              {--lvd-card-padding:24px;}
}

/* --- Bt --- */
@media (min-width:768px) and (max-width:1024px)
{
.lvd-cm-grid-cards, 
.lvd-cm-grid-cards.lvd-px, 
.lvd-cm-grid-cards.lvd-pxy                          {padding-left:24px; padding-right:24px;}
}

/* --- Full HD --- */
@media (min-width:1025px) and (max-width:1344px)
{
.lvd-cm-grid-cards, 
.lvd-cm-grid-cards.lvd-px, 
.lvd-cm-grid-cards.lvd-pxy                         {padding-left:24px; padding-right:24px;}
}