/* =========================================================
   関西大学校友会 岡山支部 スタイルシート
   - 構図：上部バナー＋左サイドバー＋メインカラム（2カラム）
   - 配色：関大ブランドの紺＋水色グラデーション＋金/赤アクセント
   - モバイルファースト
   ========================================================= */

:root {
  --navy: #16357a;
  --navy-dark: #0e2456;
  --navy-light: #2f5bb0;
  --sky: #6fb3e6;
  --sky-light: #d8ecfb;
  --accent: #c8a45c;      /* 金 */
  --red: #d23b3b;         /* NEWバッジ等 */
  --text: #333333;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f4f7fb;
  --border: #e1e8f2;
  --shadow: 0 4px 18px rgba(22, 53, 122, 0.08);
  --shadow-hover: 0 8px 28px rgba(22, 53, 122, 0.16);
  --radius: 12px;
  --max-width: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* 横方向のはみ出しを抑止（スマホで固定要素がずれる原因を防ぐ） */
html, body { overflow-x: hidden; }
body {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--text);
  line-height: 1.8;
  background: var(--bg-gray);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; border: 2px solid transparent; transition: all 0.25s ease;
  font-family: inherit;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn--full { width: 100%; }

/* =========================================================
   上部バナー（水色グラデーション）
   ========================================================= */
.banner {
  background:
    linear-gradient(120deg, rgba(22,53,122,0.06), rgba(111,179,230,0.18)),
    linear-gradient(180deg, var(--sky-light), #eef6fd);
  border-bottom: 3px solid var(--navy);
  position: relative;
  overflow: hidden;
}
.banner::after { /* 水面のような淡い光のアクセント */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.6), transparent 45%);
  pointer-events: none;
}
.banner__inner {
  max-width: var(--max-width); margin: 0 auto; padding: 22px 20px;
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap;
}
.banner__logo {
  background: #fff; border-radius: 10px; padding: 10px 16px;
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; flex-shrink: 0;
}
.banner__logo:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.banner__logo img { height: 46px; width: auto; }
.banner__titles { line-height: 1.3; }
.banner__title {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  color: var(--navy);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}
.banner__sub {
  font-size: clamp(0.6rem, 2vw, 0.8rem);
  letter-spacing: 0.18em; color: var(--navy-light); font-weight: 500; margin-top: 4px;
}

/* =========================================================
   2カラムレイアウト
   ========================================================= */
.layout { max-width: var(--max-width); margin: 0 auto; padding: 20px; }

/* ---------- 左サイドバー ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--navy), var(--navy-dark));
  color: #fff; border-radius: var(--radius); padding: 22px 18px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.sidebar__en { font-size: 0.78rem; letter-spacing: 0.08em; opacity: 0.85; line-height: 1.5; }
.sidebar__welcome {
  font-weight: 700; font-size: 1.05rem; margin: 14px 0; line-height: 1.6;
  border-left: 3px solid var(--accent); padding-left: 10px;
}
.sidebar__kulogo {
  display: block; background: #fff; border-radius: 8px; padding: 10px; text-align: center;
  transition: transform 0.2s;
}
.sidebar__kulogo:hover { transform: translateY(-2px); }
.sidebar__kulogo img { margin: 0 auto; height: 38px; width: auto; }

/* メニュー開閉（スマホのみ表示） */
.navtoggle {
  display: none; width: 100%; margin-top: 16px; padding: 11px;
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: inherit;
}

/* サイドナビ */
.sidenav { margin-top: 16px; }
.sidenav ul { display: grid; gap: 4px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px;
  font-size: 0.92rem; font-weight: 500; transition: background 0.2s, padding 0.2s;
}
.sidenav a i { width: 18px; text-align: center; opacity: 0.9; font-size: 0.9rem; }
.sidenav a:hover { background: rgba(255,255,255,0.14); padding-left: 16px; }
.sidenav__cta { background: var(--accent); color: #fff !important; font-weight: 700; margin-top: 4px; }
.sidenav__cta:hover { background: #b8924a; }
.sidenav__sub { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.2); }
.sidenav__sub a { font-size: 0.82rem; opacity: 0.9; padding: 8px 12px; }
.sidenav__sub a:hover { opacity: 1; }
.sidenav__sub i { font-size: 0.7rem; margin-left: 2px; }

/* ---------- 右メインカラム ---------- */
.main {
  background: var(--bg); border-radius: var(--radius); padding: 24px 20px;
  box-shadow: var(--shadow); min-width: 0;
}

/* ロゴ列 */
.logostrip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px;
  padding-bottom: 18px; border-bottom: 1px dashed var(--border);
}
.logostrip__item { transition: transform 0.2s, opacity 0.2s; }
.logostrip__item:hover { transform: translateY(-2px); opacity: 0.85; }
.logostrip__item img { height: 46px; width: auto; }

