.ie-board {
  background: #000;
}

.ie-board-page {
  min-height: 100vh;
  margin: 0;
  background: #000;
}

.ie-board button,
.ie-board input,
.ie-board textarea,
.ie-board select,
.ie-board a.board-button {
  font-family: 'Pretendard', 'Rimgul', 'Noto Sans KR', sans-serif !important;
}

.ie-board button {
  width: auto;
  margin-top: 0;
}

.board-menu__logo {
  color: #222;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.board-menu__links .is-active {
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 0.4rem;
}

.board-shell {
  width: min(128rem, calc(100% - 4rem));
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 8rem) 0 8rem;
}

.board-hero {
  display: grid;
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.board-hero__eyebrow {
  font-size: 1.2rem !important;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
}

.board-hero h1 {
  max-width: 80rem;
  font-size: clamp(3.2rem, 7cqi, 8rem) !important;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.board-hero p {
  max-width: 68rem;
  color: rgba(0, 0, 0, 0.72);
}

.board-actions,
.board-form__actions,
.board-admin__head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.board-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  padding: 0.7rem 1.2rem !important;
  border: 0.1rem solid #222 !important;
  border-radius: 999px;
  background: #ffffff !important;
  color: #222 !important;
  box-shadow: none !important;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
}

.board-button:hover,
.board-button.is-active {
  background: #222 !important;
  color: #fff !important;
}

.board-button--primary {
  background: #ffdd00 !important;
  color: #111 !important;
}

.board-button--primary:hover {
  background: #111 !important;
  color: #ffdd00 !important;
}

.board-button--danger {
  border-color: #c41f1f !important;
  color: #c41f1f !important;
}

.board-button--danger:hover {
  background: #c41f1f !important;
  color: #fff !important;
}

.board-alert {
  margin: 0 0 2rem;
  padding: 1rem 1.2rem;
  border: 0.1rem solid #222;
  background: #fffbd8;
  color: #222;
  font-weight: 700;
}

.board-alert[data-type='success'] {
  background: #e9ffe8;
}

.board-alert[data-type='error'] {
  background: #ffe8e8;
}

.board-alert[data-type='warning'] {
  background: #fff2cd;
}

.board-panel {
  display: grid;
  gap: 2rem;
}

.board-panel[hidden] {
  display: none !important;
}

.board-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 1.6rem;
  align-items: end;
  padding-bottom: 1.2rem;
  border-bottom: 0.1rem solid rgba(0, 0, 0, 0.18);
}

.board-panel__head p {
  color: rgba(0, 0, 0, 0.62);
}

.board-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: flex-end;
}

.board-filter label {
  font-weight: 900;
}

.board-filter select {
  width: auto;
  min-height: 3.6rem;
  padding: 0.7rem 3.2rem 0.7rem 1rem !important;
  border: 0.1rem solid #222 !important;
  border-radius: 999px;
  background: #fff !important;
  color: #222 !important;
  box-shadow: none !important;
  font-weight: 800;
}

.board-filter__count {
  color: rgba(0, 0, 0, 0.58);
  font-size: 1.2rem !important;
  font-weight: 800;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.2rem, 2vw, 2.4rem);
}

.board-card {
  display: grid;
  gap: 1rem;
  width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #222 !important;
  text-align: left;
  box-shadow: none !important;
}

.board-card__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #d7d7d7;
}

.board-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.6);
  transition: filter 260ms ease, transform 360ms ease;
}

.board-card:hover .board-card__thumb img {
  transform: scale(0.7);
}

.board-card__thumb--empty {
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 900;
}

.board-card__category {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 1;
  padding: 0.35rem 0.65rem;
  border: 0.1rem solid #222;
  background: #ffdd00;
  color: #111;
  font-size: 1.1rem !important;
  font-weight: 900;
  line-height: 1;
}

.board-card__meta {
  display: grid;
}

.board-card__meta strong {
  font-size: 1.8rem !important;
  line-height: 1.25;
}

.board-card__meta span {
  font-size: 1.2rem !important;
  color: rgba(0, 0, 0, 0.58);
}

.board-empty {
  padding: 5rem 2rem;
  border: 0.1rem dashed rgba(0, 0, 0, 0.3);
  text-align: center;
  color: rgba(0, 0, 0, 0.55);
}

