/* 메인 화면 전용 스타일 */
.board-home {
  --home-background: #f4f7fb;
  --home-surface: #ffffff;
  --home-text: #182230;
  --home-muted: #667085;
  --home-border: #e4e7ec;
  --home-primary: #3157d5;
  --home-primary-dark: #2446ba;
  --home-primary-soft: #eef2ff;
  --home-danger: #b42318;
  margin: 0;
  min-width: 320px;
  background: var(--home-background);
  color: var(--home-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.board-home *,
.board-home *::before,
.board-home *::after {
  box-sizing: border-box;
}

.board-home a {
  color: inherit;
}

.board-home button,
.board-home input,
.board-home select {
  font: inherit;
}

.home-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--home-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--home-text);
  font-size: 19px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--home-primary);
  box-shadow: 0 0 0 5px var(--home-primary-soft);
}

.user-menu,
.guest-menu,
.member-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form {
  margin: 0;
}

.user-name {
  margin-right: 4px;
  color: var(--home-muted);
  font-size: 14px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button-primary {
  border-color: var(--home-primary);
  background: var(--home-primary);
  color: #ffffff;
}

.button-primary:hover {
  border-color: var(--home-primary-dark);
  background: var(--home-primary-dark);
}

.button-secondary {
  border-color: var(--home-border);
  background: var(--home-surface);
  color: var(--home-text);
}

.button-secondary:hover {
  border-color: #c8ced8;
  background: #f9fafb;
}

.button:focus-visible,
.board-home a:focus-visible,
.board-home input:focus-visible,
.board-home select:focus-visible {
  outline: 3px solid rgba(49, 87, 213, 0.25);
  outline-offset: 2px;
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 56px 0 32px;
}

.home-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.home-hero p,
.section-heading p {
  margin: 0;
  color: var(--home-muted);
}

.post-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--home-primary-soft);
  color: var(--home-primary-dark);
  font-size: 14px;
  font-weight: 700;
}

.board-section {
  padding: 24px;
  border: 1px solid var(--home-border);
  border-radius: 16px;
  background: var(--home-surface);
  box-shadow: 0 14px 40px rgba(24, 34, 48, 0.06);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.search-form {
  display: grid;
  grid-template-columns: 140px minmax(210px, 320px) auto;
  gap: 8px;
}

.search-form select,
.search-form input {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--home-border);
  border-radius: 9px;
  background: var(--home-surface);
  color: var(--home-text);
}

.search-form input::placeholder {
  color: #98a2b3;
}

.search-error {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: 9px;
  background: #fef3f2;
  color: var(--home-danger);
  font-size: 14px;
}

.post-list {
  overflow: hidden;
  border: 1px solid var(--home-border);
  border-radius: 12px;
}

.board-home .post-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.board-home .post-table th,
.board-home .post-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--home-border);
  text-align: left;
}

.board-home .post-table th {
  background: #f9fafb;
  color: var(--home-muted);
  font-size: 13px;
  font-weight: 700;
}

.board-home .post-table tbody tr:last-child td {
  border-bottom: 0;
}

.board-home .post-table tbody tr:not(.empty-row):hover {
  background: #f9fbff;
}

.board-home .post-table .number-column,
.board-home .post-table .view-column {
  width: 80px;
  text-align: center;
}

.board-home .post-table .author-column {
  width: 130px;
  text-align: center;
}

.board-home .post-table .date-column {
  width: 130px;
  color: var(--home-muted);
  text-align: center;
}

.title-column a {
  display: block;
  overflow: hidden;
  color: var(--home-text);
  font-weight: 600;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-column a:hover {
  color: var(--home-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.board-home .post-table .empty-row td {
  padding: 52px 16px;
  color: var(--home-muted);
  text-align: center;
}

.board-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.home-pagination {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.board-write-button {
  grid-column: 3;
  justify-self: end;
}

.page-link {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  background: var(--home-surface);
  color: var(--home-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.page-link:hover {
  border-color: #b8c3df;
  background: var(--home-primary-soft);
}

.page-link.is-active {
  border-color: var(--home-primary);
  background: var(--home-primary);
  color: #ffffff;
}

.page-direction {
  padding: 0 14px;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 2px 0;
  color: var(--home-muted);
  font-size: 13px;
}

.tech-stack {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.tech-stack span {
  padding: 5px 9px;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  background: var(--home-surface);
}

.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;
}

@media (max-width: 860px) {
  .home-header,
  .home-hero,
  .section-heading,
  .home-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-menu,
  .guest-menu,
  .member-menu {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-form {
    width: 100%;
    grid-template-columns: 130px minmax(0, 1fr) auto;
  }
}

@media (max-width: 640px) {
  .home-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 14px;
  }

  .home-hero {
    padding: 38px 0 24px;
  }

  .board-section {
    padding: 16px;
    border-radius: 12px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form .button {
    width: 100%;
  }

  .board-home .post-table .number-column,
  .board-home .post-table .date-column,
  .board-home .post-table .view-column {
    display: none;
  }

  .board-home .post-table .author-column {
    width: 88px;
  }

  .board-home .post-table th,
  .board-home .post-table td {
    padding: 13px 10px;
  }

  .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
  }

  .page-direction {
    display: none;
  }

  .board-actions {
    grid-template-columns: 1fr;
  }

  .home-pagination,
  .board-write-button {
    grid-column: 1;
  }

  .board-write-button {
    width: 100%;
  }
}
