/* 커뮤니티 게시판(우리 함께 봉사해요) 전용 스타일.
   글 개수와 본문 길이에 따라 높이가 달라지므로 고정 픽셀 스테이지 대신 흐름 배치를 씁니다. */

/* 공지 페이지와 같은 방식입니다. 스테이지에는 좌우 패딩을 주지 않고
   본문 블록만 1240px 폭으로 맞춰야, 화면 폭 100vw를 쓰는 푸터가 어긋나지 않습니다. */
.h2-stage.page-community,
.h2-stage.page-community-detail,
.h2-stage.page-community-form {
  height: auto !important;
  padding: 185px 0 0;
  display: block;
}

.page-community > *,
.page-community-detail > *,
.page-community-form > * {
  position: relative;
  top: auto !important;
}

.page-community > *:not(.h2-footer),
.page-community-detail > *:not(.h2-footer),
.page-community-form > *:not(.h2-footer) {
  left: auto;
  width: 1240px;
  margin-left: 160px;
}

.page-community > .h2-footer,
.page-community-detail > .h2-footer,
.page-community-form > .h2-footer {
  margin-top: 90px;
}

/* ── 히어로 ───────────────────────────────────────────── */

.h2-community-hero {
  padding: 52px 58px;
  border-radius: 32px;
  overflow: hidden;
  background: var(--h2-blue);
  color: #000;
}

.h2-community-hero p {
  margin: 0 0 28px;
  color: #2b5f7d;
  font-size: 16px;
  line-height: 16px;
  font-weight: 900;
  letter-spacing: .1em;
}

