/* hm-board-fixes.css — 2026-05-27 post-rollback patches
 *
 * 1. mbskin (login/register/password recovery) — give the bare gnuboard
 *    core form a readable layout: centered, padded, max-width-bounded.
 * 2. board list header (.hm-list-header) explicit hide rules per board
 *    style so variant CSS grid does not re-show it.
 * 3. Disable placeholder <img alt="image"> fallback text leak from old
 *    list themes that rendered alt over background.
 */

/* ---------- 1. mbskin polish ---------- */
#mb_login, #register_form, #password_lost {
    max-width: 480px !important;
    margin: 48px auto !important;
    padding: 28px 28px 32px !important;
    background: #fff !important;
    border: 1px solid var(--hm-border, #e5e7eb) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, .06) !important;
}
#mb_login h1, #register_form h1, #password_lost h1 {
    font-size: 22px !important;
    margin: 0 0 18px !important;
    text-align: center !important;
    color: var(--hm-fg, #0f172a) !important;
}
#mb_login h2, #register_form h2, #password_lost h2 {
    font-size: 14px !important;
    margin: 0 0 16px !important;
    color: var(--hm-muted, #6b7280) !important;
    font-weight: 600 !important;
}
#mb_login fieldset, #register_form fieldset, #password_lost fieldset {
    border: 1px solid var(--hm-border, #e5e7eb) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    margin: 0 0 14px !important;
}
#mb_login legend, #register_form legend, #password_lost legend {
    font-size: 13px !important;
    padding: 0 6px !important;
    color: var(--hm-muted, #6b7280) !important;
}
#mb_login input[type=text], #mb_login input[type=password],
#register_form input[type=text], #register_form input[type=password],
#register_form input[type=email],
#password_lost input[type=text], #password_lost input[type=email] {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    margin: 6px 0 !important;
    border: 1px solid var(--hm-border, #cbd5e1) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
}
#mb_login .btn_submit, #register_form .btn_submit, #password_lost .btn_submit,
#mb_login button[type=submit], #register_form button[type=submit], #password_lost button[type=submit] {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    margin: 12px 0 0 !important;
    background: var(--hm-accent, #2563eb) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}
#mb_login .join, #mb_login .mb_log_cate a,
#register_form a, #password_lost a {
    color: var(--hm-accent, #2563eb) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}
#mb_login .login_if_auto, #mb_login .login_if_lpl {
    margin-top: 10px !important;
    font-size: 13px !important;
}
.mbskin label[for=login_id], .mbskin label[for=login_pw] { color: var(--hm-fg, #0f172a) !important; }

/* ---------- 2. board list header explicit hide for table-like board styles ---------- */
body.hm-board-02 .hm-list-variant-01 .hm-list-header,
body.hm-board-02 .hm-list-variant-05 .hm-list-header,
body.hm-board-03 .hm-list-variant-01 .hm-list-header,
body.hm-board-03 .hm-list-variant-05 .hm-list-header,
body.hm-board-04 .hm-list-variant-01 .hm-list-header,
body.hm-board-04 .hm-list-variant-05 .hm-list-header {
    display: none !important;
}

/* Fallback: keep grid header readable when shown */
.hm-list-variant-01 .hm-v01-table .hm-list-header {
    background: var(--hm-bg-soft, #f8fafc) !important;
    font-weight: 700 !important;
    text-align: center !important;
}
.hm-list-variant-01 .hm-v01-table .hm-list-header > span {
    text-align: center !important;
}

/* ---------- 3. placeholder image alt-text leak — hide rendered text node ---------- */
img[src^="data:image/svg+xml"] { font-size: 0 !important; }
img[alt="image"] { font-size: 0 !important; }

/* HM_CRITICAL_FRAME_FIX_20260527
   Remove legacy full-viewport body borders that read as broken black frames. */
body.hm-gnuboard-site {
  border: 0 !important;
}
/* END_HM_CRITICAL_FRAME_FIX_20260527 */

/* HM_RESPONSIVE_CONTENT_FIX_20260527
   Prevent narrow viewport overflow in generated main, board, and mbskin pages. */
body.hm-gnuboard-site.hm-gnuboard-site {
  max-width: 100% !important;
  overflow-x: hidden !important;
}
body.hm-gnuboard-site.hm-gnuboard-site .hm-site-main,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-structure,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-shell-v2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-section,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-page,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-view,
body.hm-gnuboard-site.hm-gnuboard-site .hm-community-list,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-tools,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-search {
  box-sizing: border-box !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.hm-gnuboard-site.hm-gnuboard-site #mb_login,
body.hm-gnuboard-site.hm-gnuboard-site #register_form,
body.hm-gnuboard-site.hm-gnuboard-site #password_lost {
  box-sizing: border-box !important;
  min-width: 0 !important;
  width: min(480px, calc(100% - 32px)) !important;
  max-width: 480px !important;
}
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card *,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-page,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-page *,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-view,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-view * {
  min-width: 0 !important;
}
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card h1,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card h2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card h3,
body.hm-gnuboard-site.hm-gnuboard-site .hm-main-card p,
body.hm-gnuboard-site.hm-gnuboard-site .hm-board-head h1,
body.hm-gnuboard-site.hm-gnuboard-site .hm-list-subject,
body.hm-gnuboard-site.hm-gnuboard-site .hm-list-subject strong,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v02-body h2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v02-body p,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v03-hero-body h2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v03-excerpt,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v04-body h2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v04-body p,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v05-subject,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v06-issue-body h2,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v06-issue-body p,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v07-pin-cap h3,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v08-title,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v08-excerpt,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v09-tile h3,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v10-cap h3,
body.hm-gnuboard-site.hm-gnuboard-site .hm-v10-meta {
  overflow-wrap: anywhere !important;
  word-break: keep-all !important;
}
@media (max-width: 720px) {
  body.hm-gnuboard-site.hm-gnuboard-site .hm-main-structure {
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow: hidden !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-page,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-view {
    width: calc(100% - 16px) !important;
    margin: 16px auto 28px !important;
    padding: 16px 10px !important;
    overflow: hidden !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-head {
    gap: 8px !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-list-row {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-list-subject,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-list-subject strong {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-tools,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-search {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 8px !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-search select,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-search input,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-search button,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-write-btn {
    width: 100% !important;
    max-width: 100% !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site #mb_login,
  body.hm-gnuboard-site.hm-gnuboard-site #register_form,
  body.hm-gnuboard-site.hm-gnuboard-site #password_lost {
    width: min(480px, calc(100% - 24px)) !important;
    max-width: 480px !important;
    margin: 24px auto 36px !important;
    padding: 22px 18px 24px !important;
  }
}
@media (max-width: 430px) {
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-page,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-board-view {
    width: calc(100% - 12px) !important;
    padding: 14px 8px !important;
  }
  body.hm-gnuboard-site.hm-gnuboard-site .hm-v02-cardgrid,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-v09-matrix,
  body.hm-gnuboard-site.hm-gnuboard-site .hm-v10-overlay {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
/* END_HM_RESPONSIVE_CONTENT_FIX_20260527 */