.board-admin-list {
  display: grid;
  border-top: 0.1rem solid rgba(0, 0, 0, 0.18);
}

.board-admin-row {
  display: grid !important;
  grid-template-columns: 7rem minmax(0, 1fr) 18rem;
  gap: 1.2rem;
  align-items: center;
  width: 100% !important;
  min-height: 4.8rem;
  margin: 0 !important;
  padding: 1rem 0 !important;
  border: 0 !important;
  border-bottom: 0.1rem solid rgba(0, 0, 0, 0.14) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #222 !important;
  box-shadow: none !important;
  text-align: left;
  cursor: pointer;
}

.board-admin-row:hover {
  background: rgba(255, 221, 0, 0.22) !important;
}

.board-admin-row__number {
  font-size: 1.2rem !important;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.45);
}

.board-admin-row__title {
  overflow: hidden;
  font-size: 1.6rem !important;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-admin-row__date {
  justify-self: end;
  color: rgba(0, 0, 0, 0.58);
  font-size: 1.2rem !important;
  font-weight: 800;
}

.board-form {
  display: grid !important;
  gap: 1.6rem !important;
  max-width: 96rem;
  padding: clamp(1.6rem, 3vw, 3rem);
  background: #ffffff;
  border: 0.1rem solid rgba(0, 0, 0, 0.15);
}

.board-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.board-form__grid--style,
.board-form__grid--meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.board-form__row {
  display: grid;
  gap: 0.6rem;
}

.board-form__row--wide {
  grid-column: span 2;
}

.board-form__row label,
.board-style-fieldset legend {
  font-weight: 900;
}

.board-form__row input,
.board-form__row textarea,
.board-form__row select {
  width: 100%;
  min-height: 3.8rem;
  padding: 0.8rem 1rem !important;
  border: 0.1rem solid #bbb !important;
  border-radius: 0;
  background: #fff !important;
  box-shadow: none !important;
  color: #222 !important;
}

.board-form__row textarea {
  resize: vertical;
  line-height: 1.6;
}

.board-form__inline {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.board-form__inline input {
  flex: 1 1 auto;
  min-width: 0;
}

.board-form__inline .board-button {
  flex: 0 0 auto;
}

.board-style-fieldset {
  padding: 1.2rem;
  border: 0.1rem solid rgba(0, 0, 0, 0.2);
}

.board-help {
  color: rgba(0, 0, 0, 0.58);
  font-size: 1.2rem !important;
}

.board-image-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.board-image-preview--existing {
  padding: 1rem;
  border: 0.1rem dashed rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.03);
}

.board-image-preview__item {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.board-image-preview__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #ddd;
}

.board-image-preview__item--existing img {
  filter: grayscale(60%);
}

.board-image-preview__item span {
  overflow: hidden;
  font-size: 1.1rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.62);
}

.board-detail {
  width: 100%;
  margin: 0;
}

