/* Lme Gallery — フロント表示 */

.lme-gallery {
	--lme-cols-pc: 4;
	--lme-cols-tablet: 3;
	--lme-cols-sp: 2;
	--lme-gap: 12px;
	--lme-radius: 6px;
}

.lme-gallery__grid {
	display: grid;
	grid-template-columns: repeat(var(--lme-cols-pc), minmax(0, 1fr));
	gap: var(--lme-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.lme-gallery__grid {
		grid-template-columns: repeat(var(--lme-cols-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.lme-gallery__grid {
		grid-template-columns: repeat(var(--lme-cols-sp), minmax(0, 1fr));
	}
}

.lme-gallery__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lme-gallery__link {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: #f2f2f2;
	border-radius: var(--lme-radius);
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 1 / 1;
}

.lme-gallery__link.is-static {
	cursor: default;
}

.lme-gallery__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.lme-gallery__link:hover .lme-gallery__img,
.lme-gallery__link:focus-visible .lme-gallery__img {
	transform: scale(1.04);
}

.lme-gallery__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lme-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 46px;
	height: 46px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	pointer-events: none;
}

.lme-gallery__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	width: 0;
	height: 0;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 8px 0 8px 14px;
	border-color: transparent transparent transparent #fff;
}

/* 複数枚投稿のアイコン */

.lme-gallery__multi {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	color: #fff;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
	pointer-events: none;
}

.lme-gallery__multi svg {
	display: block;
}

.lme-gallery__caption {
	margin-top: 8px;
	font-size: 0.85em;
	line-height: 1.6;
	word-break: break-word;
}

.lme-gallery__ig {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.78em;
	text-decoration: none;
	opacity: 0.75;
}

.lme-gallery__ig:hover {
	opacity: 1;
	text-decoration: underline;
}

.lme-gallery-empty {
	margin: 1em 0;
	opacity: 0.7;
}

/* もっと見る */

.lme-gallery__more {
	margin-top: 24px;
	text-align: center;
}

.lme-gallery__more-button {
	display: inline-block;
	min-width: 200px;
	padding: 12px 32px;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 0.95em;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.lme-gallery__more-button:hover:not(:disabled) {
	color: #fff;
	background: #222;
	border-color: #222;
}

.lme-gallery__more-button:disabled {
	opacity: 0.55;
	cursor: default;
}

.lme-gallery__more-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.lme-gallery__status {
	margin: 10px 0 0;
	text-align: center;
	font-size: 0.85em;
	opacity: 0.7;
	min-height: 1.2em;
}

/* プロフィールカード */

.lme-ig-profile {
	--lme-avatar: 150px;
	max-width: 720px;
	margin: 0 auto;
}

.lme-ig-profile__head {
	display: flex;
	align-items: flex-start;
	gap: 28px;
}

.lme-ig-profile--center .lme-ig-profile__head {
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 16px;
}

.lme-ig-profile__avatar {
	flex: 0 0 var(--lme-avatar);
	width: var(--lme-avatar);
	height: var(--lme-avatar);
	border-radius: 50%;
	overflow: hidden;
	background: #f0f0f0;
}

.lme-ig-profile__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lme-ig-profile__info {
	flex: 1 1 auto;
	min-width: 0;
}

.lme-ig-profile__username {
	margin: 0 0 6px;
	font-size: 1.7em;
	font-weight: 700;
	line-height: 1.2;
	word-break: break-all;
}

.lme-ig-profile__username a {
	color: inherit;
	text-decoration: none;
}

.lme-ig-profile__username a:hover {
	text-decoration: underline;
}

.lme-ig-profile__name {
	margin: 0 0 14px;
	font-size: 1em;
	font-weight: 500;
}

.lme-ig-profile__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.lme-ig-profile--center .lme-ig-profile__stats {
	justify-content: center;
}

.lme-ig-profile__stats li {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.95em;
}

.lme-ig-profile__stat-value {
	font-weight: 700;
}

.lme-ig-profile__bio {
	margin: 0 0 8px;
	font-size: 0.95em;
	line-height: 1.7;
	word-break: break-word;
}

.lme-ig-profile__link {
	margin: 0;
	font-size: 0.95em;
	word-break: break-all;
}

.lme-ig-profile__link a {
	font-weight: 600;
	text-decoration: none;
}

.lme-ig-profile__link a:hover {
	text-decoration: underline;
}

.lme-ig-profile__actions {
	display: flex;
	gap: 10px;
	margin-top: 22px;
}

.lme-ig-profile__button {
	flex: 1 1 0;
	padding: 14px 20px;
	border-radius: 10px;
	background: #f0f0f1;
	color: inherit;
	font-size: 0.95em;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.lme-ig-profile__button:hover {
	opacity: 0.85;
	text-decoration: none;
}

.lme-ig-profile__button--primary {
	background: #4f46e5;
	color: #fff;
}

@media (max-width: 640px) {
	.lme-ig-profile {
		--lme-avatar: 88px;
	}

	.lme-ig-profile__head {
		gap: 16px;
	}

	.lme-ig-profile__username {
		font-size: 1.3em;
	}

	.lme-ig-profile__stats {
		gap: 6px 18px;
		font-size: 0.9em;
	}

	.lme-ig-profile__actions {
		margin-top: 16px;
	}

	.lme-ig-profile__button {
		padding: 12px 14px;
	}
}

/* ライトボックス / 詳細表示 */

.lme-gallery-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 72px;
	background: rgba(0, 0, 0, 0.82);
}

.lme-gallery-modal[hidden] {
	display: none;
}

.lme-gallery-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	max-width: min(1100px, 100%);
	max-height: 100%;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.lme-gallery-modal.is-lightbox .lme-gallery-modal__dialog {
	background: transparent;
}

.lme-gallery-modal__figure {
	position: relative;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #111;
	max-height: 78vh;
}

.lme-gallery-modal__image {
	display: block;
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
}

.lme-gallery-modal__body {
	padding: 16px 20px 20px;
	overflow-y: auto;
	max-height: 22vh;
}

.lme-gallery-modal.is-lightbox .lme-gallery-modal__body {
	display: none;
}

.lme-gallery-modal__title {
	margin: 0 0 8px;
	font-size: 1.05em;
	font-weight: 600;
}

.lme-gallery-modal__caption {
	margin: 0 0 12px;
	font-size: 0.9em;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}

.lme-gallery-modal__link {
	display: inline-block;
	font-size: 0.85em;
	text-decoration: none;
	padding: 6px 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
}

.lme-gallery-modal__close,
.lme-gallery-modal__nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.lme-gallery-modal__close {
	top: 10px;
	right: 10px;
}

.lme-gallery-modal__nav {
	width: 44px;
	height: 44px;
	background: rgba(255, 255, 255, 0.16);
	font-size: 26px;
}

.lme-gallery-modal__nav--prev {
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
}

.lme-gallery-modal__nav--next {
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
}

.lme-gallery-modal__close:hover {
	background: rgba(0, 0, 0, 0.8);
}

.lme-gallery-modal__nav:hover {
	background: rgba(255, 255, 255, 0.3);
}

.lme-gallery-modal__nav[hidden],
.lme-gallery-modal__step[hidden],
.lme-gallery-modal__count[hidden] {
	display: none;
}

/* 投稿内の画像切り替え（カルーセル） */

.lme-gallery-modal__step {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0 0 2px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #222;
	font-size: 20px;
	line-height: 1;
	transform: translateY(-50%);
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lme-gallery-modal__step:hover {
	background: #fff;
}

.lme-gallery-modal__step--prev {
	left: 12px;
}

.lme-gallery-modal__step--next {
	right: 12px;
}

.lme-gallery-modal__count {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 12px;
	line-height: 1.5;
}

.lme-gallery-modal__dots {
	position: absolute;
	bottom: 12px;
	left: 50%;
	display: flex;
	gap: 5px;
	transform: translateX(-50%);
	pointer-events: none;
}

.lme-gallery-modal__dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
	transition: background-color 0.2s ease;
}

.lme-gallery-modal__dots span.is-active {
	background: #fff;
}

@media (max-width: 640px) {
	.lme-gallery-modal {
		padding: 12px 12px 68px;
	}

	.lme-gallery-modal__nav--prev,
	.lme-gallery-modal__nav--next {
		top: auto;
		bottom: 12px;
		transform: none;
	}

	.lme-gallery-modal__body {
		max-height: 30vh;
	}
}