.h2-community-hero h1 {
  margin: 0;
  font-size: 52px;
  line-height: 58px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.h2-community-hero span {
  display: block;
  margin-top: 22px;
  max-width: 760px;
  font-size: 18px;
  line-height: 30px;
  font-weight: 700;
  word-break: keep-all;
}

/* ── 카테고리 탭 ──────────────────────────────────────── */

.h2-community-tabs {
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.h2-community-tab {
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid #e0e6ee;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #46536a;
  font-size: 15px;
  line-height: 20px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.h2-community-tab:hover {
  border-color: #c3ccdb;
  background: #f5f7fb;
}

.h2-community-tab.is-active {
  border-color: transparent;
  background: #18253a;
  color: #fff;
}

/* ── 목록 ─────────────────────────────────────────────── */

.h2-community-board {
  margin-top: 40px;
}

.h2-community-board-head {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.h2-community-board-head small {
  display: block;
  margin-bottom: 8px;
  color: #2f6a86;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}

.h2-community-board-head h2 {
  margin: 0;
  color: #18253a;
  font-size: 32px;
  line-height: 40px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.h2-community-board-head p {
  margin: 8px 0 0;
  color: #788392;
  font-size: 14px;
  font-weight: 600;
}

.h2-community-write {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--h2-blue);
  color: #12242b;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.h2-community-write.is-guest {
  background: var(--h2-muted);
  color: #3d4657;
}

.h2-community-write.is-locked {
  padding: 0 20px;
  background: #f1f3f7;
  color: #8a94a3;
  font-size: 13px;
  font-weight: 700;
}

.h2-community-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.h2-community-card {
  padding: 18px;
  border: 1px solid #e0e6ee;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 20px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 52, 78, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}

.h2-community-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(36, 52, 78, .12);
}

.h2-community-card-thumb {
  height: 150px;
  border-radius: 16px;
  display: block;
  overflow: hidden;
  background: #f2f4f8;
}

.h2-community-card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.h2-community-card-thumb.is-empty {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #eef1f8 0%, #e3e8f5 100%);
}

.h2-community-card-thumb.is-empty b {
  color: #a9b3c7;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .08em;
}

.h2-community-card-copy {
  min-width: 0;
  display: block;
  padding-top: 2px;
}

.h2-community-card-copy strong {
  display: -webkit-box;
  margin: 12px 0 8px;
  overflow: hidden;
  color: #18253a;
  font-size: 20px;
  line-height: 28px;
  font-weight: 900;
  letter-spacing: -.025em;
  word-break: keep-all;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.h2-community-card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #687386;
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  word-break: keep-all;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.h2-community-card-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #8a94a3;
  font-size: 13px;
  font-weight: 700;
}

.h2-community-card-meta b {
  color: #46536a;
}

.h2-community-card-meta i {
  padding: 3px 8px 2px;
  border-radius: 999px;
  background: #f1f3f7;
  font-style: normal;
  font-size: 12px;
}

.h2-community-chip {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--h2-muted);
  color: #1f2733;
  font-size: 12px;
  line-height: 16px;
  font-weight: 900;
}

.h2-community-chip.cat-shelter,
.h2-community-chip.cat-flyer,
.h2-community-chip.cat-grooming,
.h2-community-chip.cat-foster {
  background: #f7f8d3;
  color: #6a6b18;
}

.h2-community-chip.cat-transport,
.h2-community-chip.cat-photo,
.h2-community-chip.cat-adoption {
  background: #e6f7db;
  color: #3d7029;
}

.h2-community-chip.cat-notice {
  background: #e3f4ff;
  color: #17628f;
}

.h2-community-chip.cat-lost-guide {
  background: #fff0cf;
  color: #875600;
}

.h2-community-empty {
  padding: 60px 24px;
  border: 1px dashed #d5dce8;
  border-radius: 24px;
  color: #8a94a3;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.h2-community-empty.small {
  padding: 34px 20px;
  font-size: 14px;
}

/* ── 상세 ─────────────────────────────────────────────── */

.h2-community-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8a94a3;
  font-size: 14px;
  font-weight: 800;
}

.h2-community-breadcrumb a:hover {
  color: #46536a;
  text-decoration: underline;
}

.h2-community-detail {
  margin-top: 18px;
  padding: 40px 44px;
  border: 1px solid #e0e6ee;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 52, 78, .07);
}

.h2-community-detail-head h1 {
  margin: 16px 0 0;
  color: #18253a;
  font-size: 36px;
  line-height: 46px;
  font-weight: 900;
  letter-spacing: -.03em;
  word-break: keep-all;
}

.h2-community-detail-meta {
  margin-top: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid #eaeef4;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #8a94a3;
  font-size: 14px;
  font-weight: 700;
}

.h2-community-detail-meta b {
  color: #26354b;
  font-weight: 900;
}

.h2-community-detail-avatar {
  width: 34px;
  height: 34px;
}

.h2-community-detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.h2-community-detail-actions a,
.h2-community-detail-actions button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #dde3ec;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  color: #46536a;
  font-size: 13px;
  font-weight: 800;
}

.h2-community-detail-actions button {
  border-color: #f2c9c9;
  color: #b3413f;
}

.h2-community-detail-actions button[data-home2-notice-share] {
  border-color: #b8dcf0;
  color: #17678f;
}

.h2-community-gallery {
  margin-top: 26px;
}

.h2-community-photo {
  border-radius: 20px;
  overflow: hidden;
  background: #f2f4f8;
}

.h2-community-photo img {
  width: 100%;
  max-height: 620px;
  display: block;
  object-fit: contain;
}

.h2-community-thumbs {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.h2-community-thumb {
  width: 82px;
  height: 62px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f4f8;
}

.h2-community-thumb.is-active {
  border-color: #4cbfe8;
}

.h2-community-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.h2-community-body {
  margin-top: 28px;
  color: #37465a;
  font-size: 16px;
  line-height: 30px;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ── 댓글 ─────────────────────────────────────────────── */

.h2-community-comments {
  margin-top: 26px;
  padding: 34px 44px 40px;
  border: 1px solid #e0e6ee;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 52, 78, .07);
}

.h2-community-comments h2 {
  margin: 0 0 20px;
  color: #18253a;
  font-size: 22px;
  font-weight: 900;
}

.h2-community-comments h2 span {
  margin-left: 6px;
  color: #2f6a86;
}

.h2-community-comment-form {
  margin-bottom: 24px;
  display: grid;
  gap: 12px;
}

.h2-community-comment-form textarea {
  padding: 16px 18px;
  border: 1px solid #dde3ec;
  border-radius: 16px;
  background: #fbfcfe;
  color: #26354b;
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  resize: vertical;
}

.h2-community-comment-form button {
  justify-self: end;
  min-height: 46px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #18253a;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.h2-community-login-note {
  margin-bottom: 22px;
  padding: 20px;
  border-radius: 16px;
  background: #f5f7fb;
  color: #6a7488;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.h2-community-login-note a {
  color: #001eff;
  font-weight: 900;
  text-decoration: underline;
}

.h2-community-comment-list {
  display: grid;
  gap: 14px;
}

.h2-community-comment {
  padding: 18px 20px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  background: #f7f9fc;
}

.h2-community-comment-avatar {
  width: 44px;
  height: 44px;
}

.h2-community-comment-copy strong {
  display: block;
  color: #26354b;
  font-size: 14px;
  font-weight: 900;
}

.h2-community-comment-copy p {
  margin: 6px 0 0;
  color: #46536a;
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.h2-community-comment-copy span {
  display: block;
  margin-top: 8px;
  color: #9aa3b2;
  font-size: 12px;
  font-weight: 700;
}

.h2-community-comment-delete {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e4e8f0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  color: #8a94a3;
  font-size: 12px;
  font-weight: 800;
}

.h2-community-detail-nav {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.h2-community-detail-nav a {
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid #dde3ec;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #46536a;
  font-size: 14px;
  font-weight: 800;
}

/* ── 작성/수정 폼 ─────────────────────────────────────── */

.h2-community-form {
  margin-top: 34px;
  padding: 38px 44px 40px;
  border: 1px solid #e0e6ee;
  border-radius: 28px;
  display: grid;
  gap: 22px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(36, 52, 78, .07);
}

.h2-community-field {
  display: grid;
  gap: 10px;
}

.h2-community-field > span {
  color: #40556a;
  font-size: 14px;
  font-weight: 900;
}

.h2-community-field > span small {
  color: #96a0b0;
  font-size: 12px;
  font-weight: 700;
}

.h2-community-field input,
.h2-community-field textarea,
.h2-community-field select {
  padding: 15px 18px;
  border: 1px solid #dde3ec;
  border-radius: 14px;
  background: #fbfcfe;
  color: #26354b;
  font-size: 15px;
  line-height: 24px;
  font-weight: 600;
}

.h2-community-field textarea {
  resize: vertical;
}

.h2-community-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #7a869a 50%), linear-gradient(135deg, #7a869a 50%, transparent 50%);
  background-position: calc(100% - 22px) 24px, calc(100% - 16px) 24px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.h2-community-form .h2-upload-zone {
  position: relative;
}

.h2-community-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.h2-community-form-status {
  margin: 0;
  color: #b3413f;
  font-size: 14px;
  font-weight: 700;
}

.h2-community-form-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.h2-community-form-actions a {
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid #dde3ec;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #46536a;
  font-size: 14px;
  font-weight: 800;
}

.h2-community-form-actions button {
  min-height: 50px;
  padding: 0 30px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #18253a;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.h2-community-form-actions button[disabled] {
  background: #c4cbd8;
  cursor: not-allowed;
}

/* ── 반응형 ───────────────────────────────────────────── */

@media (max-width: 1024px) {
  .h2-stage.page-community,
  .h2-stage.page-community-detail,
  .h2-stage.page-community-form {
    padding: 22px 24px 0;
  }

  .page-community > *:not(.h2-footer),
  .page-community-detail > *:not(.h2-footer),
  .page-community-form > *:not(.h2-footer) {
    width: auto;
    margin-left: 0;
  }

  .page-community > .h2-footer,
  .page-community-detail > .h2-footer,
  .page-community-form > .h2-footer {
    margin-top: 40px;
  }

  .h2-community-hero {
    padding: 34px 26px;
    border-radius: 24px;
  }

  .h2-community-hero p {
    margin-bottom: 16px;
    font-size: 13px;
  }

  .h2-community-hero h1 {
    font-size: 32px;
    line-height: 40px;
  }

  .h2-community-hero span {
    margin-top: 14px;
    font-size: 15px;
    line-height: 25px;
  }

  .h2-community-tabs {
    margin-top: 22px;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .h2-community-tabs::-webkit-scrollbar {
    display: none;
  }

  .h2-community-tab {
    min-height: 42px;
    padding: 0 18px;
    font-size: 14px;
  }

  .h2-community-board {
    margin-top: 26px;
  }

  .h2-community-board-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .h2-community-board-head h2 {
    font-size: 24px;
    line-height: 32px;
  }

  .h2-community-write {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .h2-community-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .h2-community-card {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
  }

  .h2-community-card-thumb {
    height: 108px;
    border-radius: 13px;
  }

  .h2-community-card-copy strong {
    margin: 9px 0 6px;
    font-size: 16px;
    line-height: 23px;
  }

  .h2-community-card-copy p {
    font-size: 13px;
    line-height: 20px;
    -webkit-line-clamp: 2;
  }

  .h2-community-detail,
  .h2-community-comments,
  .h2-community-form {
    padding: 24px 20px 28px;
    border-radius: 20px;
  }

  .h2-community-detail-head h1 {
    font-size: 24px;
    line-height: 33px;
  }

  .h2-community-detail-actions {
    margin-left: 0;
    width: 100%;
  }

  .h2-community-body {
    font-size: 15px;
    line-height: 27px;
  }

  .h2-community-comment {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 14px;
    gap: 10px;
  }

  .h2-community-comment-avatar {
    width: 38px;
    height: 38px;
  }

  .h2-community-form-actions {
    margin-left: 0;
    width: 100%;
  }

  .h2-community-form-actions a,
  .h2-community-form-actions button {
    flex: 1 1 0;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .h2-stage.page-community,
  .h2-stage.page-community-detail,
  .h2-stage.page-community-form {
    padding: 18px 12px 0;
  }

  .h2-community-hero {
    padding: 26px 18px;
  }

  .h2-community-hero h1 {
    font-size: 26px;
    line-height: 34px;
  }

  .h2-community-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .h2-community-card-thumb {
    height: 168px;
  }
}

@media (max-width: 520px) {
  .h2-community-hero {
    padding: 18px 16px;
    border-radius: 17px;
  }

  .h2-community-hero p {
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 15px;
  }

  .h2-community-hero h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .h2-community-hero span {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 19px;
  }

  .h2-community-tabs {
    width: calc(100% + 24px);
    margin: 12px 0 0 -12px;
    padding: 0 12px 4px;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .h2-community-tabs::-webkit-scrollbar {
    display: none;
  }

  .h2-community-tab {
    min-height: 38px;
    padding: 0 14px;
    flex: 0 0 auto;
    font-size: 12px;
  }

  .h2-community-board {
    margin-top: 18px;
  }

  .h2-community-board-head {
    margin-bottom: 14px;
    gap: 10px;
  }

  .h2-community-board-head small {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .h2-community-board-head h2 {
    font-size: 21px;
    line-height: 27px;
  }

  .h2-community-board-head p {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 17px;
  }

  .h2-community-write {
    min-height: 46px;
    border-radius: 13px;
    font-size: 13px;
  }

  .h2-community-grid {
    gap: 10px;
  }

  .h2-community-card {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(36, 52, 78, .055);
  }

  .h2-community-card-thumb {
    height: 142px;
    border-radius: 11px;
  }

  .h2-community-chip {
    min-height: 24px;
    padding: 0 8px;
    font-size: 10px;
  }

  .h2-community-card-copy strong {
    margin: 7px 0 4px;
    font-size: 14px;
    line-height: 19px;
  }

  .h2-community-card-copy p {
    font-size: 11px;
    line-height: 17px;
  }

  .h2-community-card-meta {
    margin-top: 7px;
    gap: 4px 7px;
    font-size: 10px;
    line-height: 15px;
  }

  .h2-community-detail,
  .h2-community-comments {
    padding: 16px 14px 18px;
    border-radius: 17px;
    box-shadow: 0 5px 18px rgba(36, 52, 78, .055);
  }

  .h2-community-detail-head h1 {
    margin-top: 10px;
    font-size: 21px;
    line-height: 29px;
  }

  .h2-community-detail-meta {
    margin-top: 14px;
    padding-bottom: 14px;
    gap: 7px;
    font-size: 11.5px;
  }

  .h2-community-detail-actions {
    gap: 6px;
  }

  .h2-community-detail-actions a,
  .h2-community-detail-actions button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 11.5px;
  }

  .h2-community-gallery {
    margin-top: 18px;
  }

  .h2-community-photo {
    border-radius: 14px;
  }

  .h2-community-body {
    margin-top: 18px;
    font-size: 13px;
    line-height: 22px;
  }

  .h2-community-comments {
    margin-top: 14px;
  }

  .h2-community-comments h2 {
    margin-bottom: 13px;
    font-size: 19px;
  }

  .h2-community-login-note {
    margin-bottom: 12px;
    padding: 14px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    line-height: 18px;
  }

  .h2-community-detail-nav {
    margin-top: 14px;
    gap: 7px;
  }

  .h2-community-detail-nav a {
    min-height: 46px;
    flex: 1 1 0;
    padding: 0 12px;
    font-size: 12px;
  }
}
