@charset "UTF-8";
/*------------------------------------------------------------------------------
  app.css — 情報配信システム 共通スタイル
    旧環境の info.css / colors_c.css（table レイアウト + font タグ前提）を置き換えた
    もの。表側・管理側の両方をこれ 1 枚で賄う。
    ※ 変更したら、参照側の app.css?d= のクエリ文字列を上げること。
  構成
    1  トークン（色・余白・角丸）
    2  ベース
    3  レイアウト（container / header / card）
    4  見出し・本文
    5  ボタン
    6  フォーム
    7  テーブル（＋狭い画面でのカード化）
    8  お知らせ一覧（news / hotnewslog / news_index_ls）
    9  お知らせ詳細（more_info）
   10  通知・エラー
   11  ページ送り
   12  埋め込み用（iframe で読まれる画面）
------------------------------------------------------------------------------*/

/* ===== 1 トークン ========================================================= */
:root {
  --bg:        #f6f7f4;
  --surface:   #ffffff;
  --surface-2: #f0f2ec;
  --border:    #dfe3d9;
  --text:      #1f2420;
  --text-mute: #5f6b60;
  --accent:    #2f7d4f;   /* 旧 #00CC00 の系統を落ち着かせた緑 */
  --accent-2:  #1f5e3a;
  --accent-bg: #eaf4ed;
  --danger:    #b3261e;
  --danger-bg: #fdecea;
  --warn:      #8a5a00;
  --warn-bg:   #fdf3e0;

  --radius:    12px;
  --radius-sm: 8px;
  --gap:       16px;
  --shadow:    0 1px 2px rgba(31, 36, 32, .06), 0 8px 24px rgba(31, 36, 32, .06);

  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
          "Yu Gothic UI", "Meiryo", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #14171a;
    --surface:   #1c2024;
    --surface-2: #23282d;
    --border:    #333a40;
    --text:      #e6e8e4;
    --text-mute: #a3ada4;
    --accent:    #6cc08c;
    --accent-2:  #8fd3a9;
    --accent-bg: #1e2c23;
    --danger:    #ef9a93;
    --danger-bg: #2d1e1d;
    --warn:      #e3bd72;
    --warn-bg:   #2c2518;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg:        #14171a;
  --surface:   #1c2024;
  --surface-2: #23282d;
  --border:    #333a40;
  --text:      #e6e8e4;
  --text-mute: #a3ada4;
  --accent:    #6cc08c;
  --accent-2:  #8fd3a9;
  --accent-bg: #1e2c23;
  --danger:    #ef9a93;
  --danger-bg: #2d1e1d;
  --warn:      #e3bd72;
  --warn-bg:   #2c2518;
  --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

/* ===== 2 ベース =========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  word-break: break-word;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== 3 レイアウト ======================================================= */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-narrow .container { max-width: 640px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.site-title .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 700;
  vertical-align: 2px;
}

.site-nav { margin-left: auto; display: flex; gap: 14px; font-size: .9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 0 0 var(--gap);
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-head h2 { margin: 0; font-size: 1.1rem; }

.card-head .count { color: var(--text-mute); font-size: .85rem; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 16px 0 0;
}

.actions-center { justify-content: center; }

.site-footer {
  padding: 24px 16px 40px;
  text-align: center;
  color: var(--text-mute);
  font-size: .8rem;
}

/* ===== 4 見出し・本文 ===================================================== */
h1 { font-size: 1.4rem; margin: 0 0 18px; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

.lead { color: var(--text-mute); margin-top: -8px; }

.hint { color: var(--text-mute); font-size: .85rem; }

.req { color: var(--danger); font-size: .85rem; }

/* ===== 5 ボタン =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: filter .12s ease;
}

.btn:hover, .btn:focus-visible { filter: brightness(1.08); text-decoration: none; }

.btn-ghost {
  background: var(--surface);
  color: var(--accent-2);
}

.btn-ghost:hover { background: var(--accent-bg); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 6 フォーム ========================================================= */
.form-grid { display: grid; gap: 18px; }

.field { display: grid; gap: 6px; }

.field > label, .field-label {
  font-weight: 700;
  font-size: .9rem;
}

input[type="text"], input[type="password"], input[type="email"],
input[type="url"], input[type="number"], input[type="file"],
select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea { min-height: 140px; resize: vertical; line-height: 1.7; }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-bg);
}

.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.inline select { width: auto; min-width: 5.5em; }

.inline-label { font-size: .9rem; color: var(--text-mute); }

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.6;
}

.check input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; flex: none; }

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 0;
  background: var(--surface-2);
}

.fieldset > legend { padding: 0 6px; font-weight: 700; font-size: .9rem; }

/* ===== 7 テーブル ========================================================= */
.table-wrap { overflow-x: auto; }

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

