/* AI Creative Gallery — selectors are intentionally isolated from the LION BLOG theme. */
.ai-creative-gallery,
.ai-creative-gallery *,
.ai-creative-lightbox,
.ai-creative-lightbox * {
	box-sizing: border-box;
}

.ai-creative-gallery {
	--ai-gallery-ink: #171717;
	--ai-gallery-muted: #666;
	--ai-gallery-line: #dedede;
	--ai-gallery-accent: #9c1f24;
	--ai-gallery-shadow: 0 18px 48px rgba(0, 0, 0, 0.10);
	width: 100%;
	margin: 0 0 56px;
	color: var(--ai-gallery-ink);
	font: inherit;
}

.ai-creative-gallery__intro,
.ai-creative-gallery__notice {
	margin: 0;
}

.ai-creative-gallery__intro {
	max-width: 760px;
	color: #444;
	font-size: 15px;
	line-height: 1.9;
}

.ai-creative-gallery__notice {
	margin-top: 16px;
	margin-bottom: 30px;
	padding: 12px 15px;
	border: 0;
	background: #f7f7f7;
	color: #606060;
	font-size: 12px;
	line-height: 1.75;
}

.ai-creative-gallery__grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-flow: row;
	align-items: start !important;
	gap: 26px 18px;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
}

.ai-creative-gallery__cell {
	position: relative !important;
	top: auto !important;
	align-self: start !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	transform: none !important;
}

button.ai-creative-gallery__card {
	-webkit-appearance: none;
	appearance: none;
	position: relative !important;
	top: auto !important;
	display: block !important;
	width: 100% !important;
	min-width: 0;
	height: auto;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	color: inherit !important;
	font: inherit;
	line-height: inherit;
	text-align: left;
	text-decoration: none !important;
	transform: none !important;
	cursor: zoom-in;
}

.ai-creative-gallery__figure {
	display: block !important;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
}

.ai-creative-gallery__visual {
	position: relative;
	display: block;
	aspect-ratio: 1122 / 1402;
	overflow: hidden;
	border: 1px solid var(--ai-gallery-line);
	border-radius: 4px;
	background: #ececec;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.ai-creative-gallery__visual::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.48), transparent 29%);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease;
}

.ai-creative-gallery__image {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.ai-creative-gallery__zoom {
	position: absolute;
	right: 14px;
	bottom: 13px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	opacity: 0;
	transform: translateY(5px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.ai-creative-gallery__zoom svg {
	width: 17px;
	height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.ai-creative-gallery__meta {
	display: block;
	margin: 0;
	padding: 12px 0 0;
}

.ai-creative-gallery__title {
	display: block;
	color: var(--ai-gallery-ink);
	font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.55;
}

.ai-creative-gallery__category {
	display: block;
	margin-top: 4px;
	color: var(--ai-gallery-muted);
	font-size: 11px;
	line-height: 1.6;
	letter-spacing: 0.03em;
}

.ai-creative-gallery__card:hover .ai-creative-gallery__visual,
.ai-creative-gallery__card:focus-visible .ai-creative-gallery__visual {
	border-color: #aaa;
	box-shadow: var(--ai-gallery-shadow);
}

.ai-creative-gallery__card:hover .ai-creative-gallery__image,
.ai-creative-gallery__card:focus-visible .ai-creative-gallery__image {
	transform: scale(1.018);
}

.ai-creative-gallery__card:hover .ai-creative-gallery__visual::after,
.ai-creative-gallery__card:focus-visible .ai-creative-gallery__visual::after,
.ai-creative-gallery__card:hover .ai-creative-gallery__zoom,
.ai-creative-gallery__card:focus-visible .ai-creative-gallery__zoom {
	opacity: 1;
}

.ai-creative-gallery__card:hover .ai-creative-gallery__zoom,
.ai-creative-gallery__card:focus-visible .ai-creative-gallery__zoom {
	transform: translateY(0);
}

.ai-creative-gallery__card:focus-visible {
	outline: 3px solid rgba(156, 31, 36, 0.25);
	outline-offset: 5px;
	border-radius: 3px;
}

body.ai-creative-lightbox-open {
	overflow: hidden;
}

.ai-creative-lightbox[hidden] {
	display: none !important;
}

.ai-creative-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: 14px;
	background: rgba(0, 0, 0, 0.84);
	backdrop-filter: blur(3px);
}

.ai-creative-lightbox__panel {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	width: min(1040px, 100%);
	height: min(88vh, 900px);
	max-height: calc(100vh - 28px);
	overflow: hidden;
	border-radius: 6px;
	background: #121212;
	box-shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
}

.ai-creative-lightbox__visual {
	position: relative;
	display: grid;
	place-items: center;
	min-width: 0;
	min-height: 0;
	padding: 26px 74px;
	background: linear-gradient(135deg, #161616, #050505);
}

.ai-creative-lightbox__image {
	display: block !important;
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	object-fit: contain;
	box-shadow: 0 14px 48px rgba(0, 0, 0, 0.42);
}

.ai-creative-lightbox__info {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: 30px 25px;
	background: #fff;
	color: #171717;
}

.ai-creative-lightbox__title,
.ai-creative-lightbox__category,
.ai-creative-lightbox__guide {
	margin: 0;
}

.ai-creative-lightbox__title {
	margin: 0 0 8px !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: #171717 !important;
	font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif !important;
	font-size: 21px !important;
	font-weight: 600 !important;
	line-height: 1.55 !important;
}

.ai-creative-lightbox__title::before,
.ai-creative-lightbox__title::after {
	display: none !important;
	content: none !important;
}

.ai-creative-lightbox__category {
	color: #666;
	font-size: 12px;
	line-height: 1.7;
}

.ai-creative-lightbox__guide {
	margin-top: 28px;
	color: #888;
	font-size: 11px;
	line-height: 1.7;
}

.ai-creative-lightbox button {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
}

.ai-creative-lightbox__close {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 6;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.34);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.42);
	color: #fff;
	cursor: pointer;
}

.ai-creative-lightbox__close::before,
.ai-creative-lightbox__close::after {
	content: "";
	position: absolute;
	width: 17px;
	height: 1px;
	background: currentColor;
}

.ai-creative-lightbox__close::before { transform: rotate(45deg); }
.ai-creative-lightbox__close::after { transform: rotate(-45deg); }

.ai-creative-lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: grid;
	place-items: center;
	width: 48px;
	height: 68px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.36);
	color: #fff;
	transform: translateY(-50%);
	cursor: pointer;
	transition: background 0.18s ease;
}