.update {
  font-size: 0.8rem; color: var(--text-light); font-weight: 700; letter-spacing: 0.04em;
  margin: 12px 0 8px;
}

/* ---------- 共通：ブロック見出し ---------- */
.block { padding: 26px 0; border-bottom: 1px solid var(--border); }
.block:last-child { border-bottom: none; }
.block__title {
  font-size: 1.25rem; color: var(--navy); font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--navy); position: relative;
}
.block__title i { color: var(--accent); font-size: 1.1rem; }
.block p { margin-bottom: 12px; }
.block__lead { color: var(--text-light); font-size: 0.92rem; }

/* =========================================================
   新着情報
   ========================================================= */
.newslist { display: grid; gap: 4px; }
.newslist__item {
  display: flex; gap: 14px; padding: 14px 8px; border-bottom: 1px dotted var(--border);
}
.newslist__item:last-child { border-bottom: none; }
.newslist__meta { flex: 0 0 92px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.newslist__meta time { font-size: 0.82rem; color: var(--text-light); font-weight: 700; }
.badge-new {
  font-size: 0.66rem; font-weight: 700; color: #fff; background: var(--red);
  padding: 2px 8px; border-radius: 4px; letter-spacing: 0.05em;
}
.newslist__title { font-weight: 700; color: var(--navy); font-size: 1rem; margin-bottom: 2px; }
.newslist__text { font-size: 0.88rem; color: var(--text-light); }

/* =========================================================
   校友会について（統計カード）
   ========================================================= */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat-card {
  background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 8px; text-align: center;
}
.stat-card__icon { font-size: 1.4rem; color: var(--navy-light); margin-bottom: 6px; }
.stat-card__num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--navy); font-family: "Shippori Mincho", serif; }
.stat-card__num small { font-size: 0.78rem; font-weight: 500; }
.stat-card__label { font-size: 0.78rem; color: var(--text-light); }