table.list th, table.list td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.list thead th {
  background: var(--surface-2);
  font-size: .82rem;
  color: var(--text-mute);
  white-space: nowrap;
}

table.list tbody tr:hover { background: var(--accent-bg); }

.col-actions { width: 1%; white-space: nowrap; }

/* 操作列のボタンは横並びのまま（列幅が狭いと折り返して行が間延びするため） */
.col-actions .btn-row { flex-wrap: nowrap; }

.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 狭い画面では 1 件 1 カードの縦並びへ（thead は JS が data-label に写す） */
@media (max-width: 680px) {
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    padding: 6px 2px;
    background: var(--surface);
  }
  table.list td { border: 0; padding: 6px 12px; }
  table.list td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-mute);
  }
  .col-actions { width: auto; }
}

/* ===== 8 お知らせ一覧 ===================================================== */
.news-list { list-style: none; margin: 0; padding: 0; }

.news-list > li {
  border-bottom: 1px solid var(--border);
}

.news-list > li:last-child { border-bottom: 0; }

.news-link {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 4px;
  color: var(--text);
}

.news-link:hover { background: var(--accent-bg); text-decoration: none; }

.news-date {
  color: var(--text-mute);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-title { font-weight: 600; }

.news-sname { color: var(--text-mute); font-size: .82rem; margin-left: .5em; }

.is-new {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  vertical-align: 1px;
}

.news-empty { color: var(--text-mute); padding: 14px 4px; margin: 0; }

@media (max-width: 480px) {
  .news-link { grid-template-columns: 1fr; gap: 2px; }
}

/* 定義リスト型（news_index_ls.php が出す形） */
.news-dl { margin: 0; }
.news-dl .newsdt {
  color: var(--text-mute);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.news-dl .newsdd { margin: 0 0 12px; padding: 0; font-weight: 600; }

/* ===== 9 お知らせ詳細 ===================================================== */
.info-head { margin: 0 0 18px; }

.info-head h1 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.5; }

.info-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-mute);
  font-size: .85rem;
}

.info-body { margin: 0 0 20px; }

.info-body::after { content: ""; display: block; clear: both; }

.info-fig { margin: 0 0 14px; }

.info-fig-block { text-align: center; }

.info-fig-left  { float: left;  margin: 0 16px 10px 0; max-width: 50%; }
.info-fig-right { float: right; margin: 0 0 10px 16px; max-width: 50%; }

@media (max-width: 560px) {
  .info-fig-left, .info-fig-right { float: none; max-width: 100%; margin: 0 0 14px; }
}

.info-img { border-radius: var(--radius-sm); }

.attach { margin: 16px 0; }

.attach-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 600;
}

.attach-icon { font-size: 1.1rem; }

.info-rows { display: grid; gap: 0; margin: 0; }

.info-row {
  display: grid;
  grid-template-columns: 7em 1fr;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.info-row > dt { color: var(--text-mute); font-size: .85rem; }
.info-row > dd { margin: 0; }

@media (max-width: 480px) {
  .info-row { grid-template-columns: 1fr; }
}

/* ===== 10 通知・エラー =================================================== */
.notice {
  margin: 16px auto;
  max-width: 640px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.notice p { margin: 0 0 10px; }
.notice p:last-child { margin-bottom: 0; }

.notice-error  { border-left-color: var(--danger); background: var(--danger-bg); }
.notice-warn   { border-left-color: var(--warn);   background: var(--warn-bg); }
.notice-done   { border-left-color: var(--accent); background: var(--accent-bg); }

.notice-title { font-weight: 700; margin: 0 0 6px; }

.strong-name { color: var(--danger); font-weight: 700; }

/* ===== 11 ページ送り ===================================================== */
.pager {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0 0;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
}

.pager-link:hover { background: var(--accent-bg); text-decoration: none; }

.pager-link.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ===== 12 埋め込み用 ===================================================== */
/*  news.php / event.php / hnews.php は親サイトの iframe や直接埋め込みで
    読まれるため、余白と背景を持たない。親側の文字色を継ぐ。             */
body.embed {
  background: transparent;
  font-size: 15px;
}

body.embed .embed-wrap { padding: 0; }

body.embed .news-list > li { border-color: rgba(127, 127, 127, .25); }

body.embed .news-link { padding: 8px 2px; color: inherit; }

body.embed .news-link:hover { background: rgba(127, 127, 127, .08); }

/* 添付ファイル一覧のサムネイル */
.thumb {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.thumb-doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 64px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 1.6rem;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: .75rem;
}

.tag-unused { background: var(--warn-bg); color: var(--warn); }
.tag-missing { background: var(--danger-bg); color: var(--danger); }

/* 管理画面メニュー */
.menu-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.menu-item {
  display: block;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
}

.menu-item:hover { border-color: var(--accent); text-decoration: none; }

.menu-item strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.menu-item span { color: var(--text-mute); font-size: .85rem; }