.ai-creative-lightbox__nav:hover,
.ai-creative-lightbox__nav:focus-visible,
.ai-creative-lightbox__close:hover,
.ai-creative-lightbox__close:focus-visible {
	background: rgba(0, 0, 0, 0.76);
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}

.ai-creative-lightbox__nav svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
}

.ai-creative-lightbox__nav--prev { left: 15px; }
.ai-creative-lightbox__nav--next { right: 15px; }

.ai-creative-lightbox__actions {
	display: flex;
	gap: 8px;
}

.ai-creative-lightbox__actions button {
	flex: 1;
	margin: 0;
	padding: 10px 8px;
	border: 1px solid #ccc;
	border-radius: 0;
	background: #fff;
	color: #222;
	cursor: pointer;
}

.ai-creative-lightbox__actions button:hover,
.ai-creative-lightbox__actions button:focus-visible {
	border-color: #777;
	outline: 2px solid rgba(156, 31, 36, 0.3);
	outline-offset: 1px;
}

@media (max-width: 720px) {
	.ai-creative-gallery {
		margin-bottom: 44px;
	}

	.ai-creative-gallery__intro {
		font-size: 14px;
	}

	.ai-creative-gallery__notice {
		margin-bottom: 24px;
	}

	.ai-creative-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 10px;
	}

	.ai-creative-gallery__zoom {
		display: none;
	}

	.ai-creative-gallery__title {
		font-size: 13px;
	}

	.ai-creative-gallery__category {
		font-size: 10px;
	}

	.ai-creative-lightbox__panel {
		grid-template-columns: 1fr;
		height: auto;
		max-height: calc(100vh - 28px);
		overflow: auto;
	}

	.ai-creative-lightbox__visual {
		min-height: min(68vh, 720px);
		padding: 54px 38px 18px;
	}

	.ai-creative-lightbox__info {
		display: block;
		padding: 20px 22px;
	}

	.ai-creative-lightbox__guide {
		display: none;
	}

	.ai-creative-lightbox__actions {
		margin-top: 18px;
	}

	.ai-creative-lightbox__nav {
		width: 38px;
		height: 56px;
	}

	.ai-creative-lightbox__nav--prev { left: 4px; }
	.ai-creative-lightbox__nav--next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
	.ai-creative-gallery *,
	.ai-creative-gallery *::before,
	.ai-creative-gallery *::after,
	.ai-creative-lightbox *,
	.ai-creative-lightbox *::before,
	.ai-creative-lightbox *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

.ai-creative-lightbox__loader {
	position: absolute;
	z-index: 4;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.ai-creative-lightbox__loader[hidden] {
	display: none !important;
}

.ai-creative-lightbox__loader > span:first-child {
	display: block;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.28);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ai-creative-gallery-spin 0.8s linear infinite;
}

.ai-creative-lightbox.is-loading .ai-creative-lightbox__image {
	opacity: 0;
}

.ai-creative-lightbox__image {
	transition: opacity 0.16s ease;
}

.ai-creative-lightbox .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@keyframes ai-creative-gallery-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.ai-creative-lightbox__loader > span:first-child {
		animation: none;
	}
}
