@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Noto+Sans+KR:wght@400;500;700&display=swap");

:root {
  --bg-1: #edf3f8;
  --bg-2: #f8f2e8;
  --surface: #f4f7fb;
  --surface-2: #f9fbfe;
  --text: #1d2b43;
  --muted: #58708f;
  --line: #c5d8ee;
  --brand-start: #43d38b;
  --brand-end: #56a2ff;
  --primary-start: #74d39d;
  --primary-end: #efb665;
  --danger: #bf3e5b;
  --shadow: 0 20px 36px rgba(33, 56, 82, 0.16);
}

* {
  box-sizing: border-box;
}

body.community-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, #d8eaf8 0%, transparent 34%),
    radial-gradient(circle at 84% 16%, #f5ddc8 0%, transparent 34%),
    linear-gradient(128deg, var(--bg-1), var(--bg-2));
  padding: 20px;
}

.community-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.surface {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.community-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(145, 171, 199, 0.62);
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(24, 46, 70, 0.18);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(95deg, var(--brand-start), var(--brand-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-chip {
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #bfd2e6;
  background: rgba(255, 255, 255, 0.8);
  color: #223c60;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.btn,
.chip-select {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid #bfd2e6;
  background: rgba(255, 255, 255, 0.8);
  color: #223c60;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover,
.chip-select:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(40, 68, 98, 0.15);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.98);
}

.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(110deg, var(--primary-start), var(--primary-end));
  box-shadow: 0 12px 22px rgba(79, 113, 90, 0.22);
}

.btn-soft {
  background: #f9fbfe;
}

.btn-danger {
  border: 1px solid #e6b7c2;
  color: #8a2940;
  background: #fff5f8;
}

.community-main {
  display: grid;
  gap: 16px;
}

.community-main.list-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.board-panel {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-title {
  margin: 0;
  font-size: clamp(1.38rem, 2.2vw, 1.88rem);
  font-weight: 800;
}

.panel-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.toolbar {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.category-btn {
  flex: 0 0 auto;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #c2d5ea;
  background: #f8fbff;
  color: #284364;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}

.category-btn.active {
  border-color: #6ca0d4;
  background: linear-gradient(100deg, #e3f0ff, #eef8ff);
}

.search-form {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #c7d9eb;
  background: #fff;
  padding: 0 8px 0 10px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: #6783a6;
  flex: 0 0 auto;
}

.search-icon svg,
.search-submit svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.search-input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  font-size: 0.92rem;
  color: #203655;
  background: transparent;
  outline: none;
}

.search-submit {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #c4d7eb;
  background: #f4f9ff;
  color: #2f5f95;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  flex: 0 0 auto;
}

.search-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 14px rgba(43, 78, 112, 0.18);
}

.search-submit:active {
  transform: scale(0.97);
  filter: brightness(0.96);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.board-hint {
  margin: 2px 0 0;
  color: #4f6e93;
  font-size: 0.86rem;
  font-weight: 600;
}

.post-list {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  min-height: 420px;
  min-width: 0;
}

.post-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid #c8daec;
  border-radius: 18px;
  background: var(--surface-2);
  padding: 18px;
  display: grid;
  gap: 11px;
  min-height: 170px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.post-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(34, 58, 84, 0.12);
}

.post-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.post-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.4;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #b9cde2;
  background: #eef6ff;
  color: #35567f;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.chip.pet-cat {
  background: #f0f6ff;
}

.chip.pet-dog {
  background: #f4f8ff;
}

.post-snippet {
  margin: 0;
  color: #3e5578;
  font-size: 0.97rem;
  line-height: 1.55;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.post-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #557092;
  font-size: 0.84rem;
  font-weight: 600;
  min-width: 0;
}

.post-meta strong {
  color: #314f75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-cta {
  color: #2e5f95;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-info {
  min-width: 90px;
  text-align: center;
  color: #446287;
  font-size: 0.86rem;
  font-weight: 700;
}

.side-card {
  padding: 18px;
}

.side-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.side-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.side-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.side-list li {
  border: 1px solid #c9dbec;
  border-radius: 12px;
  background: #fbfdff;
  padding: 10px 12px;
  color: #38557d;
  font-size: 0.88rem;
}

.empty-state,
.loading-state,
.error-state {
  border: 1px dashed #bfd2e6;
  border-radius: 16px;
  padding: 28px 14px;
  text-align: center;
  color: #547293;
  font-weight: 600;
  background: #fafcff;
}

.error-state {
  color: #9b344d;
  border-color: #e5b6c1;
  background: #fff7fa;
}

.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-title {
  margin: 14px 0 0;
  font-size: clamp(1.35rem, 2.4vw, 1.88rem);
  line-height: 1.35;
}

.detail-content {
  margin-top: 14px;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 1rem;
  color: #2b4568;
  border-top: 1px solid #d8e6f4;
  padding-top: 14px;
}

.action-row {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.write-layout {
  width: min(760px, 100%);
}

.write-form {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #2a4469;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #c7d9eb;
  background: #fff;
  color: #203655;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 11px 12px;
}

.field textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.55;
}

.counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.counter {
  color: #587195;
  font-size: 0.84rem;
  font-weight: 700;
}

.login-required {
  margin-top: 14px;
  border: 1px dashed #bdd2e8;
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
  color: #4a668b;
  line-height: 1.6;
}

.message {
  margin-top: 12px;
  min-height: 22px;
  color: #3f5f88;
  font-size: 0.9rem;
  font-weight: 600;
}

.message.error {
  color: #a6324f;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 34, 53, 0.46);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-dialog {
  width: min(460px, 100%);
  border-radius: 18px;
  border: 1px solid #bed3e8;
  background: #f3f8fd;
  box-shadow: 0 22px 42px rgba(22, 42, 64, 0.28);
  padding: 16px;
  position: relative;
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #b8cde3;
  background: rgba(255, 255, 255, 0.95);
  color: #34567e;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
}

.auth-title {
  margin: 2px 0 6px;
  font-size: 1.3rem;
}

.auth-desc {
  margin: 0;
  color: #537195;
  line-height: 1.5;
}

.oauth-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.oauth-btn {
  height: 48px;
  border-radius: 12px;
  border: 1px solid #bfd3e8;
  font-weight: 800;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.oauth-btn img {
  width: 20px;
  height: 20px;
}

.oauth-google {
  background: #fff;
  color: #1f3658;
}

.oauth-kakao {
  border-color: #e7d113;
  background: #fee500;
  color: #171717;
}

.oauth-facebook {
  border-color: #2e79dd;
  background: #1877f2;
  color: #fff;
}

.auth-message {
  min-height: 22px;
  margin-top: 10px;
  color: #a6324f;
  font-size: 0.88rem;
  font-weight: 700;
}

@media (max-width: 1024px) {
  .board-panel {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body.community-page {
    padding: 12px;
  }

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

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .chip-select,
  .btn,
  .user-chip {
    min-height: 36px;
    font-size: 0.84rem;
    padding: 0 12px;
  }

  .panel {
    padding: 14px;
  }

  .search-form {
    height: 42px;
    padding-right: 6px;
  }

  .search-submit {
    width: 32px;
    height: 32px;
  }

  .panel-title {
    font-size: 1.36rem;
  }

  .post-list {
    min-height: 300px;
  }

  .post-card {
    min-height: unset;
    padding: 15px;
  }

  .post-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-title {
    font-size: 0.98rem;
  }

  .post-snippet,
  .detail-content {
    font-size: 0.92rem;
  }

  .post-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .detail-cta {
    font-size: 0.82rem;
  }

  .write-layout {
    width: 100%;
  }

  .auth-dialog {
    padding: 14px;
  }

  .oauth-btn {
    height: 46px;
    font-size: 0.96rem;
  }
}
