/* V2 board interaction parity: focused admin workspace and student overlays. */

.board-admin-page[data-board-focused="true"] #boardWorkspace > :not(#boardFocusPanel):not(#boardPostPanel):not(#boardCommentPanel):not(#boardReviewPanel):not(#boardEditorCard) {
  display: none;
}

.board-focus-panel {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #315174;
  border-radius: 16px;
  background: #101e31;
  scroll-margin-top: 128px;
}

.board-focus-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.board-focus-heading span { color: #74c7ff; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.board-focus-heading h2 { margin: 4px 0; color: #f2f7ff; font-size: 25px; }
.board-focus-heading p { margin: 0; color: #91a7c1; font-size: 12px; }
.board-focus-actions { display: flex; gap: 8px; }
.board-focus-actions .compact-button { display: inline-flex; min-height: 42px; align-items: center; gap: 7px; text-decoration: none; }

.board-focus-view-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 7px;
  border: 1px solid #294663;
  border-radius: 13px;
  background: #091624;
}

.board-focus-view-switch button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #9eb1c8;
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.board-focus-view-switch button i { margin-right: 7px; }
.board-focus-view-switch button.is-active { border-color: #477fc0; color: #eff6ff; background: #1c3b63; }

.board-admin-page[data-board-focused="true"] #boardPostPanel:not([hidden]),
.board-admin-page[data-board-focused="true"] #boardCommentPanel:not([hidden]) {
  position: static;
  width: auto;
  max-height: none;
  overflow: visible;
  transform: none;
  box-shadow: none;
}

.board-admin-page[data-board-review-open="true"] #boardWorkspace > #boardFocusPanel { display: grid; }
.board-admin-page[data-board-review-open="true"] #boardReviewPanel { min-height: calc(100vh - 300px); }
.board-admin-page[data-board-focused="true"] #boardReviewPanel > .management-section-heading { display: none; }

.board-admin-page[data-board-focus-view="gallery"] #boardPostList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.board-admin-page[data-board-focus-view="gallery"] #boardPostList > .post-card { margin: 0; }
.board-admin-page[data-board-focus-view="shelf"] #boardPostList { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.board-admin-shelf-lane { min-width: 0; padding: 12px; border: 1px solid #2c4766; border-radius: 14px; background: #0a1727; }
.board-admin-shelf-lane > header { display: flex; justify-content: space-between; align-items: center; padding: 3px 3px 12px; }
.board-admin-shelf-lane > header h3 { margin: 0; color: #f0f6ff; font-size: 15px; }
.board-admin-shelf-lane > header span { color: #7fc4ff; font-size: 11px; font-weight: 900; }
.board-admin-shelf-posts { display: grid; gap: 10px; }
.board-admin-shelf-posts > p { color: #859ab3; text-align: center; }

#studentBoardPresentation {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #d5deeb;
  border-radius: 12px;
  color: #314e91;
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

#studentBoardPresentation[hidden] { display: none; }

.student-board-view-switch button:disabled { opacity: 1; }
.student-board-view-switch button:not(.is-active):disabled { opacity: .6; }

.student-board-page[data-board-comments-open="true"]::before {
  content: "";
  position: fixed;
  z-index: 210;
  inset: 0;
  background: rgba(12, 24, 45, .58);
  backdrop-filter: blur(3px);
}

.student-board-page[data-board-compose-open="true"] .student-board-post-form:not([hidden]) {
  position: fixed;
  z-index: 220;
  inset: 50% auto auto 50%;
  width: min(720px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 22px;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(12, 25, 48, .35);
}

.student-board-page[data-board-comments-open="true"] #studentBoardCommentPanel:not([hidden]) {
  position: fixed;
  z-index: 220;
  inset: 0 0 0 auto;
  width: min(520px, calc(100vw - 70px));
  max-height: none;
  overflow: auto;
  padding: 22px;
  border: 0;
  border-radius: 20px 0 0 20px;
  background: #fff;
  box-shadow: -20px 0 70px rgba(12, 25, 48, .26);
}

.student-board-page #studentBoardCommentPanel > .management-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
}

.student-board-page #studentBoardCommentClose {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.student-board-spotlight {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(780px, calc(100vh - 54px));
  width: min(1120px, calc(100vw - 54px));
  max-height: calc(100vh - 54px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: #172745;
  background: #f8faff;
  box-shadow: 0 30px 100px rgba(10, 24, 48, .4);
}

.student-board-spotlight[open] { display: grid; }
.student-board-spotlight:not([open]) { display: none; }

.student-board-spotlight::backdrop { background: rgba(10, 21, 40, .7); backdrop-filter: blur(4px); }
.student-board-spotlight > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #dbe3ef; background: #fff; }
.student-board-spotlight > header span { color: #4d6ec8; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.student-board-spotlight > header h2 { margin: 4px 0; color: #10203d; font-size: 24px; }
.student-board-spotlight > header p { margin: 0; color: #718199; font-size: 12px; }
.student-board-spotlight > header button { width: 42px; height: 42px; border: 1px solid #d7e0ec; border-radius: 50%; color: #263c68; background: #f7f9fd; cursor: pointer; }
.student-board-spotlight-body { min-height: 0; overflow: auto; padding: 20px 24px; }
.student-board-spotlight-body .student-board-post-card { max-width: 100%; box-shadow: none; }
.student-board-spotlight-body .board-file-card img { width: 100%; max-height: 56vh; object-fit: contain; background: #eef3f8; }
.student-board-spotlight > footer { display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid #dbe3ef; background: #fff; }
.student-board-spotlight > footer button { min-height: 42px; border: 1px solid #d4dfed; border-radius: 11px; color: #31518f; background: #f7f9fd; font-weight: 850; cursor: pointer; }
.student-board-spotlight > footer button:disabled { opacity: .45; cursor: default; }
.student-board-spotlight > footer button:last-child { justify-self: stretch; }
.student-board-spotlight > footer output { color: #60718b; font-size: 12px; font-weight: 900; }

.student-board-page[data-board-theme="dark"] #studentBoardPresentation { border-color: #293e59; color: #d8e4f3; background: #0d1b2d; }
.student-board-page[data-board-theme="dark"][data-board-comments-open="true"] #studentBoardCommentPanel { color: #d8e4f3; background: #0d1b2d; }

@media (max-width: 1100px) {
  .board-admin-page[data-board-focus-view="gallery"] #boardPostList,
  .board-admin-page[data-board-focus-view="shelf"] #boardPostList { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (orientation: portrait) {
  .student-board-spotlight { width: calc(100vw - 34px); }
  .student-board-spotlight > footer { grid-template-columns: 1fr 1fr; }
  .student-board-spotlight > footer output { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .student-board-spotlight > footer #studentBoardSpotlightComments { grid-column: 1 / -1; }
}
