/* ============================================================
   JustAds — Frontend styles
   Loaded via the `style` field of build/block.json.
   ============================================================ */

/* ---------- Wrapper + skeleton -------------------------------- */
.justads-wrapper {
	align-items: center;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 600px;
	overflow: hidden;
	position: relative !important;
	transition: background-color .3s ease;
	width: 300px;
}
.justads-wrapper[data-ad-loaded="true"] {
	height: auto;
	min-height: 0;
	overflow: visible;
}
.justads-wrapper[data-ad-loaded="true"] {
	background: transparent;
	border: none;
}

.justads-skeleton {
	animation: justads-shimmer 1.5s infinite;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	height: 100%;
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
	z-index: 1;
}
.justads-wrapper[data-ad-loaded="true"] .justads-skeleton {
	display: none;
}

@keyframes justads-shimmer {
	0%   { background-position:  200% 0; }
	100% { background-position: -200% 0; }
}

/* ---------- Responsive: hide on tablet & mobile --------------- */
@media (max-width: 1023px) {
	.justads-wrapper {
		display: none !important;
		height: 0 !important;
		min-height: 0 !important;
		overflow: hidden !important;
		visibility: hidden !important;
		width: 0 !important;
	}
}

/* ---------- Dark mode ----------------------------------------- */
@media (prefers-color-scheme: dark) {
	.justads-skeleton {
		background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
		background-size: 200% 100%;
	}
	.justads-wrapper {
		border-color: #444;
	}
}

/* ---------- Reduced motion + print ---------------------------- */
@media (prefers-reduced-motion: reduce) {
	.justads-skeleton {
		animation: none;
		background: #f5f5f5;
	}
}
@media print {
	.justads-wrapper {
		display: none !important;
	}
}

/* ---------- Local ad container -------------------------------- */
.justads-content {
	height: 100%;
	width: 100%;
}

.justads-wrapper.justads-local-visible {
	background: transparent;
	border: none;
	overflow: visible;
}

.justads-ad-item {
	display: flex;
	flex-direction: column;
	width: 300px;
}

/* ---------- Local ad template (300×600) ----------------------- */
.justads-template-front {
	cursor: pointer;
	display: block;
	height: 600px;
	overflow: hidden;
	position: relative;
	text-decoration: none !important;
	transition: box-shadow .25s ease;
	width: 300px;
}
.justads-template-front:hover,
.justads-template-front:focus,
.justads-template-front:visited {
	text-decoration: none !important;
}
.justads-template-front:hover {
	box-shadow: 0 8px 32px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .14);
}

@media (prefers-reduced-motion: reduce) {
	.justads-template-front { transition: none; }
	.justads-template-front:hover {
		box-shadow: 0 0 0 3px rgba(0, 0, 0, .2);
		transform: none;
	}
}

/* ---------- Layers inside the template ------------------------ */
.justads-bg-layer {
	background-position: 50%;
	background-size: cover;
	bottom: -15px;
	left:   -15px;
	right:  -15px;
	top:    -15px;
	position: absolute;
	z-index: 0;
}

.justads-overlay-layer {
	bottom: 0;
	left:   0;
	right:  0;
	top:    0;
	position: absolute;
	z-index: 1;
}

.justads-content-container {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 15px;
	height: 100%;
	justify-content: center;
	padding: 20px;
	position: relative;
	text-align: center;
	z-index: 2;
}

.justads-logo {
	max-height: 80px;
	max-width: 80%;
	object-fit: contain;
}

.justads-headline {
	font-size: 28px;
	font-weight: 800;
	line-height: 1.2;
	margin: 0;
}

.justads-description {
	font-size: 15px;
	line-height: 1.4;
	margin: 0;
}

.justads-button {
	border-radius: 6px;
	display: inline-block;
	font-size: 16px;
	font-weight: 700;
	margin-top: 10px;
	padding: 12px 24px;
}

/* ---------- Animations ---------------------------------------- */
.justads-template-front[data-animation]:not([data-animation="none"]) .anim-el {
	opacity: 0;
}

.justads-anim-cascade_fade  { animation: justads-fade .5s forwards; }
.justads-anim-cascade_slide { animation: justads-slide-up .6s cubic-bezier(.175, .885, .32, 1.275) forwards; }
.justads-anim-zoom_out      { animation: justads-zoom-out .6s ease-out forwards; }

@keyframes justads-fade {
	0%   { opacity: 0; }
	100% { opacity: 1; }
}
@keyframes justads-slide-up {
	0%   { opacity: 0; transform: translateY(30px); }
	100% { opacity: 1; transform: translateY(0); }
}
@keyframes justads-zoom-out {
	0%   { opacity: 0; transform: scale(1.2); }
	100% { opacity: 1; transform: scale(1); }
}

/* ---------- Advertiser attribution ----------------------------
   Block element displayed above the 300×600 ad, outside the ad
   container so it never overlaps the border. */
.justads-ad-attribution {
	display: block;
	width: 300px;
	box-sizing: border-box;
	padding: 4px 8px;
	background: #f3f4f6;
	color: #6b7280;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.3px;
	text-align: center;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-radius: 0 0 4px 4px;
}

@media (prefers-color-scheme: dark) {
	.justads-ad-attribution {
		background: #1f2937;
		color: #d1d5db;
	}
}
