/* 授与品ギャラリー - 既存デザインシステムに調和 */
.amulet-gallery {
    display: grid;
    gap: 1em;
    margin: 1.5em 0;
    padding: 0;
}

.omamori-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.5em;
    box-shadow: 5px 5px 5px 0 #777, -2px 0 5px #aaa;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.omamori-item:hover {
    transform: translateY(-2px);
    box-shadow: 5px 7px 8px 0 #555, -2px 2px 8px #888;
}

#bodymain .omamori-item img {
    margin: 0;
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    display: block;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
    cursor: zoom-in;
}

.omamori-item figcaption {
    padding: 0.8em 1em;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.omamori-item h5 {
    font-size: 0.9em;
    font-weight: bold;
    color: #222;
    margin: 0 0 0.5em 0;
    line-height: 1.4;
    text-align: left;
}

#bodymain .omamori-item p {
    font-size: 0.8em;
    color: #666;
    line-height: 1.5;
    margin: 0;
    text-align: left;
    text-indent: 0;
    padding: 0;
}


/* デスクトップ時: 3列表示、画像下部にタイトル・説明文 */
@media (min-width: 1063px) {
    .amulet-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2em;
        padding: 0 1em;
    }
}

/* タブレット時: 2列表示 (1062px以下) */
@media (max-width: 1062px) and (min-width: 801px) {
    .amulet-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1em;
        padding: 0 0.5em;
    }
}

/* モバイル時: 3列表示 (800px以下) */
@media (max-width: 800px) {
    .amulet-gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5em;
        padding: 0;
        margin: 1em 0;
    }
    
    .omamori-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #bodymain .omamori-item img {
        width: 100%;
        height: 120px;
        flex-shrink: 0;
        border-bottom: 1px solid #eee;
        object-fit: contain;
        object-position: center;
        background-color: #f9f9f9;
    }
    #bodymain img{
        margin:0;
    }
    .omamori-item figcaption {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0.4em 0.5em;
        min-width: 0;
    }
    
    .omamori-item h5 {
        font-size: 0.75em;
        margin-bottom: 0.2em;
        line-height: 1.2;
    }
    
    .omamori-item p {
        font-size: 0.7em;
        line-height: 1.3;
    }
}

/* 画像拡大機能のスタイル */
.image-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(245, 245, 245, 0.9);
    display: block;
    z-index: 1000;
    cursor: zoom-out;
}

.image-overlay::before {
    content: "";
    position: fixed;
    inset: 0;
    display: block;
}

.enlarged-image {
    position: fixed;
    object-fit: contain;
    transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease;
    cursor: default;
    pointer-events: auto;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
