/**
 * Media area: /media (video tabs), /blogs and /events listings, blog and
 * event details (live "Constro" .blog-post.date-style-3 cards, .wt-tabs,
 * .blog-post-single, .mfp-gallery).
 *
 * Values measured on bluearc.com.pk (media.md §0.4, §1–5) at 1440, 1024,
 * 768 and 390. Imported body classes (h2.ba-h1, figure.image …) live in
 * components.css.
 *
 * @package BlueArcChild
 */

/* ==========================================================================
   1. Shared post pieces: media box, date pill
   <div class="ba-post-media [ba-post-media--zoom]"><img class="ba-post-media__img"></div>
   <span class="ba-post-date"><i class="fa fa-calendar"></i><time>…</time></span>
   ========================================================================== */

.ba-post-media {
	position: relative;
	display: block;
	overflow: hidden;
	border-bottom: 3px solid var(--ba-primary);
}

.ba-post-media > a {
	display: block;
}

.ba-post-media__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	transition: transform 0.6s ease;
}

/* Keep the image zoom responsive and gentle on both hover in and out. */
.ba-post-media--zoom .ba-post-media__img {
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.ba-post-media--zoom:hover .ba-post-media__img {
	transform: scale(1.08);
}

/* Sits on the image's bottom-left corner, just above the 3px cyan rule. */
.ba-post-date {
	position: absolute;
	z-index: 1;
	top: -39px;
	left: 0;
	display: block;
	height: 36px;
	padding: 8px 15px;
	background-color: var(--ba-dark);
	color: var(--ba-white);
	font-family: var(--ba-font-accent);
	font-size: 14px;
	font-style: italic;
	font-weight: var(--ba-fw-regular);
	line-height: 20px;
	white-space: nowrap;
}

.ba-post-date .fa {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 36px;
	margin: -8px 15px 0 -15px;
	background-color: var(--ba-primary);
	color: var(--ba-white);
	line-height: 36px;
	text-align: center;
}

/* ==========================================================================
   2. Listing cards (/blogs, /events)
   ========================================================================== */

.ba-post-card {
	position: relative;
	margin-bottom: 40px;
}

.ba-post-card__info {
	position: relative;
	padding: 30px 0;
}

.ba-post-card__title-wrap,
.ba-post-single__title-wrap {
	margin-bottom: 10px;
}

.ba-post-card__title,
.ba-post-single__title {
	margin: 0;
	color: var(--ba-text-legacy-heading);
	font-size: var(--ba-fs-h3);
	font-weight: var(--ba-fw-regular);
	line-height: var(--ba-lh-h3);
}

/* Blogs: live inline rule `.post-title { font-weight: bold; text-transform: capitalize }` on an h2. */
.ba-post-card--blog .ba-post-card__title,
.ba-post-single--blog .ba-post-single__title {
	font-size: var(--ba-fs-h2);
	font-weight: var(--ba-fw-bold);
	line-height: var(--ba-lh-h2);
	text-transform: capitalize;
}

.ba-post-card__meta,
.ba-post-single__meta {
	margin-bottom: 5px;
}

.ba-post-card__text {
	margin-bottom: 15px;
}

.ba-post-card__text p:last-child {
	margin: 0;
}

.ba-post-card__more {
	margin-bottom: 15px;
}

.ba-post-card__readmore {
	display: inline-block;
	font-size: 16px;
	font-weight: var(--ba-fw-semibold);
	line-height: 1.42857;
}

/* Stays underlined on hover (#333), unlike other links. */
.ba-post-card__readmore,
.ba-post-card__readmore:hover,
.ba-post-card__readmore:focus {
	text-decoration: underline;
}

.ba-media-listing__empty {
	text-align: center;
}

/* ==========================================================================
   3. Details (blog: 80px under the header; event: flush under the header)
   ========================================================================== */

.ba-post-single {
	position: relative;
	margin-bottom: 40px;
}

.ba-post-single__body {
	position: relative;
	padding-top: 30px;
}

/* Live wraps the body in a <p>, which the parser closes into an empty
   paragraph: its 24px margin is the gap under the title. */
.ba-post-single__text {
	margin-top: 24px;
	margin-bottom: 15px;
	overflow-wrap: break-word;
}

.ba-post-single__text ul,
.ba-post-single__text ol {
	padding: 0;
	list-style-position: outside;
}

/* Live body figures sit flush on the next block (measured on blog 74). */
.ba-post-single__text figure.image {
	margin-bottom: 0;
}

/* ==========================================================================
   4. Event gallery (live .portfolio-wrap.mfp-gallery.no-col-gap, Isotope masonry)
   ========================================================================== */

.ba-event-gallery {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	margin-right: calc(var(--ba-gutter) * -1);
	margin-left: calc(var(--ba-gutter) * -1);
}

/* media.js packs the tiles (absolute positions) once it runs. */
.ba-event-gallery.is-masonry {
	display: block;
}

.ba-event-gallery.is-masonry .ba-event-gallery__item {
	position: absolute;
	top: 0;
	left: 0;
}

.ba-event-gallery.is-animated .ba-event-gallery__item {
	transition: top 1s, left 1s;
}

.ba-event-gallery__item {
	width: 33.333333%;
	padding: 15px;
}

.ba-event-gallery__thumb {
	position: relative;
	overflow: hidden;
	background-color: var(--ba-black);
}

/* 40% black veil growing from the middle (live .wt-img-overlay5). */
.ba-event-gallery__thumb::before {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 0;
	width: 100%;
	height: 0;
	background: var(--ba-black);
	content: "";
	opacity: 0.4;
	transition: all 0.3s linear;
}

.ba-event-gallery__img {
	display: block;
	width: 100%;
	height: auto;
	transition: filter 0.2s;
}

.ba-event-gallery__overlay {
	position: absolute;
	z-index: 1;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	text-align: center;
	transition: opacity 0.2s linear;
}

.ba-event-gallery__icon {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 50%;
	width: 160px;
	height: 40px;
	margin: -20px -75px;
}

.ba-event-gallery__zoom {
	display: inline-block;
	margin: 0 2px;
	border: 1px solid var(--ba-white);
	color: var(--ba-white);
	vertical-align: top;
}

.ba-event-gallery__zoom:hover,
.ba-event-gallery__zoom:focus {
	border-color: transparent;
	background-color: var(--ba-primary);
	color: var(--ba-white);
}

.ba-event-gallery__zoom .fa {
	display: inline-block;
	width: 40px;
	height: 40px;
	font-size: 14px;
	line-height: 40px;
	text-align: center;
}

.ba-event-gallery__thumb:hover::before {
	top: 0;
	height: 100%;
}

.ba-event-gallery__thumb:hover .ba-event-gallery__img {
	filter: blur(3px);
}

.ba-event-gallery__thumb:hover .ba-event-gallery__overlay,
.ba-event-gallery__thumb:focus-within .ba-event-gallery__overlay {
	opacity: 1;
}

@media (max-width: 991px) {
	.ba-event-gallery__item {
		width: 50%;
	}
}

@media (max-width: 768px) {
	.ba-event-gallery__item {
		width: 100%;
	}
}

/* ==========================================================================
   5. /media video library (live .wt-tabs .media_menu + #content)
   ========================================================================== */

.ba-media-tabs__list {
	border: 1px solid var(--ba-border-team);
}

.ba-media-tabs__tab {
	display: block;
	width: 100%;
	margin: 0 0 -1px;
	padding: 15px;
	border: 1px solid transparent;
	border-bottom-color: var(--ba-border-team);
	border-radius: 0;
	background-color: transparent;
	color: var(--ba-text-strong);
	font-family: var(--ba-font-body);
	font-size: 14px;
	font-weight: var(--ba-fw-semibold);
	line-height: 20px;
	text-align: left;
	transition: all var(--ba-t-legacy);
}

.ba-media-tabs__tab:hover,
.ba-media-tabs__tab.is-active {
	border-color: var(--ba-primary);
	background-color: var(--ba-primary);
	color: var(--ba-white);
}

.ba-media-tabs__tab.is-active {
	cursor: default;
}

.ba-media-tabs__heading {
	margin: 20px 0;
	color: var(--ba-primary);
	font-size: var(--ba-fs-h3);
	font-weight: var(--ba-fw-bold);
	line-height: var(--ba-lh-h3);
	text-align: center;
}

.ba-video-card {
	position: relative;
	margin-bottom: 40px;
}

/* Live: a 16:9 box (fitvids) holding a 200px-tall iframe, then the cyan rule;
   never shorter than the player so it cannot cover the title. */
.ba-video-card__media {
	position: relative;
	height: 0;
	padding-top: max(56.25%, 200px);
	border-bottom: 3px solid var(--ba-primary);
}

.ba-video-card__player.ba-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 200px;
	aspect-ratio: auto;
}

