/*
 * NDTI Ads front-end styles.
 *
 * Everything hooks on data attributes rather than class names, because the
 * wrapper class prefix is user-configurable (it exists so that generic
 * "ad"-style selectors in blocker lists do not match).
 */

[data-ndti-label] {
	display: block;
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: .04em;
	text-transform: uppercase;
	opacity: .6;
	margin: 0 0 4px;
}

/* Sticky placements ----------------------------------------------------- */

[data-ndti-sticky] {
	position: fixed;
	z-index: 99990;
	max-width: 100%;
	box-shadow: 0 0 12px rgba( 0, 0, 0, .18 );
	background: #fff;
}

[data-ndti-sticky="header"] {
	top: 0;
	left: 0;
	right: 0;
	text-align: center;
}

[data-ndti-sticky="footer"] {
	bottom: 0;
	left: 0;
	right: 0;
	text-align: center;
}

[data-ndti-sticky="left"] {
	left: 0;
	top: 50%;
	transform: translateY( -50% );
}

[data-ndti-sticky="right"] {
	right: 0;
	top: 50%;
	transform: translateY( -50% );
}

@media ( max-width: 767px ) {
	[data-ndti-sticky="left"],
	[data-ndti-sticky="right"] {
		display: none;
	}
}

/* Layer / pop-up -------------------------------------------------------- */

[data-ndti-layer] {
	position: fixed;
	z-index: 99999;
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
	max-width: calc( 100vw - 32px );
	max-height: calc( 100vh - 32px );
	overflow: auto;
	padding: 24px;
	background: #fff;
	box-shadow: 0 8px 40px rgba( 0, 0, 0, .3 );
	border-radius: 4px;
}

/* Close button ---------------------------------------------------------- */

[data-ndti-close-btn] {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 24px;
	height: 24px;
	padding: 0;
	line-height: 22px;
	text-align: center;
	font-size: 18px;
	cursor: pointer;
	border: 1px solid rgba( 0, 0, 0, .15 );
	border-radius: 50%;
	background: rgba( 255, 255, 255, .9 );
	color: #333;
}

[data-ndti-close-btn]:hover {
	background: #fff;
	color: #000;
}

/* Containment ----------------------------------------------------------- */

/*
 * An ad must never be wider than the column it sits in. Ad markup comes from
 * third parties and often carries its own fixed dimensions, so this is a
 * backstop rather than a nicety.
 */

[data-ndti-ad],
[data-ndti-pl] {
	max-width: 100%;
}

[data-ndti-ad] img,
[data-ndti-pl] img {
	max-width: 100%;
	height: auto;
}

[data-ndti-ad] iframe,
[data-ndti-pl] iframe {
	max-width: 100%;
}

/* Utility --------------------------------------------------------------- */

[data-ndti-slide] {
	width: 100%;
}

.ndti-ads-image {
	max-width: 100%;
	height: auto;
}
