/* =========================================================
   본문 블록 스타일 (사이트 + 편집기 공용)
   ========================================================= */

/* ---- 관리자 수정 링크 ---- */
.page-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.edit-page-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 2px dashed var(--brand, #1d3d6b); color: var(--brand, #1d3d6b); font-weight: 700; font-size: 1rem; text-decoration: none; background: #fff;
}
.edit-page-link:hover { background: var(--brand, #1d3d6b); color: #fff; border-style: solid; }

/* ---- 강조 문단 ---- */
.is-style-jdfb-lead { font-size: 1.375rem; font-weight: 700; line-height: 1.6; color: var(--text, #1b1b1b); }

/* ---- 안내 상자 ---- */
.wp-block-group.is-style-jdfb-note {
  background: var(--surface, #f5f3ee); border-left: 6px solid var(--brand, #1d3d6b); border-radius: 12px; padding: 20px 24px;
}
.wp-block-group.is-style-jdfb-note > :first-child { margin-top: 0; }
.wp-block-group.is-style-jdfb-note > :last-child { margin-bottom: 0; }

/* ---- 연혁 로드맵: [H2 연도 + 목록] 반복 ----
   왼쪽 점선 세로줄 + 연도마다 동그라미 */
.wp-block-group.is-style-jdfb-timeline {
  --tl-x: 28px;          /* 세로줄 위치 */
  --tl-dot: 26px;
  position: relative; padding-left: calc(var(--tl-x) + 36px);
}
.wp-block-group.is-style-jdfb-timeline::before {
  content: ""; position: absolute; left: var(--tl-x); top: 14px; bottom: 14px;
  border-left: 3px dashed var(--brand, #1d3d6b); opacity: .55;
}
.wp-block-group.is-style-jdfb-timeline > h2,
.wp-block-group.is-style-jdfb-timeline > h3 {
  position: relative; margin: 36px 0 10px; font-size: 1.75rem; line-height: 1.2; color: var(--brand, #1d3d6b); letter-spacing: -0.01em;
}
.wp-block-group.is-style-jdfb-timeline > h2:first-child,
.wp-block-group.is-style-jdfb-timeline > h3:first-child { margin-top: 0; }
.wp-block-group.is-style-jdfb-timeline > h2::before,
.wp-block-group.is-style-jdfb-timeline > h3::before {
  content: ""; position: absolute; left: calc(-36px - var(--tl-dot) / 2 + 1.5px); top: 50%; transform: translateY(-50%);
  width: var(--tl-dot); height: var(--tl-dot); border-radius: 50%;
  background: #fff; border: 6px solid var(--brand, #1d3d6b); box-shadow: 0 0 0 5px var(--bg, #fff);
}
/* 가장 최근 연도는 무지개 동그라미 */
.wp-block-group.is-style-jdfb-timeline > h2:first-child::before,
.wp-block-group.is-style-jdfb-timeline > h3:first-child::before {
  border: 0; background: conic-gradient(#e94b5b, #f39c34, #f6d23c, #4cb86b, #3b8fd9, #7a5bd0, #e94b5b);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px);
}
html[data-contrast="high"] .wp-block-group.is-style-jdfb-timeline > h2:first-child::before { background: var(--brand); }
.wp-block-group.is-style-jdfb-timeline > ul, .wp-block-group.is-style-jdfb-timeline > ol {
  list-style: none; margin: 0; padding: 4px 0 0; display: grid; gap: 10px;
}
.wp-block-group.is-style-jdfb-timeline > ul > li, .wp-block-group.is-style-jdfb-timeline > ol > li {
  max-width: none; background: var(--bg, #fff); border: 1px solid var(--line, #d4d0c6); border-radius: 12px; padding: 12px 16px; line-height: 1.6;
}
.wp-block-group.is-style-jdfb-timeline li strong:first-child {
  display: inline-block; min-width: 4.2em; margin-right: 8px; color: var(--accent, #b4440a); font-weight: 800;
}

/* ---- 번호 카드 목록(주요사업 등) ---- */
ol.is-style-jdfb-cards, ul.is-style-jdfb-cards {
  list-style: none; counter-reset: jdfb-card; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px;
}
ol.is-style-jdfb-cards > li, ul.is-style-jdfb-cards > li {
  counter-increment: jdfb-card; max-width: none; position: relative; display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg, #fff); border: 1px solid var(--line, #d4d0c6); border-radius: 12px; padding: 14px 16px; line-height: 1.55; font-weight: 600;
}
ol.is-style-jdfb-cards > li::before, ul.is-style-jdfb-cards > li::before {
  content: counter(jdfb-card, decimal-leading-zero); flex: none; display: grid; place-items: center;
  width: 2.4em; height: 2.4em; border-radius: 50%; background: var(--brand-soft, #e7edf6); color: var(--brand, #1d3d6b); font-weight: 800; font-size: .9375rem;
}

/* ---- 정보 표 ---- */
.wp-block-table.is-style-jdfb-info table { border-collapse: collapse; width: 100%; border-top: 2px solid var(--text, #1b1b1b); }
.wp-block-table.is-style-jdfb-info th, .wp-block-table.is-style-jdfb-info td { border: 0; border-bottom: 1px solid var(--line, #d4d0c6); padding: 12px 16px; text-align: left; vertical-align: top; }
.wp-block-table.is-style-jdfb-info th, .wp-block-table.is-style-jdfb-info td:first-child { width: 9em; background: var(--surface, #f5f3ee); font-weight: 700; white-space: nowrap; }

/* ---- 조직도: 들여쓴 목록 = 하위 조직 ----
   편집기에서 목록을 들여쓰기(Tab)하면 아래 단계가 된다. 각 항목의 굵은 글씨가 상자, 나머지는 설명.
   데스크톱: 가지형 트리 / 좁은 화면: 들여쓴 세로 트리 */
ul.is-style-jdfb-orgchart, ul.is-style-jdfb-orgchart ul { list-style: none; margin: 0; padding: 0; }
ul.is-style-jdfb-orgchart li { max-width: none; }
ul.is-style-jdfb-orgchart li > strong {
  display: inline-block; padding: 10px 16px; border-radius: 12px; background: var(--bg, #fff); border: 2px solid var(--brand, #1d3d6b);
  font-weight: 800; text-align: center; min-width: 7.5em; line-height: 1.4; position: relative; z-index: 1;
}
ul.is-style-jdfb-orgchart > li > strong { background: var(--brand, #1d3d6b); color: var(--brand-ink, #fff); font-size: 1.25rem; padding: 14px 28px; }
ul.is-style-jdfb-orgchart .org-note { display: block; margin-top: 4px; font-size: .9375rem; font-weight: 600; color: var(--muted, #45474d); }
@media (min-width: 861px) {
  ul.is-style-jdfb-orgchart { text-align: center; }
  ul.is-style-jdfb-orgchart ul { display: flex; justify-content: center; position: relative; padding-top: 28px; }
  ul.is-style-jdfb-orgchart ul li { position: relative; padding: 28px 6px 0; flex: 1 1 0; min-width: 0; }
  ul.is-style-jdfb-orgchart ul li::before, ul.is-style-jdfb-orgchart ul li::after {
    content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 28px; border-top: 3px solid var(--brand, #1d3d6b);
  }
  ul.is-style-jdfb-orgchart ul li::after { right: auto; left: 50%; border-left: 3px solid var(--brand, #1d3d6b); }
  ul.is-style-jdfb-orgchart ul li:only-child { padding-top: 0; }
  ul.is-style-jdfb-orgchart ul li:only-child::before, ul.is-style-jdfb-orgchart ul li:only-child::after { display: none; }
  ul.is-style-jdfb-orgchart ul li:first-child::before, ul.is-style-jdfb-orgchart ul li:last-child::after { border: 0 none; }
  ul.is-style-jdfb-orgchart ul li:last-child::before { border-right: 3px solid var(--brand, #1d3d6b); border-radius: 0 10px 0 0; }
  ul.is-style-jdfb-orgchart ul li:first-child::after { border-radius: 10px 0 0 0; }
  ul.is-style-jdfb-orgchart ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 28px; border-left: 3px solid var(--brand, #1d3d6b); }
  ul.is-style-jdfb-orgchart ul li strong { min-width: 0; width: min(100%, 11em); }
}
@media (max-width: 860px) {
  ul.is-style-jdfb-orgchart ul { padding-left: 22px; margin-left: 14px; border-left: 3px solid var(--brand, #1d3d6b); }
  ul.is-style-jdfb-orgchart ul li { position: relative; padding: 8px 0; }
  ul.is-style-jdfb-orgchart ul li::before { content: ""; position: absolute; left: -22px; top: 30px; width: 18px; border-top: 3px solid var(--brand, #1d3d6b); }
}
/* 시설장 옆 위원회(조직도 위 안내) */
.org-committees { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; margin: 0 0 16px; }
.org-committees span { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 2px dashed var(--brand, #1d3d6b); font-weight: 700; color: var(--brand, #1d3d6b); }

/* ---- 인사말 ---- */
.jdfb-greeting { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; align-items: start; }
.jdfb-greeting .wp-block-image img { border-radius: 16px; width: 100%; height: auto; }
.jdfb-greeting .wp-block-image figcaption { text-align: center; font-weight: 700; color: var(--text, #1b1b1b); }
.jdfb-greeting .signature { margin-top: 28px; font-weight: 800; font-size: 1.1875rem; text-align: right; }
@media (max-width: 860px) {
  .jdfb-greeting { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .jdfb-greeting .wp-block-image { max-width: 200px; }
}

/* 편집기: 블록 레이아웃 기본 여백과 충돌 방지 */
.editor-styles-wrapper .wp-block-group.is-style-jdfb-timeline > * { max-width: none; }

/* ---- 버튼 블록(지도 링크 등) ---- */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.wp-block-button__link, .wp-element-button {
  display: inline-flex; align-items: center; min-height: 48px; padding: 10px 22px; border-radius: 10px;
  background: var(--brand, #1d3d6b); color: var(--brand-ink, #fff) !important; border: 2px solid var(--brand, #1d3d6b);
  font-weight: 700; font-size: 1.0625rem; text-decoration: none !important;
}
.wp-block-button__link:hover { background: var(--bg, #fff); color: var(--brand, #1d3d6b) !important; }

/* ---- 버스 노선 표 ---- */
.wp-block-table.bus-table table { border-collapse: collapse; width: 100%; border-top: 2px solid var(--text, #1b1b1b); }
.wp-block-table.bus-table th, .wp-block-table.bus-table td { border: 0; border-bottom: 1px solid var(--line, #d4d0c6); padding: 12px 14px; text-align: left; vertical-align: top; }
.wp-block-table.bus-table thead th { background: var(--surface, #f5f3ee); font-weight: 800; }
.wp-block-table.bus-table tbody th { font-size: 1.25rem; font-weight: 800; color: var(--brand, #1d3d6b); white-space: nowrap; width: 5em; }
.wp-block-table.bus-table td:last-child { white-space: nowrap; font-weight: 700; }
.wp-block-table figcaption, .wp-element-caption { font-size: 1rem; color: var(--muted, #45474d); margin-top: 10px; text-align: left; }
.wp-block-table.is-style-jdfb-info table, .wp-block-table.bus-table table { font-size: 1.0625rem; }

/* ---- 오시는길 지도(카카오 지도 퍼가기) ---- */
.location-map { margin: 24px 0 8px; }
.location-map .root_daum_roughmap { width: 100% !important; border-radius: 12px; overflow: hidden; border: 1px solid var(--line, #d4d0c6); }
.location-map .root_daum_roughmap .wrap_map { height: 400px !important; }
.location-map figcaption { font-size: 1rem; color: var(--muted, #45474d); margin-top: 8px; }
@media (max-width: 640px) { .location-map .root_daum_roughmap .wrap_map { height: 300px !important; } }

/* ---- 단계(절차): 번호 + 화살표 ---- */
ol.is-style-jdfb-steps, ul.is-style-jdfb-steps {
  list-style: none; counter-reset: jdfb-step; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px 36px;
}
ol.is-style-jdfb-steps > li, ul.is-style-jdfb-steps > li {
  counter-increment: jdfb-step; position: relative; max-width: none;
  background: var(--bg, #fff); border: 2px solid var(--brand, #1d3d6b); border-radius: 14px; padding: 16px 18px 18px; font-weight: 700; line-height: 1.5;
}
ol.is-style-jdfb-steps > li::before, ul.is-style-jdfb-steps > li::before {
  content: counter(jdfb-step) "단계"; display: block; margin-bottom: 6px; font-size: .9375rem; font-weight: 800; color: var(--accent, #b4440a);
}
ol.is-style-jdfb-steps > li:not(:last-child)::after, ul.is-style-jdfb-steps > li:not(:last-child)::after {
  content: "→"; position: absolute; right: -30px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 800; color: var(--brand, #1d3d6b);
}
ol.is-style-jdfb-steps li span, ul.is-style-jdfb-steps li span { display: block; font-weight: 500; color: var(--muted, #45474d); font-size: 1rem; margin-top: 4px; }
@media (max-width: 860px) {
  ol.is-style-jdfb-steps, ul.is-style-jdfb-steps { grid-template-columns: 1fr; gap: 28px; }
  ol.is-style-jdfb-steps > li:not(:last-child)::after, ul.is-style-jdfb-steps > li:not(:last-child)::after {
    content: "↓"; right: auto; left: 50%; top: auto; bottom: -30px; transform: translateX(-50%);
  }
}

/* ---- 정보 카드: 각 항목의 굵은 글씨 = 제목, 나머지 = 설명 ---- */
ul.is-style-jdfb-facts, ol.is-style-jdfb-facts {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px;
}
ul.is-style-jdfb-facts > li, ol.is-style-jdfb-facts > li {
  max-width: none; background: var(--surface, #f5f3ee); border-radius: 14px; padding: 18px 20px; line-height: 1.65; border-top: 5px solid var(--brand, #1d3d6b);
}
ul.is-style-jdfb-facts > li > strong:first-child, ol.is-style-jdfb-facts > li > strong:first-child {
  display: block; font-size: 1.1875rem; font-weight: 800; color: var(--brand, #1d3d6b); margin-bottom: 6px;
}

/* 전화번호·메일 주소는 중간에서 줄바꿈하지 않는다 */
a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }

/* ---- 우리의 발자국: 활동 카드 목록 ---- */
.fp-count { color: var(--muted, #45474d); margin: 0 0 16px; }
.fp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.fp-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--text, #1b1b1b); background: var(--bg, #fff); border: 1px solid var(--line, #d4d0c6); border-radius: 14px; overflow: hidden; }
.fp-card a:hover { border-color: var(--brand, #1d3d6b); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.fp-card a:hover .fp-title { text-decoration: underline; text-underline-offset: 4px; }
.fp-card img, .fp-noimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface, #f5f3ee); }
.fp-noimg { display: grid; place-items: center; color: var(--muted, #45474d); }
.fp-noimg .icon { width: 48px; height: 48px; }
.fp-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.fp-title { font-weight: 800; font-size: 1.125rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp-meta { font-size: 1rem; color: var(--muted, #45474d); }
.fp-pages ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 32px 0 0; padding: 0; }
.fp-pages a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line, #d4d0c6); text-decoration: none; font-weight: 700; color: var(--text, #1b1b1b); }
.fp-pages a[aria-current="page"] { background: var(--brand, #1d3d6b); border-color: var(--brand, #1d3d6b); color: var(--brand-ink, #fff); }

/* ---- 활동 상세 ---- */
.fp-detail-meta { color: var(--muted, #45474d); font-weight: 600; margin: 0 0 16px; }
.fp-detail .wp-block-gallery { gap: 12px; }
.fp-detail .wp-block-gallery .wp-block-image img { border-radius: 10px; }
.fp-back { margin-top: 32px; }
.fp-back .icon { margin-right: 4px; }
/* 사진이 한 장인 활동은 너무 크게 보이지 않게 */
.fp-detail .wp-block-gallery:has(> .wp-block-image:only-child) { max-width: 760px; }
