/*
Component: LVD Do / Do Not
Version: 1.0.1
Author: Live Design
*/

/* --- Do / Do Not --- */
/* Hairlines derive from currentColor, so they read on any appearance without a
   per-appearance token. The rgba fallback is a neutral grey that works both ways. */
.lvd-cm-do-donot                                          {position:relative;
                                                          --lvd-do-donot-cell-x:32px;
                                                          --lvd-do-donot-cell-y:24px;
                                                          --lvd-do-donot-gap:16px;
                                                          --lvd-do-donot-hairline:rgba(128,128,128,0.3);
                                                          /* The section's surface, captured before the card re-scopes the token */
                                                          --lvd-do-donot-section-bg:var(--lvd-cc-surface);
                                                          --lvd-do-donot-top:0px;}

@supports (color:color-mix(in srgb, currentColor 10%, transparent)) {
.lvd-cm-do-donot                                          {--lvd-do-donot-hairline:color-mix(in srgb, currentColor 14%, transparent);}
}

/* Sticky offset — the shared header-following token (header.css, STICKY OFFSET) */
.lvd-cm-do-donot                                          {--lvd-do-donot-top:var(--lvd-sticky-top, 0px);}

/* Section head */
.lvd-cm-do-donot .lvd-section-head .lvd-badge             {margin-bottom:16px;}
.lvd-cm-do-donot .lvd-section-intro                       {max-width:80%;}
.lvd-cm-do-donot .lvd-section-intro.lvd-text-center       {margin-left:auto; margin-right:auto;}

/* --- Table (the card) --- */
/* No overflow on the card or any ancestor: it would turn off position:sticky on the head. */
.lvd-cm-do-donot .lvd-do-donot                             {display:flex; flex-direction:column; border-radius:var(--lvd-rounded); text-align:left;}

/* Head and rows share the same two equal tracks at every width */
.lvd-cm-do-donot .lvd-do-donot-head,
.lvd-cm-do-donot .lvd-do-donot-row                         {display:grid; grid-template-columns:repeat(2, minmax(0, 1fr));}

/* Head — opaque, or the rows would show through while it is stuck. Card over section over
   page: a transparent layer lets the next one through, so any style combination stays opaque. */
