#dentistry-container {
    width: 100%;
    padding: 0 5%;
}

.dentistry-first-row {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 30px 0;
}

.dentistry-container-grid1, .dentistry-container-grid3{
    width: 100%;
    display: grid;
    grid-template-columns: 52% 48%;
    gap: 30px;
}

.dentistry-grid1-right, .dentistry-grid3-right{
    width: calc(100% - 30px);
}

.dentistry-grid1-right img, .dentistry-grid3-right img{
    width: 100%;
    max-width: 450px;
    border-radius: 10px;
    object-fit: cover;
}

.dentistry-container-grid2 {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 30px 0;
}

.dentistry-grid2-left, .dentistry-grid2-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fcfcfc;
    border-radius: 10px;
    padding: 20px;
}

.dentistry-container-grid2 img {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.dentistry-second-row {
    width: 100%;
    padding: 30px 0;
}

.dentistry-second-row-inner {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
}

.text-caption-medium, .text-caption-small {
    text-align: center;
    margin: 0;
}

.text-caption-small {
    font-size: 0.8rem;
}

.case-grid {
    width: 100%;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 15px;
}

.case-grid li {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #eee;
    border-radius: 10px;
}

.case-grid img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.case-grid p {
    text-align: center;
    margin-bottom: 0;
}

.dentistry2-container {
    width: 100%;
    margin: 30px 0;
}

.dentistry-case {
    background-color: #fcfcfc;
    padding: 20px 15px;
    border-radius: 3px;
}

.dentistry-container-normal {
    background-color: #fcfcfc;
    padding: 20px 15px;
    border-radius: 3px;
}

.dentistry-second-row-inner {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 30px 0;
}




/* モーダル（ライトボックス）全体の背景 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* 表示された時のクラス */
.lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* 画像とテキストを囲むコンテナ */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 拡大画像 */
.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* 症例名（キャプション） */
.lightbox-caption {
    color: #fff;
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}

/* --- 操作ボタン類 --- */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}

.lightbox-prev, 
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    padding: 20px; /* クリック判定を広げる */
    z-index: 10000;
}

.lightbox-prev { left: 2%; }
.lightbox-next { right: 2%; }

/* ボタンのホバーアクション */
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #15a0a0; /* 当院のテーマカラー（ティール）に光るぜ */
}

/* --- スマホ対応 --- */
@media screen and (max-width: 768px) {
    .lightbox-prev { left: 0; padding: 10px; font-size: 30px; }
    .lightbox-next { right: 0; padding: 10px; font-size: 30px; }
    .lightbox-close { top: 10px; right: 15px; font-size: 35px; }
    .lightbox-img { max-height: 60vh; }
    .lightbox-caption { font-size: 14px; }
}



/********/
/*TABLET*/
/********/
@media only screen and (max-width: 1025px) {

#dentistry-container {
    width: 100%;
    padding: 0 3%;
}

.dentistry-container-grid1, .dentistry-container-grid3 {
    width: 100%;
    display: grid;
    grid-template-columns: 100%;
    gap: 0px;
}

.dentistry-grid1-right, .dentistry-grid3-right {
    width: 100%;
}

.dentistry-grid1-right {
    order: 1;
}

.dentistry-grid1-left {
    order: 2;
}

.dentistry-first-row {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 0 15px 0;
}

.dentistry-container-grid2 {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 0px;
    padding: 15px 0;
}

.dentistry-second-row {
    width: 100%;
    padding: 0 0 15px 0;
}

.case-grid {
    width: 100%;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 15px;
}


}
/********/
/*MOBILE*/
/********/
@media only screen and (max-width: 599px) { 

.case-grid {
    width: 100%;
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 15px;
}

}



