.pan {
    font-size: clamp(1.3rem, 2vw + 1rem, 1.4rem);
    padding-left: 3rem;
    padding-top: 1rem;
    text-align: left;
    width: 100%
}

.pan a {
    color: #B92100;
    font-weight: 600;
    border-bottom: dashed #B92100 thin;
    padding-bottom: 0.3em
}

.ai-stretch {
    align-items: stretch;
}


/*ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー*/
/*馬込浅間神社*/
/*ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー*/
#magome.page-top,
#seinen.page-top {
    background-image: url(../img/bg_body_seinen.webp);
    background-size: 200px;
    overflow: hidden;
}

.magome-main {
    background-image: url(../img/second_magome.jpg);
    background-size: cover;
    background-position: center center;
    /*aspect-ratio: 1.797/1;*/
    aspect-ratio: 2.2/1;
    border-bottom-left-radius: 50px;
}

#magome h4,
#map h4,
#shintou h4 {
    font-size: 1.2em;
    font-weight: 600;
    color: #B92100
}

#magome .map-img {
    width: 100%;
    max-width: 650px;
}

#magome .contents a,
#shintou a {
    color: #B92100;
    font-weight: 600;
    border-bottom: dashed #B92100 thin;
    padding-bottom: 0.3em
}

#magome p.list-txt,
#map p.list-txt {
    padding-left: 1em;
    margin-bottom: 1em;
}

.map-main {
    background-image: url(../img/second_magome.jpg);
    background-size: cover;
    background-position: center center;
    aspect-ratio: 1.797/1;
    border-bottom-left-radius: 50px;
}

#map .map-img {
    width: 100%;
    max-width: 700px;
}

#map ul.info-btn {
    display: flex;
    width: 700px;
    padding: 0.5em 0 1em;
    gap: 5px;
}

#map ul.info-btn li {
    flex: 1;
    display: flex;
    justify-content: center;
    align-content: center;
}

#map ul.info-btn li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #B92100;
    color: #fff;
    font-weight: 600;
    padding: 0.3em;
    text-align: center;
    border-radius: 5px;
}

@media (max-width: 434px) {
    #map ul.info-btn {
        display: flex;
        flex-direction: column;
        width: 100%;

    }
}

/*青年会*/
.seinen-main {
    background-image: url(../img/second-seinen.jpg);
    background-size: cover;
    aspect-ratio: 1.797/1;
    border-bottom-left-radius: 50px;
    background-position: center top;
}

/*神社案内図*/
.map-main {
    background-image: url(../img/second-map.webp);
    aspect-ratio: 1.797/1;
    border-bottom-left-radius: 50px;
    background-position: center bottom;
}

/*神道の知識*/
.shintou-main {
    background-image: url(../img/second-shinto.webp);
    background-size: cover;
    aspect-ratio: 1.797/1;
    border-bottom-left-radius: 50px;
    background-position: center top;
}

#shintou ul.shintou-index {
    list-style: none;
}

#shintou ul.shintou-index li {
    margin-left: 0.5em;
    line-height: 2;
}

#shintou ul.shintou-index li.mokuji-midashi {
    margin-left: 2em;
}

#shintou ul.shintou-index li a {
    display: block;
    padding: 0.6em 0.9em;
    color: #B92100;
    font-weight: 600;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    margin: 0.2em 0.5em 0.2em;
    box-shadow: 1px 1px 3px #ddd;
}

#shintou ul.shintou-index li a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.8);
}

#shintou ul.sub-index li {
    margin-left: 0.25em;
    letter-spacing: 0.02em;
}

#shintou ul.shintou-index li>ul.sub-index li i {
    font-weight: 900;
    margin-right: 6px;
}

/*
ul.shintou-index > li > a {
  display: block;
  padding: 0.6em 0.9em;
  background: rgba(255,255,255,0.3);
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
  margin:0.5em 0;
}
ul.shintou-index > li > a:hover {
  background: rgba(255,255,255,0.5);
}
ul.shintou-index > li > a:active {
  transform: translateY(0);
}
*/
#shintou .tejun {
    display: flex;
}

#shintou .num {
    margin-right: 1em;
}

#shintou .imgphoto {
    overflow: hidden;
    margin-right: 1em;
    min-height: 0;
}

#shintou .imgphoto img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#shintou .keishin {
    padding: 1em;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 650px;
    border-radius: 15px;
}

#shintou .keishin img {
    width: 100%;
}

#shintou .sasie {
    background-color: #fff;
    padding: 1em;
    display: flex;
    justify-content: center;
    align-items: center;
}

#shintou .sasie-text {
    background-color: #fff;
    padding: 1em 1.5em;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}

