/* 藍住まちゼミ：チラシの「黒板の緑」と「チョークの黄色」を基調に */
:root {
  --board: #1f4d3a;
  --board-deep: #163829;
  --chalk: #f7d046;
  --chalk-soft: #fff4c2;
  --paper: #fbf7ee;
  --card: #ffffff;
  --ink: #23302a;
  --ink-soft: #5b675f;
  --line: #e4dccb;
  --ok: #1f7a4d;
  --warn: #b5541a;
  --full: #8a8f8c;
  --danger: #b3261e;
  --cat-yaku: #2f6fb3;
  --cat-tsukuru: #c0582b;
  --cat-bi: #b0407a;
  --radius-s: 8px;
  --radius-l: 18px;
  --shadow: 0 2px 0 rgba(22, 56, 41, 0.08), 0 8px 24px rgba(22, 56, 41, 0.08);
  --font: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', 'Meiryo', sans-serif;
  --text-base: clamp(1.02rem, 0.98rem + 0.25vw, 1.12rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--board); }
img { max-width: 100%; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ---------- ヘッダー（黒板） ---------- */
.board {
  position: relative;
  color: #fff;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.07), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(0, 0, 0, 0.25), transparent 55%),
    var(--board);
  border-bottom: 10px solid #8b5e34; /* 黒板の木枠 */
  overflow: hidden;
}
.board::after { /* チョークの粉っぽさ */
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 6px 6px;
  pointer-events: none;
}
.board .wrap { position: relative; z-index: 1; padding: 28px 0 30px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--chalk);
  color: var(--board-deep);
  font-weight: 900;
  line-height: 1.05;
  font-size: 0.82rem;
  text-align: center;
  transform: rotate(-6deg);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.brand-name { font-size: 0.95rem; letter-spacing: 0.08em; opacity: 0.85; }
.hero-title {
  margin: 18px 0 6px;
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.6rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.hero-title .chalk { color: var(--chalk); }
.hero-lead { margin: 0; font-size: 1.05rem; opacity: 0.92; }

/* ---------- 受付状態の帯 ---------- */
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: -18px 0 0;
  position: relative;
  z-index: 2;
  padding: 16px 20px;
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 8px solid var(--chalk);
}
.status strong { font-size: 1.15rem; }
.status.is-open { border-left-color: var(--ok); }
.status.is-closed { border-left-color: var(--full); }
.pill {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-open { background: #dff3e7; color: var(--ok); }
.pill-before { background: var(--chalk-soft); color: #7a5b00; }
.pill-closed { background: #ececec; color: #555; }

/* ---------- 本文 ---------- */
main { padding: 28px 0 56px; }
.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 36px 0 14px;
  font-size: 1.45rem;
}
.section-title small { color: var(--ink-soft); font-size: 0.9rem; font-weight: 400; }
.notice-box {
  padding: 18px 20px;
  border-radius: var(--radius-l);
  background: var(--chalk-soft);
  border: 2px dashed #e2b93b;
}
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding: 0; list-style: none; }
.steps li {
  padding: 16px 18px;
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow);
}
.steps b { display: block; color: var(--board); font-size: 1.05rem; }

/* 絞り込み */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  font: inherit;
  font-size: 0.95rem;
  padding: 6px 16px;
  border-radius: 999px;
  border: 2px solid var(--board);
  background: var(--card);
  color: var(--board);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed='true'] { background: var(--board); color: #fff; }

/* 講座カード */
.course-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.course-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 16px;
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  border-top: 6px solid var(--board);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.course-card:hover, .course-card:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(22, 56, 41, 0.16); }
.course-card[data-cat='役立つ'] { border-top-color: var(--cat-yaku); }
.course-card[data-cat='創る'] { border-top-color: var(--cat-tsukuru); }
.course-card[data-cat='美・健'] { border-top-color: var(--cat-bi); }
.course-card { padding-top: 0; overflow: hidden; }
.course-photo {
  position: relative;
  margin: 0 -18px 4px;
  aspect-ratio: 3 / 2;
  background: #ece6d6;
  overflow: hidden;
}
.course-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s var(--ease); }
.course-card:hover .course-photo img { transform: scale(1.04); }
.cat-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--board);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.course-card[data-cat='役立つ'] .cat-tag { background: var(--cat-yaku); }
.course-card[data-cat='創る'] .cat-tag { background: var(--cat-tsukuru); }
.course-card[data-cat='美・健'] .cat-tag { background: var(--cat-bi); }
.session-list li.more { color: var(--ink-soft); }
.course-head { display: flex; gap: 12px; align-items: flex-start; padding-top: 14px; }
.course-photo + .course-head { padding-top: 6px; }
.detail-photo { margin: -24px -24px 20px; max-height: 420px; overflow: hidden; background: #ece6d6; }
.detail-photo img { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.detail { overflow: hidden; }
.course-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--board);
  color: var(--chalk);
  font-weight: 900;
  font-size: 1.15rem;
}
.course-title { margin: 0; font-size: 1.12rem; line-height: 1.45; }
.course-shop { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.session-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.session-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 0.95rem; border-top: 1px dashed var(--line); padding-top: 4px; }
.seat { font-weight: 700; white-space: nowrap; }
.seat-ok { color: var(--ok); }
.seat-few { color: var(--warn); }
.seat-full, .seat-past { color: var(--full); }

