/* =============================
   Hajiro High School styles.css (Retro Brown Edition)
   - 茶色基調 / 少し古い官公庁・学校サイト風
   - グラデーション＋立体感（擬似マテリアル）
   - 明朝・教科書っぽい字体
   - 検索オーバーレイは script.js 前提（IDは現状のまま）
   ============================= */

/* ===== reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ===== theme ===== */
:root {
  /* ベース（茶色・生成り） */
  --paper: #f5efe6;
  /* 全体背景 */
  --paper2: #eee2d2;
  /* 罫線っぽい薄茶 */
  --ink: #231d16;
  /* 文字 */
  --muted: #5a4b3f;

  /* ブラウンアクセント */
  --brown-1: #6b4a2b;
  /* 濃 */
  --brown-2: #8a6441;
  /* 中 */
  --brown-3: #a9825f;
  /* 薄 */

  /* 枠線・影 */
  --line: #cdbba7;
  --line2: #bfa894;
  --shadow: rgba(35, 29, 22, 0.18);
  --shadow2: rgba(35, 29, 22, 0.10);

  /* 角丸（古めは控えめ） */
  --r: 8px;
  --r2: 10px;
}

body {
  /* 明朝＋教科書っぽい雰囲気 */
  font-family:
    "Yu Mincho", "游明朝", "Hiragino Mincho ProN", "ヒラギノ明朝 ProN",
    "MS Mincho", "ＭＳ 明朝",
    serif;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
}

/* ほんのり紙っぽい「濃淡」 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 28%),
    linear-gradient(90deg, rgba(0, 0, 0, .03) 0, rgba(0, 0, 0, 0) 18% 82%, rgba(0, 0, 0, .03) 100%);
  mix-blend-mode: multiply;
  opacity: .55;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #2b5b79;
  text-decoration: underline;
}

a:hover {
  color: #1f4257;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== header ===== */
.site-header {
  background:
    linear-gradient(#fffaf3, #efe1cc);
  border-bottom: 4px solid var(--brown-1);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.header-inner {
  max-width: 1000px;
  /* 少し狭めると古いサイト感が出る */
  margin: 0 auto;
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  /* 校章が“印刷物”っぽく見えるように */
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.65)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12));
}

.brand-text {
  min-width: 0;
}

.brand-sub {
  margin: 0;
  font-size: 12px;
  color: #4a3d33;
  letter-spacing: .06em;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: .10em;
  font-weight: 700;
  color: #1f1a14;
}

.brand-sub2 {
  margin: 0;
  font-size: 11px;
  color: #6a5a4c;
  letter-spacing: .06em;
}

/* 右上：検索 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-input {
  width: clamp(160px, 22vw, 240px);
  padding: 8px 10px;
  /* page-dark 等の白文字ページでも入力文字が見えるよう明示 */
  color: var(--ink);
  caret-color: var(--ink);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background:
    linear-gradient(#ffffff, #f6efe6);
  outline: none;
  font-size: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 0 rgba(0, 0, 0, 0.06);
}

