/*
 * 가평우리마을 마을도서관 상세 페이지
 * 기존 rest-spaces.css 색상과 공통 헤더/푸터를 유지합니다.
 */

.rest-library-page {
  background: #f6f4f1;
}

.library-page-hero {
  padding-bottom: 46px;
}

.library-intro-section {
  padding: 58px 0 92px;
}

.library-visual {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.8fr);
  gap: 16px;
  min-height: 430px;
}

.library-visual-main,
.library-visual-small {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #e3ddd5;
}

.library-visual-main {
  min-height: 430px;
}

.library-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-visual-main img {
  object-position: center 45%;
}

.library-visual-side {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.library-visual-small {
  min-height: 0;
}

.library-visual-tag {
  position: absolute;
  left: 24px;
  bottom: 22px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 100px;
  background: rgba(255, 253, 250, 0.93);
  color: #6c4e3e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.library-intro-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 44px;
  align-items: end;
  margin-top: 54px;
}

.library-eyebrow {
  display: inline-block;
  margin-bottom: 15px;
  color: #b86b4c;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.15em;
}

.library-intro-copy h2 {
  margin: 0;
  font-size: clamp(27px, 3.2vw, 42px);
  line-height: 1.4;
  letter-spacing: -0.055em;
  word-break: keep-all;
}

.library-intro-copy p {
  margin: 0;
  color: #6e6660;
  font-size: 16px;
  line-height: 1.95;
  word-break: keep-all;
}

.library-info-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 45px 0 0;
  padding: 26px 12px;
  border: 1px solid #e7ddd5;
  border-radius: 18px;
  background: #fff;
}

.library-info-strip > div {
  min-width: 0;
  padding: 8px 24px;
}

.library-info-strip > div + div {
  border-left: 1px solid #e7ddd5;
}

.library-info-strip dt {
  margin-bottom: 9px;
  color: #b86b4c;
  font-size: 12px;
  font-weight: 750;
}

.library-info-strip dd {
  margin: 0;
  color: #332d29;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.library-info-strip a {
  color: inherit;
  text-decoration: none;
}

.library-spaces-section {
  padding: 85px 0 120px;
  background: #f0eae3;
}

.library-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.library-section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.26;
  letter-spacing: -0.055em;
}

.library-section-heading p {
  margin: 14px 0 0;
  color: #716760;
  font-size: 16px;
  line-height: 1.7;
}

.library-section-count {
  flex: none;
  padding-bottom: 6px;
  color: #b08671;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.library-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.library-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 310px;
  padding: 31px;
  border: 1px solid #e4dbd3;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(48, 39, 31, 0.025);
}

.library-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 12px;
  margin-bottom: 32px;
}

.library-card-number {
  color: #b86b4c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.library-card-icon {
  color: #d9b9a5;
  font-size: 25px;
  line-height: 1;
}

.library-card h3 {
  margin: 0 0 16px;
  color: #2e2925;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.055em;
}

.library-card-description {
  margin: 0;
  color: #675e58;
  font-size: 15px;
  line-height: 1.9;
  word-break: keep-all;
}

.library-card-location {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px 13px;
  margin-top: 27px;
  padding-top: 18px;
  border-top: 1px solid #eee7e0;
}

.library-card-location span {
  color: #b86b4c;
  font-size: 13px;
  font-weight: 750;
}

.library-card-location strong {
  color: #4c423b;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.6;
}

.library-card--featured {
  grid-column: span 2;
  background: #fffaf5;
}

.library-card-featured-label {
  color: #b86b4c;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.library-donation-details {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 26px;
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid #e8d9cd;
}

.library-donation-details h4 {
  margin: 0 0 13px;
  color: #a15b3d;
  font-size: 15px;
  font-weight: 850;
}

.library-donation-details p,
.library-donation-details li {
  color: #554a44;
  font-size: 14px;
  line-height: 1.9;
  word-break: keep-all;
}

.library-donation-details p {
  margin: 0;
}

.library-donation-details p strong {
  color: #2e2925;
}

.library-donation-details ul {
  margin: 0;
  padding-left: 19px;
}

.library-donation-details li + li {
  margin-top: 7px;
}

.library-card--bible {
  background: #fdfcf9;
}

.library-back-row {
  margin-top: 34px;
  text-align: center;
}

.library-back-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 21px;
  border: 1px solid #d5c9bd;
  border-radius: 999px;
  color: #493c33;
  background: #fff;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.library-back-link:hover,
