/*=====ISOMETRIFY!=====*/
  
.cube{
	min-width: 250px;
	position: absolute;
}
  
  /* hack for keeping square aspect ratio (parent "cube" and sides must stay square). Only on the cubes: an image
     with the "square" shape (style.css) must not get this empty space under it. */
  .cube.square{
	position: relative;
  }
  
  .cube.square:after,
  .side.square:after {
	content: "";
	display: block;
	padding-bottom: 100%; /* square aspect ratio */
  }
  
  .content {
	position: absolute;
	/* stretch to fit parent */
	width: 100%;
	height: 100%;
  }
  
  /* building sides into a cube */
  .side{
	/* reset "anchor point" -> it is now the center of the side */
	position:absolute;
	/* a side can not fill the whole cube */
	width:60%;
	height:60%;
  }
  
  .side.top{
	transform:
	  /* build sides into a cube! */
	  translate(33.6%,-7.2%)
	  /* isometrify! (top side) */
	 scaleY(.5773) rotate(-45deg);
  }
  
  .side.left{
	box-shadow: -.5em .5em 2em rgba(90,70,50,.3);
	transform:
	  /* build sides into a cube! */
	  translate(-1.7%,54.05%)
	  /* isometrify! (left side) */
	  rotate(60deg) scaleY(.5773) rotate(-45deg);
  }
	
  .side.right{
	box-shadow: .5em .5em 2em rgba(90,70,50,.3);
	transform:
	  /* build sides into a cube! */
	  translate(68.95%,53.95%)
	  /* isometrify! (right side) */
	  rotate(-60deg) scaleY(.5773) rotate(45deg);
  }



  /*=====GRID=SETUP=====*/

.cubegrid{
	display:grid;
	width:100vw;
	max-width:100vw;
}

.cubegrid .cell{
	overflow:visible;
	grid-column: span 2;
}

.cubegrid .cube{
	width:95%; /* 100% = cubes stuck together */
	top:50%;
	margin-top:-50%;
	left:50%;
	margin-left:-50%;
}



/*=====SOLO=CUBE=====*/

.monocube .cube{
}


  
  /*=====CUBE=TUNING=====*/
  
  /* default cube */
  
/* "clip" (not "hidden") cuts what goes past a side without making it a box that could scroll: the iPhone's Safari
   then draws each side whole, with the rest of the page. (With "hidden", plus a layer of its own per side, it cut
   a side along a horizontal line: the top of the excerpt disappeared.) "hidden" stays for older browsers. */
.side{
	padding:5%;
	overflow: hidden;
	overflow: clip;
	background-color: #18606b; /* paon */
}
  
