/*
 * KDHA 소통광장 게시판
 * 기준: kdha_pub/src/assets/scss/_community.scss, _components.scss
 * OpenWorks 동작은 JSP에서 유지하고 퍼블리싱의 의미 클래스만 사용한다.
 */
.community-page {
  padding-bottom: 120px;
  color: #232a31;
  background: #fff;
}

.community-container {
  width: min(1440px, 100% - 40px);
  margin-inline: auto;
}

.community-page .ofe-hero {
  padding-block: 52px 24px;
}

.community-page .ofe-hero nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 40px;
  font-size: 18px;
  line-height: 1.6;
}

.community-page .ofe-hero nav a {
  display: flex;
  color: inherit;
}

.community-page .ofe-hero nav a .material-symbols-rounded {
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.community-page .ofe-hero nav > .material-symbols-rounded {
  width: 16px;
  height: 16px;
  color: #a9b2bf;
  font-size: 16px;
  line-height: 1;
}

.community-page .ofe-hero h1 {
  margin: 0 0 16px;
  font-size: 60px;
  line-height: 1.25;
  letter-spacing: -0.6px;
}

.community-page .ofe-hero p {
  margin: 0;
  color: #6f7a89;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
}

.community-notices {
  padding-bottom: 120px;
}

.community-search {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 110px;
  gap: 24px;
  margin: 60px 0 40px;
  padding: 32px 60px;
  border: 0;
  border-radius: 24px;
  background: #f7f7ff;
}

.community-search > * {
  min-width: 0;
}

.community-search input[type="search"] {
  width: 100%;
}

.community-page .ds-tabs {
  gap: 48px;
  margin-bottom: 48px;
  overflow-x: auto;
}

.community-page .ds-tabs__item {
  display: inline-block;
  flex: none;
}

.community-page .ds-tabs__item[aria-current="page"] {
  color: #232a31;
}

.community-page .ds-tabs__item[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #232a31;
  content: "";
}

.community-list-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.community-list-tools > select {
  width: 180px;
  height: 48px;
  padding: 0 40px 0 12px;
  border: 1px solid #d0d8e2;
  border-radius: 12px;
  background: #fff;
  font: inherit;
}

.community-list-tools .ds-select {
  width: 180px;
}

.community-list-meta .row {
  display: none;
}

.community-list-meta .pull-left {
  float: none !important;
}

.community-list-meta h4 {
  margin: 0;
  color: #505a67;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.community-list-meta h4 small {
  color: inherit;
  font-size: inherit;
}

.community-notice-list .ds-board {
  border-top: 1px solid #6f7a89;
}

.community-notice-list .ds-board:has(> .ds-board__head) {
  border-top: 0;
}

.community-notice-list .ds-board__head,
.community-notice-list .ds-board__row {
  display: grid;
  grid-template-columns: var(--ds-board-columns, 100px 110px minmax(0, 1fr) 120px 180px 120px);
  align-items: center;
  border-bottom: 1px solid #e8ecf1;
  text-align: center;
}

.community-notice-list .ds-board__head {
  min-height: 66px;
  border-top: 1px solid #6f7a89;
  border-bottom-color: #6f7a89;
  color: #505a67;
  font-weight: 700;
  line-height: 1.5;
}

.community-notice-list .ds-board__row {
  min-height: 73px;
  color: #505a67;
  font-size: 16px;
  line-height: 1.5;
}

.community-notice-list .ds-board__row > * {
  min-width: 0;
  padding: 20px 8px;
}

.community-notice-list .ds-board__row--pinned {
  background: #f7f7ff;
}

.community-notice-list .ds-board__row--pinned .ds-board__number {
  color: #713acc;
  font-weight: 700;
}

.community-notice-list .ds-board__title {
  display: flex;
  gap: 4px;
  align-items: center;
  color: #232a31;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
}

.community-notice-list .ds-board__title a {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-notice-list .ds-board__title a:hover {
  color: #713acc;
}

.community-notice-list .ds-board__title .bbsTtlMargin {
  display: none;
}

.community-notice-list .ds-board__title img {
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

.community-notice-list .ds-board__views > span {
  display: none;
}

.community-empty {
  margin: 0;
  padding: 60px 20px;
  border-bottom: 1px solid #e8ecf1;
  text-align: center;
}

.community-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

.community-notice-actions .btn,
.community-detail__actions .btn {
  display: inline-flex;
  min-width: 76px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid #713acc;
  border-radius: 12px;
  color: #713acc;
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.community-notice-actions .btn-primary,
.community-detail__actions .btn-info {
  color: #fff;
  background: #713acc;
}

.community-pagination .pagination {
  display: flex;
  min-height: 44px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 60px 0 0;
  padding: 0;
  list-style: none;
}

.community-pagination .pagination li {
  list-style: none;
}

.community-pagination .pagination a {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e8ecf1;
  border-radius: 50%;
  color: #6f7a89;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  place-items: center;
}

.community-pagination .pagination .active a {
  border-color: #25262b;
  color: #fff;
  background: #25262b;
}

.community-pagination .pagination .first a,
.community-pagination .pagination .last a {
  width: auto;
  padding-inline: 14px;
  border-radius: 999px;
}

/* 상세 */
.community-detail {
  margin-top: 60px;
}

.community-detail__header {
  padding: 40px;
  border-block: 1px solid #e8ecf1;
}

.community-detail__header h2 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.072px;
}

.community-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  color: #6f7a89;
  font-size: 16px;
  line-height: 1.5;
}

.community-detail__meta > * + * {
  position: relative;
  padding-left: 17px;
}

.community-detail__meta > * + *::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 1px;
  height: 12px;
  margin-top: -6px;
  background: #d0d8e2;
  content: "";
}

.community-detail__meta-label {
  margin-right: 6px;
}

.community-detail__body {
  display: flex;
  min-height: 400px;
  flex-direction: column;
  gap: 24px;
  padding: 60px 40px;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.6;
  word-break: keep-all;
}

.community-detail__body .txt {
  width: 100%;
}

.community-detail__body :where(p, h3, h4) {
  margin-top: 0;
}

.community-detail__body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.community-detail__body table {
  max-width: 100%;
}

.community-detail__files {
  display: flex;
  min-height: 65px;
  gap: 24px;
  align-items: center;
  padding: 0 40px;
  border-block: 1px solid #e8ecf1;
  font-size: 16px;
  line-height: 1.5;
}

.community-detail__files > strong {
  flex: 0 0 80px;
  color: #6f7a89;
}

.community-detail__files ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-detail__files a {
  color: #232a31;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.community-detail__files .text-success {
  margin-left: 6px;
  color: #6f7a89;
  font-size: 14px;
}

.community-detail__actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 60px 0 120px;
}

