/* 牛久市空手道連盟
   色と文字はここの :root だけで決めている。デザイン案が決まったら、ここを差し替える。 */
:root {
  --ink: #15171c;        /* 墨。文字と濃い背景 */
  --ink-soft: #2a2e36;
  --paper: #f7f5f0;      /* 道着の生成り。薄い背景 */
  --white: #ffffff;
  --red: #a51e1e;        /* 仮のメインカラー（要件定義書 8章 No.8 で未定） */
  --red-dark: #861616;
  --line: #dcd7cc;
  --muted: #5a5f68;
  --todo-bg: #fff3bf;
  --todo-ink: #6b4e00;

  --font-head: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  --wrap: 1080px;
  --narrow: 800px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.9;
  overflow-wrap: anywhere;
}
h1, h2, h3, p, ul, dl, dd, table { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: var(--narrow); }
.sp { display: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--white); padding: 8px 12px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-head); font-weight: 800; font-size: 1.2rem;
  letter-spacing: .08em; text-decoration: none; white-space: nowrap;
}
.brand-mark { width: 8px; height: 30px; background: var(--red); flex: none; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav ul { display: flex; gap: 4px; }
.nav li a {
  display: block; padding: 10px 11px;
  font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav li a:hover { border-bottom-color: var(--line); }
.nav li a[aria-current="page"] { border-bottom-color: var(--red); }
.nav-toggle { display: none; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 28px;
  font: inherit; font-weight: 700; text-decoration: none; text-align: center;
  border: 2px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); }
.btn-line { border-color: var(--white); color: var(--white); background: transparent; }
.btn-line:hover { background: var(--white); color: var(--ink); }
.btn-line-ink { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line-ink:hover { background: var(--ink); color: var(--white); }
.nav-cta { min-height: 44px; padding: 6px 22px; font-size: .9rem; }

/* ---------- トップの見出し部分 ---------- */
.hero {
  background: var(--ink); color: var(--white);
  position: relative; overflow: hidden;
}
.hero::before {            /* 帯を思わせる赤い縦線 */
  content: ""; position: absolute; top: 0; bottom: 0; left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  width: 6px; background: var(--red);
}
.hero-in { padding-top: 88px; padding-bottom: 96px; }
.hero-in > * { margin-left: 36px; }
.hero h1 {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(2.1rem, 6.4vw, 4rem); letter-spacing: .12em; line-height: 1.35;
}
.hero-lead { margin-top: 20px; font-size: 1.1rem; color: #e6e3dc; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
}
.hero .eyebrow { color: #c9c4b8; }

/* ---------- 下層ページの見出し ---------- */
.page-head { background: var(--ink); color: var(--white); padding: 52px 0 48px; }
.page-head h1 { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.7rem, 4.6vw, 2.5rem); letter-spacing: .1em; line-height: 1.4; }
.page-head .eyebrow { color: #c9c4b8; }
.page-lead { margin-top: 12px; color: #e6e3dc; }

.ln { display: block; }
.page-head h1.two-line { font-size: clamp(1.2rem, 5.4vw, 2.5rem); }
.card h3.two-line { font-size: clamp(1rem, 4.5vw, 1.3rem); }
.card h3.two-line::after { content: none; }
.card h3.two-line .ln:last-child::after { content: " →"; color: var(--red); }

/* ---------- セクション ---------- */
.sec { padding: 72px 0; }
.sec-tint { background: var(--paper); }
.sec-ink { background: var(--ink); color: var(--white); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
h2 {
  font-family: var(--font-head); font-weight: 800; font-size: 1.6rem; letter-spacing: .08em; line-height: 1.5;
  padding-left: 16px; border-left: 6px solid var(--red);
}
.narrow h2 { margin: 56px 0 20px; }
.narrow h2:first-child, .narrow .lead + h2 { margin-top: 0; }
.lead { margin-bottom: 40px; }
.more { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--red); padding-bottom: 2px; white-space: nowrap; }
.more::after { content: " →"; }
.more:hover { color: var(--red); }
.note { margin-top: 20px; color: var(--muted); }
.note a { text-decoration-color: var(--red); }
.back { margin-top: 48px; }

/* ---------- お知らせ ---------- */
.news-list { border-top: 2px solid var(--ink); }
.news-item { padding: 28px 0; border-bottom: 1px solid var(--line); }
.news-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.news-item h3 { font-size: 1.25rem; line-height: 1.6; margin-bottom: 8px; }
.news-item .contact { margin: 16px 0; }
.news-flyer { margin: 16px 0; }
.news-flyer a { display: block; max-width: 420px; }
.news-flyer img { display: block; width: 100%; border: 1px solid var(--line); }
.news-flyer span { display: block; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.tag { display: inline-block; padding: 1px 12px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; border-radius: 2px; line-height: 1.8; }
.tag-red { background: var(--red); color: var(--white); }
.tag-ink { background: var(--ink); color: var(--white); }

/* ---------- 連絡先 ---------- */
.contact { background: var(--paper); border-left: 4px solid var(--ink); padding: 14px 20px; margin-top: 16px; }
.contact > div { display: flex; gap: 16px; padding: 2px 0; }
.contact dt { flex: none; width: 4em; font-weight: 700; font-size: .9rem; color: var(--muted); }
.contact dd { min-width: 0; }
.contact a, .list a { font-weight: 700; text-decoration-color: var(--red); text-underline-offset: 4px; }
.sec-ink .contact { background: var(--ink-soft); border-left-color: var(--red); max-width: 560px; }
.sec-ink .contact dt { color: #c9c4b8; }

/* ---------- カード ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: block; padding: 28px 28px 30px; text-decoration: none;
  background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--ink);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-top-color: var(--red); transform: translateY(-2px); }
.card h3 { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: .06em; margin: 8px 0 6px; }
.card h3::after { content: " →"; color: var(--red); }
.card p { color: var(--muted); font-size: .95rem; }

/* ---------- Instagram（トップ下部） ---------- */
.ig-lead { margin-bottom: 24px; }
.ig-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.ig { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--white); border: 1px solid var(--line); padding: 20px; }
.ig-qr { flex: none; width: 180px; }
.ig-text { flex: 1 1 200px; display: grid; gap: 14px; justify-items: start; }
.ig-account { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }

/* ---------- 一覧表（理事・所属団体） ---------- */
.list { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.list th, .list td { padding: 16px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.list thead th { font-size: .85rem; color: var(--muted); font-weight: 700; padding: 10px 12px; background: var(--paper); }
.list tbody th { font-weight: 700; }
.officers tbody th { white-space: nowrap; width: 9.5em; color: var(--red-dark); font-size: .95rem; }
.officers .name { white-space: nowrap; font-weight: 700; font-size: 1.05rem; }
.members td { white-space: nowrap; }

/* ---------- 実施要項 ---------- */
.spec { border-top: 2px solid var(--ink); }
.spec > div { display: flex; gap: 20px; padding: 16px 12px; border-bottom: 1px solid var(--line); }
.spec dt { flex: none; width: 6em; font-weight: 700; }
.spec dd { min-width: 0; }
h3.sub { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; letter-spacing: .04em; line-height: 1.6; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--red); }
.group-label { display: inline-block; margin: 20px 0 10px; padding: 0 12px; background: var(--ink); color: var(--white); font-size: .85rem; font-weight: 700; border-radius: 2px; }
.notes { display: grid; gap: 10px; margin-top: 16px; }
.notes li { position: relative; padding-left: 1.4em; }
.notes li::before { content: "※"; position: absolute; left: 0; color: var(--red-dark); font-weight: 700; }
.letter { background: var(--paper); padding: 28px; display: grid; gap: 12px; }
.letter p:last-child, .letter-date { text-align: right; }
.closing { margin-top: 32px; }
.steps { counter-reset: step; display: grid; gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; position: relative; background: var(--paper); border-left: 4px solid var(--ink); padding: 20px 20px 22px 68px; }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 18px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--white); font-family: var(--font-head); font-weight: 800; border-radius: 50%; }
.steps li > strong { font-size: 1.1rem; }
.steps li p { margin-top: 8px; }
.steps .mail { font-weight: 700; text-decoration-color: var(--red); text-underline-offset: 4px; }
.deadline { margin: 20px 0 56px; padding: 14px 20px; border: 2px solid var(--red); text-align: center; }
.deadline strong { color: var(--red-dark); font-size: 1.1rem; }
h2[id] { scroll-margin-top: 90px; }
.cta-box.cta-top { margin: 0 0 56px; border-top: 4px solid var(--red); }
.cta-top strong { font-size: 1.15rem; color: var(--red-dark); }
.pdf { margin-top: 40px; }
.cta-box { margin-top: 56px; padding: 32px; background: var(--paper); text-align: center; }
.cta-box p { margin-bottom: 18px; }

/* ---------- フォーム ---------- */
.form { display: grid; gap: 26px; }
.field label, .players legend { display: block; font-weight: 700; margin-bottom: 6px; }
.req, .opt { display: inline-block; margin-left: 10px; padding: 0 8px; font-size: .72rem; font-weight: 700; border-radius: 2px; line-height: 1.8; vertical-align: 2px; }
.req { background: var(--red); color: var(--white); }
.opt { background: var(--line); color: var(--ink); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], select, textarea {
  display: block; width: 100%; min-height: 54px; padding: 12px 14px;
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1.5px solid #8b8f97; border-radius: 2px;
}
.field label > input, .field label > select { margin-top: 6px; }
textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8b8f97; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--red); outline-offset: 1px; border-color: var(--ink); }
.is-error input, .is-error select, .is-error textarea { border-color: var(--red); background: #fdf3f2; }
.err { color: var(--red-dark); font-weight: 700; font-size: .9rem; margin-top: 4px; }
.err:empty { display: none; }
.players { border: 0; padding: 0; margin: 0; min-width: 0; }
.player { background: var(--paper); border-left: 4px solid var(--ink); padding: 20px; margin-bottom: 16px; display: grid; gap: 18px; }
.player-no { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; }
.player-del { font: inherit; font-size: .85rem; background: none; border: 0; padding: 8px 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
.player-del[hidden] { display: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.consent label { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.consent input { width: 24px; height: 24px; margin-top: 5px; flex: none; accent-color: var(--red); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-note { color: var(--muted); font-size: .9rem; }
.btn-submit { width: 100%; min-height: 60px; font-size: 1.1rem; }
.btn-submit[disabled] { opacity: .6; cursor: wait; }
.form-status { font-weight: 700; color: var(--red-dark); }
.form-status:empty { display: none; }
.done { padding: 40px 28px; background: var(--paper); border-top: 4px solid var(--red); }
.done h2 { margin-bottom: 16px; }
.done p + p { margin-top: 16px; }

/* ---------- 文章ページ ---------- */
.prose h2 { font-size: 1.25rem; margin: 40px 0 12px; }

/* ---------- 「確認中」の目印（公開前にすべて消す） ---------- */
.todo { background: var(--todo-bg); color: var(--todo-ink); font-weight: 700; font-size: .9rem; padding: 2px 10px; border-radius: 2px; }
.todo-block { display: block; padding: 12px 16px; margin-bottom: 28px; border-left: 4px solid #e0a800; }

/* ---------- フッター ---------- */
.site-footer { background: var(--ink); color: #e6e3dc; padding: 56px 0 0; border-top: 6px solid var(--red); }
.footer-in { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-name { font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; letter-spacing: .1em; color: var(--white); margin-bottom: 12px; }
.footer-office { font-size: .92rem; }
.footer-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 36px; align-content: start; font-size: .92rem; }
.footer-nav a { text-decoration: none; display: block; padding: 3px 0; }
.footer-nav a:hover { text-decoration: underline; }
.copyright { text-align: center; padding: 20px var(--gutter); margin-top: 44px; border-top: 1px solid #3a3e47; color: #a9a59b; }

/* ---------- 狭い画面 ---------- */
@media (max-width: 1020px) {
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px;
    font: inherit; font-size: .9rem; font-weight: 700; color: var(--ink);
    background: var(--white); border: 2px solid var(--ink); border-radius: 2px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 2px solid var(--ink); padding: 8px var(--gutter) 20px;
  }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li a { padding: 14px 4px; font-size: 1rem; border-bottom: 1px solid var(--line); }
  .nav li a[aria-current="page"] { border-bottom-color: var(--line); color: var(--red-dark); }
  .nav-cta { margin-top: 16px; min-height: 52px; font-size: 1rem; }
}

@media (max-width: 640px) {
  .sp { display: inline; }
  .brand { font-size: 1.05rem; letter-spacing: .04em; }
  .hero-in { padding-top: 60px; padding-bottom: 64px; }
  .hero-in > * { margin-left: 24px; }
  .hero-btns .btn { width: 100%; }
  .sec { padding: 52px 0; }
  h2 { font-size: 1.35rem; }
  .sec-head { flex-wrap: wrap; }
  .row2 { grid-template-columns: 1fr; }
  .contact > div { flex-direction: column; gap: 0; padding: 4px 0; }   /* 長いメールアドレスを途中で折らない */
  .contact dt { width: auto; font-size: .8rem; }
  .spec > div { flex-direction: column; gap: 2px; }
  .spec dt { width: auto; font-size: .9rem; color: var(--muted); }
  .cta-box { padding: 24px 18px; }
  .cta-box .btn, .steps .btn { width: 100%; }
  .steps li { padding: 62px 16px 20px; }
  .ig { flex-direction: column; align-items: center; gap: 12px; text-align: center; }   /* アカウント名を途中で折らない */
  .ig-text { flex: none; width: 100%; justify-items: center; }
  .ig-text .btn { width: 100%; }

  /* 表は1件ずつの縦並びにする（横にはみ出させない） */
  .list thead { position: absolute; left: -9999px; }
  .list, .list tbody, .list tr, .list th, .list td { display: block; width: auto; }
  .list tr { padding: 16px 4px; border-bottom: 1px solid var(--line); }
  .list th, .list td { padding: 0; border: 0; white-space: normal; }
  .officers tbody th { width: auto; font-size: .85rem; }
  .officers td:last-child { color: var(--muted); font-size: .92rem; }
  .members tbody th { font-size: 1.05rem; margin-bottom: 4px; }
  .members td { display: flex; gap: 12px; }
  .members td::before { content: attr(data-label); flex: none; width: 4em; font-size: .85rem; font-weight: 700; color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
