/*
 * Global Hand Catalog - Frontend Styles
 *
 * テーマのCSS変数を利用し、未定義の場合はフォールバック値を使用する。
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.ghc-button {
	display: inline-block;
	padding: 0.7em 1.8em;
	font-size: 0.9rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ghc-button--primary {
	background-color: var(--color-tokoname-red, #9A3F2D);
	border-color: var(--color-tokoname-red, #9A3F2D);
	color: var(--color-washi, #F6F1E8);
}

.ghc-button--primary:hover,
.ghc-button--primary:focus {
	background-color: #7E3222;
	border-color: #7E3222;
	color: var(--color-washi, #F6F1E8);
}

.ghc-button--outline {
	background-color: transparent;
	border-color: var(--color-kiln-gray, #6D6A62);
	color: var(--color-sumi, #1F1C18);
}

.ghc-button--outline:hover,
.ghc-button--outline:focus {
	border-color: var(--color-sumi, #1F1C18);
	background-color: rgba(255, 255, 255, 0.6);
	color: var(--color-sumi, #1F1C18);
}

/* ==========================================================================
   Logged-out guard
   ========================================================================== */

.ghc-guard {
	max-width: 640px;
	margin: 0 auto;
	padding: 56px 32px;
	background-color: var(--color-white, #FFFFFF);
	border: 1px solid var(--color-brass, #B08A45);
	text-align: center;
}

.ghc-guard__en {
	font-size: 0.8125rem;
	letter-spacing: 0.35em;
	color: var(--color-brass, #B08A45);
	margin: 0 0 12px;
	text-transform: uppercase;
}

.ghc-guard__title {
	font-size: 1.5rem;
	margin: 0 0 0.8em;
}

.ghc-guard__text {
	color: var(--color-kiln-gray, #6D6A62);
	margin: 0 0 2em;
	text-align: left;
}

.ghc-guard__buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
}

/* ==========================================================================
   Catalog list
   ========================================================================== */

.ghc-catalog__empty {
	text-align: center;
	color: var(--color-kiln-gray, #6D6A62);
	padding: 40px 0;
}

/* サイドバー付き2カラムレイアウト */
.ghc-catalog--with-sidebar {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.ghc-sidebar {
	position: sticky;
	top: 100px;
	background-color: var(--color-white, #FFFFFF);
	border: 1px solid rgba(109, 106, 98, 0.3);
	padding: 24px 20px;
}

.ghc-sidebar__title {
	font-size: 0.9375rem;
	letter-spacing: 0.08em;
	margin: 0 0 0.8em;
	padding-bottom: 0.6em;
	border-bottom: 1px solid var(--color-brass, #B08A45);
}

.ghc-sidebar__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ghc-sidebar__item {
	border-bottom: 1px solid rgba(109, 106, 98, 0.15);
}

.ghc-sidebar__item:last-child {
	border-bottom: 0;
}

.ghc-sidebar__link {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding: 0.6em 2px;
	font-size: 0.875rem;
	color: var(--color-sumi, #1F1C18);
	text-decoration: none;
	transition: color 0.25s ease;
}

.ghc-sidebar__link:hover,
.ghc-sidebar__link:focus {
	color: var(--color-tokoname-red, #9A3F2D);
}

.ghc-sidebar__count {
	font-size: 0.75rem;
	color: var(--color-kiln-gray, #6D6A62);
	white-space: nowrap;
}

/* 0件カテゴリ(リンクなし・薄い表示) */
.ghc-sidebar__link--empty {
	color: rgba(109, 106, 98, 0.55);
	cursor: default;
}

.ghc-sidebar__link--empty .ghc-sidebar__count {
	color: rgba(109, 106, 98, 0.55);
}

/* アンカージャンプ時に固定ヘッダーと重ならないように */
.ghc-category {
	scroll-margin-top: 110px;
}

/* サイドバーがある分、カードは2列に */
.ghc-catalog--with-sidebar .ghc-category__grid {
	grid-template-columns: repeat(2, 1fr);
}

.ghc-category {
	margin-bottom: 64px;
}

.ghc-category__title {
	font-size: 1.375rem;
	padding-bottom: 0.5em;
	border-bottom: 1px solid var(--color-brass, #B08A45);
	margin-bottom: 28px;
}

.ghc-category__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

/* ==========================================================================
   PDF card
   ========================================================================== */

.ghc-card {
	display: flex;
	flex-direction: column;
	background-color: var(--color-white, #FFFFFF);
	border: 1px solid rgba(109, 106, 98, 0.3);
}

.ghc-card__thumbnail img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}

.ghc-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 24px 22px;
}

.ghc-card__title {
	font-size: 1.0625rem;
	margin: 0 0 0.6em;
}

.ghc-card__description {
	font-size: 0.875rem;
	color: var(--color-kiln-gray, #6D6A62);
	margin-bottom: 1em;
}

.ghc-card__description p {
	margin: 0 0 0.5em;
}

.ghc-card__meta {
	margin: 0 0 1.25em;
	font-size: 0.8125rem;
	border-top: 1px solid rgba(109, 106, 98, 0.2);
	padding-top: 0.75em;
	margin-top: auto;
}

.ghc-card__meta-row {
	display: flex;
	gap: 1em;
}

.ghc-card__meta-row dt {
	color: var(--color-kiln-gray, #6D6A62);
	min-width: 4em;
	font-weight: 400;
}

.ghc-card__meta-row dd {
	margin: 0;
}

.ghc-card__buttons {
	display: flex;
	gap: 10px;
}

.ghc-card__buttons .ghc-button {
	flex: 1;
	font-size: 0.8125rem;
	padding: 0.7em 0.5em;
	white-space: nowrap;
}

.ghc-card__no-pdf {
	font-size: 0.8125rem;
	color: var(--color-kiln-gray, #6D6A62);
	margin: 0;
}

/* ==========================================================================
   PDF placeholder (アイキャッチ未設定時)
   ========================================================================== */

.ghc-card__thumbnail--pdf {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 180px;
	background-color: var(--color-indigo-black, #1F3440);
	background-image:
		linear-gradient(rgba(176, 138, 69, 0.08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(176, 138, 69, 0.08) 1px, transparent 1px);
	background-size: 24px 24px;
	overflow: hidden;
}

.ghc-card__pdf-mark {
	width: 76px !important;
	height: 76px !important;
	object-fit: contain !important;
	opacity: 0.95;
}

.ghc-card__pdf-label {
	font-size: 0.6875rem;
	letter-spacing: 0.3em;
	color: rgba(246, 241, 232, 0.6);
	text-transform: uppercase;
}

/* ==========================================================================
   Photo gallery (lightbox)
   ========================================================================== */

.ghc-card__thumbnail {
	position: relative;
}

.ghc-card__count-badge {
	position: absolute;
	right: 8px;
	bottom: 8px;
	background-color: rgba(31, 28, 24, 0.75);
	color: var(--color-washi, #F6F1E8);
	font-size: 0.75rem;
	padding: 3px 10px;
}

.ghc-gallery-open {
	width: 100%;
	cursor: pointer;
}

.ghc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
}

.ghc-lightbox.is-open {
	display: flex;
}

body.ghc-lightbox-open {
	overflow: hidden;
}

.ghc-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(21, 21, 21, 0.92);
}

.ghc-lightbox__figure {
	position: relative;
	margin: 0;
	max-width: min(1080px, 90vw);
	text-align: center;
}

.ghc-lightbox__img {
	max-width: 100%;
	max-height: 78vh;
	object-fit: contain;
	background-color: #000;
}

.ghc-lightbox__caption {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	color: var(--color-washi, #F6F1E8);
	font-size: 0.875rem;
	padding: 12px 4px 0;
}

.ghc-lightbox__counter {
	color: var(--color-brass, #B08A45);
	font-size: 0.8125rem;
	white-space: nowrap;
}

.ghc-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 44px;
	height: 44px;
	background: transparent;
	border: 1px solid rgba(246, 241, 232, 0.5);
	border-radius: 50%;
	color: var(--color-washi, #F6F1E8);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.25s ease;
}

.ghc-lightbox__close:hover,
.ghc-lightbox__close:focus {
	border-color: var(--color-brass, #B08A45);
	color: var(--color-brass, #B08A45);
}

.ghc-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	background: transparent;
	border: 1px solid rgba(246, 241, 232, 0.5);
	border-radius: 50%;
	color: var(--color-washi, #F6F1E8);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.25s ease, color 0.25s ease;
}

.ghc-lightbox__nav:hover,
.ghc-lightbox__nav:focus {
	border-color: var(--color-brass, #B08A45);
	color: var(--color-brass, #B08A45);
}

.ghc-lightbox__nav--prev {
	left: 20px;
}

.ghc-lightbox__nav--next {
	right: 20px;
}

@media (max-width: 768px) {
	.ghc-lightbox__nav--prev {
		left: 8px;
	}

	.ghc-lightbox__nav--next {
		right: 8px;
	}
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
	.ghc-category__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 900px) {
	/* サイドバーは上部の横並びチップに変形 */
	.ghc-catalog--with-sidebar {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.ghc-sidebar {
		position: static;
		padding: 18px 16px;
	}

	.ghc-sidebar__list {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
	}

	.ghc-sidebar__item {
		border-bottom: 0;
	}

	.ghc-sidebar__link {
		border: 1px solid rgba(109, 106, 98, 0.3);
		padding: 0.4em 0.9em;
	}
}

@media (max-width: 768px) {
	.ghc-category__grid,
	.ghc-catalog--with-sidebar .ghc-category__grid {
		grid-template-columns: 1fr;
	}

	.ghc-guard {
		padding: 40px 20px;
	}

	.ghc-guard__buttons .ghc-button {
		width: 100%;
	}
}
