@charset "utf-8";

.subpage .works-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	margin: 30px 0
}
.subpage .work-item {
	border-radius: 0;
	box-shadow: none;
	border: 1px solid #dce3e7
}
.subpage .work-info {
	padding: 20px
}
.subpage .work-title {
	font: 500 20px/1.6 var(--serif);
	color: var(--navy)
}
.subpage .work-cat {
	display: inline-block;
	font-size: 12px;
	letter-spacing: 1px;
	color: #57758b;
	margin-top: 10px
}
.subpage .detail-content {
	max-width: 100%;
	padding: 0
}
.subpage .detail-header {
	padding: 30px;
	border-bottom: 1px solid #dce3e7;
	
}
.subpage .detail-title {
	font: 500 clamp(26px, 3vw, 1.6rem)/1.6 var(--serif);
	color: var(--navy)
}
.subpage .description-box {
	font-size: 16px;
	line-height: 2;
	white-space: normal;
	margin-bottom: 32px;
}
.photo-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 22px;
}
.photo-grid img {
	width: 100%;
	height: auto
}
.subpage .photo-item {
	cursor: zoom-in;
}


/*--breadcrumb--*/
/* ==========================================================================
   パンくずリスト
   ========================================================================== */
.subpage .breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	padding: 18px 10px;
	margin: 0;
	font-size: 12px;
	
}

.breadcrumb li {
    display: inline;
}
.breadcrumb li:after {
    content: ">";
    margin: 0 10px;
   
}
.breadcrumb li:last-child:after {
    content: "";
}
.breadcrumb a {
    text-decoration: none;
    color: #333;
}
.breadcrumb a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   共通設定
   ========================================================================== */
* {
    box-sizing: border-box;
}

.zirei-container {
    max-width: 1200px;
    margin: 0 auto;
   
    width: 100%;
}
h2.tittle{
	text-align: center;
	margin: 30px;
    font-size: 2.2rem;}

/* ==========================================================================
   一覧ページ（グリッド表示）
   ========================================================================== */
.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
    margin-top: 30px;
	margin-left: 10px;
	margin-right: 10px;
}

.work-item {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.work-img-box {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f0f0f0;
}

.work-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.work-item:hover .work-img-box img {
    transform: scale(1.06);
}



.work-title {
    margin: 0 0 12px;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.5;
    color: #2b2b2b;
}

.work-cat {
    display: inline-block;
    background: #4a7fc9;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 999px;
    line-height: 1;
}

/* カテゴリごとに色分けしたい場合は gallery.php 側で
   <span class="work-cat" data-cat="<?php echo htmlspecialchars($work['category']); ?>"> のように
   data-cat 属性を追加すると下記が有効になります（不要なら削除可） */
.work-cat[data-cat="住宅リフォーム"] { background: #4a7fc9; }
.work-cat[data-cat="店舗改装"] { background: #d98c3f; }
.work-cat[data-cat="塗装工事"] { background: #5aa06c; }
.work-cat[data-cat="マンションリノベーション"] { background: #8a6fc9; }
.work-cat[data-cat="その他"] { background: #8a8a8a; }

/* ==========================================================================
   詳細ページ
   ========================================================================== */
.detail-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.description-box {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    white-space: pre-wrap;
    line-height: 1.3;
}

.subpage .photo-item { background:#f2f5f7; 
  overflow: hidden;}



.photo-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

/* ==========================================================================
   ライトボックス（外部化）
   ========================================================================== */
#custom-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
	
	top: 50%; 
	left: 50%; 
	transform: translate(-50%, -50%);
	width: 75%; 
	height: auto;
}

#custom-lightbox.active {
    display: flex;
}

#lightbox-img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}


.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
    opacity: 0.7;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    opacity: 0.5;
    transition: 0.3s;
}

.nav-btn:hover, .close-btn:hover {
    opacity: 1;
}

.prev { left: 10px; }
.next { right: 10px; }

body.noscroll {
    overflow: hidden;
}

/* ==========================================================================
   ボタン・ナビゲーション
   ========================================================================== */
.view-more, .footer-nav {
    text-align: center;
    margin: 40px 0;
}

.btn-link {
    display: inline-block;
    padding: 12px 50px;
    border: 1px solid #333;
    color: #333;
    text-decoration: none;
    transition: 0.3s;
}

.btn-link:hover {
    background: #333;
    color: #fff;
}


/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */
@media (max-width: 960px) {
    .zirei-container {
        padding-left: 30px;
        padding-right: 30px;
    }
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
	 .photo-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 628px) {
    .zirei-container {
        padding-left: 20px;
        padding-right: 20px;
    }
	
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }
    .work-info {
        padding: 12px 14px 16px;
    }
    .work-title {
        font-size: 1.2rem;
    }
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-btn {
        font-size: 40px; /* スマホでは矢印を少し小さく */
    }
	#custom-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
	
	top: 50%; 
	left: 50%; 
	transform: translate(-50%, -50%);
	width: 100%; 
	height: auto;
}
}

@media (max-width: 480px) {
    .works-grid {
        grid-template-columns: 1fr;
    }
}