.community-detail__actions .btn {
  min-width: 160px;
}

/* OpenWorks 기본 파일 입력을 퍼블리싱의 드래그 업로드 UI로 보강한다. */
.community-upload__legacy.is-enhanced .op-fileSn > #opfileSnFileFormDiv,
.community-upload__legacy.is-enhanced .op-fileSn > .row,
.community-upload__legacy.is-enhanced .op-fileSn > #opfileSnFileDummyDiv {
  display: none;
}

.community-upload__drop {
  transition: outline-color 0.2s ease, background-color 0.2s ease;
}

.community-upload__drop.is-dragover {
  outline: 2px solid #713acc;
  outline-offset: -2px;
  background: #f7f7ff;
}

.community-upload [data-upload-status] {
  margin: 0;
  color: #d33f49;
  font-size: 14px;
  line-height: 1.5;
}

/* 등록/수정은 전용 템플릿 안의 기존 OpenWorks 입력 태그만 정돈한다. */
.community-notice-form {
  margin-top: 60px;
  padding-bottom: 120px;
}

.community-notice-form .panel {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.community-notice-form .panel-heading {
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  color: #232a31;
  background: transparent;
}

.community-notice-form .panel-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
}

.community-notice-form .panel-title i {
  display: none;
}

.community-notice-form .panel-body {
  padding: 0;
}

.community-notice-form .table-responsive {
  width: 100%;
  overflow-x: auto;
}

.community-notice-form .table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  border-top: 1px solid #6f7a89;
}

.community-notice-form .table :where(th, td) {
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid #e8ecf1;
  font-size: 16px;
  line-height: 1.5;
  vertical-align: middle;
}

.community-notice-form .table th {
  width: 180px;
  color: #505a67;
  background: #f7f7ff;
  text-align: left;
}

.community-notice-form :where(input[type="text"], input[type="password"], select, textarea) {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #d0d8e2;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.community-notice-form textarea {
  min-height: 240px;
  resize: vertical;
}

.community-notice-form :where(input, select, textarea):focus {
  border-color: #713acc;
  outline: 2px solid #ad99ff;
  outline-offset: 1px;
}