.library-back-link:focus-visible {
  border-color: #b86b4c;
  transform: translateY(-1px);
}

/* 문화 카드 전체를 클릭하되 기존 전화번호 링크는 유지합니다. */
.culture-place.library-link-target {
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.culture-place.library-link-target:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(65, 48, 37, 0.09);
}

.culture-place.library-link-target .library-card-hit {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  color: inherit;
}

.culture-place.library-link-target .library-card-hit:focus-visible {
  outline: 3px solid #b86b4c;
  outline-offset: 4px;
}

.culture-place.library-link-target .culture-info a {
  position: relative;
  z-index: 3;
}

.culture-place.library-link-target .library-card-hit span {
  position: absolute;
  right: 29px;
  bottom: 16px;
  color: #b86b4c;
  font-size: 13px;
  font-weight: 780;
}

@media (max-width: 900px) {
  .library-intro-copy {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .library-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-card--featured {
    grid-column: span 2;
  }

  .library-card--bible {
    grid-column: span 2;
    min-height: 250px;
  }

  .library-donation-details {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .library-page-hero {
    padding-bottom: 36px;
  }

  .library-desktop-break {
    display: none;
  }

  .library-intro-section {
    padding: 30px 0 65px;
  }

  .library-visual {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 10px;
  }

  .library-visual-main {
    min-height: 0;
    aspect-ratio: 5 / 4;
  }

  .library-visual-side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    gap: 10px;
  }

  .library-visual-small {
    aspect-ratio: 5 / 4;
  }

  .library-intro-copy {
    margin-top: 38px;
  }

  .library-intro-copy h2 {
    font-size: 27px;
  }

  .library-intro-copy p {
    font-size: 15px;
  }

  .library-info-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 34px;
    padding: 10px;
  }

  .library-info-strip > div {
    padding: 18px 14px;
  }

  .library-info-strip > div + div {
    border-left: none;
  }

  .library-info-strip > div:nth-child(2n) {
    border-left: 1px solid #e7ddd5;
  }

  .library-info-strip > div:nth-child(n + 3) {
    border-top: 1px solid #e7ddd5;
  }

  .library-info-strip dd {
    font-size: 14px;
  }

  .library-spaces-section {
    padding: 62px 0 80px;
  }

  .library-section-heading {
    margin-bottom: 25px;
  }

  .library-section-count {
    display: none;
  }

  .library-section-heading h2 {
    font-size: 30px;
  }

  .library-cards {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .library-card,
  .library-card--bible,
  .library-card--featured {
    grid-column: auto;
    min-height: 0;
    padding: 25px 22px;
  }

  .library-card-top {
    margin-bottom: 18px;
  }

  .library-card h3 {
    font-size: 25px;
  }

  .library-donation-details {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .library-card-location {
    margin-top: 20px;
  }

  .culture-place.library-link-target .library-card-hit span {
    right: 22px;
    bottom: 12px;
  }
}


/* REST LIBRARY GALLERY V2: 대형 슬라이드 + 사진 정보 카드 */
.library-visual.library-hero-slider {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(350px, 42vw, 540px);
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #e6ded6;
  outline-offset: 5px;
}

.library-hero-slides,
.library-hero-slide {
  position: absolute;
  inset: 0;
}

.library-hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.library-hero-slide.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.library-hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.library-hero-bottom {
  position: absolute;
  z-index: 3;
  bottom: 24px;
  right: 25px;
  left: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
}

.library-hero-dots,
.library-hero-arrows {
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
}

.library-hero-dot {
  width: 27px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.60);
  cursor: pointer;
}

.library-hero-dot.is-active {
  width: 40px;
  background: #fff;
}

.library-hero-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  background: rgba(255, 253, 250, 0.94);
  color: #3d322b;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.library-hero-arrow:hover {
  background: #fff;
}

.library-hero-dot:focus-visible,
.library-hero-arrow:focus-visible {
  outline: 3px solid #b86b4c;
  outline-offset: 3px;
}

.library-cards .library-card {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.library-card-photo {
  position: relative;
  width: 100%;
  height: 218px;
  overflow: hidden;
  background: #e7ded5;
}

.library-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.library-card:hover .library-card-photo img {
  transform: scale(1.035);
}

.library-card-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 27px 29px 30px;
}

.library-cards .library-card-top {
  margin-bottom: 20px;
}