.side.top{
	background: rgb(24,96,107);
	background: -moz-linear-gradient(315deg, rgba(24,96,107,1) 0%, rgba(22,63,92,1) 30%, rgba(22,53,87,1) 70%);
	background: -webkit-linear-gradient(315deg, rgba(24,96,107,1) 0%, rgba(22,63,92,1) 30%, rgba(22,53,87,1) 70%);
	background: linear-gradient(315deg, rgba(24,96,107,1) 0%, rgba(22,63,92,1) 30%, rgba(22,53,87,1) 70%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#18606b",endColorstr="#163557",GradientType=1);
}
.side.left{
	background: -moz-linear-gradient(0deg, rgba(160,186,149,1) 0%, rgba(95,143,129,1) 15%, rgba(58,119,118,1) 30%, rgba(24,96,107,1) 70%);
	background: -webkit-linear-gradient(0deg, rgba(160,186,149,1) 0%, rgba(95,143,129,1) 15%, rgba(58,119,118,1) 30%, rgba(24,96,107,1) 70%);
	background: linear-gradient(0deg, rgba(160,186,149,1) 0%, rgba(95,143,129,1) 15%, rgba(58,119,118,1) 30%, rgba(24,96,107,1) 70%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#a0ba95",endColorstr="#18606b",GradientType=1);
}
.side.right{
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: flex-end;
}

/* Typography */

/* The title has the same size on every cube, in proportion to the cube: 100cqi = the width of the top of the cube,
   inside its padding (about 26px on a large screen). Expanded like every title (wdth 151, XTRA 540): a long word
   ("Saperlipopote", "Communication") is hyphenated (the pages are in French: lang="fr"), and broken in two only as a
   last resort, never cut. */
.cube .side.top{
	container-type: inline-size;
}

.cube h3{
	margin-top: 0;
	font-size: calc(100cqi / 6.55);
	font-variation-settings: 'wdth' 151, 'XTRA' 540, 'XOPQ' 55, 'YOPQ' 54;
	letter-spacing: 0;
	line-height: 110%;
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 6 3 3; /* as the introductions (style.css, .excerpt p) */
	-webkit-hyphenate-limit-before: 3;
	-webkit-hyphenate-limit-after: 3;
	overflow-wrap: break-word;
}

/* The date: a paragraph, not a title, in small capitals like the date of an article (style.css, .single-date) */
.cube .cube-date{
	margin: 0;
	z-index: 1;
	text-transform: uppercase;
	font-size: 1rem;
	font-variation-settings: 'wdth' 100, 'XOPQ' 79, 'YOPQ' 78;
	line-height: 80%;
}

.cube .trop-long{
	position: absolute;
    height: 65%;
    right: 0;
    left: 0;
    bottom: 0;

    /* olivine */
	/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#a0ba95+0,a0ba95+100&0+10,0.25+40,0.5+65,1+95 */
	background: -moz-linear-gradient(-178deg, rgba(160,186,149,0) 0%, rgba(160,186,149,0) 10%, rgba(160,186,149,0.25) 40%, rgba(160,186,149,0.5) 65%, rgba(160,186,149,1) 95%, rgba(160,186,149,1) 100%); /* FF3.6-15 */
	background: -webkit-linear-gradient(-178deg, rgba(160,186,149,0) 0%,rgba(160,186,149,0) 10%,rgba(160,186,149,0.25) 40%,rgba(160,186,149,0.5) 65%,rgba(160,186,149,1) 95%,rgba(160,186,149,1) 100%); /* Chrome10-25,Safari5.1-6 */
	background: linear-gradient(-178deg, rgba(160,186,149,0) 0%,rgba(160,186,149,0) 10%,rgba(160,186,149,0.25) 40%,rgba(160,186,149,0.5) 65%,rgba(160,186,149,1) 95%,rgba(160,186,149,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00a0ba95', endColorstr='#a0ba95',GradientType=0 ); /* IE6-9 */
}

/* dépassements de texte */
.cube .side.top .trop-long,
.cube .side.right .trop-long{
	height: 100%;

	background: rgb(24,96,107);
	background: -moz-linear-gradient(0deg, rgba(24,96,107,1) 0%, rgba(22,53,87,0) 70%);
	background: -webkit-linear-gradient(0deg, rgba(24,96,107,1) 0%, rgba(22,53,87,0) 70%);
	background: linear-gradient(0deg, rgba(24,96,107,1) 0%, rgba(22,53,87,0) 70%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#18606b",endColorstr="#163557",GradientType=1);
}

/* Hover */

a .cube{
	transition: transform .2s ease-out;
	transform-origin: center;
}

a .cube .side{
	transition: box-shadow .2s ease-out;
}

/* The theme colours a link in lavender while it is hovered, active or focused (style.css): a cube's texts stay
   white. A cube reached with the keyboard zooms as on hover, so the focus can still be seen. */
a:hover .cube,
a:focus .cube,
a:active .cube{
	color: white;
}

a:hover .cube,
a:focus-visible .cube{
	transform: scale(1.15) translateY(-2rem);
	z-index: 1;
}

.monocube a:hover .cube,
.monocube a:focus-visible .cube{
	transform: scale(1.025) translateY(0);
}

  
  /*=====MEDIA=QUERIES=====*/
  
  /* Each width matches only one of these layouts: the "max-width" values stop just
     below the next "min-width", otherwise two layouts mix at exactly 500, 750 and
     1000 px wide and the cubes overlap or get cut off. */
  /* over 4 x min cube width, stretch */
  @media screen and (min-width:1000px){
	
	/* Template:
	
		 [][][]
		[][][][]
		  etc.    */
	
	.cubegrid{
	  grid-template-columns: repeat(8, 12.5vw); /* 8 col */
	  grid-auto-rows: 18.35vw; /* control the vertical spacing of the cubes */
	  margin-top:5vw;
	  margin-bottom:5vw;
	}
  
	.cubegrid .cell{
	  /* default span to get 4 square cubes per line instead of 8 squished ones */
	  grid-column: span 2;
	}
  
	/* stick cubes side by side */
  
	.cubegrid .cell:nth-child(7n+1) .content{
	  transform:translateX(15.3%);
	}
  
	.cubegrid .cell:nth-child(7n+3) .content{
	  transform:translateX(-15.3%);
	}
	.cubegrid .cell:nth-child(7n+4) .content{
	  transform:translateX(22.9%);
	}
  
	.cubegrid .cell:nth-child(7n+5) .content{
	  transform:translateX(7.75%);
	}
  
	.cubegrid .cell:nth-child(7n+6) .content{
	  transform:translateX(-7.75%);
	}
  
	.cubegrid .cell:nth-child(7n+7) .content{
	  transform:translateX(-23.35%);
	}
  
	/* offset odd rows by one column */
  
	.cubegrid .cell:nth-child(7n+1){
	  grid-column-start:2;
	  grid-column-end:4;
	}
  
	.cubegrid .cell:nth-child(7n+2){
	  grid-column-start:4;
	  grid-column-end:6;
	}
  
	.cubegrid .cell:nth-child(7n+3){
	  grid-column-start:6;
	  grid-column-end:8;
	}
  }
  
  
  /* less than 4 x min cube width */
  @media screen and (min-width:750px) and (max-width:999.98px){
	
	/* Template:
	
		 [][]
		[][][]
		 etc.    */
	
	.cubegrid{
	  grid-template-columns: repeat(6, 16.666vw); /* 6 col */
	  grid-auto-rows: 24.5vw;
	  margin-top:5vw;
	  margin-bottom:5vw;
	}
	
	.cubegrid .cell{
	  /* default span to get 3 square cubes per line instead of 6 squished ones */
	  grid-column: span 2;
	}
	
	/* stick cubes side by side */
	
	 .cubegrid .cell:nth-child(5n+1) .content{
	  transform:translateX(7.75%);
	}
	
	.cubegrid .cell:nth-child(5n+2) .content{
	  transform:translateX(-7.75%);
	}
	
	.cubegrid .cell:nth-child(5n+3) .content{
	  transform:translateX(15.3%);
	}
	
	.cubegrid .cell:nth-child(5n+5) .content{
	  transform:translateX(-15.3%);
	}
	
	/* offset odd rows by one column */
	
	.cubegrid .cell:nth-child(5n+1){
	  grid-column-start:2;
	  grid-column-end:4;
	}
  
	.cubegrid .cell:nth-child(5n+2){
	  grid-column-start:4;
	  grid-column-end:6;
	}
	
  }
  
  
  /* less than 3 x min cube width */
  @media screen and (min-width:500px) and (max-width:749.98px){
	
	/* Template:
	
		 []
		[][]
		etc.     */
	
	.cubegrid{
	  grid-template-columns: repeat(4, 25vw); /* 4 col */
	  grid-auto-rows:36.7vw;
	  margin-top:11vw;
	  margin-bottom:11vw;
	}
	
	.cubegrid .cell{
	  /* default span to get 3 square cubes per line instead of 6 squished ones */
	  grid-column: span 2;
	}
	
	/* stick cubes side by side */
	
	 .cubegrid .cell:nth-child(3n+2) .content{
	  transform:translateX(7.75%);
	}
	
	.cubegrid .cell:nth-child(3n+3) .content{
	  transform:translateX(-7.75%);
	}
	
	/* offset odd rows by one column */
	
	.cubegrid .cell:nth-child(3n+1){
	  grid-column-start:2;
	  grid-column-end:4;
	}
	
  }
  
  
  /* less than 2 x min cube width (phones): one cube per row */
  @media screen and (max-width:499.98px){
	.cubegrid{
	  grid-template-columns: 250px;
	  grid-auto-rows: minmax(245px, 98.3vw);
	  /* The first cube goes past the top of the grid. The iPhone's Safari cut it there, along a horizontal line (but
	     not on the home page): the grid starts higher (padding), at the same place (negative margin), so that the
	     whole cube is inside it. The space added lets the clicks through to what is above. */
	  padding-top:30vw;
	  margin-top:-30vw;
	  pointer-events:none;
	}

	.cubegrid .cell{
	  pointer-events:auto;
	}

	/* The cube is 95% of its row: centred, it starts at 2.5% (and not at 0, as "margin-left: -50%" put it). */
	.cubegrid .cube{
	  margin-left:-47.5%;
	}
  }

/* Cubes placed in a column or a group (Goupil's "Cubes de projets" block): the grid above is made for the whole
   width of the page (sizes in vw, offset rows). In a column, the cubes fill the column's width instead, side by side
   as long as they fit, without the offsets. */
.column .cubegrid,
.group .cubegrid{
	width:100%;
	max-width:100%;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	grid-auto-rows: auto;
	margin-top:2rem;
	margin-bottom:2rem;
	padding-top:0;
}
.column .cubegrid .cell,
.group .cubegrid .cell{
	position:relative;
	grid-column:auto;
	aspect-ratio:1;
}
.column .cubegrid .cell .content,
.group .cubegrid .cell .content{
	transform:none;
}