#shintou table.saikigu {
    width: 100%;
    font-size: 0.9em;
    max-width: 100%;
    border-collapse: collapse;
    /* 罫線を綺麗にまとめる */
    background: #fff;
    border: 1px solid #eee;
    margin-top: 1em;
}

#shintou table.saikigu th {
    text-align: left;
    padding: 1em;
    vertical-align: middle;
    border-right: 1px solid #dcdcdc;
    border-bottom: 1px solid #dcdcdc;
    background-color: #f8e58c;
}

#shintou table.saikigu td {
    vertical-align: middle;
    padding: 1em;
    border-bottom: 1px solid #eee;
}

@media (max-width: 434px) {
    #shintou .flex {
        flex-direction: column;
    }

    #shintou ul.sub-index li {
        letter-spacing: -0.05em;
    }

}


/*境内マップ*/
.keidai-main {
    background-image: url(../img/second-keidai.jpg);
    aspect-ratio: 1.797/1;
    border-bottom-left-radius: 50px;
    background-position: center bottom;
    background-size: cover;
}

#keidai .map-img {
    width: 100%;
    max-width: 835px;
}

#keidai section {
    margin: 40px 0;
}

#keidai .map-gallery {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, 1fr);

}

@media (min-width: 768px) {
    #keidai .map-gallery {
        grid-template-columns: repeat(3, 1fr);
        max-width: 835px;
        margin: 0 auto;
    }
}

#keidai .spot {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
}

#keidai .spot-head {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.75em 0.75em 0.5em;
}

#keidai .spot-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.2em, 1vw + 1rem, 1.3em);
    height: clamp(1.2em, 1vw + 1rem, 1.3em);
    background: #c3d825;
    color: #fff;
    border-radius: 50%;
    line-height: 1;
    font-weight: 300;
    font-size: clamp(1.4em, 1vw + 1rem, 1.6em);
    font-family: sans-serif;
}

#keidai h3 {
    font-size: clamp(1em, 1vw + 1rem, 1.2em);
    letter-spacing: clamp(0em, 1vw + 1rem, 0.2em);
}

#keidai .spot img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

#keidai .spot-desc {
    padding: 0.75em;
    color: #444;
}

/*ＰＣのみクリッカブルマッピング風対応*/
/* 境内マップ
--------------------------------------------- */
.map-wrap {
    position: relative;
    max-width: 835px;
    /* PC想定 */
    width: 100%;
}

.map-base {
    width: 100%;
    height: auto;
    display: block;
}

.map-hit {
    position: absolute;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0 */
    width: 100%;
    height: 100%;
}

.spot-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .6);
    z-index: 9999;

    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}

.spot-modal.is-active {
    opacity: 1;
    visibility: visible;
}

/* 背景クリック用 */
.spot-bg {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: zoom-out;
    z-index: 1;
}

/* 中央カード */
.spot-content {
    position: relative;
    z-index: 2;
    /* ← これ超重要 */
    max-width: 85vw;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

/* 画像 */
.spot-content img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-spot-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5em;
    padding: 0.75em 0.75em 0.5em;
}

.spot-close {
    font-size: .9em;
    text-decoration: none;
    color: #666;
}

.spot-close:hover {
    text-decoration: underline;
}

/*
@media (hover: none) {
  .spot-modal {
    display: none !important;
  }
}
*/


/*御札と御守*/
.ofuda-main{
    background-image: url(../img/second-ofuda.jpg);
}
#ofuda h4 {
    margin-top: 2em;
}

.ofuda_container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.ofuda_box {
    background: url(../img/bg_juyo_m.png) center / cover;
    width: 100%;
    flex: 0 0 auto;
    overflow: hidden;
    padding: 2em;
    border: thin solid #B92100;
    background-color: #fff;
    text-align: center;
}

.is-square {
    aspect-ratio: 1 / 1;
}

.is-tatenaga {
    aspect-ratio: 2 / 3;
}

.ofuda_box img {
    width: 100%;
    /* height: 90%; */
    aspect-ratio: 10 / 9;
    object-fit: contain;
    object-position: center center;
    display: block;
    filter: drop-shadow(1px 1px 2px #999);
}

.ofuda_box p {
    font-size: 0.9em;
    line-height: 1.1;
    margin: 0 0;
    text-align: center;
}

@media (max-width: 1200px) {
    .ofuda_container {

        grid-template-columns: repeat(2, 1fr);
        gap: 15px;

    }
}

@media (max-width: 540px) {
    .ofuda_container {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 25px;
    }

    .ofuda_box {
        margin: 0 auto;
    }
}