/* =============================================================
   石川商店 サイト強化キット
   既存テーマのスタイルは上書きしない。すべて .ib- 接頭辞で閉じている。
   唯一の例外は body への下余白追加(固定バーが本文を隠さないため)。
   ============================================================= */

:root {
	--ib-navy: #0e2a47;
	--ib-navy-dark: #08203a;
	--ib-sky: #2fa8e0;
	--ib-line: #06c755;
	--ib-white: #fff;
	--ib-bar-h: 62px;

	/* テーマの固定サイドバーを避けるための右余白。
	   実測(2026-08-03, 現行テーマ businessmaster-it):
	     - PC幅   : body に padding-right:100px、.side-right は position:fixed で幅100px
	                → 100px ぶん内側に寄せる必要がある
	     - スマホ幅: body の padding-right は 0、.side-right は position:absolute の
	                小さな要素に変わる → 余白は不要(0)
	   よって既定は 0 とし、PC幅のときだけ --ib-offset-desktop を適用する。 */
	--ib-offset-desktop: 100px; /* PHP側から設定値で上書きされる */
	--ib-right-offset: 0px;
}

@media (min-width: 901px) {
	:root {
		--ib-right-offset: var(--ib-offset-desktop);
	}
}

/* -------------------------------------------------------------
   1. スマホ固定フッターCTA
   ------------------------------------------------------------- */
.ib-cta {
	display: none;
}

@media (max-width: 900px) {
	.ib-cta {
		position: fixed;
		left: 0;
		right: var(--ib-right-offset);
		bottom: 0;
		z-index: 9998;
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 1fr;
		gap: 1px;
		background: rgba(14, 42, 71, 0.25);
		box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.18);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.ib-cta__btn {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-height: var(--ib-bar-h);
		padding: 6px 2px;
		color: var(--ib-white);
		background: var(--ib-navy);
		text-decoration: none;
		font-size: 12px;
		line-height: 1.25;
		font-weight: 700;
		letter-spacing: 0.02em;
		-webkit-tap-highlight-color: transparent;
	}

	.ib-cta__btn:link,
	.ib-cta__btn:visited,
	.ib-cta__btn:hover,
	.ib-cta__btn:active {
		color: var(--ib-white);
		text-decoration: none;
	}

	.ib-cta__btn:active {
		filter: brightness(0.88);
	}

	.ib-cta__btn--tel {
		background: var(--ib-navy);
	}

	.ib-cta__btn--line {
		background: var(--ib-line);
	}

	.ib-cta__btn--parts {
		background: var(--ib-sky);
	}

	.ib-cta__icon {
		display: block;
		height: 22px;
	}

	.ib-cta__label {
		display: block;
		white-space: nowrap;
	}

	/* 固定バーの高さぶんだけ本文の下に余白を足す(内容が隠れないように) */
	body {
		padding-bottom: calc(var(--ib-bar-h) + env(safe-area-inset-bottom, 0px)) !important;
	}
}

/* -------------------------------------------------------------
   2. 右下の丸型動画ボタン
   ------------------------------------------------------------- */
.ib-fab {
	position: fixed;
	/* +28px はサイドバーとの間隔。PC幅では 100+28=128px 右から離す。 */
	right: calc(var(--ib-right-offset) + 28px);
	bottom: 16px;
	z-index: 9997;
	box-sizing: border-box;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 3px solid var(--ib-sky);
	border-radius: 50%;
	overflow: hidden;
	background: var(--ib-navy);
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
	-webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
	.ib-fab {
		bottom: calc(var(--ib-bar-h) + 14px + env(safe-area-inset-bottom, 0px));
	}
}

.ib-fab img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.65;
}

.ib-fab__play {
	position: absolute;
	top: 50%;
	left: 52%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent var(--ib-white);
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.ib-fab__text {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 3px;
	font-size: 9px;
	font-weight: 700;
	color: var(--ib-white);
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* -------------------------------------------------------------
   3. 縦型ショート動画ギャラリー
   ------------------------------------------------------------- */
.ib-reels {
	background: linear-gradient(180deg, var(--ib-navy) 0%, var(--ib-navy-dark) 100%);
	color: var(--ib-white);
	padding: 48px 0 40px;
	overflow: hidden;
}

.ib-reels__inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

.ib-reels__head {
	margin-bottom: 22px;
}

.ib-reels__title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ib-white);
	position: relative;
	padding-left: 14px;
}

.ib-reels__title::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.18em;
	bottom: 0.18em;
	width: 4px;
	border-radius: 2px;
	background: var(--ib-sky);
}

.ib-reels__lead {
	margin: 0;
	font-size: 14px;
	line-height: 1.8;
	color: rgba(255, 255, 255, 0.8);
}

.ib-reels__track {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding: 4px 0 14px;
	scrollbar-width: thin;
	scrollbar-color: var(--ib-sky) rgba(255, 255, 255, 0.15);
}

.ib-reels__track::-webkit-scrollbar {
	height: 6px;
}

.ib-reels__track::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

.ib-reels__track::-webkit-scrollbar-thumb {
	background: var(--ib-sky);
	border-radius: 3px;
}

.ib-reels__card {
	flex: 0 0 auto;
	width: 180px;
	scroll-snap-align: start;
}

.ib-reels__link {
	display: block;
	color: var(--ib-white);
	text-decoration: none;
}

.ib-reels__link:link,
.ib-reels__link:visited,
.ib-reels__link:hover {
	color: var(--ib-white);
	text-decoration: none;
}

.ib-reels__frame {
	position: relative;
	display: block;
	width: 100%;
	/* 9:16 の縦型。aspect-ratio 非対応ブラウザ向けに padding-top も併用 */
	aspect-ratio: 9 / 16;
	padding-top: 177.78%;
	border-radius: 10px;
	overflow: hidden;
	background: #0a1a2e;
}

