/* ==========================================================
 * Image Table Widget for Elementor
 * ======================================================== */

.itw-wrap {
	width: 100%;
}

.itw-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	border-spacing: 0;
	background: transparent;
}

.itw-table th,
.itw-table td {
	padding: 18px 14px;
	border: 1px solid #d9d9d9;
	vertical-align: middle;
	line-height: 1.7;
}

.itw-table thead th {
	background-color: #1c2a20;
	color: #fff;
	font-weight: 600;
	letter-spacing: .05em;
}

.itw-table tbody td {
	background-color: #fff;
}

/* 配置 */
.itw-align-left   { text-align: left; }
.itw-align-center { text-align: center; }
.itw-align-right  { text-align: right; }

/* セル内：画像＋テキスト */
.itw-cell {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.itw-img-below .itw-cell {
	flex-direction: column-reverse;
}
.itw-align-left .itw-cell   { align-items: flex-start; }
.itw-align-center .itw-cell { align-items: center; }
.itw-align-right .itw-cell  { align-items: flex-end; }

.itw-media {
	line-height: 0;
}
.itw-img {
	display: block;
	width: auto;
	max-width: 110px;
	height: auto;
}

/* 画像リンク・ポップアップ */
.itw-img-link {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	cursor: pointer;
}
.itw-img-link .itw-img {
	transition: opacity .25s ease, transform .35s ease;
}
.itw-hover-opacity .itw-img-link:hover .itw-img {
	opacity: .75;
}
.itw-hover-zoom .itw-img-link {
	overflow: hidden;
}
.itw-hover-zoom .itw-img-link:hover .itw-img {
	transform: scale(1.06);
}
.itw-img-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* 虫眼鏡アイコン */
.itw-zoomicon-yes .itw-lightbox::after {
	content: "";
	position: absolute;
	right: 4px;
	bottom: 4px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / 13px no-repeat;
	pointer-events: none;
}

/* テキストリンク */
a.itw-link {
	display: block;
	color: inherit;
	text-underline-offset: 3px;
	transition: color .2s ease;
}
.itw-underline-always a.itw-link { text-decoration: underline; }
.itw-underline-hover a.itw-link,
.itw-underline-none a.itw-link { text-decoration: none; }
.itw-underline-hover a.itw-link:hover { text-decoration: underline; }

.itw-main {
	color: #333;
}
.itw-main p {
	margin: 0;
}
.itw-sub {
	font-size: .85em;
	color: #666;
	line-height: 1.5;
}

/* ---------- 横スクロール ---------- */
.itw-mobile-scroll .itw-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ---------- スマホ（767px以下）：カード型 ----------
 * 色・余白などはウィジェットの設定から CSS 変数で上書きされます。
 * 切り替え幅を変える場合は下の 767px を変更してください。
 * ------------------------------------------------------ */
@media (max-width: 767px) {

	.itw-mobile-card .itw-table,
	.itw-mobile-card .itw-table tbody,
	.itw-mobile-card .itw-table tr,
	.itw-mobile-card .itw-table td {
		display: block;
		width: 100%;
	}

	/* 見出し行は視覚的に隠す（読み上げには残す） */
	.itw-mobile-card .itw-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	/* カード */
	.itw-mobile-card .itw-table tbody tr {
		margin: 0 0 var(--itw-card-gap, 24px);
		border: var(--itw-card-border-w, 1px) solid var(--itw-card-border, #d9d9d9);
		border-radius: var(--itw-card-radius, 0);
		background: var(--itw-card-bg, #fff);
		box-shadow: var(--itw-card-shadow, 0 0 0) var(--itw-card-shadow-color, rgba(0, 0, 0, .12));
		overflow: hidden;
	}
	.itw-mobile-card .itw-table tbody tr:last-child {
		margin-bottom: 0;
	}

	/* 項目（セル） */
	.itw-mobile-card .itw-table tbody tr td {
		padding: 0;
		background: transparent;
		border: 0;
		border-bottom: var(--itw-divider-w, 1px) solid var(--itw-divider, #eee);
		text-align: var(--itw-m-align, left);
	}
	.itw-mobile-card .itw-table tbody tr td:last-child {
		border-bottom: 0;
	}
	.itw-mobile-card .itw-table tbody tr td.itw-td-empty {
		display: none;
	}

	/* 内容 */
	.itw-mobile-card .itw-table tbody tr td .itw-cell {
		height: 100%;
		padding: var(--itw-content-pad, 14px 16px);
		background: var(--itw-content-bg, transparent);
		align-items: var(--itw-m-justify, flex-start);
		justify-content: var(--itw-m-valign, center);
	}

	/* 項目見出し（共通） */
	.itw-mobile-card.itw-label-side .itw-table tbody tr td::before,
	.itw-mobile-card.itw-label-stacked .itw-table tbody tr td::before {
		content: attr(data-label);
		display: flex;
		align-items: var(--itw-m-valign, center);
		justify-content: var(--itw-label-justify, flex-start);
		padding: var(--itw-label-pad, 14px 12px);
		background: var(--itw-label-bg, transparent);
		color: var(--itw-label-color, #1c2a20);
		text-align: var(--itw-label-align, left);
	}
	/* 文字の初期値（詳細度を下げてタイポグラフィ設定を優先） */
	:where(.itw-mobile-card) .itw-table td::before {
		font-size: .85em;
		font-weight: 600;
		line-height: 1.5;
	}

	/* 左に見出し・右に内容 */
	.itw-mobile-card.itw-label-side .itw-table tbody tr td {
		display: grid;
		grid-template-columns: var(--itw-label-w, 7.5em) minmax(0, 1fr);
		align-items: stretch;
	}

	/* 上に見出し・下に内容 */
	.itw-mobile-card.itw-label-stacked .itw-table tbody tr td::before {
		padding: var(--itw-label-pad, 8px 16px);
		background: var(--itw-label-bg, #f4f4f2);
	}

	/* タイトル帯（1列目） */
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child {
		display: block;
		background: var(--itw-ct-bg, #1c2a20);
		border-bottom: 0;
		text-align: var(--itw-ct-align, center);
	}
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child::before {
		display: none;
	}
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child .itw-cell {
		padding: var(--itw-ct-pad, 12px 16px);
		background: transparent;
		align-items: var(--itw-ct-justify, center);
	}
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child .itw-text {
		display: flex;
		flex-direction: var(--itw-ct-dir, column);
		flex-wrap: wrap;
		align-items: var(--itw-ct-items, var(--itw-ct-justify, center));
		justify-content: var(--itw-ct-justify, center);
		column-gap: var(--itw-ct-gap, 0);
	}
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child .itw-main {
		color: var(--itw-ct-color, #fff);
		font-size: var(--itw-ct-size, 1.375rem);
		line-height: 1.4;
	}
	.itw-mobile-card.itw-cardtitle-yes .itw-table tbody tr td:first-child .itw-sub {
		color: var(--itw-ct-sub-color, rgba(255, 255, 255, .75));
	}
}
