/* 한국어와 영어 모두 어절이나 단어가 끝난 뒤 줄바꿈되도록 합니다. */
body p,
body .hero-copy,
body .section-summary,
body .worship-main p,
body .sermon-feature p,
body .home-worship-board p,
body .resource-grid p,
body .site-footer p,
body .people-hero p,
body .pastor-copy p,
body .staff-card p,
body .intro-detail-copy p,
body .vision-detail-grid p,
body .facility-guide p,
body .intro-location p,
body .parking-panel p {
  word-break: keep-all;
  overflow-wrap: normal;
  line-break: strict;
}

/* 태블릿 화면에 맞춘 레이아웃입니다. */
@media (max-width: 1120px) {
  .menu-toggle {
    display: flex;
    width: 44px;
    height: 44px;
    margin-left: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.16);
    color: currentColor;
    cursor: pointer;
  }

  .site-header.is-scrolled .menu-toggle,
  .site-header.is-open .menu-toggle {
    background: var(--surface-cool);
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: transform 180ms ease;
  }

  .site-header.is-open .menu-toggle span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .site-header.is-open .menu-toggle span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .header-actions {
    display: contents;
  }

  .header-social {
    display: none;
  }

  .site-footer {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: clamp(18px, 2.4vw, 30px);
  }

  .footer-social {
    grid-column: 3;
    justify-self: end;
  }

  .main-nav {
    position: absolute;
    top: 82px;
    left: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav > a {
    padding: 14px 12px;
  }
  .quick-links,
  .vision-grid,
  .resource-grid,
  .home-worship-board,
  .worship-layout,
  .news-layout,
  .location {
    grid-template-columns: 1fr 1fr;
  }

  .quick-links {
    gap: 0;
    transform: none;
  }

  .quick-links a:nth-child(2) {
    border-radius: 0 8px 0 0;
    border-right: 0;
  }

  .quick-links a:nth-child(3) {
    border-right: 1px solid var(--line);
    border-radius: 0;
  }

  .quick-links a:nth-child(4) {
    border-right: 0;
    border-radius: 0;
  }

  .quick-links a:last-child {
    border-right: 0;
    border-radius: 0 0 8px 0;
  }

  .pastor-feature {
    grid-template-columns: 1fr;
  }

  .pastor-photo {
    max-width: 360px;
  }

  .staff-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 260px));
    justify-content: start;
  }

  .intro-detail-hero,
  .worship-time-layout,
  .facility-floor-grid,
  .intro-location {
    grid-template-columns: 1fr;
  }

  .intro-detail-media {
    max-width: 620px;
  }

  .intro-detail-media {
    min-height: 300px;
    max-height: 380px;
  }

  .vision-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 64px;
  }

  .vision-detail-grid::before {
    top: -36px;
    right: auto;
    bottom: 0;
    left: 50%;
    width: 1px;
    height: auto;
  }

  .vision-detail-grid article:nth-child(odd)::before,
  .vision-detail-grid article:nth-child(even)::before {
    top: 50%;
    bottom: auto;
    width: 32px;
    height: 1px;
  }

  .vision-detail-grid article:nth-child(odd)::before {
    right: -32px;
    left: auto;
  }

  .vision-detail-grid article:nth-child(even)::before {
    right: auto;
    left: -32px;
  }

  .vision-detail-grid article:nth-child(odd)::after,
  .vision-detail-grid article:nth-child(even)::after {
    top: 50%;
    transform: translateY(-50%);
  }

  .vision-detail-grid article:nth-child(odd)::after {
    right: -5px;
    left: auto;
    transform: translate(50%, -50%);
  }

  .vision-detail-grid article:nth-child(even)::after {
    right: auto;
    left: -5px;
    transform: translate(-50%, -50%);
  }

  .vision-detail-grid article:nth-child(5) {
    grid-column: 1 / -1;
    width: calc((100% - 64px) / 2);
    justify-self: center;
  }

  .vision-detail-grid article:nth-child(5)::before {
    top: -24px;
    right: auto;
    bottom: 100%;
    left: 50%;
    width: 1px;
    height: 24px;
  }

  .vision-detail-grid article:nth-child(5)::after {
    top: -5px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .history-entry {
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  }
}

