/* =Media
----------------------------------------------- */

.page-content,
.entry-content,
.comment-content {
	img.wp-smiley {
		border: none;
		margin-bottom: 0;
		margin-top: 0;
		padding: 0;
	}
}
// Image Captions
.wp-caption {
	border: 1px solid #ccc;
	margin-bottom: $vspacing;
	max-width: 100%;

	img[class*="wp-image-"] {
		display: block;
		margin: 1.2% auto 0;
		max-width: 98%;
	}
	.wp-caption-text {
		text-align: center;
		margin: 0.8075em 0;
	}
}

// Galleries
.gallery {

	@extend %clearfix;

	margin-bottom: $vspacing;

	.gallery-item {
		float: left;

		.gallery-icon {
			a { display: block; }

			img {
				border: none;
				height: auto;
				margin-bottom: 0;
			}
		}

		.gallery-caption {
			margin: 0;
			text-align: center;
		}

	}

}

@mixin gallery_column ( $margin: 2, $num: 4 ){
	.gallery-columns-#{$num} .gallery-item {
     width: ( 100% - $margin * ( $num - 1 ) ) / $num;
     margin-right: $margin;
  }
  	.gallery-columns-#{$num} .gallery-item:nth-of-type(#{$num}n - #{$num}) {
     margin-right: 0;
     clear: right;
  }

}

/* Fluid Gallery Columns
   works well if you remove the default gallery styling
   by adding the following to your functions.php
   add_filter( 'use_default_gallery_style', '__return_false' );
*/

@for $i from 2 through 9 {
	@include gallery_column( 2, $i );
}

/* Make sure embeds and iframes fit their containers */
embed,
iframe,
object {
	max-width: 100%;
}