/* =========================================================
   年間行事（タイムライン）
   ========================================================= */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 22px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline__item { position: relative; display: flex; gap: 16px; padding-bottom: 18px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__month {
  flex: 0 0 46px; height: 46px; display: grid; place-items: center;
  background: var(--navy); color: #fff; border-radius: 50%; font-weight: 700; font-size: 0.82rem;
  z-index: 1; box-shadow: var(--shadow);
}
.timeline__body { background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; flex: 1; }
.timeline__title { font-size: 1rem; color: var(--navy); margin-bottom: 2px; }
.timeline__text { font-size: 0.88rem; color: var(--text-light); }

/* =========================================================
   役員名簿テーブル
   ========================================================= */
.officer-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.officer-table { width: 100%; border-collapse: collapse; }
.officer-table thead th { background: var(--navy); color: #fff; font-size: 0.85rem; font-weight: 700; text-align: left; padding: 12px 16px; }
.officer-table tbody td { padding: 11px 16px; font-size: 0.9rem; border-top: 1px solid var(--border); }
.officer-table tbody tr:nth-child(even) { background: var(--bg-gray); }
.officer-table tbody tr:hover { background: #eaf1fb; }
.role-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: #eef1f6; color: var(--navy); white-space: nowrap; }
.role-badge--lead { background: var(--navy); color: #fff; }
.role-badge--audit { background: var(--accent); color: #fff; }
.officer-note { text-align: right; font-size: 0.78rem; color: var(--text-light); margin-top: 10px; }

/* =========================================================
   活動の様子（ギャラリー）
   ========================================================= */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.gallery__item { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery__item:hover img { transform: scale(1.06); }
/* 集合写真（横長・中央寄せ／実寸に近いサイズで鮮明に表示） */
.gallery__item--wide {
  grid-column: 1 / -1;
  max-width: 460px;
  margin-inline: auto;
  aspect-ratio: 420 / 244;
}
/* 写真タイトル（下部オーバーレイ） */
.gallery__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 12px 8px;
  background: linear-gradient(transparent, rgba(14,36,86,0.85));
  color: #fff; font-size: 0.76rem; font-weight: 500; line-height: 1.4;
}
.gallery__item--placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-gray); border: 2px dashed var(--border); color: var(--text-light); box-shadow: none;
}
.gallery__item--placeholder i { font-size: 1.6rem; }
.gallery__item--placeholder span { font-size: 0.78rem; }

/* =========================================================
   よくある質問（アコーディオン）
   ========================================================= */
.faq { display: grid; gap: 10px; }
.faq__item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq__item summary {
  cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--navy); font-size: 0.92rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.78rem;
  color: var(--navy-light); transition: transform 0.25s; flex-shrink: 0;
}
.faq__item[open] summary::after { transform: rotate(180deg); }
.faq__a { padding: 0 16px 16px; font-size: 0.88rem; color: var(--text-light); }
.faq__a a { color: var(--navy-light); text-decoration: underline; }

/* =========================================================
   お問い合わせ
   ========================================================= */
.contact { display: grid; gap: 24px; }
.contact__subtitle { color: var(--navy); font-size: 1.1rem; margin-bottom: 14px; font-family: "Shippori Mincho", serif; }
.contact__list { display: grid; gap: 14px; margin-bottom: 16px; }
.contact__list li { display: flex; gap: 12px; align-items: flex-start; }
.contact__list i { color: var(--navy-light); font-size: 1.05rem; margin-top: 4px; width: 20px; text-align: center; }
.contact__note { font-size: 0.88rem; color: var(--text-light); background: var(--bg-gray); padding: 12px 14px; border-radius: 10px; border-left: 3px solid var(--accent); }
.contact__form { background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.86rem; font-weight: 500; margin-bottom: 6px; }
.req { background: var(--accent); color: #fff; font-size: 0.66rem; padding: 2px 8px; border-radius: 4px; margin-left: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.95rem; color: var(--text); background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy-light); box-shadow: 0 0 0 3px rgba(47,91,176,0.12);
}
.hidden-field { display: none; }
.form-result { margin-top: 12px; font-size: 0.9rem; font-weight: 500; text-align: center; }
.form-result.is-ok { color: #2f7d4f; }
.form-result.is-error { color: #c0392b; }

/* =========================================================
   プライバシーポリシー等（下層ページ）
   ========================================================= */
.legal { max-width: 860px; margin: 0 auto; padding: 26px 20px 50px; }
.legal .main { padding: 28px 24px; }
.legal__title { font-family: "Shippori Mincho", serif; font-size: 1.6rem; color: var(--navy); margin-bottom: 6px; }
.legal__back { display: inline-flex; align-items: center; gap: 6px; color: var(--navy-light); font-weight: 700; font-size: 0.9rem; margin-bottom: 18px; }
.legal__intro { margin-bottom: 24px; }
.legal__block { margin-bottom: 24px; }
.legal__block h2 { font-size: 1.05rem; color: var(--navy); border-left: 4px solid var(--accent); padding-left: 12px; margin-bottom: 10px; }
.legal__block ul { padding-left: 1.2em; list-style: disc; }
.legal__block li { margin-bottom: 4px; }
.legal__date { text-align: right; color: var(--text-light); font-size: 0.85rem; margin-top: 28px; }

/* =========================================================
   フッター
   ========================================================= */
.footer { background: var(--navy-dark); color: #fff; padding: 36px 0 22px; margin-top: 8px; }
.footer__inner { display: grid; gap: 16px; text-align: center; }
.footer__name { font-weight: 700; font-size: 1.05rem; }
.footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.footer__nav a { font-size: 0.86rem; opacity: 0.85; transition: opacity 0.2s; }
.footer__nav a:hover { opacity: 1; text-decoration: underline; }
.footer__copy { font-size: 0.76rem; opacity: 0.6; }

/* =========================================================
   チャットボット
   ========================================================= */
.chatbot__toggle {
  position: fixed; bottom: 24px; right: 24px; width: 60px; height: 60px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; font-size: 1.5rem; cursor: pointer;
  box-shadow: var(--shadow-hover); z-index: 200; transition: transform 0.25s, background 0.25s;
}
.chatbot__toggle:hover { transform: scale(1.08); background: var(--navy-dark); }
.chatbot__toggle.is-hidden { transform: scale(0); }
.chatbot__window {
  position: fixed; bottom: 24px; right: 24px; width: 360px; max-width: calc(100vw - 32px);
  height: 540px;
  /* スマホのアドレスバー分を考慮（dvh対応ブラウザは動的に追従） */
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: var(--bg); border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.24); display: flex; flex-direction: column; overflow: hidden;
  z-index: 201; opacity: 0; transform: translateY(20px) scale(0.96); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

/* スマホ：画面内に確実に収める（入力欄・送信ボタンが隠れないように） */
@media (max-width: 640px) {
  .chatbot__window {
    /* vwを使わず左右アンカーで幅を決める（横はみ出しの影響を受けない） */
    left: 8px; right: 8px; bottom: 8px;
    width: auto;
    max-width: none;
    height: auto;
    top: 60px;                    /* 上に少し余白を残してほぼ全画面 */
    top: max(60px, env(safe-area-inset-top));
    max-height: none;
    border-radius: 14px;
  }
  .chatbot__quick { padding-left: 10px; padding-right: 10px; }
  .chatbot__input { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chatbot__toggle { bottom: 16px; right: 16px; }
}
.chatbot__window.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chatbot__header { background: var(--navy); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.chatbot__header-info { display: flex; align-items: center; gap: 10px; }
.chatbot__avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.18); display: grid; place-items: center; font-size: 1.1rem; }
.chatbot__name { font-weight: 700; font-size: 0.95rem; }
.chatbot__status { font-size: 0.72rem; opacity: 0.85; display: flex; align-items: center; gap: 5px; }
.chatbot__status::before { content: ""; width: 7px; height: 7px; background: #4ade80; border-radius: 50%; display: inline-block; }
.chatbot__close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; opacity: 0.85; }
.chatbot__close:hover { opacity: 1; }
.chatbot__body { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg-gray); display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 0.88rem; line-height: 1.6; animation: fadeIn 0.3s ease; }
.msg--bot { background: #fff; color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg--user { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing span { width: 7px; height: 7px; background: var(--text-light); border-radius: 50%; animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100%{ opacity: 0.3; transform: translateY(0);} 30%{ opacity:1; transform: translateY(-4px);} }
.chatbot__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--border); }
.quick-btn { font-size: 0.78rem; padding: 6px 12px; border: 1px solid var(--navy-light); color: var(--navy); background: #fff; border-radius: 999px; cursor: pointer; transition: all 0.2s; }
.quick-btn:hover { background: var(--navy); color: #fff; }
.chatbot__input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--bg); }
.chatbot__input input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; font-family: inherit; font-size: 0.9rem; }
.chatbot__input input:focus { outline: none; border-color: var(--navy-light); }
.chatbot__input button { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; border: none; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
.chatbot__input button:hover { background: var(--navy-dark); }

/* =========================================================
   レスポンシブ
   ========================================================= */
/* タブレット〜PC：2カラム化 */
@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 232px 1fr; gap: 28px; align-items: start; padding: 28px 20px; }
  .sidebar { position: sticky; top: 16px; margin-bottom: 0; }
  .navtoggle { display: none !important; }
  .sidenav { display: block !important; }
  .main { padding: 30px 32px; }
  .block__title { font-size: 1.35rem; }
  .stats { gap: 14px; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  /* お問い合わせは2カラム */
  .contact { grid-template-columns: 1fr 1.2fr; }
}

/* スマホ：サイドナビを開閉式に */
@media (max-width: 899px) {
  .navtoggle { display: block; }
  .sidenav { display: none; }
  .sidenav.is-open { display: block; animation: fadeIn 0.25s ease; }
}
