/* ==========================================================================
   株式会社ヒューマン・コメディ / 一般社団法人チーム・ヒューマン・コメディ
   共通スタイル（フレームワーク不使用）
   ========================================================================== */

:root {
  --accent: #ff8b18;
  --accent-dark: #e06f00;
  --accent-soft: #fff4e8;
  --sub: #023a8c;
  --sub-soft: #eef3fb;
  --text: #333;
  --muted: #777;
  --line: #e2e2e2;
  --bg: #fff;
  --bg-gray: #f6f6f6;
  --radius: 6px;
  --container: 1140px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

/* 一般社団法人はネイビーをメインカラーに */
.theme-ippan {
  --accent: #023a8c;
  --accent-dark: #012a66;
  --accent-soft: #eef3fb;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--accent-dark); }
a:hover { text-decoration: none; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #000; color: #fff; padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* --------------------------------------------------------------------------
   ヘッダー
   -------------------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 20; }

.header-tagline { font-size: 11px; color: var(--muted); padding: 2px 0; }
.header-tagline .container { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.header-brand { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.site-logo img { width: 300px; max-width: 60vw; }
.header-banners { display: flex; gap: 6px; }
.header-banners img { height: 47px; width: auto; }

.header-contact { text-align: right; line-height: 1.3; }
.header-contact__lead { margin: 0; font-size: 12px; }
.header-contact__tel { margin: 0; font-size: 26px; font-weight: bold; }
.header-contact__tel a { color: var(--accent); text-decoration: none; }
.header-contact__time { margin: 0; font-size: 11px; color: var(--muted); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle__bar { display: block; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.global-nav { border-top: 1px solid var(--line); }
.global-nav ul {
  display: flex;
  list-style: none;
  margin: 0 auto;
  padding: 0;
}
.global-nav li { flex: 1; }
.global-nav a {
  display: block;
  padding: 10px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
  border-left: 1px solid var(--line);
  transition: background .2s, color .2s;
}
.global-nav li:last-child a { border-right: 1px solid var(--line); }
.global-nav a:hover, .global-nav a.is-current { background: var(--accent); color: #fff; }
.nav-sub { display: block; font-size: 10px; font-weight: normal; color: var(--muted); letter-spacing: .08em; line-height: 1.2; }
.global-nav a:hover .nav-sub, .global-nav a.is-current .nav-sub { color: #fff; }
.global-nav__banners { display: none; }

/* --------------------------------------------------------------------------
   トップ
   -------------------------------------------------------------------------- */
.hero { background: var(--bg-gray); text-align: center; }
.hero img { width: 100%; max-width: 1600px; display: block; margin: 0 auto; }

.home { padding-top: 40px; padding-bottom: 40px; }

.pr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 48px; }
.pr-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s;
}
.pr-card:hover { transform: translateY(-3px); }
.pr-card__title { font-size: 14px; margin: 0 0 6px; color: var(--text); }
.pr-card img { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 4px; background: #fff; }
.pr-card__text { font-size: 13px; margin: 6px 0 0; text-decoration: underline; color: var(--accent-dark); }

.home-section { margin-bottom: 56px; }
.section-title {
  font-size: 22px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
  margin: 0 0 24px;
}

.greeting h2 { margin-top: 0; }

/* --------------------------------------------------------------------------
   下層ページ レイアウト
   -------------------------------------------------------------------------- */
.breadcrumb { font-size: 12px; padding-top: 8px; padding-bottom: 8px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li { color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; }
.breadcrumb a { color: var(--muted); }

.page-body { padding-top: 16px; padding-bottom: 56px; }
.page-body.has-sidebar {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
}
.page-body.has-sidebar .main { grid-column: 2; grid-row: 1; }
.page-body.has-sidebar .sidebar { grid-column: 1; grid-row: 1; }

.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-size: 26px;
  line-height: 1.5;
  margin: 0;
  padding: 12px 16px;
  border-left: 6px solid var(--accent);
  background: var(--accent-soft);
}
.post-meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --------------------------------------------------------------------------
   本文
   -------------------------------------------------------------------------- */
.entry { overflow-wrap: anywhere; }
.entry h2 {
  font-size: 22px;
  margin: 40px 0 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.entry h3 {
  font-size: 18px;
  margin: 32px 0 12px;
  padding: 8px 12px;
  background: var(--bg-gray);
  border-left: 4px solid var(--accent);
}
.entry h4 { font-size: 16px; margin: 24px 0 8px; }
.entry h3 span[style*="color"] { color: inherit !important; }
.entry figure { margin: 24px 0; }
.entry img { border-radius: 2px; }
.entry .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry .alignleft { float: left; margin: 0 16px 16px 0; }
.entry .alignright { float: right; margin: 0 0 16px 16px; }
.entry figure.aligncenter { text-align: center; }
.entry::after { content: ""; display: block; clear: both; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.spacer { height: 24px !important; }
.accent { color: var(--accent-dark); }

.entry .table, .entry table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
}
.entry table th, .entry table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.entry table th { background: var(--bg-gray); white-space: nowrap; }
.entry table td:first-child:not(:only-child) { background: var(--bg-gray); width: 25%; }
.donation-table td:first-child:not(:only-child) { background: transparent !important; }
.donation-table th { width: 50%; font-size: 18px; }
.donation-table td { text-align: center !important; }

.note {
  background: var(--sub-soft);
  border: 1px solid #c9d8f0;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.entry blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--line); background: var(--bg-gray); }
.entry blockquote p { margin: 0; }
.entry iframe { max-width: 100%; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }

.cols { display: flex; gap: 24px; margin: 24px 0; }
.cols > * { flex: 1; min-width: 0; }

/* 『Chance!!』閲覧・購入 */
.cols:has(> .chance-banners) { align-items: flex-start; }
.chance-banners { text-align: center; }
.chance-banners img { max-width: 300px; width: 100%; }
.chance-banners small { display: block; margin: 4px 0 16px; font-size: 13px; }

/* --------------------------------------------------------------------------
   ボタン
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-orange { background: #ff8b18; }
.btn-orange:hover { background: #e06f00; }
.btn-blue { background: #023a8c; }
.btn-blue:hover { background: #012a66; }
.btn-more {
  display: block;
  margin-top: 24px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 14px;
}
.btn-more:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-contact { background: var(--accent); width: 100%; }

/* --------------------------------------------------------------------------
   サイドバー
   -------------------------------------------------------------------------- */
.sidebar { font-size: 14px; }
.side-contact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 24px;
}
.side-contact .btn-contact { font-size: 18px; padding: 14px; }
.side-contact__lead { margin: 12px 0 0; }
.side-contact__tel { margin: 0; font-size: 22px; font-weight: bold; }
.side-contact__tel a { color: var(--accent); text-decoration: none; }
.side-contact__time { margin: 0; font-size: 12px; color: var(--muted); }

.side-menu { margin-bottom: 24px; }
.side-menu h2 {
  font-size: 15px;
  margin: 0;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}
.side-menu ul { list-style: none; margin: 0; padding: 0; }
.side-menu a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px dotted var(--line);
  color: var(--text);
  text-decoration: none;
}
.side-menu a::before { content: "›"; margin-right: 8px; color: var(--accent); }
.side-menu a:hover { background: var(--bg-gray); }
.side-banner { display: block; margin-bottom: 12px; }
.side-banner img { width: 100%; }

.bottom-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding: 24px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.bottom-contact p { margin: 0; }
.bottom-contact__tel { font-size: 26px; font-weight: bold; }
.bottom-contact__tel a { color: var(--accent); text-decoration: none; }
.bottom-contact__time { font-size: 13px; color: var(--muted); }
.bottom-contact .btn { width: auto; }

/* --------------------------------------------------------------------------
   記事カード・一覧
   -------------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .2s; }
.card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }
.card a { display: flex; flex-direction: column; height: 100%; color: var(--text); text-decoration: none; }
.card__thumb { aspect-ratio: 600 / 315; background: var(--bg-gray); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__noimg { font-weight: bold; color: #ccc; letter-spacing: .2em; font-size: 20px; }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card__cats { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.card__cat, .post-meta .card__cat {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 1px 8px;
  border-radius: 3px;
  line-height: 1.6;
}
.card__title { font-size: 15px; line-height: 1.6; margin: 6px 0 8px; flex: 1; }
.card__date { font-size: 12px; color: var(--muted); }

.pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0; margin: 40px 0 0; }
.pagination a, .pagination span {
  display: block;
  min-width: 40px;
  padding: 8px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
}
.pagination span[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a:hover { background: var(--bg-gray); }

.post-nav ul { list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 24px 0 0; margin: 40px 0 0; border-top: 1px solid var(--line); }
.post-nav li { flex: 1; font-size: 14px; }
.post-nav .next { text-align: right; }

/* Kindle バックナンバー */
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 24px; }
.book a { display: block; color: var(--text); text-decoration: none; }
.book img { width: 100%; aspect-ratio: 1 / 1.41; object-fit: cover; border: 1px solid var(--line); transition: transform .2s; }
.book a:hover img { transform: translateY(-3px); }
.book__title { font-size: 15px; margin: 8px 0 0; }
.book__title span { display: block; font-size: 12px; font-weight: normal; color: var(--muted); }
.book__price { margin: 0; font-weight: bold; color: var(--accent-dark); }

/* X タイムライン */
.x-timeline { max-width: 600px; margin: 24px auto; }

/* --------------------------------------------------------------------------
   お問合せフォーム
   -------------------------------------------------------------------------- */
.contact-form { margin-top: 32px; }
.form-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.form-row:first-child { border-top: 1px solid var(--line); }
.form-row label { font-weight: bold; padding-top: 8px; }
.req, .opt { display: inline-block; font-size: 11px; color: #fff; background: #d9534f; padding: 0 6px; border-radius: 3px; margin-left: 6px; vertical-align: 2px; }
.opt { background: #999; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"],
.contact-form select, .contact-form textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.contact-form .is-invalid { border-color: #d9534f; background: #fff6f6; }
.contact-form .hp { position: absolute; left: -9999px; }
.form-privacy { text-align: center; margin: 24px 0 0; font-size: 14px; }
.form-actions { text-align: center; margin-top: 24px; }
.btn-submit { min-width: 240px; }
.form-status { text-align: center; min-height: 1.5em; font-weight: bold; }
.form-status.is-error { color: #d9534f; }
.form-status.is-success { color: #2e7d32; }

/* --------------------------------------------------------------------------
   フッター
   -------------------------------------------------------------------------- */
.site-footer { background: #3a3a3a; color: #ddd; font-size: 14px; position: relative; }
.theme-ippan .site-footer { background: #012a66; }
.site-footer a { color: #fff; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1.5fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.footer-name { font-size: 16px; font-weight: bold; margin: 0 0 8px; }
.footer-name a { text-decoration: none; }
.footer-info p { margin: 0 0 8px; }
.footer-menu { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.footer-menu li { margin-bottom: 6px; break-inside: avoid; }
.footer-menu a { text-decoration: none; }
.footer-menu a:hover { text-decoration: underline; }
.footer-menu a::before { content: "›"; margin-right: 6px; }
.copyright { margin: 0; padding: 12px 16px; text-align: center; font-size: 12px; background: rgba(0, 0, 0, .25); }
.copyright a { text-decoration: none; }

.page-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff !important;
  border-radius: 50%;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 30;
}
.page-top.is-visible { opacity: .9; pointer-events: auto; }

/* --------------------------------------------------------------------------
   レスポンシブ
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .header-contact { display: none; }
  .page-body.has-sidebar { grid-template-columns: 1fr; gap: 32px; }
  .page-body.has-sidebar .main, .page-body.has-sidebar .sidebar { grid-column: 1; grid-row: auto; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 15px; }
  .header-banners { display: none; }
  .header-brand { gap: 8px; }
  .site-logo img { width: 230px; }
  .pr-grid { grid-template-columns: 1fr; gap: 20px; }
  .card-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .page-header h1 { font-size: 21px; }
  .entry h2 { font-size: 19px; }
  .entry h3 { font-size: 17px; }
  .entry .alignleft, .entry .alignright { float: none; margin: 16px auto; display: block; }
  .entry table th, .entry table td { padding: 8px 10px; }
  .entry table td:first-child:not(:only-child) { width: 32%; }
  .cols { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .form-row label { padding-top: 0; }
  .bottom-contact { flex-direction: column; text-align: center; }
  .bottom-contact .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .post-nav ul { flex-direction: column; }
  .post-nav .next { text-align: left; }
}

/* タブレット以下はハンバーガーメニュー */
@media (max-width: 991px) {
  .site-header { position: sticky; top: 0; }
  .header-tagline { display: none; }
  .nav-toggle { display: block; flex-shrink: 0; }

  .global-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .1);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  .nav-open .global-nav { display: block; }
  .global-nav ul { flex-direction: column; padding: 0; }
  .global-nav a { text-align: left; padding: 14px 16px; border: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .nav-sub { display: inline; margin-left: 8px; }
  .global-nav__banners { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
  .global-nav__banners img { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
}
