/* -----------------------------------------
	09. WordPress Defaults
----------------------------------------- */

/* WordPress Galleries
=================================== */
.gallery {
	@include make-row($grid-gutter-widths-galleries);
	margin: 40px 0;

	&:first-child {
		margin-top: 0;
	}

	&:last-child {
		margin-bottom: 0;
	}
}

.gallery-item {
	margin-bottom: 10px;

	img {
		width: 100%;
		max-width: 100%;
	}

	&:hover {
		.gallery-caption {
			opacity: 1;
		}
	}
}

@for $i from 1 through 9 {
	.gallery-columns-#{$i} {
		.gallery-item {
			@include make-col-ready($grid-gutter-widths-galleries);
			@include make-col(calc(12 / $i));

			@if $i > 5 {
				@include media-breakpoint-down(md) {
					@include make-col(4);
				}
			}

			@include media-breakpoint-down(sm) {
				@include make-col(6);
			}
		}
	}
}

.gallery-caption {
	background-color: rgba($black, .7);
	color: $white;
	font-size: 12px;
	line-height: 1.5;
	margin: 0 0 0 5px;
	max-height: 50%;
	opacity: 0;
	padding: 6px 8px;
	position: absolute;
	bottom: 0;
	left: 0;
	text-align: left;
	width: calc(100% - 10px);
	transition: opacity .18s ease;

	&::before {
		content: "";
		height: 100%;
		min-height: 49px;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
	}
}

.gallery-columns-6,
.gallery-columns-7,
.gallery-columns-8,
.gallery-columns-9 {
	.gallery-caption {
		display: none;
	}
}

/* WordPress Classes
=================================== */

/* Alignment */

.alignnone {
	margin: 5px 0 20px;

	p & {
		margin-bottom: 0;
	}
}

.aligncenter {
	display: block;
	margin: 7px auto;
}

.alignright {
	float: right;
	margin: 7px 0 7px 24px;
}

.alignleft {
	float: left;
	margin: 7px 24px 7px 0;
}

/* Captions */

.wp-caption {
	max-width: 100%;
	margin-bottom: 15px;

	img {
		border: 0 none;
		height: auto;
		margin: 0;
		padding: 0;
		width: auto;
	}

	.wp-caption-text {
		font-size: 12px;
		line-height: 17px;
		margin: 3px 0 5px;
		padding: 5px 0 0;
		text-align: left;
		font-style: italic;
	}
}

.sticky {
	/* Provide sticky styles if necessary */
}
