/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------ 6.0/00 - 20-08-22 */
/* file     -> flipbox.css */
/* colors   -> #EE741D | rgba(238,116,29) | hsla(25,86%,53%) */
/* ------------------------------------------------------------------------------ */
/* link     -> https://codepen.io/maddesigns/pen/JjddyzG */
/* info     -> gridbox / flexbox and flip-cards with auto-counter */
/* ------------------------------------------------------------------------------ */
/* ROOT and VARIBLES */
:root {
	--hover-bgr:hsla(210,100%,56%,1);
    
    /* cards */
    --card-front-col: rgba(0,0,0,.6); /* black, gray OR client-color */
    --card-front-bgr: #fff;
    --card-back-col: #fff;
    --card-back-bgr: #EE741D;
    --card-ibox-hgt: 14rem;         /* min-height of the card - depends of the text card-back - def 14rem */
    --card-body-bdr: 1px solid rgba(0,0,0,.05);     /* border - def 1px */
    /* grid-area */
    --grid-area-gap: 1rem;          /* gap between flipboxes - def 1rem | min .3rem - check used shadow */
    --grid-area-pad: 1rem;          /* padding - check card-border-radius - def 1rem | min .3rem */
    --grid-area-bgr: none;          /* background - def none */
    --grid-area-bdr: 0px solid rgba(0,0,0,.25);     /* border - def 0px  */
    --grid-area-rad: 0rem;          /* border-radius - def 0rem */
    /* counter - card-front */ 
    --count-color: #EE741D;         /* color of the counter - must be the same as card-back-background AND no transparent */
    --count-size: 4rem;             /* counter size - def 4rem */
    --count-pos-top: 0rem;          /* counte rposition top - NOT IN USE */
    --count-pos-right: 1.2rem;      /* counter position right - def 1.2rem */
    --count-pos-bottom: 0.6rem;     /* counter position bottom - def 0.6rem */ 
    --count-width: 1px;             /* counter stroke - def 1px | max 3px */
    /* animation */
    --time-flip: 0.8s;              /* def 0.8s */
	}

/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------ 6.0/00 - 20-08-22 */
/* CARDS */
.cards {
    display:grid;
    counter-reset:Element; /* reset must be here */
    }

.card {
    perspective:100rem;
    }

.card-body {
    display:flex;
    transform-style:preserve-3d;
    transition:var(--time-flip) transform;
    }
.card:hover .card-body, .card:focus .card-body {
    transform:rotateY(-180deg);
    }

.card-front, .card-back {
    -webkit-backface-visibility:hidden;
            backface-visibility:hidden;
    min-width:100%;
    align-items:flex-end;
    height:100%;
    }

/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------ 6.0/00 - 20-08-22 */
/* make it pretty */
.cards {
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); /* DO NOT CHANGE - width of cards */
    grid-auto-rows:1fr;
    grid-gap:var(--grid-area-gap,1rem);
    padding:var(--grid-area-pad,1rem);
    background:var(--grid-area-bgr,#ccc);
    border:var(--grid-area-bdr,1px solid rgba(0,0,0,.25));
    border-radius:var(--grid-area-rad,.5rem);
    }   
.card {
    display:flex;
    min-height:var(--card-ibox-hgt,14rem);  /* min-height of cards */
    transition:z-index, transform calc(var(--time-flip) / 4);
    transition-delay: var(--time-flip), 0s;
    text-decoration:none;
    color:inherit;
    z-index:0;
    }
.card:hover {
    transition-delay:0s;
    z-index:1;
    }
.card:active {
    transform:scale(0.975);
    }
/* card-body */
.card-body {
    flex:1;
    background:var(--card-front-bgr,#fff);
    border:var(--card-body-bdr,1px solid rgba(0,0,0,.05));
    }
.card-body h2, p {
    color:var(--card-front-col,rgba(0,0,0,.6));
    margin:0;
    padding:0;
    }
/* card-front and card-back */
.card-front, .card-back {
    display:flex;
    align-items:center;
    justify-content:center;
    padding:.5rem;
    border-radius:0.25rem;
    text-align:center;
    }
.card-front {
    font-size:1rem;
    align-items:flex-center;
    }
.card-back {    
    background:var(--card-back-bgr,#EE741D);
    color:var(--card-back-col,#fff);
    white-space:inherit;
    transform:rotateY(180deg) translate(100%, 0);
    }
/* not in USE */
.card-back::before {    
    /*content:counter(Element) ''; /* with counter in text */
    }

/* ------------------------------------------------------------------------------ */
/* ------------------------------------------------------------ 6.0/00 - 20-08-22 */
/* css-counter postion background */
/* https://stackoverflow.com/questions/43514987/css-increasing-number-as-background-images-for-css */	
.card-front::before { 
	position:absolute;
    display:flex;
	/*top:0;*/
  	right:var(--count-pos-right,1.2rem);
  	bottom:var(--count-pos-bottom,0.6rem);
	justify-content:center;
    align-items:center;
    counter-increment:Element 1;
	content:counter(Element) '';
	font-size:var(--count-size,4rem); 
	font: 800 Arial;
	  -webkit-text-fill-color:transparent; /* works FF, Chrome and Edge */
	  -webkit-text-stroke:var(--count-width,1px);
	  -webkit-font-smoothing:antialiased;
	color:var(--count-color,#EE741D); /* must be the same color als card-back background */
    opacity:1;
	z-index:999;
	}
/* shadow */
.shadow, .card-front, .card-back {
  box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.04), 0 2px 2px rgba(0, 0, 0, 0.04), 0 4px 4px rgba(0, 0, 0, 0.04), 0 8px 8px rgba(0, 0, 0, 0.04), 0 16px 16px rgba(0, 0, 0, 0.04);
}
	
/* ------------------------------------------------------------------------------ */
/* END */	
/* ------------------------------------------------------------------------------ */