.search-input:focus {
  border-color: var(--brown-2);
  box-shadow:
    0 0 0 2px rgba(107, 74, 43, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* ボタン：古い“押せそう”な立体感 */
.search-btn {
  padding: 8px 12px;
  border: 1px solid #5d3f25;
  border-radius: var(--r);
  background:
    linear-gradient(#b7906c, #7a5434);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.12);
}

.search-btn:hover {
  filter: brightness(1.03);
}

.search-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(0, 0, 0, 0.10);
}

/* ハンバーガー（スマホ） */
.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line2);
  background: linear-gradient(#ffffff, #f3e7d7);
  border-radius: var(--r);
  padding: 8px 10px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

.nav-toggle .bars {
  display: inline-block;
  inline-size: 18px;
  block-size: 2px;
  background: #3a2e24;
  box-shadow: 0 6px 0 0 #3a2e24, 0 12px 0 0 #3a2e24;
}

/* ===== nav ===== */
.primary-nav {
  background:
    linear-gradient(#ead8c5, #d9c2ab);
  border-top: 1px solid #c7ad94;
  border-bottom: 1px solid #b9997b;
}

.nav-list {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 10px;
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-list li {
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-block;
  padding: 8px 10px;
  border-radius: var(--r);
  color: #2a231b;
  font-size: 13px;
  text-decoration: none;

  border: 1px solid rgba(93, 63, 37, 0.28);
  background: linear-gradient(#fffaf2, #ead8c5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

.nav-list a:hover {
  background: linear-gradient(#ffffff, #e6d0b8);
}

.nav-list a[aria-current="page"] {
  font-weight: 700;
  background: linear-gradient(#e7caa8, #caa279);
  border-color: rgba(93, 63, 37, 0.35);
  color: #1f1a14;
}

/* ===== main ===== */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 44px;
}

/* hero */
.hero {
  background:
    linear-gradient(#fffdf9, #f1e5d7);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  padding: 18px;
  align-items: center;
}

.hero-eyebrow {
  margin: 0 0 6px;
  color: var(--brown-1);
  font-weight: 700;
  letter-spacing: .10em;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: .12em;
}

.hero-lead {
  margin: 0 0 12px;
  color: #2e261f;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}

/* CTAボタンも立体に */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid #5d3f25;
  background: linear-gradient(#b7906c, #7a5434);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.12);
}

.btn:hover {
  filter: brightness(1.03);
}

.btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.22),
    0 1px 0 rgba(0, 0, 0, 0.10);
}

.btn-outline {
  background: linear-gradient(#ffffff, #f1e5d7);
  color: #2a231b;
  border-color: rgba(93, 63, 37, 0.35);
}

.btn-outline:hover {
  background: linear-gradient(#ffffff, #ead8c5);
}

.hero-visual {
  display: grid;
  place-items: center;
}

/* hero写真枠：古いサイトの“写真枠”っぽく */
.hero-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r2);
  border: 1px solid var(--line2);
  background:
    linear-gradient(135deg, #d7c1aa, #f7efe6);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

.photo-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(#ffffff, #f2e6d8);
  border: 1px solid var(--line2);
  color: #3a2e24;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* content grid */
.content {
  margin-top: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 14px;
  align-items: start;
}

/* カードも“古いパネル”っぽく */
.card {
  background: linear-gradient(#fffdf9, #f0e3d4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px 14px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

.card-compact {
  padding: 12px 12px 10px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: .10em;
  padding: 8px 10px;
  border: 1px solid rgba(93, 63, 37, 0.25);
  border-radius: var(--r);
  background: linear-gradient(#e7caa8, #caa279);
  color: #1f1a14;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

/* ニュース */
.news-item {
  padding: 10px 0;
  border-bottom: 1px dotted rgba(93, 63, 37, 0.35);
}

.news-item:last-child {
  border-bottom: 0;
}

.news-date {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.news-link {
  display: inline-block;
  font-weight: 700;
  color: #224a63;
  text-decoration: underline;
}

.news-body {
  margin: 6px 0 0;
  font-size: 13px;
  color: #2e261f;
}

.card-actions {
  margin-top: 8px;
  text-align: right;
}

.text-link {
  font-size: 13px;
  font-weight: 700;
}

/* 右のクイックリンク：ボタンも立体 */
.quick {
  display: grid;
  gap: 10px;
}

.quick-btn {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid rgba(93, 63, 37, 0.35);
  background: linear-gradient(#ffffff, #ead8c5);
  color: #2a231b;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

.quick-btn:hover {
  background: linear-gradient(#ffffff, #e6d0b8);
}

.quick-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

.list {
  margin: 0;
  padding-left: 18px;
}

.list li {
  margin: 6px 0;
}

.small {
  margin: 0;
  font-size: 13px;
  color: #3a2e24;
}

/* ===== footer ===== */
.site-footer {
  margin-top: 18px;
  background: linear-gradient(#efe1cc, #ddc7ae);
  border-top: 4px solid var(--brown-1);
  box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.04);
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 16px 18px;
}

.footer-school {
  margin: 0;
  font-weight: 800;
  letter-spacing: .10em;
  color: #3a2e24;
}

.footer-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: #3a2e24;
}

.footer-copy {
  margin: 10px 0 0;
  font-size: 12px;
  color: #4a3d33;
}

.footer-warn {
  margin: 10px 0 0;
  font-size: 12px;
  color: #4a3d33;
  line-height: 1.8;
}

/* =========================
   検索結果オーバーレイ
   - script.js が display を切替
   ========================= */
#searchOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(35, 29, 22, 0.55);
  z-index: 9999;
  overflow-y: auto;
}

#searchResults.search-results-panel {
  width: min(760px, 92vw);
  margin: 40px auto;
  padding: 16px 16px 18px;
  background: linear-gradient(#fffdf9, #f1e5d7);
  border-radius: var(--r2);
  border: 1px solid var(--line2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.30);
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(93, 63, 37, 0.25);
  margin-bottom: 12px;
}

.search-results-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: .10em;
}

.search-results-close {
  border: 1px solid rgba(93, 63, 37, 0.35);
  background: linear-gradient(#ffffff, #ead8c5);
  color: #1f1a14;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

.search-results-close:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

.search-results-body {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 2px;
}

/* script.js が1行ずつ div を足すので、古い“掲示板”っぽく */
#resultsContent>div {
  border: 1px solid rgba(93, 63, 37, 0.28);
  background: linear-gradient(#ffffff, #f2e6d8);
  border-radius: var(--r2);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #1f1a14;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 0 rgba(0, 0, 0, 0.06);
}

#resultsContent>div.loading-line {
  border: none;
  background: transparent;
  padding: 0;
  color: #3a2e24;
  box-shadow: none;
}

#resultsContent a {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(93, 63, 37, 0.35);
  background: linear-gradient(#ffffff, #ead8c5);
  color: #1f4257;
  font-weight: 700;
  word-break: break-all;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

#resultsContent a:hover {
  background: linear-gradient(#ffffff, #e6d0b8);
}

/* ===== responsive ===== */
@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* navは折りたたみ（script.js が .open を付与） */
  .primary-nav {
    display: none;
  }

  .primary-nav.open {
    display: block;
  }

  .nav-list {
    padding: 10px 10px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .search-input {
    width: 68%;
  }
}

/* =========================
   ページ進捗バッジ（右下固定）
   ========================= */
.pager-badge {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 9999;

  padding: 6px 12px;
  border-radius: 5px;

  font-size: 12px;
  letter-spacing: 0.08em;

  color: #1f1a14;
  background: #e6d0b8;
  backdrop-filter: blur(10px) saturate(160%);

  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);

  pointer-events: none;
  /* クリックを邪魔しない */
}

/* =========================
   magazine.html（学校だより）
   ========================= */

/* magazineページはヒーローを1カラムに */
.hero-inner--single {
  grid-template-columns: 1fr;
}

/* PDF表示エリア */
.pdf-viewer {
  margin-top: 6px;
}

/* 枠付きのPDFフレーム（古い学校サイトっぽく“額縁”感） */
.pdf-frame {
  width: 100%;
  height: min(78vh, 980px);
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

/* フォールバック文 */
.pdf-fallback {
  margin: 10px 2px 0;
  font-size: 13px;
  color: #3a2e24;
}

@media (max-width: 520px) {
  .pdf-frame {
    height: 70vh;
  }
}

/* =========================
   レポート.html（職員メール）専用
   - 暗く簡素な背景
   - メールスレッド風UI
   ========================= */

.page--narrow {
  max-width: 920px;
}

/* このページだけ暗い背景にする */
body.page-dark {
  background: #0f1112;
  color: #e9e5dd;
}

/* 紙っぽいオーバーレイを無効化 */
body.page-dark::before {
  content: none;
}


/* メインの“メール表示枠” */
.mail-shell {
  margin: 18px auto 44px;
  background: #14171a;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.40);
  overflow: hidden;

  /* メールっぽく少しゴシック寄りに */
  font-family: "Yu Gothic", "游ゴシック", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN", "MS PGothic", sans-serif;
}

/* 上部 */
.mail-top {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: #101215;
}

.mail-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  color: rgba(233, 229, 221, 0.75);
  letter-spacing: .06em;
}

.mail-title {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: .06em;
}

.mail-note {
  margin: 0;
  font-size: 12px;
  color: rgba(233, 229, 221, 0.70);
  line-height: 1.7;
}

/* スレッド */
.mail-thread {
  padding: 14px 14px 18px;
}

.mail-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(233, 229, 221, 0.92);
}

.kv {
  display: inline-flex;
  gap: 8px;
  font-size: 12px;
  color: rgba(233, 229, 221, 0.78);
}

.kv .k {
  color: rgba(233, 229, 221, 0.55);
}

.kv .v {
  color: rgba(233, 229, 221, 0.92);
}

/* メール本文カード */
.mail-message {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: #171b1f;
  overflow: hidden;
  margin-top: 12px;
}

.mail-message--reply {
  background: #151a1e;
}

.mail-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.fromto .line,
.subject {
  font-size: 12px;
  line-height: 1.7;
  color: rgba(233, 229, 221, 0.85);
}

.label {
  display: inline-block;
  min-width: 64px;
  color: rgba(233, 229, 221, 0.55);
}

.subject {
  margin-top: 6px;
  font-weight: 700;
}

.mail-body {
  padding: 12px;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(233, 229, 221, 0.92);
}

.mail-body p {
  margin: 0 0 10px;
}

/* 添付 */
.mail-attach {
  margin: 12px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: #0f1112;
}

.attach-cap {
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(233, 229, 221, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.attach-img {
  width: 100%;
  display: block;
  max-height: 640px;
  object-fit: contain;
  background: #0f1112;
}

/* =========================
   history.html（沿革）専用
   - 縦タイムライン（中央線＋左右交互）
   - 写真添付ゾーンあり
   ========================= */

.timeline-wrap {
  margin-top: 6px;
  padding: 8px 6px 2px;
}

/* 中央の縦線 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 10px 0 6px;
  position: relative;
}

/* 縦線（中央） */
.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: linear-gradient(#d9c2ab, #b9997b);
  border-radius: 99px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 1px 0 rgba(0, 0, 0, 0.06);
}

/* 1アイテムの“左右振り分け” */
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  margin: 0;
  padding: 10px 0 18px;
}

/* 交互配置：奇数=左、偶数=右 */
.tl-item:nth-child(odd) .tl-card {
  grid-column: 1;
}

.tl-item:nth-child(even) .tl-card {
  grid-column: 2;
}

/* 中央の丸（マーカー） */
.tl-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(#fffdf9, #f1e5d7);
  border: 2px solid rgba(93, 63, 37, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.10);
}

/* カード本体：既存.cardに近い“古いパネル”感 */
.tl-card {
  background: linear-gradient(#fffdf9, #f0e3d4);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 12px 12px 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.06);
  position: relative;
}

/* 中央線へ向かう“くさび” */
.tl-card::before {
  content: "";
  position: absolute;
  top: 18px;
  width: 12px;
  height: 12px;
  background: linear-gradient(#fffdf9, #f0e3d4);
  border: 1px solid var(--line);
  transform: rotate(45deg);
}

/* 左側カードは右向き、右側カードは左向き */
.tl-item:nth-child(odd) .tl-card::before {
  right: -7px;
  border-left: 0;
  border-bottom: 0;
}

.tl-item:nth-child(even) .tl-card::before {
  left: -7px;
  border-right: 0;
  border-top: 0;
}

.tl-date {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .06em;
}

.tl-title {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: .08em;
  color: #1f1a14;
}

.tl-text {
  margin: 0;
  font-size: 13px;
  color: #2e261f;
  line-height: 1.8;
}

/* 写真ゾーン */
.tl-photo {
  margin: 10px 0 0;
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  overflow: hidden;
  background: linear-gradient(135deg, #d7c1aa, #f7efe6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

.tl-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.tl-photo figcaption {
  padding: 8px 10px;
  font-size: 12px;
  color: #3a2e24;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(93, 63, 37, 0.18);
}

/* 注記 */
.tl-note {
  margin: 10px 2px 0;
  font-size: 12px;
  color: #3a2e24;
}

/* ===== responsive =====
   スマホ：中央線を左に寄せて、カードを1カラム化
*/
@media (max-width: 820px) {
  .timeline::before {
    left: 14px;
    transform: none;
  }

  .tl-item {
    grid-template-columns: 1fr;
    padding-left: 30px;
    column-gap: 0;
  }

  .tl-item::before {
    left: 14px;
    transform: none;
  }

  .tl-card {
    grid-column: 1 !important;
  }

  .tl-card::before {
    left: -7px !important;
    right: auto !important;
    border-right: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
}

/* =========================
   history.html ARG gimmick
   - 通常は「閉校」より上（tl-item--pre）を隠す
   - オフライン時のみ表示
   ========================= */

body.history-page.history--sealed .tl-item--pre {
  display: none;
}

/* オフラインで“真実の年表”を表示 */
body.history-page.history--unsealed .tl-item--pre {
  display: grid;
  /* tl-item が grid 前提のため */
  animation: tlRevealPre .55s ease-out both;
}

@keyframes tlRevealPre {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* オフライン時は、タイムラインに“霜”っぽい微変化（控えめ） */
body.history-page.history--unsealed .timeline::before {
  background: linear-gradient(#dbe9f7, #b8cfe6);
}

body.history-page.history--unsealed .tl-item::before {
  border-color: rgba(70, 110, 150, 0.35);
}


/* ===== 校長あいさつ（history.html内で完結） ===== */
.principal-card {
  margin-top: 14px;
}

.principal-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  align-items: start;
}

.principal-photo {
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  overflow: hidden;
  background: linear-gradient(135deg, #d7c1aa, #f7efe6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

.principal-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.principal-name {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
}

.principal-msg {
  margin: 0;
  font-size: 13px;
  color: #2e261f;
  line-height: 1.9;
}

.principal-msg strong {
  color: #1f1a14;
}

@media (max-width: 820px) {
  .principal-grid {
    grid-template-columns: 1fr;
  }

  .principal-photo {
    max-width: 220px;
  }
}

/* ===== 写真クリック拡大（ライトボックス） ===== */
.photo-zoom {
  display: block;
  cursor: zoom-in;
  text-decoration: none;
}

.img-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
}

.img-modal.is-open {
  display: grid;
  place-items: center;
  padding: min(4vw, 24px);
}

.img-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(35, 29, 22, 0.72);
  cursor: zoom-out;
}

.img-modal__panel {
  position: relative;
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 12px;
  border-radius: var(--r2);
  border: 1px solid var(--line2);
  background: linear-gradient(#fffdf9, #f1e5d7);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.img-modal__panel img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line2);
  border-radius: var(--r2);
  background: #fff;
}

.img-modal__cap {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #3a2e24;
  line-height: 1.7;
}

.img-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(93, 63, 37, 0.35);
  background: linear-gradient(#ffffff, #ead8c5);
  color: #1f1a14;
  cursor: pointer;
  font-size: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 0 rgba(0, 0, 0, 0.08);
}

.img-modal__close:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.08);
}

/* =========================
   about.html（学校概要）専用
   ========================= */

body.about-page .hero-photo > img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 右カラムの「基本情報」テーブル */
.info-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.6;
}

.info-table th,
.info-table td{
  border: 1px solid rgba(93, 63, 37, 0.28);
  padding: 8px 10px;
  vertical-align: top;
}

.info-table th{
  width: 34%;
  text-align: left;
  color: #2a231b;
  background: linear-gradient(#fffaf2, #ead8c5);
}

.info-table td{
  background: linear-gradient(#ffffff, #f2e6d8);
  color: #1f1a14;
}

.about-text{
  margin: 0 0 10px;
  font-size: 13px;
  color: #2e261f;
  line-height: 1.9;
}

.about-list{
  margin: 0;
  padding-left: 18px;
}

.about-list li{
  margin: 8px 0;
  font-size: 13px;
  color: #2e261f;
}

.about-features{
  display: grid;
  gap: 10px;
}

.about-feature{
  border: 1px solid rgba(93, 63, 37, 0.22);
  background: linear-gradient(#ffffff, #f2e6d8);
  border-radius: var(--r2);
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 1px 0 rgba(0, 0, 0, 0.06);
}

.about-feature-title{
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: .06em;
  color: #1f1a14;
}

.about-mini-note{
  margin-top: 10px;
}

.about-map{
  margin-top: 10px;
}

.about-map-placeholder{
  border: 1px solid rgba(93, 63, 37, 0.28);
  border-radius: var(--r2);
  background: linear-gradient(#ffffff, #f2e6d8);
  height: 160px;
  display: grid;
  place-items: center;
  color: #3a2e24;
  font-size: 12px;
  letter-spacing: .06em;
}

/* =========================
   shimogamine_top.html 専用
   - Windows XPっぽいグレー背景
   - 2011年頃の“垢抜けない”UI（タブ/グラデ/角丸控えめ）
   - 既存の紙オーバーレイ・明朝系フォントを無効化
   ========================= */

body.shimogamine-portal{
  /* XP寄りのグレー */
  background: #414141;
  color: #111;
  line-height: 1.55;

  /* 2010〜2012っぽいフォント寄せ（教科書体/明朝を避ける） */
  font-family:
    Tahoma,
    "MS PGothic",
    "MS UI Gothic",
    "Meiryo",
    Arial,
    sans-serif;
}

/* 紙っぽいオーバーレイをこのページだけ消す */
body.shimogamine-portal::before{
  content: none;
}

/* メイン領域：ヘッダー下に余白 */
body.shimogamine-portal .portal-main{
  padding: 14px 14px 22px;
}

/* “XPウィンドウ”っぽい枠 */
body.shimogamine-portal .portal-window{
  width: 100%;
  background: #efefef;
  border: 1px solid #7a7a7a;

  /* XPのベベル（立体） */
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #8b8b8b,
    0 1px 0 rgba(0,0,0,0.15);
}

/* タイトルバー（青グラデ） */
body.shimogamine-portal .portal-titlebar{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;

  color: #fff;
  background: linear-gradient(#2a70c9, #0b4fa5);

  border-bottom: 1px solid #083a78;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

body.shimogamine-portal .portal-title{
  font-weight: 700;
  letter-spacing: .02em;
}

body.shimogamine-portal .portal-title-sub{
  font-weight: 400;
  opacity: .9;
  margin-left: 6px;
  font-size: 12px;
}

body.shimogamine-portal .portal-caption{
  font-size: 12px;
  opacity: .95;
}

/* メニューバー（タブ） */
body.shimogamine-portal .portal-menubar{
  padding: 8px 10px;
  background: linear-gradient(#f9f9f9, #e3e3e3);
  border-bottom: 1px solid #bcbcbc;
}

body.shimogamine-portal .portal-tab{
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 10px;

  font-size: 13px;
  color: #103b74;
  text-decoration: none;

  border: 1px solid #a6a6a6;
  background: linear-gradient(#ffffff, #dadada);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 1px 0 rgba(0,0,0,0.08);
}

body.shimogamine-portal .portal-tab:hover{
  filter: brightness(1.03);
  text-decoration: underline;
}

/* 本文 */
body.shimogamine-portal .portal-body{
  padding: 12px 12px 14px;
  background: #c5c4c4;
}

body.shimogamine-portal .portal-note{
  margin: 0 0 10px;
  padding: 10px 10px;
  font-size: 16px;
  color:white;
  background: #ce0000;

  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.75),
    0 1px 0 rgba(0,0,0,0.06);
}

body.shimogamine-portal .portal-hr{
  border: 0;
  border-top: 1px solid #c3c3c3;
  margin: 10px 0 12px;
}

/* 見出し・本文（古い社内ページ感：角丸控えめ＆薄い帯） */
body.shimogamine-portal .portal-section{
  margin: 0 0 14px;
}

body.shimogamine-portal .portal-h2{
  margin: 0 0 8px;
  padding: 6px 8px;

  font-size: 14px;
  font-weight: 700;

  background: linear-gradient(#d6d6d6, #e7e7e7);
  border: 1px solid #bcbcbc;

  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #cfcfcf;
}

body.shimogamine-portal .portal-p{
  margin: 0 0 8px;
  font-size: 13px;
}

body.shimogamine-portal .portal-r{
  margin: 0 0 8px;
  font-size: 16px;
  color: red;
}

body.shimogamine-portal .portal-ul{
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 13px;
}

body.shimogamine-portal .portal-ul li{
  margin: 5px 0;
}

/* リンク：昔の青リンク */
body.shimogamine-portal a{
  color: #1a4db3;
  text-decoration: underline;
}

body.shimogamine-portal a:visited{
  color: #5a2ea6;
}

/* ステータスバー */
body.shimogamine-portal .portal-statusbar{
  margin-top: 12px;
  padding: 6px 8px;
  font-size: 12px;
  color: #222;

  display: flex;
  flex-wrap: wrap;
  gap: 10px;

  background: linear-gradient(#e9e9e9, #d7d7d7);
  border: 1px solid #b3b3b3;

  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #bdbdbd;
}

/* スマホ：タブ詰める */
@media (max-width: 560px){
  body.shimogamine-portal .portal-main{
    padding: 10px 10px 18px;
  }
  body.shimogamine-portal .portal-tab{
    padding: 6px 8px;
    margin-right: 4px;
  }
}

/* =========================
   霜ヶ峯：マナビセッション報告書（個別ページ）追加
   ========================= */

body.shimogamine-portal.shimogamine-report .portal-window--report .portal-titlebar{
  /* 既存と同系統のまま、少しだけ“書類感” */
  background: linear-gradient(#2b6fc4, #094a9a);
}

body.shimogamine-portal .portal-table{
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 0;
  font-size: 13px;
}

body.shimogamine-portal .portal-table th,
body.shimogamine-portal .portal-table td{
  border: 1px solid #b3b3b3;
  padding: 8px 10px;
  vertical-align: top;
  background: #f3f3f3;
}

body.shimogamine-portal .portal-table th{
  width: 18%;
  color: #1a1a1a;
  background: linear-gradient(#ffffff, #e6e6e6);
  font-weight: 700;
  white-space: nowrap;
}

body.shimogamine-portal .portal-box{
  border: 1px solid #b3b3b3;
  background: #f6f6f6;
  padding: 10px 10px;
  margin: 10px 0;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #d0d0d0;
}

body.shimogamine-portal .portal-box-title{
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid #bcbcbc;
  background: linear-gradient(#ffffff, #e7e7e7);
}

body.shimogamine-portal .portal-box--memo{
  background: #fffdf3; /* “記録メモ”っぽい */
  border-color: #cbbf92;
}

body.shimogamine-portal .portal-mini{
  margin: 10px 2px 0;
  font-size: 12px;
  color: rgba(0,0,0,0.70);
}

/* 押印っぽい枠（古い稟議書風） */
body.shimogamine-portal .portal-stamp{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

body.shimogamine-portal .portal-stamp-box{
  width: 210px;
  border: 1px solid #9a9a9a;
  background: #f2f2f2;
  box-shadow:
    inset 1px 1px 0 #ffffff,
    inset -1px -1px 0 #d0d0d0;
}

body.shimogamine-portal .portal-stamp-title{
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(#ffffff, #e7e7e7);
  border-bottom: 1px solid #bcbcbc;
}

body.shimogamine-portal .portal-stamp-body{
  padding: 10px 8px;
  font-size: 12px;
  color: #222;
}

/* =========================
   關口浩太の日誌（sekiguchi_diary.html）専用
   - XP “Olive”っぽい配色で差別化
   - 左に縦書き背表紙（文字方向の変化）
   ========================= */

body.shimogamine-portal.shimogamine-diary{
  background: #414141; /* XP Olive系の外側 */
}

/* 日誌ウィンドウのタイトルバーをオリーブへ */
body.shimogamine-portal.shimogamine-diary .portal-titlebar--olive{
  background: linear-gradient(#6f7f3f, #3f5321);
  border-bottom: 1px solid #2a3b14;
}

/* 日誌のメニューバーも色味を変える */
body.shimogamine-portal.shimogamine-diary .portal-menubar--olive{
  background: linear-gradient(#f1f2e6, #d8dac8);
  border-bottom: 1px solid #b7ba9f;
}

body.shimogamine-portal.shimogamine-diary .portal-tab--olive{
  color: #1f2a12;
  border-color: #a3a88a;
  background: linear-gradient(#ffffff, #d9dcc8);
}

body.shimogamine-portal.shimogamine-diary .portal-tab--olive:hover{
  filter: brightness(1.02);
}

/* 本文：紙っぽいが報告書より柔らかい（罫線） */
body.shimogamine-portal.shimogamine-diary .portal-body--diary{
  background: #e7e6d6;
}

/* 見出しもオリーブ寄り */
body.shimogamine-portal.shimogamine-diary .diary-h2{
  background: linear-gradient(#f5f6ed, #d9dcc8);
  border-color: #b7ba9f;
}

/* レイアウト：左に縦書きスパイン */
body.shimogamine-portal.shimogamine-diary .diary-grid{
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: stretch;
}

body.shimogamine-portal.shimogamine-diary .diary-spine{
  background: linear-gradient(#55682c, #2f3f16);
  border: 1px solid #26310f;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.15),
    inset -1px -1px 0 rgba(0,0,0,0.25);
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px 6px;
}

body.shimogamine-portal.shimogamine-diary .diary-spine-text{
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 14px;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.92);
  font-weight: 700;
}

body.shimogamine-portal.shimogamine-diary .diary-spine-mini{
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(255,255,255,0.75);
}

/* 中身 */
body.shimogamine-portal.shimogamine-diary .diary-content{
  min-width: 0;
}

/* 注意ノート：赤ではなく黄緑寄りで変化 */
body.shimogamine-portal.shimogamine-diary .diary-note{
  background: #fffbe0;
  border: 1px solid #cbbf92;
  color: #1b1b1b;
  font-size: 13px;
}

/* 日誌エントリ（紙の束） */
body.shimogamine-portal.shimogamine-diary .diary-entry{
  margin-top: 10px;
}

body.shimogamine-portal.shimogamine-diary .diary-entry-head{
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

body.shimogamine-portal.shimogamine-diary .diary-entry-date{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #1f1f1f;
}

body.shimogamine-portal.shimogamine-diary .diary-entry-tags{
  font-size: 12px;
  color: rgba(0,0,0,0.72);
  padding: 4px 8px;
  border: 1px solid #b7ba9f;
  background: linear-gradient(#ffffff, #dde0cc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* “PRIVATE”スタンプ：少し傾けて刺激 */
body.shimogamine-portal.shimogamine-diary .diary-entry-stamp{
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 800;
  color: rgba(120, 20, 20, 0.85);
  border: 2px solid rgba(120, 20, 20, 0.55);
  padding: 4px 8px;
  transform: rotate(-6deg);
  background: rgba(255,255,255,0.35);
}

/* 罫線紙（repeating-linear-gradient） */
body.shimogamine-portal.shimogamine-diary .diary-entry-paper{
  border: 1px solid #b3b3b3;
  background:
    repeating-linear-gradient(
      180deg,
      #ffffff 0px,
      #ffffff 22px,
      #f3f6e6 22px,
      #f3f6e6 23px
    );
  padding: 12px 12px;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.85),
    inset -1px -1px 0 rgba(0,0,0,0.08);
}

/* フッター行 */
body.shimogamine-portal.shimogamine-diary .diary-entry-foot{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.70);
}

/* ステータスバーも色を合わせる */
body.shimogamine-portal.shimogamine-diary .portal-statusbar--olive{
  background: linear-gradient(#eef0e2, #d2d6bf);
  border-color: #b7ba9f;
}

/* スマホ：背表紙を上に回す */
@media (max-width: 640px){
  body.shimogamine-portal.shimogamine-diary .diary-grid{
    grid-template-columns: 1fr;
  }

  body.shimogamine-portal.shimogamine-diary .diary-spine{
    height: 44px;
    padding: 6px 10px;
  }

  body.shimogamine-portal.shimogamine-diary .diary-spine-text{
    writing-mode: horizontal-tb;
    font-size: 13px;
  }
}