/* 모바일 화면에 맞춘 레이아웃입니다. */
@media (max-width: 680px) {
  .site-header {
    padding: 14px 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .brand small {
    display: none;
  }

  .hero {
    min-height: 88vh;
    padding: 118px 20px 74px;
  }

  h1 {
    font-size: clamp(2.25rem, 11vw, 3.25rem);
  }

  .scroll-cue {
    display: none;
  }
  .quick-links,
  .vision-grid,
  .resource-grid,
  .worship-layout,
  .news-layout,
  .location {
    grid-template-columns: 1fr;
  }

  .home-worship-board {
    display: none;
  }

  .worship-main {
    min-height: 340px;
  }

  .worship-main a {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 8px;
  }

  .quick-links {
    margin-top: 0;
    padding: 0;
    transform: none;
  }

  .quick-links a,
  .quick-links a:first-child,
  .quick-links a:nth-child(2),
  .quick-links a:nth-child(3),
  .quick-links a:nth-child(4),
  .quick-links a:last-child {
    grid-column: auto;
    border-right: 0;
    border-top: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .section {
    padding: 78px 20px;
  }
  .vision-grid article,
  .resource-grid a,
  .home-worship-board article,
  .worship-main,
  .sermon-feature,
  .notice-list a,
  .map-panel {
    padding: 24px;
  }

  .newcomer {
    align-items: flex-start;
    flex-direction: column;
  }

  .newcomer .button.primary {
    width: 100%;
  }

  .site-footer {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: flex-start;
    gap: 18px 20px;
    padding: 28px 20px;
  }

  .footer-verse {
    grid-row: 1;
    grid-column: 1 / -1;
    margin-bottom: 4px;
    padding-bottom: 22px;
  }

  body .site-footer .footer-verse p {
    font-size: 0.84rem;
    line-height: 1.65;
  }

  .footer-brand {
    grid-row: 2 / span 2;
    grid-column: 1;
    align-items: flex-start;
  }

  .footer-copy {
    grid-row: 2;
    grid-column: 2;
    gap: 6px;
  }

  .site-footer .footer-copy p,
  .site-footer .footer-copy address {
    font-size: 0.78rem;
    line-height: 1.55;
  }

  body .site-footer .footer-logo {
    width: 82px;
  }

  .footer-social {
    grid-row: 3;
    grid-column: 2;
    justify-self: end;
  }

  .people-hero {
    padding: 130px 20px 52px;
  }

  .pastor-feature,
  .staff-section {
    padding-right: 20px;
    padding-left: 20px;
  }

  .pastor-feature {
    padding-bottom: 76px;
  }

  .pastor-photo {
    width: min(100%, 340px);
    margin-right: auto;
    margin-left: auto;
    background: var(--white);
  }

  .pastor-photo img {
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .staff-section {
    padding-top: 76px;
    padding-bottom: 76px;
  }

  .staff-grid,
  .elders-grid {
    grid-template-columns: 1fr;
  }

  .staff-card img {
    width: min(100%, 300px);
    height: auto;
    max-height: none;
    margin-right: auto;
    margin-left: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .intro-detail-hero {
    padding: 130px 20px 62px;
  }

  .intro-detail-media {
    min-height: 240px;
    max-height: 300px;
  }

  .vision-detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 44px;
    padding-left: 44px;
  }

  .vision-detail-core {
    width: 100%;
    min-height: 120px;
    border-radius: 24px;
  }

  .vision-detail-core::after {
    display: none;
  }

  .vision-detail-grid::before {
    top: -44px;
    bottom: 0;
    left: 26px;
  }

  .vision-detail-grid article {
    min-height: 150px;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 5px 16px;
    align-content: start;
    justify-items: start;
    padding: 22px;
    text-align: left;
  }

  .vision-detail-grid article:nth-child(5) {
    grid-column: auto;
    width: 100%;
  }

  .vision-detail-grid article:nth-child(n)::before {
    top: 50%;
    right: auto;
    left: -18px;
    width: 18px;
    height: 1px;
  }

  .vision-detail-grid article:nth-child(n)::after {
    top: 50%;
    right: auto;
    left: -5px;
    transform: translate(-50%, -50%);
  }

  .vision-detail-grid span {
    grid-row: 1 / span 2;
    margin: 0;
  }

  .vision-detail-grid h3 {
    align-self: start;
    margin: 0;
  }

  .vision-detail-grid p {
    grid-column: 2;
    align-self: start;
  }

  .intro-history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-history-heading h2 {
    white-space: normal;
  }

  .history-controls {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 32px;
  }

  .history-year-filters {
    width: 100%;
  }

  .history-year-filter {
    flex: 1 0 auto;
  }

  .history-count {
    align-self: flex-end;
  }

  .history-entry {
    display: block;
    min-height: 0;
    padding: 0 0 20px;
  }

  .history-entry time {
    display: inline-block;
    margin-bottom: 9px;
    padding: 5px 8px;
  }

  .history-album-link {
    grid-column: auto;
    grid-template-columns: 1fr;
    max-width: none;
    justify-self: auto;
    gap: 10px;
  }

  .history-entry:nth-child(even) .history-album-link {
    grid-column: auto;
  }

  .history-timeline {
    margin: 0;
    padding-left: 38px;
  }

  .history-timeline::before {
    left: 12px;
    transform: none;
  }

  .history-entry time::before {
    position: absolute;
    top: 50%;
    left: -33px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--blue-500);
    border-radius: 50%;
    content: "";
    background: var(--white);
    transform: translateY(-50%);
  }

  .history-actions .button {
    width: 100%;
  }

  .facility-render-placeholder {
    min-height: 270px;
    padding: 24px;
  }

  .facility-floor-number {
    top: 22px;
    left: 22px;
  }

  .facility-floor-copy {
    padding: 24px;
  }

  .time-panel {
    padding: 24px;
  }

  .time-panel dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .intro-location {
    grid-template-columns: 1fr;
  }

  .parking-panel {
    padding: 26px;
  }
}