.board-detail__header {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.board-detail__header h2 {
  font-size: clamp(2.8rem, 6cqi, 7rem) !important;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.board-detail__header p {
  color: rgba(0, 0, 0, 0.58);
}

.board-detail__images {
  display: grid;
  gap: 2rem;
}

.board-detail__figure {
  margin: 0;
  background: #eee;
}

.board-detail__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.board-detail__body {
  margin-top: 2rem;
  padding: 0;
  white-space: pre-wrap;
  line-height: 1.8;
}

.is-board-loading {
  cursor: progress;
}

.is-board-loading .board-button {
  opacity: 0.72;
  cursor: wait;
}

.is-board-edit-mode .board-form {
  border-color: rgba(0, 0, 0, 0.35);
}

@container (max-width: 980px) {
  .board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (max-width: 720px) {
  .board-shell {
    width: min(100% - 2.4rem, 128rem);
  }

  .board-grid,
  .board-image-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-form__grid,
  .board-form__grid--style,
  .board-form__grid--meta {
    grid-template-columns: 1fr;
  }

  .board-form__row--wide {
    grid-column: auto;
  }

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

  .board-filter {
    justify-content: flex-start;
  }

  .board-admin-row {
    grid-template-columns: 4.4rem minmax(0, 1fr);
  }

  .board-admin-row__date {
    grid-column: 2;
    justify-self: start;
  }
}

@container (max-width: 420px) {
  .board-grid,
  .board-image-preview {
    grid-template-columns: 1fr;
  }

  .board-actions,
  .board-form__actions,
  .board-admin__head-actions,
  .board-form__inline {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Rich editor for board-write.html */
.board-editor-block {
  display: grid;
  gap: 1rem;
}

.board-editor-block__head {
  display: grid;
  gap: 0.4rem;
}

.board-editor-block__head label {
  font-weight: 900;
}

.board-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 1rem;
  border: 0.1rem solid rgba(0, 0, 0, 0.18);
  background: #f8f8f8;
}

.board-editor-toolbar__select,
.board-editor-color,
.board-editor-button {
  min-height: 3.2rem;
  border: 0.1rem solid #222 !important;
  background: #fff !important;
  color: #222 !important;
  font-size: 1.2rem !important;
  font-weight: 800;
}

.board-editor-toolbar__select {
  width: auto;
  padding: 0.5rem 2.8rem 0.5rem 0.8rem !important;
}

.board-editor-color {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.7rem;
}

.board-editor-color input {
  width: 3rem !important;
  min-height: 2.2rem !important;
  height: 2.2rem;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.board-editor-button {
  width: auto !important;
  margin: 0 !important;
  padding: 0.5rem 0.8rem !important;
  border-radius: 0;
  box-shadow: none !important;
  cursor: pointer;
}

.board-editor-button:hover,
.board-editor-button:focus-visible {
  background: #222 !important;
  color: #fff !important;
}

.board-editor-button--primary {
  background: #ffdd00 !important;
  color: #111 !important;
}

.board-rich-editor {
  min-height: 32rem;
  padding: clamp(1.4rem, 2vw, 2.4rem);
  border: 0.1rem solid #222;
  background: #fff;
  color: #222;
  line-height: 1.8;
  outline: none;
  overflow-wrap: anywhere;
  white-space: normal;
}

.board-rich-editor:focus {
  box-shadow: inset 0 0 0 0.2rem rgba(255, 221, 0, 0.85);
}

.board-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: rgba(0, 0, 0, 0.42);
}

.board-rich-editor p,
.board-detail__body p {
  margin: 0 0 1em;
}

.board-rich-editor h2,
.board-detail__body h2,
.board-rich-editor h3,
.board-detail__body h3 {
  margin: 1.4em 0 0.6em;
  line-height: 1.2;
}

.board-rich-editor ul,
.board-rich-editor ol,
.board-detail__body ul,
.board-detail__body ol {
  margin: 0 0 1em 1.6em;
}

.board-editor-figure,
.board-detail__body figure {
  display: grid;
}

.board-editor-figure img,
.board-detail__body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #eee;
}

.board-editor-figure figcaption,
.board-detail__body figcaption {
  color: rgba(0, 0, 0, 0.55);
  font-size: 1.2rem !important;
  text-align: center;
}

.board-detail__body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@container (max-width: 720px) {
  .board-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .board-editor-toolbar__select,
  .board-editor-button,
  .board-editor-color {
    width: 100% !important;
  }
}

/* Thumbnail-only preview controls */
.board-thumbnail-preview {
  max-width: 18rem;
}

.board-thumbnail-preview__frame {
  position: relative;
  overflow: hidden;
  border: 0.1rem solid rgba(0, 0, 0, 0.18);
  background: #ddd;
}

.board-thumbnail-preview__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.board-thumbnail-preview__remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: grid;
  place-items: center;
  width: 2.6rem !important;
  height: 2.6rem;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0.1rem solid #222 !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #111 !important;
  font-size: 1.8rem !important;
  font-weight: 900;
  line-height: 1;
  box-shadow: none !important;
  cursor: pointer;
}

.board-thumbnail-preview__remove:hover,
.board-thumbnail-preview__remove:focus-visible {
  background: #c41f1f !important;
  color: #fff !important;
}

.board-form__row:has([data-board-images]) .board-image-preview {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 18rem));
}

.board-editor-button.is-active,
.board-editor-button[aria-pressed='true'] {
  background: #222 !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 0.2rem #ffdd00 !important;
}
