
    :root{
      --gap: clamp(16px, 3vw, 32px);
      --shadow: 0 6px 30px rgba(0,0,0,.08);
    }

    .sub-img-frame {
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow);
      background: #e2e8f0;
      height: 640px;
      isolation: isolate;
    }
    
    .sub-img-frame {
    	width: calc(100% + 8rem); margin-left: -4rem; z-index: 3; position: relative;
    }

    .sub-img-frame > img {
      display: block;
      width: 100%;
      height: auto;
      transform: translate3d(0,0,0);
      will-change: transform;
      user-select: none;
      pointer-events: none;
    }

    /* CSS fallback */
    @supports (animation-timeline: view(block)) {
      .sub-img-frame[data-css-fallback="true"] img {
        animation: imgScroll var(--css-duration, 1s) linear both;
        animation-timeline: view();
        animation-range: contain 0% contain 100%;
      }
      @keyframes imgScroll {
        from { transform: translateY(var(--from, 0)); }
        to   { transform: translateY(var(--to, -20%)); }
      }
    }




/* 基本カードスタイル */
.sub-card {
    overflow: hidden;
}

.sub-card#sub-enma-explain {
    grid-column: 1 / 4;
}

.sub-card-image {
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: #666;
}

.sub-card#sub-enma-explain .sub-card-image {
    aspect-ratio: 5 / 2;

}

.sub-card-content {
    padding-bottom: 0.5rem;
    padding-top: 1.5rem;
}

.sub-section .sub-card-image {
    position: relative;
}

.sub-card-image h3.sub-card-title {
    font-size: 1.3rem;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    background: linear-gradient(0deg, #000000bd, #00000000);
    position: absolute;
    padding: 3rem 0.5rem 0.4rem;
    letter-spacing: 1px;
    z-index: 2;
    width: 100%;
    bottom: 0;
    
    
}

h3#facilities-enmadaiou {
       margin-top: -1rem;
       margin-bottom: 1rem;
    }

.sub-section .sub-card-image h3.sub-card-title.oni-explain-name {
    padding-top: 0.7rem;
}

.sub-card-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.7;
}

/* ハイライトテキスト */
.highlight {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

/* 情報ボックス */
.info-box {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 5px;
}


.sub-facilities-add-info {
    background: #333333;
    padding: 0.5rem 1rem;
    margin-top: 0.3rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

/* 価格タグ */
.price-tag {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    display: inline-block;
    margin-top: 15px;
    font-size: 1.1rem;
}

/* リンクボタンスタイル */
.link-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.link-btn {
    background: linear-gradient(135deg, var(--gold), var(--deep-gold));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.link-btn:hover {
    transform: translateY(-2px);
}

/* 境内施設用のスタイル（2カラム） */
.facilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

/* 閻魔堂の神様・鬼たち用のスタイル（3カラム） */
.spirits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 3rem;
}

.icon-enma{
	width: 22px; margin-right: 0.6rem; position: relative; top: 2px;
}

.icon-omamori-add{
	width: 24px; margin-right: 0.6rem; position: relative; top: 4px;
}

/* お楽しみ・授与品用のスタイル（3カラム） */
.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

section#r-color:before {
    content: "";
    width: 140%;
    height: 100%;
    position: absolute;
    display: inline-block;
    background-color: #000000;
    left: -20%;
    top: 0;
    transform: rotate(5deg);
    z-index: 2;
    opacity: 1;
}

section#r-color:after {
    content: "";
    width: 140%;
    height: 100%;
    position: absolute;
    display: inline-block;
    background-color: #990000;
    left: -20%;
    top: 0;
    transform: rotate(-5deg);
    z-index: 2;
    opacity: 0.5;
    background-image: url(images/enma_bg1.jpg);
    background-repeat: repeat;
}



/* アニメーション（ない場合のみ追加） */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {

    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }

}

/* レスポンシブデザイン */
@media (max-width: 1024px) {

    .sub-card#sub-enma-explain {
        grid-column: 1 / 3;
    }
    
    .spirits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {


    .sub-card#sub-enma-explain {
        grid-column: 1 / 3;
    }

    .facilities-grid,
    .spirits-grid,
    .items-grid {
        grid-template-columns: repeat(2,1fr);
    }
    
    .sub-card-title {
        font-size: 1.4rem;
    }

    section#r-color:before {
    transform: rotate(3deg);
    width: 1000%;
    left: -400%;
        opacity: 1;
    }

    section#r-color:after {
    transform: rotate(-3deg);
    width: 1000%;
    left: -500%;
    }


    .sub-img-frame {
	      height: 400px;
	}

}

@media (max-width: 640px) {

    .sub-card#sub-enma-explain {
        grid-column: 1 / 2;
    }

    .facilities-grid,
    .spirits-grid,
    .items-grid {
        grid-template-columns: none;
    }

}

@media (max-width: 500px) {

    .link-buttons {
        flex-direction: column;
    }

    .link-btn {
        text-align: center;
    }

    .sub-img-frame {
	      height: 200px;
	}

	.sub-card-content {
	    padding-bottom: 1rem;
	}


}