/* The cued YouTube player shows its red play button. */
.ba-video-card__player .ba-video__play {
	background-color: var(--ba-youtube);
}

/* hqdefault.jpg is 4:3 with letterbox bands: size it so its 16:9 picture covers the player. */
.ba-video-card__player .ba-video-card__thumb {
	inset: auto;
	top: 50%;
	left: 50%;
	width: max(100%, 355.56px);
	max-width: none;
	height: auto;
	object-fit: fill;
	transform: translate(-50%, -50%);
}

.ba-video-card__info {
	position: relative;
	padding: 30px 0;
}

/* Fixed 30px box as live: two-line titles run into the padding below. */
.ba-video-card__title {
	height: 30px;
	margin: 0 0 10px;
	color: var(--ba-text-legacy-heading);
	font-size: var(--ba-fs-h3);
	font-weight: var(--ba-fw-regular);
	line-height: var(--ba-lh-h3);
	transition: color var(--ba-t-legacy);
}

.ba-video-card__title:hover {
	color: var(--ba-primary);
}

@media (min-width: 768px) {
	.ba-media-tabs__list {
		margin-right: auto;
		margin-left: auto;
	}
}

@media (min-width: 1025px) {
	.ba-media-tabs__list {
		width: 65%;
	}
}

@media (max-width: 768px) {
	.ba-media-tabs__panel {
		padding-top: 60px;
	}
}
.ba-post-single__text .ba-p-flush { margin: 0; line-height: normal; }
.ba-post-single__text .ba-p-lh138 { line-height: 1.38; }
