/* =========================================================
   Video block — frontend styles
   ========================================================= */

/* Wrapper */
.video-block {
	position: relative;
}

/* Clickable trigger button */
.video-block__trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

/* Thumbnail image */
.video-block__thumbnail {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: filter 0.25s ease;
}

.video-block__thumbnail--empty {
	background: var(--wp--preset--color--tmavoseda, #333);
	aspect-ratio: 1 / 1;
}

.video-block__trigger:hover .video-block__thumbnail,
.video-block__trigger:focus-visible .video-block__thumbnail {
	filter: brightness(0.75);
}

/* Play icon — top-right corner */
.video-block__play-icon {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 25px;
	height: 25px;
	pointer-events: none;
	transition: transform 0.2s ease;
}

.video-block__trigger:hover .video-block__play-icon,
.video-block__trigger:focus-visible .video-block__play-icon {
	transform: scale(1.15);
}

/* =========================================================
   Popup / modal
   ========================================================= */

.video-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-popup[hidden] {
	display: none;
}

/* Dark backdrop */
.video-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.88);
	cursor: pointer;
}

/* Centred container — 16:9 aspect ratio */
.video-popup__container {
	position: relative;
	z-index: 1;
	width: min(90vw, 960px);
	aspect-ratio: 16 / 9;
}

/* Close button */
.video-popup__close {
	position: absolute;
	top: -44px;
	right: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #fff;
	padding: 4px;
	line-height: 1;
}

.video-popup__close svg {
	width: 32px;
	height: 32px;
}

.video-popup__close:hover svg,
.video-popup__close:focus-visible svg {
	opacity: 0.75;
}

/* Embed area */
.video-popup__embed {
	width: 100%;
	height: 100%;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.video-popup__embed iframe,
.video-popup__embed video {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* =========================================================
   Editor styles
   ========================================================= */

/* Placeholder shown in editor when no image/URL is set */
.video-block-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	border: 2px dashed var(--wp--preset--color--bledoseda, #ccc);
	color: var(--wp--preset--color--stredneseda, #888);
}

.video-block-placeholder .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

/* Editor preview wrapper */
.video-block--editor-preview {
	position: relative;
	overflow: hidden;
}

/* =========================================================
   Responsive: full-width on mobile
   ========================================================= */
@media (max-width: 600px) {
  .wp-block-dku-abuba-video {
    width: 100% !important;
  }
}