/* 講座ページ */
.back { display: inline-block; margin-bottom: 12px; }
.detail {
  padding: 24px;
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow);
}
.detail h1 { margin: 0 0 4px; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); line-height: 1.4; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 18px 0 0; }
.facts dt { color: var(--ink-soft); font-weight: 700; }
.facts dd { margin: 0; white-space: pre-wrap; }

/* フォーム */
.form { display: grid; gap: 18px; margin-top: 20px; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 6px; }
.req { color: var(--danger); font-size: 0.85rem; margin-left: 6px; }
.opt { color: var(--ink-soft); font-size: 0.85rem; margin-left: 6px; font-weight: 400; }
input[type='text'], input[type='tel'], input[type='email'], input[type='password'], input[type='datetime-local'], select, textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--chalk);
  outline-offset: 2px;
  border-color: var(--board);
}
fieldset { border: 0; margin: 0; padding: 0; }
.choice-list { display: grid; gap: 8px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--board); background: #eef6f1; }
.choice.is-disabled { opacity: 0.55; cursor: not-allowed; }
.choice input { width: 22px; height: 22px; accent-color: var(--board); }
.choice .seat { margin-left: auto; }
.err { color: var(--danger); font-size: 0.92rem; margin: 4px 0 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.consent input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--board); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 28px;
  border-radius: 999px;
  border: 0;
  background: var(--board);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--board-deep);
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
.btn:hover { background: #26604a; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--board-deep); }
.btn[disabled] { background: var(--full); box-shadow: none; cursor: not-allowed; }
.btn-sub { background: #fff; color: var(--board); border: 2px solid var(--board); box-shadow: none; font-size: 1rem; padding: 10px 20px; }
.btn-sub:hover { background: #eef6f1; }
.btn-danger { background: #fff; color: var(--danger); border: 2px solid var(--danger); box-shadow: none; font-size: 0.9rem; padding: 4px 12px; }
.btn-wide { width: 100%; }

/* 申込完了 */
.done {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-l);
  background: var(--card);
  box-shadow: var(--shadow);
  border: 4px solid var(--ok);
}
.done-code {
  display: inline-block;
  margin: 10px 0 14px;
  padding: 10px 22px;
  border-radius: var(--radius-s);
  background: var(--board);
  color: var(--chalk);
  font-size: clamp(2rem, 1.4rem + 3vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.18em;
}

/* 特典クーポン（券の形） */
.coupon {
  position: relative;
  max-width: 460px;
  margin: 16px auto;
  padding: 22px 24px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 0 58%, var(--paper) 14px, transparent 15px),
    radial-gradient(circle at 100% 58%, var(--paper) 14px, transparent 15px),
    linear-gradient(160deg, #fff8d6, #ffe68a);
  box-shadow: var(--shadow);
  border: 3px solid #e2b93b;
  text-align: center;
}
.coupon-head { display: flex; align-items: center; justify-content: center; gap: 10px; }
.coupon-head .brand-badge { width: 44px; height: 44px; font-size: 0.7rem; }
.coupon-label { margin: 14px 0 0; color: var(--ink-soft); font-size: 0.9rem; }
.coupon-no {
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--board-deep);
  border-top: 2px dashed #d3a72a;
  border-bottom: 2px dashed #d3a72a;
  margin: 4px 0 8px;
}
.coupon-check b { font-size: 1.3rem; letter-spacing: 0.2em; background: #fff; padding: 2px 10px; border-radius: 6px; }
.coupon-shops { text-align: left; margin-top: 8px; }
.coupon-shops summary { cursor: pointer; font-weight: 700; }
.coupon-small { color: var(--ink-soft); font-size: 0.82rem; margin-bottom: 0; }
.coupon.is-used { filter: grayscale(0.9); }
.coupon-used { font-weight: 900; color: var(--danger); font-size: 1.1rem; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 14px 16px; border-radius: var(--radius-s); background: #f6f2e7; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.2; color: var(--board); }
.bar-cell { width: 45%; }
.bar { height: 10px; border-radius: 999px; background: var(--board); min-width: 2px; }

.msg { padding: 12px 16px; border-radius: var(--radius-s); margin: 12px 0; }
.msg-error { background: #fdecea; color: var(--danger); }
.msg-ok { background: #e3f4ea; color: var(--ok); }
.empty { color: var(--ink-soft); }
.mt { margin-top: 16px; }

/* 管理画面の表 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.95rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f1ede2; white-space: nowrap; }
tr.is-cancelled td { color: var(--full); text-decoration: line-through; }
.panel { padding: 20px; border-radius: var(--radius-l); background: var(--card); box-shadow: var(--shadow); margin-bottom: 20px; }
.panel h2, .panel h3 { margin-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }

footer { background: var(--board-deep); color: #e8efe9; padding: 24px 0; font-size: 0.92rem; }
footer a { color: var(--chalk); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
@media print {
  .board, footer, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; }
}