.library-card-inner .library-card-description {
  flex: 1;
}

.library-cards .library-card--featured .library-card-photo {
  height: 275px;
}

.library-cards .library-card--featured .library-card-description {
  flex: none;
}

@media (max-width: 900px) {
  .library-card-photo {
    height: 235px;
  }
}

@media (max-width: 700px) {
  .library-visual.library-hero-slider {
    height: clamp(260px, 69vw, 350px);
    border-radius: 17px;
  }

  .library-hero-bottom {
    right: 14px;
    bottom: 13px;
    left: 14px;
  }

  .library-hero-dot {
    width: 19px;
  }

  .library-hero-dot.is-active {
    width: 28px;
  }

  .library-hero-arrow {
    width: 36px;
    height: 36px;
    font-size: 26px;
  }

  .library-cards .library-card {
    padding: 0;
  }

  .library-cards .library-card-photo,
  .library-cards .library-card--featured .library-card-photo {
    height: 215px;
  }

  .library-card-inner {
    padding: 23px 22px 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-hero-slide,
  .library-card-photo img {
    transition: none;
  }
}
/* END REST LIBRARY GALLERY V2 */

/* REST LIBRARY PHOTO UNIFORM V3 */
/* 다섯 카드 공통: 배경, 이미지 높이, 하단 정보 영역을 통일합니다. */
.library-spaces-section .library-cards {
  align-items: stretch;
  gap: 20px;
}

.library-spaces-section .library-cards .library-card,
.library-spaces-section .library-cards .library-card--featured,
.library-spaces-section .library-cards .library-card--bible {
  height: 100%;
  background: #fff;
  border-color: #e4dbd3;
}

.library-spaces-section .library-cards .library-card-inner {
  background: #fff;
}

.library-spaces-section .library-cards .library-card-photo,
.library-spaces-section .library-cards .library-card--featured .library-card-photo {
  flex: 0 0 320px;
  height: 320px;
  min-height: 320px;
}

.library-spaces-section .library-cards .library-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-spaces-section .library-cards .library-card-inner {
  padding: 27px 29px 30px;
}

/* 후원 안내의 길이에 상관없이 같은 줄에 있는 카드 하단은 맞춰집니다. */
.library-spaces-section .library-cards .library-card-location {
  margin-top: 25px;
}

/* 사진 등록 전에는 이전 공식 사진 대신 단정한 대체 문구를 표시합니다. */
.library-hero-slide.is-image-missing,
.library-card-photo.is-image-missing {
  background: #ece5dd;
}

.library-hero-slide.is-image-missing::after,
.library-card-photo.is-image-missing::after {
  content: '사진 등록 예정';
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #8b7b70;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.library-hero-slide img.is-missing,
.library-card-photo img.is-missing {
  opacity: 0;
}

@media (max-width: 900px) {
  .library-spaces-section .library-cards .library-card-photo,
  .library-spaces-section .library-cards .library-card--featured .library-card-photo {
    flex-basis: 285px;
    height: 285px;
    min-height: 285px;
  }
}

@media (max-width: 700px) {
  .library-spaces-section .library-cards .library-card-photo,
  .library-spaces-section .library-cards .library-card--featured .library-card-photo {
    flex-basis: 260px;
    height: 260px;
    min-height: 260px;
  }

  .library-spaces-section .library-cards .library-card-inner {
    padding: 23px 22px 25px;
  }
}
/* END REST LIBRARY PHOTO UNIFORM V3 */

/* REST LIBRARY HERO FULL PHOTO FOOTER V4 */
/* 화면 너비에 맞춰 사진 영역을 키워 위아래 잘림을 방지합니다. */
body.rest-library-page .library-visual.library-hero-slider {
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 8 / 5;
  background: #e6ded6;
}

/* 사진을 확대 크롭하지 않고 원본 전체가 보이도록 유지합니다. */
body.rest-library-page .library-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* 공통 푸터의 기본 margin-top:20px은 도서관에서만 해제합니다. */
body.rest-library-page #siteFooter .site-footer {
  margin-top: 0 !important;
}

/* 공통 푸터가 늦게 삽입되더라도 사이에 밝은 띠가 보이지 않게 합니다. */
body.rest-library-page #siteFooter {
  background: #292a2d;
}

@media (max-width: 700px) {
  body.rest-library-page .library-visual.library-hero-slider {
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }
}
/* END REST LIBRARY HERO FULL PHOTO FOOTER V4 */
