/* 공통 바닥 — 이 시안은 자기 눈금을 갖고 있어 layouts.css 의 눈금을 쓰지 않습니다. */
html { overflow-x: hidden; }
h1, h2, h3, h4 { line-height: 1.3; }
.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 社会福祉法人明照園(meishoen.com) — 연살구 바탕(#f8f2ee)에 왼쪽 고정 사이드바(세로 로고, 메뉴,
   색 버튼 셋: 입소신청 파랑·채용 주황·문의 살구), 오른쪽은 둥근 모서리 흰 종이. 첫 화면은 어르신·직원
   얼굴 일러스트가 말풍선과 함께 바둑판처럼 깔리고 「まいにちに、よりそいたい。」 세로 글 + 오늘 날짜.
   MESSAGE(기울인 사진) → 주황 띠 DAILY(일력 카드) → PEOPLE 사진 모자이크 → SERVICE 2단 카드 → NEWS
   → 푸터. 일러스트 얼굴은 사진 원과 말풍선으로 대신합니다. */
/* 색 전환기(palette.js)가 색을 고르기 전에는 이 시안 본래의 색을 씁니다.
   .js-pal 이 붙으면 palettes.css 의 --primary 가 이깁니다. */
body:not(.js-pal) { --primary: #f0813b; --primary-dk: #a3572a; --primary-lt: #fbe6d8; }
body { --pg: #f8f2ee; --ink: #3f342d; --or: var(--primary); --blue: #3fb6c9; --peach: #f2b27e; --ppr: #fff; }
body { background: var(--pg); color: var(--ink); font-size: 14px; word-break: keep-all; }
p, h2, h3 { text-wrap: pretty; }
h1, h2, h3 { color: var(--ink); font-weight: 500; }
.wrap { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.side { position: sticky; top: 0; height: 100vh; padding: 40px 30px; display: flex; flex-direction: column; }
.side__logo { font-size: 30px; font-weight: 700; letter-spacing: .05em; line-height: 1.1; }
.side__logo small { display: block; font-size: 12px; letter-spacing: .2em; margin-bottom: 6px; font-weight: 400; }
.side__logo b { border: 2px solid var(--ink); padding: 0 4px; }
.side__nav { margin-top: 60px; display: grid; gap: 22px; font-size: 13px; }
.side__nav a { display: block; line-height: 1.5; }
.side__nav small { display: block; font-size: 12px; color: var(--primary-dk); letter-spacing: .15em; }
.side__nav small::before { content: "■ "; }
.side__btns { margin-top: auto; display: grid; gap: 10px; margin-left: -30px; }
.side__btns a { color: #1f1f1f; padding: 12px 20px; border-radius: 0 999px 999px 0; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.side__btns a::after { content: "→"; }
.side__btns a:nth-child(1) { background: var(--blue); } .side__btns a:nth-child(2) { background: var(--or); } .side__btns a:nth-child(3) { background: var(--peach); }

.paper { background: var(--ppr); border-radius: 40px 0 0 40px; margin: 20px 0 0; overflow: hidden; }
.kv { position: relative; background: #e9d6ce; overflow: hidden; }
/* 사진 원·말풍선·세로 글·오늘 날짜가 모두 한 바둑판에 들어갑니다 — 세로 글과 날짜가 칸을 차지해 사진을 가리지 않습니다. */
.faces { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); grid-auto-rows: 118px; grid-auto-flow: dense; padding: 40px 30px 50px; gap: 10px; }
.faces span { position: relative; width: min(86px, 100%); aspect-ratio: 1; border-radius: 50%; overflow: hidden; justify-self: center; align-self: center; border: 3px solid #fff; }
.faces span:nth-child(3n) { transform: translateY(22px); } .faces span:nth-child(5n) { transform: translateX(-12px) scale(.9); }
.faces img { width: 100%; height: 100%; object-fit: cover; }
.faces i { position: relative; justify-self: center; align-self: center; font-size: 13px; line-height: 1.4; color: #1f1f1f; padding: 6px 12px; border-radius: 999px; font-style: normal; white-space: nowrap; box-shadow: 0 4px 10px rgba(63,52,45,.1); }
.faces i::after { content: ""; position: absolute; left: 14px; bottom: -4px; width: 9px; height: 9px; background: inherit; transform: rotate(45deg); }
.kv__t { grid-column: 4 / 6; grid-row: 2 / 5; justify-self: center; align-self: center; position: relative; z-index: 1; background: #fff; padding: 28px 22px; writing-mode: vertical-rl; font-size: 32px; font-weight: 700; letter-spacing: .1em; line-height: 1.5; border-radius: 20px; box-shadow: 0 10px 30px rgba(63,52,45,.15); }
.kv__t::before, .kv__t::after { content: ""; position: absolute; width: 30px; height: 30px; background: #fff; border-radius: 50%; }
.kv__t::before { left: -14px; bottom: 30px; } .kv__t::after { left: -30px; bottom: 12px; width: 14px; height: 14px; }
.today { grid-column: -2 / -1; grid-row: 1; justify-self: center; align-self: center; background: #fff; padding: 10px 14px; text-align: center; border-radius: 4px; font-size: 12px; letter-spacing: .2em; line-height: 1.3; box-shadow: 0 6px 16px rgba(63,52,45,.12); }
.today b { display: block; font-size: 36px; letter-spacing: 0; line-height: 1; margin-top: 2px; }
.today em { font-style: normal; display: block; font-size: 14px; letter-spacing: 0; }

.sec { padding: 90px 60px; position: relative; }
.eb { font-size: 12px; color: var(--primary-dk); letter-spacing: .2em; font-weight: 700; margin-bottom: 16px; }
.eb::before { content: "● "; font-size: 8px; vertical-align: middle; }
.msg { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.msg h2 { font-size: 34px; line-height: 1.6; margin-bottom: 26px; }
.msg p { line-height: 2.2; font-size: 14px; }
.msg__pics { position: relative; height: 480px; }
.msg__pics img { position: absolute; width: 58%; aspect-ratio: 4/3; object-fit: cover; box-shadow: 0 10px 30px rgba(63,52,45,.15); border: 6px solid #fff; }
.msg__pics img:nth-child(1) { right: 0; top: 0; transform: rotate(4deg); }
.msg__pics img:nth-child(2) { left: 0; top: 160px; transform: rotate(-6deg); }
.msg__pics img:nth-child(3) { right: 6%; bottom: 0; transform: rotate(3deg); }
.msg::before { content: ""; position: absolute; left: -60px; right: 0; bottom: -40px; height: 220px; background: #f8e3d6; border-radius: 0 200px 0 0; z-index: -1; }

.daily { background: var(--or); color: #1f1f1f; padding: 90px 60px; position: relative; overflow: hidden; }
.daily::before { content: ""; position: absolute; inset: -60px 0 auto; height: 120px; background: var(--ppr); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.daily .eb { color: #3d1e08; }
.daily h2 { color: #1f1f1f; font-size: 34px; margin-bottom: 14px; }
.daily p { font-size: 14px; line-height: 2; }
.cal { position: absolute; right: 60px; top: 60px; display: flex; gap: 20px; }
.cal div { width: 150px; min-height: 190px; background: #fff; color: var(--ink); border-radius: 6px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.cal div:nth-child(1) { transform: rotate(-8deg) translateY(30px); } .cal div:nth-child(3) { transform: rotate(6deg) translateY(20px); }
.cal b { display: block; font-size: 40px; line-height: 1; }
.cal small { font-size: 12px; letter-spacing: .1em; }
.cal img { width: 100%; height: 80px; object-fit: cover; margin-top: 10px; border-radius: 4px; }
.cal em { display: block; margin-top: 8px; text-align: center; font-size: 14px; font-weight: 700; font-style: normal; }
.bt { white-space: nowrap; display: inline-block; margin-top: 30px; padding: 12px 30px; border-radius: 999px; background: #fff; color: var(--primary-dk); font-weight: 700; font-size: 13px; }
.bt--o { background: var(--or); color: #1f1f1f; }

.people h2 { font-size: 34px; margin-bottom: 10px; } .people p { margin-bottom: 40px; }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mosaic img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; }
.mosaic img:nth-child(odd) { transform: translateY(20px); }

.svc { display: grid; grid-template-columns: 1fr 1fr; gap: 50px 40px; }
.svc__h { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.svc__h h2 { font-size: 34px; }
.sv { position: relative; }
.sv img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; }
.sv h3 { font-size: 24px; margin: 18px 0 8px; } .sv h3::before { content: "● "; color: var(--primary-dk); font-size: 10px; vertical-align: middle; }
.sv p { font-size: 13px; line-height: 1.9; }
.sv .bt { position: absolute; right: 10px; top: 45%; margin: 0; padding: 8px 16px; font-size: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.15); }

.news h2 { font-size: 34px; margin-bottom: 30px; display: flex; gap: 20px; align-items: center; }
.news__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news__grid div { border-top: 3px solid var(--or); padding-top: 12px; font-size: 13px; }
.news__grid b { display: block; font-size: 24px; margin-bottom: 8px; }
.news__grid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }

.other { background: #f4e6dc; padding: 70px 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.other div { background: #fff; border-radius: 12px; padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.other p { margin-bottom: 26px; } .other .bt { margin-top: auto; }
.other h3 { font-size: 22px; margin: 6px 0 10px; } .other small { color: var(--primary-dk); letter-spacing: .15em; font-size: 12px; } .other p { font-size: 13px; }
.ft { padding: 40px 60px; font-size: 12px; color: #6a5f57; display: flex; justify-content: space-between; gap: 20px; }
.ft > span:last-child { white-space: nowrap; }
.ft__legal { display: block; margin-top: 6px; font-size: 12px; line-height: 1.8; }
@media (max-width: 960px) { .wrap { grid-template-columns: minmax(0, 1fr); } .side, .paper { min-width: 0; max-width: 100%; overflow: hidden; } .side { position: static; height: auto; } .side__btns { margin-left: 0; } .paper { border-radius: 0; } .msg, .svc, .mosaic, .news__grid, .other { grid-template-columns: 1fr; } .sec, .daily, .other { padding: 50px 24px; } .cal { display: none; } .faces { grid-template-columns: repeat(4, 1fr); } }

/* ── 원래 인라인 style 이던 자리 — CSP 때문에 클래스로 뺐습니다 ── */
.si-1 { background:#8fc9a3; }
.si-2 { background:#f2b27e; }
.si-3 { background:#3fb6c9; }
.si-4 { background:#f0813b; }
.si-5 { margin:0; }
.si-6 { margin:0;font-size:12px;padding:8px 16px; }

/* 좁은 화면 — 첫 화면은 4칸 바둑판을 6줄로 줄이고, 사람 사진은 2칸, 기울인 사진은 서로 겹치게 모읍니다. */
@media (max-width: 960px) {
  .side__btns { margin-top: 36px; }
  .faces { grid-auto-rows: 84px; gap: 6px; padding: 24px 14px 32px; }
  .faces > :nth-child(n+20) { display: none; }
  .faces span { width: min(70px, 100%); }
  .faces span:nth-child(3n) { transform: translateY(12px); } .faces span:nth-child(5n) { transform: scale(.9); }
  .faces i { font-size: 12px; padding: 4px 8px; }
  .kv__t { grid-column: 2 / 4; grid-row: 2 / 5; font-size: 24px; padding: 20px 16px; }
  .kv__t::before { left: -10px; width: 22px; height: 22px; } .kv__t::after { left: -22px; width: 10px; height: 10px; }
  .today { padding: 8px 8px; letter-spacing: .1em; } .today b { font-size: 28px; }
  .msg__pics { height: 370px; } .msg__pics img { width: min(64%, 320px); }
  .msg__pics img:nth-child(2) { top: 112px; }
  .mosaic { grid-template-columns: 1fr 1fr; padding-bottom: 20px; }
  .svc__h { flex-wrap: wrap; gap: 16px; }
  .ft { flex-direction: column; padding: 32px 24px; }
}
@media (min-width: 600px) and (max-width: 960px) {
  .faces { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 104px; }
  .faces > :nth-child(n+20):nth-child(-n+31) { display: block; }
  .faces span { width: min(84px, 100%); }
  .kv__t { grid-column: 3 / 5; font-size: 28px; }
}
/* 사이드바 옆 종이가 좁아지는 폭 — 일력 카드를 제목 아래로 내려 글과 겹치지 않게 */
@media (min-width: 961px) and (max-width: 1240px) {
  .cal { position: static; margin-top: 56px; justify-content: center; }
}

/* ── 마감 다듬기 ── */
.sv h3::before { content: "●"; display: inline-block; margin-right: 8px; }
.other p { text-wrap: balance; }
@media (min-width: 961px) and (max-width: 1240px) {
  .other { padding: 60px 40px; gap: 16px; }
  .other div { padding: 28px 18px; }
  .other h3 { font-size: 20px; }
}
/* 좁은 화면 — 메뉴 칸을 가로로 눕혀 첫 화면에 사진 바둑판이 바로 보이게 */
@media (max-width: 960px) {
  .side { padding: 28px 24px 24px; }
  .side__nav { margin-top: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
  .side__btns { margin-top: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .side__btns a { border-radius: 999px; padding: 12px 18px; }
  .daily { padding-top: 100px; }
}
@media (min-width: 600px) and (max-width: 960px) {
  .faces span { width: min(92px, 100%); }
  .mosaic { grid-template-columns: repeat(4, 1fr); }
  .svc { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
  .news__grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .news__grid b { font-size: 20px; }
  .other { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .other div { padding: 26px 16px; }
  .other h3 { font-size: 18px; }
}
@media (max-width: 599px) {
  .side__nav { grid-template-columns: 1fr 1fr; }
  .side__btns a { justify-content: center; padding: 12px 8px; }
  .side__btns a::after { content: none; }
  /* 소식: 작은 사진 왼쪽, 날짜와 제목 오른쪽 */
  .news__grid { gap: 0; }
  .news__grid div { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-content: start; column-gap: 16px; padding: 16px 0; border-top-width: 2px; }
  .news__grid img { grid-row: 1 / 3; grid-column: 1; margin: 0; aspect-ratio: 4 / 3; }
  .news__grid b { grid-column: 2; font-size: 18px; margin: 2px 0 4px; }
}
