/* アイカスの見た目（全ページ共通）
   レイアウト: 雑誌型ブログ。上部にロゴ帯＋ヒーロー＋カテゴリ帯、下は「記事一覧＋サイドバー」の2段組（スマホでは1段） */
:root {
  --ink: #1e2530;        /* 文字・ヘッダー帯 */
  --ink-2: #2b3442;      /* カテゴリ帯 */
  --muted: #5d6675;      /* 補足の文字 */
  --line: #e3e6ea;       /* 区切り線 */
  --bg: #f4f5f7;         /* ページの地 */
  --paper: #ffffff;      /* カード・本文の地 */
  --accent: #0f7f8c;     /* リンク・ボタン */
  --accent-soft: #e3f3f4;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-logo: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ===== ヘッダー ===== */
.site-header { background: var(--ink); color: #fff; }
.header-bar { display: flex; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; padding-block: 12px; }
.logo { font-family: var(--font-logo); font-weight: 800; font-size: 1.6rem; color: #fff; text-decoration: none; letter-spacing: .04em; }
.tagline { margin: 0; font-size: .8rem; color: #c7ced8; }

/* ヒーロー: 写真の代わりにCSSで描いた背景 */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 30%, rgba(255, 214, 120, .55) 0 9%, transparent 9.5%),
    radial-gradient(circle at 78% 30%, rgba(255, 214, 120, .18) 0 22%, transparent 22.5%),
    linear-gradient(160deg, #0f7f8c 0%, #1b4f72 55%, #1e2530 100%);
}
.hero::before {
  /* 方眼ノートのような細い線 */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
}
.hero::after {
  /* 下側の丘のシルエット */
  content: "";
  position: absolute;
  left: -5%; right: -5%; bottom: -40px;
  height: 120px;
  background: radial-gradient(ellipse at 30% 100%, #16323f 0 60%, transparent 61%),
              radial-gradient(ellipse at 80% 100%, #1a3b4a 0 55%, transparent 56%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px max(16px, env(safe-area-inset-right, 0px)) 72px max(16px, env(safe-area-inset-left, 0px));
}
.hero-title {
  margin: 0;
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: 1.1;
  letter-spacing: .08em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.hero-sub { margin: 8px 0 0; color: #d9eef0; font-style: italic; letter-spacing: .06em; }

/* カテゴリ帯 */
.cat-nav { background: var(--ink-2); border-top: 1px solid rgba(255,255,255,.08); }
.cat-nav ul {
  list-style: none;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav ul::-webkit-scrollbar { display: none; }
.cat-nav li { flex: 1 0 auto; }
.cat-nav a {
  display: block;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.cat-nav a:hover { background: rgba(255,255,255,.08); }

/* ===== トップ ===== */
main { padding-block: 24px 48px; }
.cat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cat-tile {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px;
  padding: 8px;
  border-radius: 6px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15);
}
.cat-tile:hover { filter: brightness(1.08); }

.top-search { display: flex; gap: 8px; margin-top: 16px; }
.top-search input, .search-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--paper);
}
.top-search button, .search-row button {
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.section { margin-top: 28px; }
.section-title {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 5px solid var(--accent);
  font-size: 1.15rem;
  line-height: 1.4;
}
.slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(270px, 80vw);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.slider .card { scroll-snap-align: start; }

/* 2段組 */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; margin-top: 28px; align-items: start; }
.main-col { min-width: 0; }

/* 記事カード */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--paper); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,30,40,.08); }
.card a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card a:hover h3 { color: var(--accent); }
.card-body { padding: 12px 14px 16px; }
.card h3 { margin: 6px 0; font-size: 1rem; line-height: 1.55; }
.excerpt {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 3px; background: var(--c); color: #fff; font-weight: 700; font-size: .72rem; }

/* 画像の無い記事の文字サムネイル（16:9） */
.thumb { aspect-ratio: 16 / 9; max-width: 100%; background: var(--line); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-text {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
  color: #fff;
}
.thumb-cat { font-size: 11px; font-weight: 700; letter-spacing: .08em; opacity: .85; }
.thumb-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== サイドバー ===== */
.sidebar { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.side-box { background: var(--paper); border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(20,30,40,.08); }
.side-title { display: block; margin: 0 0 10px; font-size: .95rem; font-weight: 700; }
.search-row { display: flex; gap: 6px; }
.search-row button { padding: 8px 12px; }
.side-cats, .side-recent { list-style: none; margin: 0; padding: 0; }
.side-cats a { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; }
.side-cats a:hover { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.count { margin-left: auto; color: var(--muted); font-size: .8rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.side-recent li { border-bottom: 1px dashed var(--line); }
.side-recent a { display: block; padding: 8px 0; color: var(--ink); text-decoration: none; font-size: .88rem; line-height: 1.55; }
.side-recent a:hover { color: var(--accent); }
.side-recent time { display: block; color: var(--muted); font-size: .72rem; }
.empty { color: var(--muted); font-size: .9rem; }

/* ===== 記事ページ ===== */
.post { background: var(--paper); border-radius: 8px; padding: 24px clamp(16px, 4vw, 40px) 36px; box-shadow: 0 1px 3px rgba(20,30,40,.08); }
.breadcrumb { font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.post-title, .page-title { margin: 10px 0 20px; font-size: clamp(1.4rem, 4vw, 1.9rem); line-height: 1.45; text-wrap: balance; }
.page-title { display: flex; align-items: baseline; gap: 12px; }
.page-title .count { margin-left: 0; font-size: .9rem; }
.post-body { max-width: 720px; }
.post-body h2 {
  margin: 2.4em 0 1em;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
  font-size: 1.25rem;
  line-height: 1.5;
}
.post-body h3 { margin: 2em 0 .8em; padding-bottom: 6px; border-bottom: 2px solid var(--accent); font-size: 1.1rem; }
.post-body h4 { margin: 1.6em 0 .6em; font-size: 1rem; }
.post-body p { margin: 0 0 1.4em; }
.post-body ul, .post-body ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.post-body blockquote { margin: 0 0 1.4em; padding: 12px 16px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 4px; }
.post-body blockquote p { margin: 0; }
.post-body img { border-radius: 6px; margin: 0 auto 1.4em; }
.post-body code { padding: 1px 6px; background: var(--bg); border-radius: 4px; font-size: .9em; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.post-body strong { background: linear-gradient(transparent 62%, #ffe08a 62%); }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; margin-bottom: 1.4em; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; }
.related { margin-top: 40px; }
.search-status { color: var(--muted); font-size: .9rem; }

/* ===== フッター ===== */
.site-footer { background: var(--ink); color: #c7ced8; font-size: .85rem; padding-block: 32px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: #fff; }
.footer-name { font-family: var(--font-logo); font-weight: 800; font-size: 1.3rem; color: #fff; }
.copy { margin-top: 14px !important; font-size: .75rem; }
.to-top {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* ===== スマホ・タブレット ===== */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .cat-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .hero-inner { padding-top: 36px; padding-bottom: 56px; }
  .cat-tile { min-height: 52px; font-size: .85rem; }
  .post-body h2 { font-size: 1.12rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