.community-notice-form .row.block {
  margin-top: 24px;
}

.community-notice-form .pull-right {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.community-notice-form .btn {
  min-width: 100px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid #713acc;
  border-radius: 12px;
  color: #713acc;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.community-notice-form .btn-success {
  color: #fff;
  background: #713acc;
}

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

@media (max-width: 1100px) and (min-width: 768px) {
  .community-search {
    padding: 24px;
  }

  .community-notice-list .ds-board {
    --ds-board-columns: 60px 80px minmax(0, 1fr) 80px 110px 80px;
  }
}

@media (max-width: 767px) {
  .community-page {
    padding-bottom: 40px;
  }

  .community-container {
    width: calc(100% - 24px);
  }

  .community-page .ofe-hero {
    padding-block: 40px 0;
  }

  .community-page .ofe-hero nav {
    display: none;
  }

  .community-page .ofe-hero h1 {
    margin-bottom: 8px;
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  .community-page .ofe-hero p {
    max-width: 336px;
  }

  .community-notices {
    padding-bottom: 40px;
  }

  .community-search {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 12px 8px;
    margin: 40px 0;
    padding: 16px;
    border-radius: 16px;
  }

  .community-search > select,
  .community-search > .ds-select {
    grid-column: 1 / -1;
    width: 100%;
  }

  .community-list-tools .ds-select {
    width: 110px;
  }

  .community-page .ds-tabs {
    min-height: 44px;
    gap: 24px;
    margin-bottom: 24px;
  }

  .community-notice-list .ds-board,
  .community-notice-list .ds-board:has(> .ds-board__head) {
    border-top: 1px solid #6f7a89;
  }

  .community-notice-list .ds-board__head {
    display: none;
  }

  .community-notice-list .ds-board__row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    padding: 20px 16px;
    text-align: left;
  }

  .community-notice-list .ds-board__row > * {
    padding: 0;
  }

  .community-notice-list .ds-board__number {
    display: none;
  }

  .community-notice-list .ds-board__title {
    order: -1;
    width: 100%;
    margin-bottom: 8px;
    font-size: 16px;
  }

  .community-notice-list .ds-board__title a {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .community-notice-list .ds-board__category,
  .community-notice-list .ds-board__author {
    position: relative;
    margin-right: 16px;
    padding-right: 16px;
  }

  .community-notice-list .ds-board__category::after,
  .community-notice-list .ds-board__author::after {
    position: absolute;
    top: 6px;
    right: 0;
    height: 12px;
    border-right: 1px solid #d0d8e2;
    content: "";
  }

  .community-notice-list .ds-board__views {
    width: 100%;
  }

  .community-notice-list .ds-board__views > span {
    display: inline;
  }

  .community-notice-actions {
    width: 100%;
  }

  .community-notice-actions .btn {
    flex: 1;
  }

  .community-pagination .pagination {
    gap: 4px;
    margin-top: 40px;
  }

  .community-pagination .pagination a {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .community-pagination .pagination .first,
  .community-pagination .pagination .last {
    display: none;
  }

  .community-detail {
    margin-top: 40px;
  }

  .community-detail__header {
    padding: 24px 0;
  }

  .community-detail__header h2 {
    margin-bottom: 12px;
    font-size: 20px;
    letter-spacing: -0.06px;
  }

  .community-detail__label {
    display: none;
  }

  .community-detail__meta {
    row-gap: 4px;
  }

  .community-detail__meta > :last-child {
    flex-basis: 100%;
    padding-left: 0;
  }

  .community-detail__meta > :last-child::before {
    display: none;
  }

  .community-detail__body {
    min-height: 240px;
    padding: 40px 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .community-detail__files {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 20px 16px;
  }

  .community-detail__files > strong {
    flex: none;
  }

  .community-detail__files ul {
    flex-direction: column;
  }

  .community-detail__actions {
    flex-wrap: wrap;
    margin: 40px 0;
  }

  .community-detail__actions .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
  }

  .community-notice-form {
    margin-top: 40px;
    padding-bottom: 40px;
  }

  .community-notice-form .table :where(th, td) {
    display: block;
    width: 100%;
    padding: 12px;
  }

  .community-notice-form .table th {
    border-bottom: 0;
  }

  .community-notice-form .pull-right {
    width: 100%;
  }

  .community-notice-form .btn {
    flex: 1;
  }

}
