/* 메인 사진 영역: 사진 파일은 자르거나 변환하지 않고 전체 비율로 표시합니다. */
.gallery-preview { background: linear-gradient(#f3f8f6, #f5f9f9); }
.gallery-preview .section-heading { margin-bottom: 24px; }
.gallery-intro { text-align: center; font-size: 14px; line-height: 1.95; color: #5c7880; margin-bottom: 31px; }
.gallery-slideshow { margin: 0 -10px; }
.gallery-stage { position: relative; aspect-ratio: 4 / 3; background: #163f4e; overflow: hidden; border-radius: 5px; box-shadow: 0 12px 32px #164f691a; }
.gallery-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.4s ease; }
.gallery-slide.is-visible { opacity: 1; }
.gallery-slide.is-front { z-index: 2; }
.gallery-caption { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 2px 0; font-size: 14px; color: #315f70; }
.gallery-count { flex-shrink: 0; font-size: 11px; letter-spacing: .08em; color: #78929a; font-variant-numeric: tabular-nums; }
.gallery-count > span { color: #286f8c; font-weight: 700; }
.gallery-controls { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.gallery-controls button { min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid #ccdddf; border-radius: 24px; color: #3b6c7c; background: #ffffffa8; font-size: 17px; }
.gallery-controls #galleryPlay { min-width: 92px; font-size: 12px; }
.gallery-status { font-size: 12px; color: #627f88; text-align: center; }
.gallery-status:not(:empty) { margin-top: 10px; }
.button-gallery { margin-top: 29px; color: #fff; background: #267ba1; border-color: #267ba1; gap: 20px; }
.button-gallery span { font-size: 19px; font-weight: 400; }
.gallery-empty { text-align: center; padding: 45px 20px; color: #668089; border: 1px solid #d4e3e1; border-radius: 5px; background: #ffffff80; }

/* 갤러리 페이지: 모바일 2열, 태블릿 3열, PC 4열 */
.gallery-page { min-height: 100vh; background: radial-gradient(ellipse at 12% 0, #dcebe5, transparent 55%), linear-gradient(#f4f8f6, #eaf2f3); }
.gallery-page-inner { max-width: 1200px; margin: 0 auto; padding: 0 40px 55px; }
.gallery-page-header { position: relative; padding: 100px 16px 48px; text-align: center; }
.gallery-back { position: absolute; left: 0; top: 27px; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; color: #426878; }
.gallery-back span { font-size: 21px; }
.gallery-page-header h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(29px, 4vw, 40px); letter-spacing: .03em; }
.gallery-page-description { margin-top: 20px; font-size: 14px; line-height: 1.95; color: #68818a; }
.gallery-list-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; border-bottom: 1px solid #cfdfdf; padding: 0 0 18px; margin-bottom: 24px; }
.gallery-list-heading h2 { font-size: 15px; font-weight: 600; }
.gallery-list-heading h2 span { margin-left: 6px; color: #2b8199; }
.gallery-list-heading p { font-size: 12px; color: #738991; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.gallery-card { display: block; min-width: 0; }
.gallery-card-image { position: relative; aspect-ratio: 4 / 3; background: #dce8e6; border-radius: 4px; overflow: hidden; }
.gallery-card-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
.gallery-card-image > span { position: absolute; right: 9px; bottom: 9px; display: grid; place-items: center; width: 29px; height: 29px; color: #fff; background: #163f4eb8; border-radius: 50%; font-size: 20px; line-height: 1; }
.gallery-card-caption { display: flex; align-items: baseline; gap: 10px; padding: 12px 2px 0; }
.gallery-card-number { font-size: 10px; letter-spacing: .04em; color: #76949b; }
.gallery-card-caption h3 { min-width: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.gallery-page-footer { margin-top: 58px; padding-top: 30px; border-top: 1px solid #cfdfdf; text-align: center; }
.gallery-page-footer p { font-size: 12px; color: #708891; }
.gallery-page-footer .button { max-width: 310px; margin: 23px auto 0; }

/* 원본 비율 확대 보기: dialog 미지원/JS 미사용 환경은 원본 링크로 열립니다. */
.gallery-lightbox { width: min(1120px, calc(100% - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; padding: 18px 24px; border-radius: 6px; color: #f5fafb; background: #12313b; overflow: auto; }
.gallery-lightbox::backdrop { background: #071d29e8; backdrop-filter: blur(8px); }
.lightbox-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 12px; }
.lightbox-toolbar h2 { font-size: 17px; font-weight: 500; }
.lightbox-toolbar button { flex-shrink: 0; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 0 6px 14px; color: #e5eef0; border: 0; background: transparent; font-size: 12px; }
.lightbox-toolbar button span { font-size: 27px; line-height: 1; }
.lightbox-image-area { position: relative; display: flex; align-items: center; justify-content: center; height: min(65vh, 750px); height: min(65dvh, 750px); background: #0c242e; }
.lightbox-image-area img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-image-area p { position: absolute; padding: 15px; text-align: center; font-size: 13px; color: #d7e6e9; pointer-events: none; }
.lightbox-controls { display: flex; justify-content: center; align-items: center; gap: 28px; margin-top: 15px; }
.lightbox-controls button { width: 48px; height: 44px; border: 1px solid #809da866; color: #fff; border-radius: 24px; background: transparent; font-size: 22px; }
.lightbox-controls span { min-width: 70px; text-align: center; font-size: 13px; letter-spacing: .09em; font-variant-numeric: tabular-nums; }
.lightbox-original { display: block; width: fit-content; margin: 8px auto 0; padding: 8px 12px; font-size: 12px; color: #bdd1d8; }
@media (hover: hover) {
	.gallery-controls button:hover, .lightbox-controls button:hover { background: #75a6ac33; }
	.button-gallery:hover { background: #1c6387; }
}
@media (max-width: 1000px) { .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.gallery-page-inner { padding: 0 20px 40px; }
	.gallery-page-header { padding-top: 96px; padding-bottom: 38px; }
	.gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 13px; }
	.gallery-list-heading { margin-bottom: 20px; }
	.gallery-card-caption { gap: 7px; }
	.gallery-card-caption h3 { font-size: 13px; }
	.gallery-lightbox { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: 12px; }
	.lightbox-toolbar h2 { font-size: 15px; }
	.lightbox-image-area { height: 57vh; height: 57dvh; }
}