@supports (aspect-ratio: 9 / 16) {
	.ib-reels__frame {
		padding-top: 0;
	}
}

.ib-reels__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.ib-reels__link:hover .ib-reels__thumb {
	transform: scale(1.05);
}

.ib-reels__thumb--empty {
	background: #0a1a2e;
}

.ib-reels__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(14, 42, 71, 0.72);
	border: 2px solid rgba(255, 255, 255, 0.9);
}

.ib-reels__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent var(--ib-white);
}

.ib-reels__caption {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.86);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ib-reels__more {
	margin: 6px 0 0;
	text-align: right;
	font-size: 13px;
}

.ib-reels__more a {
	color: var(--ib-sky);
	text-decoration: underline;
}

@media (max-width: 900px) {
	.ib-reels {
		padding: 34px 0 28px;
	}

	.ib-reels__inner {
		padding: 0 16px;
	}

	.ib-reels__title {
		font-size: 20px;
	}

	.ib-reels__card {
		width: 148px;
	}
}

/* 自動差し込みの入れ物。JSが所定位置へ移動させる。
   もしJSが動かなくてもフッター手前に表示されるだけで、ページは壊れない。 */
#ib-auto-gallery {
	display: block;
}

/* -------------------------------------------------------------
   4. LINE誘導ブロック([ishikawa_line_cta])
   ------------------------------------------------------------- */
.ib-line {
	background: #f2f7fb;
	padding: 40px 0;
}

.ib-line__inner {
	max-width: 780px;
	margin: 0 auto;
	padding: 32px 24px 28px;
	background: var(--ib-white);
	border: 2px solid var(--ib-line);
	border-radius: 14px;
	text-align: center;
	box-shadow: 0 6px 22px rgba(14, 42, 71, 0.08);
}

.ib-line__badge {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--ib-line);
	color: var(--ib-white);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.ib-line__title {
	margin: 0 0 12px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.45;
	color: var(--ib-navy);
}

.ib-line__lead {
	margin: 0 auto 20px;
	max-width: 34em;
	font-size: 15px;
	line-height: 1.9;
	color: #33455c;
	text-align: left;
}

.ib-line__points {
	list-style: none;
	margin: 0 auto 24px;
	padding: 0;
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 10px;
}

.ib-line__points li {
	position: relative;
	padding: 6px 14px 6px 30px;
	border-radius: 999px;
	background: #eef8f1;
	font-size: 13px;
	font-weight: 700;
	color: #14603a;
}

.ib-line__points li::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 50%;
	width: 6px;
	height: 11px;
	margin-top: -7px;
	border: solid var(--ib-line);
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.ib-line__action {
	margin: 0 0 14px;
}

.ib-line__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: min(100%, 340px);
	padding: 16px 28px;
	border-radius: 999px;
	background: var(--ib-line);
	color: var(--ib-white);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(6, 199, 85, 0.32);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ib-line__btn:link,
.ib-line__btn:visited,
.ib-line__btn:hover,
.ib-line__btn:active {
	color: var(--ib-white);
	text-decoration: none;
}

.ib-line__btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(6, 199, 85, 0.4);
}

.ib-line__btn-icon {
	display: inline-flex;
	height: 24px;
}

.ib-line__store {
	margin: 0 0 12px;
	padding-top: 14px;
	border-top: 1px dashed #d3dde7;
	font-size: 14px;
}

.ib-line__store a {
	display: inline-block;
	padding: 9px 20px;
	border: 2px solid var(--ib-navy);
	border-radius: 999px;
	color: var(--ib-navy);
	font-weight: 700;
	text-decoration: none;
}

.ib-line__store a:link,
.ib-line__store a:visited {
	color: var(--ib-navy);
	text-decoration: none;
}

.ib-line__store a:hover {
	background: var(--ib-navy);
	color: var(--ib-white);
}

.ib-line__store-note {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: #6b7b8d;
}

.ib-line__sub {
	margin: 0;
	font-size: 13px;
	color: #5b6b7d;
}

.ib-line__sub a {
	font-weight: 700;
	color: var(--ib-navy);
	text-decoration: underline;
	white-space: nowrap;
}

@media (max-width: 900px) {
	.ib-line {
		padding: 28px 0;
	}

	.ib-line__inner {
		padding: 26px 16px 22px;
		border-radius: 12px;
	}

	.ib-line__title {
		font-size: 19px;
	}

	.ib-line__lead {
		font-size: 14px;
	}

	.ib-line__btn {
		width: 100%;
		min-width: 0;
		padding: 15px 18px;
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ib-line__btn,
	.ib-line__btn:hover {
		transition: none;
		transform: none;
	}
}

/* -------------------------------------------------------------
   5. 動画オーバーレイ
   ------------------------------------------------------------- */
.ib-modal[hidden] {
	display: none;
}

.ib-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.ib-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 14, 26, 0.88);
}

.ib-modal__box {
	position: relative;
	width: min(92vw, 420px);
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ib-modal__close {
	position: absolute;
	top: -42px;
	right: 0;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ib-modal__body {
	width: 100%;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 9 / 16;
	max-height: 80vh;
}

.ib-modal__body video,
.ib-modal__body iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: contain;
	background: #000;
}

.ib-modal__link {
	margin: 12px 0 0;
	font-size: 13px;
}

.ib-modal__link a {
	color: var(--ib-sky);
	text-decoration: underline;
}

/* 動きを減らす設定の利用者に配慮 */
@media (prefers-reduced-motion: reduce) {
	.ib-reels__thumb,
	.ib-reels__link:hover .ib-reels__thumb {
		transition: none;
		transform: none;
	}
}