.lvd-cm-do-donot .lvd-do-donot-head                        {position:sticky; top:var(--lvd-do-donot-top); z-index:2;
                                                          background-color:var(--lvd-color-bg, #fff);
                                                          background-image:linear-gradient(var(--lvd-cc-surface), var(--lvd-cc-surface)),
                                                                           linear-gradient(var(--lvd-do-donot-section-bg), var(--lvd-do-donot-section-bg));
                                                          border-bottom:1px solid var(--lvd-do-donot-hairline);
                                                          border-radius:var(--lvd-rounded) var(--lvd-rounded) 0 0;
                                                          /* `top`, not transform: a transform would also shift the head while it is
                                                             not stuck. It runs once per header show/hide, not per scroll frame. */
                                                          transition:top 0.35s var(--lvd-header-ease, ease);}
    .lvd-cm-do-donot .lvd-do-donot-head-cell               {padding:calc(var(--lvd-do-donot-cell-y) * 0.75) var(--lvd-do-donot-cell-x); color:var(--lvd-cc-title); font-weight:700; line-height:1.3;}

/* Rows */
.lvd-cm-do-donot .lvd-do-donot-row + .lvd-do-donot-row     {border-top:1px solid var(--lvd-do-donot-hairline);}

    /* Cell — icon beside the content on desktop, above it on mobile */
    .lvd-cm-do-donot .lvd-do-donot-cell                    {display:flex; flex-direction:row; align-items:flex-start; gap:var(--lvd-do-donot-gap); min-width:0; padding:var(--lvd-do-donot-cell-y) var(--lvd-do-donot-cell-x);}
    /* Divider by position, not by column: either column can come first */
    .lvd-cm-do-donot .lvd-do-donot-cell + .lvd-do-donot-cell,
    .lvd-cm-do-donot .lvd-do-donot-head-cell + .lvd-do-donot-head-cell {border-left:1px solid var(--lvd-do-donot-hairline);}

        .lvd-cm-do-donot .lvd-icon-container              {flex:0 0 auto; display:flex; line-height:0;}
        /* Bare glyph: drop the fixed box .lvd-icon keeps for its card/dot styles, so the
           icon lines up with the text edge on mobile */
        .lvd-cm-do-donot .lvd-icon                        {width:auto; height:auto;}
        .lvd-cm-do-donot .lvd-icon svg                    {fill:currentColor;}
        /* Own glyph scale: the theme's sizes leave room for a card/dot chip, which a bare
           glyph beside a line of text does not have. (0,4,1) beats the theme's (0,3,1). */
        .lvd-cm-do-donot .lvd-do-donot-cell .lvd-icon svg  {width:var(--lvd-do-donot-icon); height:var(--lvd-do-donot-icon);}
        .lvd-cm-do-donot .lvd-icon-size-sm                {--lvd-do-donot-icon:20px;}
        .lvd-cm-do-donot .lvd-icon-size-md                {--lvd-do-donot-icon:24px;}
        .lvd-cm-do-donot .lvd-icon-size-lg                {--lvd-do-donot-icon:32px;}
        /* Role tokens from app-theme: each resolves to a readable colour for the card's appearance */
        .lvd-cm-do-donot .lvd-do-donot-icon-success        {color:var(--lvd-cc-positive);}
        .lvd-cm-do-donot .lvd-do-donot-icon-primary        {color:var(--lvd-cc-icon-primary);}
        .lvd-cm-do-donot .lvd-do-donot-icon-error          {color:var(--lvd-cc-negative);}
        /* "Black" follows the title token, so it stays visible on dark cards */
        .lvd-cm-do-donot .lvd-do-donot-icon-black          {color:var(--lvd-cc-title);}

        .lvd-cm-do-donot .lvd-content                     {flex:1 1 auto; min-width:0;}
        .lvd-cm-do-donot .lvd-content .lvd-badge          {margin-bottom:8px;}
        .lvd-cm-do-donot .lvd-content .lvd-keyword        {margin-bottom:8px;}
        .lvd-cm-do-donot .lvd-content .lvd-title          {margin-bottom:8px;}
        .lvd-cm-do-donot .lvd-content p                   {margin-bottom:16px;}
        /* no bottom margin on the last node of the cell or of its rich text → clean edges */
        .lvd-cm-do-donot .lvd-content > :last-child,
        .lvd-cm-do-donot .lvd-text > :last-child,
        .lvd-cm-do-donot .lvd-text li:last-child         {margin-bottom:0;}
        .lvd-cm-do-donot .lvd-content .lvd-button-group   {margin-top:16px; margin-bottom:0;}

/* Cards off — the card is transparent but keeps its --lvd-cc-surface, so the card layer is
   dropped and the head falls to section, then page; edge padding drops */
.lvd-cm-do-donot.lvd-cards-off                            {--lvd-do-donot-cell-x:16px;}
.lvd-cm-do-donot.lvd-cards-off .lvd-do-donot-head          {background-image:linear-gradient(var(--lvd-do-donot-section-bg), var(--lvd-do-donot-section-bg)); border-radius:0;}
.lvd-cm-do-donot.lvd-cards-off :is(.lvd-do-donot-head, .lvd-do-donot-row) > :first-child {padding-left:0;}
.lvd-cm-do-donot.lvd-cards-off :is(.lvd-do-donot-head, .lvd-do-donot-row) > :last-child  {padding-right:0;}

/* Animation */
/* initial state */
.lvd-cm-do-donot.lvd-animate-on-scroll .lvd-section-title,
.lvd-cm-do-donot.lvd-animate-on-scroll .lvd-section-intro,
.lvd-cm-do-donot.lvd-animate-on-scroll .lvd-do-donot                   {opacity:0; transform:translateY(16px); transition-property:opacity, transform; transition-duration:1s; transition-timing-function:cubic-bezier(0.65, 0, 0.35, 1);}
.lvd-cm-do-donot.lvd-animate-on-scroll .lvd-do-donot-row               {opacity:0; transition:opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);}
/* animated */
.lvd-cm-do-donot.lvd-is-visible .lvd-section-title,
.lvd-cm-do-donot.lvd-is-visible .lvd-section-intro,
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot                          {opacity:1; transform:none;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row                      {opacity:1;}
/* delay — the card lands first, then the rows fill in (row 1 is nth-child(2), after the head) */
.lvd-cm-do-donot.lvd-is-visible .lvd-section-title                    {transition-delay:0s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-section-intro                    {transition-delay:0.15s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot                          {transition-delay:0.3s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row                      {transition-delay:1.2s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row:nth-child(2)         {transition-delay:0.45s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row:nth-child(3)         {transition-delay:0.6s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row:nth-child(4)         {transition-delay:0.75s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row:nth-child(5)         {transition-delay:0.9s;}
.lvd-cm-do-donot.lvd-is-visible .lvd-do-donot-row:nth-child(6)         {transition-delay:1.05s;}

/* --- Bm --- */
/* Still two columns: the cells tighten and the icon moves above the content */
@media (min-width:1px) and (max-width:767px)
{
.lvd-cm-do-donot,
.lvd-cm-do-donot.lvd-px,
.lvd-cm-do-donot.lvd-pxy                                 {padding-left:16px; padding-right:16px;}
.lvd-cm-do-donot                                         {--lvd-do-donot-cell-x:16px; --lvd-do-donot-cell-y:16px; --lvd-do-donot-gap:8px;}
.lvd-cm-do-donot.lvd-cards-off                           {--lvd-do-donot-cell-x:12px;}
.lvd-cm-do-donot .lvd-section-intro                      {max-width:calc(100% - 24px);}
.lvd-cm-do-donot .lvd-do-donot-cell                       {flex-direction:column;}
.lvd-cm-do-donot .lvd-icon-size-sm                       {--lvd-do-donot-icon:16px;}
.lvd-cm-do-donot .lvd-icon-size-md                       {--lvd-do-donot-icon:20px;}
.lvd-cm-do-donot .lvd-icon-size-lg                       {--lvd-do-donot-icon:24px;}
}

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

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