.blog-item {
	position: relative;

	// Details

	.card-details {

		.title {

			@include fluid-typo(1.35rem, 1.55rem);
		}

		> * {
			margin-bottom: 0.6rem;
		}

		.headline-meta {
			font-size: $font-size-caption;
		}

		p {
			margin-top: 0;
		}

		.button {
			margin-top: 0.9rem;
		}

		&-item {

			&,
			.category-holder {
				margin: 0;
			}
		}

		&.-center {

			.headline-meta,
			.category-holder {

				@include flex-just(center);
			}
		}

		&.-right {

			.headline-meta,
			.category-holder {

				@include flex-just(flex-end);
			}
		}
	}

	.card-details-item {

		> * {
			margin-bottom: 0.75rem;
		}

		@include sm-screen {

			.overlay-details {
				display: none;
			}
		}
	}

	.image-holder {

		iframe {
			width: 100%;
		}

		// Gallery type (with slider)

		.slider {
			color: $color-white;
		
			.clb-slider-nav-btn {
				transform: none !important;
				margin-bottom: $grid-spacer;
				margin-right: $grid-spacer;
			}

			.clb-slider-stage {

				img {

					&.active {
						z-index: 1;
					}
				}
			}
		}

		// Audio type

		a {

			+ a:not(.tag) {
				display: none;
			}
		}
	}

	// Sticky post

	&.sticky {

		.sticky-icon {
			transform: scale(1.35);
			margin-right: 0.25rem;
			margin-top: -0.4rem;

			@include inline-flex;
		}
	}

	// Layout Type 1 - Classic

	&.-layout1 {

		.overlay-details {

			@include gradient;
		}

		.headline-meta {
			color: $color-grey;
		}

		// Sticky posts

		&.sticky {

			&.-contained {

				.card-details {

					background-color: rgba($color-warning, .1);
				}
			}
		}
	}

	// Layout Type 2 - Minimal

	&.-layout2 {

		.image-holder {
			background-color: $color-neutral-35;
		}

		.overlay-details {

			&:not(.-top) {

				@include gradient;
			}

			.title,
			.button {
				color: $color-white;
			}

			.tag {
				background-color: $color-neutral-50;
			}
		}
	}

	// Layout Type 2, 3, 5, 7

	&.-layout2,
	&.-layout3,
	&.-layout5,
	&.-layout7 {

		.overlay-details {

			&.-top {

				@include gradient(180deg);
			}
		}
	}

	// Layout Type 2, 4

	&.-layout2,
	&.-layout4 {

		.overlay-details {

			&:not(.-top) {
				display: block;
			}
		}

		&.-no-media {

			.image-holder {
				padding-bottom: 100%;
			}
		}

		// Color overlay effect

		&.-img-overlay {

			// Hide standard overlay

			.image-holder {

				&::after {
					display: none;
				}
			}
		}
	}

	// Layout Type 3 - Split

	&.-layout3 {

		@include md-screen {

			> a {
				min-width: 50%;
				max-width: 50%;
			}
		}
	}

	// Layout Type 3, 5

	&.-layout3,
	&.-layout5 {

		@include md-screen {

			@include flex;

			> a {
				display: block;
			}

			.card-details {

				@include flex;
				@include flex-direction(column);
				@include flex-just(center);
				@include align-items(flex-start);
			}

			&:not(.-contained) {

				.card-details {
					padding-top: 0;
				}
			}

			// Contained

			&.-contained {

				.image-holder {

					@include border-left-radius;
					@include border-right-radius(0);
				}

				.card-details {
					padding-top: 1.5rem;

					@include border-right-radius;
					@include border-left-radius(0);
				}
			}

			&:not(.-contained) {

				.card-details {

					@include spacer2x(padding-left);
				}
			}
		}

		&.-no-media {

			> a {
				background-color: $color-neutral-35;

				@include border-left-radius;

				.image-holder {
					height: 100%;
				}
			}
		}
	}

	// Layout Type 4 - Inner

	&.-layout4 {

		// Sticky post

		&.sticky {

			.image-holder {
				background-color: rgba($color-warning, .1);
			}
		}

		.overlay-details {
			width: auto;
		}

		.image-holder {
			background-color: $color-neutral-6;

			.overlay {
			    background-color: rgba($color-black, 0.5);
			    height: 100%;
			    width: 100%;
			    left: 0;
			    top: 0;
			    transition: none;

			    @include pseudo;
			}

			a {
				> img,
				> iframe,
				> .overlay {
					opacity: 0;
					visibility: hidden;
				}
			}
		}

		&:hover {

			.image-holder {

				a {
					> img,
					> iframe,
					> .overlay {
						opacity: 1;
						visibility: visible;
						transition: opacity $transition-duration $transition-function !important;
					}
				}
			}

			* {
				color: $color-white;
			}
		}
	}

	// Layout Type 4,6

	&.-layout4,
	&.-layout6.-contained {

		// Inner elements transition

		&:not(:hover) {

			* {
				transition: none !important;
			}
		}

		&:hover {

			* {

				transition: $transition-duration $transition-function !important;
			}
		}
	}

	// Layout Type 5 - Compact

	&.-layout5 {

		@include md-screen {

			> a {
				min-width: 38%;
				max-width: 38%;
			}
		}
	}

	// Layout Type 6 - Simple

	&.-layout6 {

		@include sm-screen {

			&:not(.-contained) {
				margin-bottom: $grid-spacer;

				.image-holder {
					margin-top: $grid-spacer;
				}
			}
		}

		@include md-screen {

			&:not(.-contained) {

				.image-holder {
					display: none;
				}
			}

			&.-contained {

				.card-details {

					@include spacer;
				}

				.image-holder {
					
					> img,
					> iframe {
						opacity: 0;
						visibility: hidden;

						@include transition;
					}
				}

				&:hover {

					.image-holder {

						> img,
						> iframe {
							opacity: 1;
							visibility: visible;
						}
					}

					* {
						color: $color-white;
					}
				}
			}

			.card-details {
				position: relative;
				z-index: 1;

				@include flex;

				&-item {
					margin: 0;

					.headline-meta {
						flex-wrap: nowrap;
					}
					
					&:nth-child(1) {
						min-width: 25%;
					}

					&:nth-child(2) {
						flex-grow: 2;
						
						@include spacer(padding-left);
						@include spacer(padding-right);
					}
				}
			}

			.image-holder {
				position: absolute;
				left: 0;
				right: 0;
				padding: 0;
				height: 100%;

				@include border-radius;

				img,
				iframe {
					position: absolute;
					left: 0;
					top: 0;

					@include metro-img;
				}
			}
		}

		.overlay-details {
			position: relative;
			padding: 0.5rem 0 0 0;
		}

		&:not(.-contained) {
			border-top: 1px solid $color-border;

			.card-details {

				@include spacer(padding-top);
				@include spacer(padding-bottom);
			}
		}
	}

	// Layout Type 7 - Wide

	&.-layout7 {

		&:not(.-contained) {
			border-top: 1px solid $color-border;

			@include spacer(padding-top);
		}

		&.-contained {
			background-color: $color-neutral-6;

			.card-details {
				background-color: transparent;
			}
		}

		@include md-screen {

			@include flex;

			.read-more {
				position: absolute;
				right: 0;
				top: calc(#{$grid-spacer} * 2);
				z-index: 1;
			}

			> a,
			.card-details {
			    transform-style: preserve-3d;

			    @include transition;

			    transition-duration: calc(#{$transition-duration} * 1.5);
			}

			&.-metro {

				> a {

					&:not(.read-more) {
						display: block;
						opacity: 0;
						min-width: calc((100% - #{$grid-spacer}) / 3 );
						transform: translate3d(-100%, 0px, 0px);
					}
				}

				.card-details {
					transform: translate3d(calc((-100% - #{$grid-spacer}) / 2 + #{$grid-spacer}), 0px, 0px);
				}

				.image-holder {
					padding-bottom: 55%;
				}
			}

			.card-details {
				width: 100%;
			}

			&:not(.-contained) {

				&.-metro {

					> a {

						&:not(.read-more) {
							padding-right: $grid-spacer;
						}
					}
				}

				.card-details {
					padding: 0;

					@include flex;
					@include flex-just(space-between);
					@include flex-direction(column);
				}
			}

			&.-contained {
				background-color: $color-neutral-6;

				.read-more {
					right: $grid-spacer;
					top: $grid-spacer;
				}
			}

			&:hover {

				&:not(.-contained) {

					.card-details {
						padding-left: $grid-spacer;
					}
				}

				> a {
					
					&:not(.read-more) {
						opacity: 1;
				    	transform: translate3d(0px, 0px, 0px);
					}
				}

				.card-details {
					opacity: 1;
				    transform: translate3d(0px, 0px, 0px);
				}
			}
		}
	}

	// Layout Type 6, 7

	&.-layout6,
	&.-layout7 {

		.read-more {
			
			@include flex;
		}

		@include sm-screen {

			.read-more {
				position: absolute;
			}

			&.-contained {

				.read-more {
					right: $grid-spacer;
					bottom: $grid-spacer;
				}
			}

			&:not(.-contained) {

				.read-more {
					bottom: 0;
					right: 0;
				}
			}
		}
	}

	// Without media

	&.-no-media {

		&.-contained {

			.card-details {

				@include border-radius;
			}
		}
	}
}

// Remove border for last element - Layout Type 6

.grid-item {

	// Add mobile spacing with grid offset enabled

	@include sm-screen {

		&.-nospace {

			.blog-item {

				&.-layout6 {

					&.-contained {
						margin-bottom: calc(#{$grid-spacer} * 2);
					}
				}
			}
		}
	}
}

// Galleries (for Envato Review)

.blog-grid {

	.gallery {
		flex-flow: row wrap;
		margin-bottom: 20px !important;

		@include flex;
        @include flex-just(center);

		.gallery-item {
			display: inline-block;
			margin: 0px 5px 5px 0px;
			margin-top: 0px !important;
			text-align: center;
			vertical-align: top;
			width: 100%;
			position: relative;

			img {
				border: none !important;

			    @include transition;
			}

			.gallery-caption {
				position: absolute;
				background: rgba($color-white, .8);
				padding: 3px 10px;
				transform: translateY(-100%);
			    width: 100%;
			    opacity: 0;
			    font-size: .8em;
			    font-weight: normal;

			    @include transition;
			}

			&:hover {

				.gallery-caption {
					opacity: 1;
				}	

				img {
					opacity: .8;
				}
			}
		}

		&.gallery-columns-3 {

			.gallery-item {
				max-width: calc((100% - 5px * 2) / 3);

				&:nth-of-type(3n+3),
				&:last-of-type {
					margin-right: 0;	
				}
		 	}
		}
	}
}
