/* ===== THEME ===== */
:root{
  --max: 840px; --space: 20px;
  --bg:#fbfaf7; --ink:#231f1a; --muted:#7a7067; --line:#e8e2da; --accent:#6b4e2e;
  --radius:14px; --shadow: 0 1px 0 rgba(70,50,20,.06);
}

/* ===== Base ===== */
*{ box-sizing:border-box }
html,body{ margin:0; }
body{
  background:var(--bg); color:var(--ink);
  font-family: Inter, system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height:1.9;  /* 本文の行間をゆったり */
}
body {
  position: relative;
  background-color: var(--bg);
  z-index: 0;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url("assets/logo.blue.png") no-repeat left center;
  background-size: 60%;   /* ←ここでロゴの大きさ調整 */
  opacity: 0.1;           /* ←透け感20% */
  z-index: -1;
  pointer-events: none;
}
.wrap{ max-width:var(--max); margin:0 auto; padding:0 var(--space); }
section{ padding:56px 0; }

/* ===== Header / Nav ===== */
.site-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0; border-bottom:1px solid var(--line);
}
.brand{
  display:block;
  font-size:1.5rem;
  font-weight:600;
  letter-spacing:.06em;
  text-decoration:none;
  color:inherit;
}
.brand .subtitle{
  display:block;
  font-size:.85rem;
  font-weight:400;
  color:#555;
  margin-top:.2em;
}
.nav{ display:flex; gap:14px; flex-wrap:wrap; }
.nav a{
  text-decoration:none; color:#333; padding:6px 8px; border-radius:8px;
}
.nav a:hover{ background:rgba(0,0,0,.04); }

/* ===== Typography ===== */
h1,h2{
  font-family:"Noto Serif JP", serif;
  margin:0 0 8px;
  line-height:1.35;   /* 見出しはやや詰め気味でメリハリ */
  letter-spacing:.02em;
}
.sub{
  display:block; font:600 .88rem/1 Inter, system-ui, -apple-system, sans-serif;
  letter-spacing:.22em; text-transform:uppercase; color:var(--muted);
}
.lead{ color:#333; max-width:72ch; margin-top:6px; }

/* ===== Links ===== */
a{ color:var(--accent); }
a:hover{ text-decoration:underline; text-underline-offset:2px; }

/* ===== Cards / Grids ===== */
.grid{ display:grid; gap:18px; }
.grid.two, .grid.three{ grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
.card{
  display:block; padding:12px; text-decoration:none; color:inherit;
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow);
}
.card img{ width:100%; height:160px; object-fit:cover; border-radius:10px; }
.card h3{ margin:8px 0 4px; font-size:1.05rem; }
.card p{ margin:0; color:var(--muted); }

/* ===== Figures / Media ===== */
figure{ margin:0; }
figure img{
  width:100%; height:auto; display:block; border-radius:var(--radius);
  filter:saturate(.92) contrast(1.02);
}
figcaption{ margin-top:10px; color:var(--muted); font-size:.92rem; }

/* ===== News (Lists) ===== */
.news-preview{ padding-top:8px; }
.news-preview h2{ margin-bottom:8px; }

.posts{ list-style:none; padding:0; margin:0; border-top:1px solid var(--line); }
.posts li{
  display:flex; gap:14px; align-items:baseline;
  padding:14px 0; border-bottom:1px solid var(--line);
}
.posts li:last-child{ border-bottom:0; }
.post-meta{ color:var(--muted); font-size:.95rem; white-space:nowrap; }
.post-link{ text-decoration:none; color:inherit; }
.post-link:hover{ text-decoration:underline; text-underline-offset:2px; }
.more{ margin-top:12px; }

/* ===== Footer (Simple ver.) ===== */
.site-footer{
  border-top:1px solid var(--line);
  padding:40px 0 60px;
  color:var(--muted);
}
.footer-grid{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:16px;
}
.footer-brand strong{ color: var(--ink); }
.footer-sub{ font-size:.9rem; margin-top:4px; }
.to-top{
  border:1px solid var(--line);
  background:#fff;
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  font:inherit;
}
.to-top:hover{ background:rgba(0,0,0,.04); }
.footer-copy{
  display:block;
  text-align:center;
  margin-top:24px;
}
@media (max-width: 720px){
  .footer-grid{ gap:12px; }
}

/* ===== Utilities ===== */
hr.sep{ border:0; border-top:1px solid var(--line); margin:36px 0; }

/* ---- トップ強化（Hero / Gate / News） ---- */
.hero{ padding:48px 0 24px; }
.hero h1{ font-size:clamp(28px, 4vw, 40px); }
.hero .lead{ margin-top:8px; }
.gate{ padding-top:24px; }

/* スキップリンク（アクセシビリティ） */
.skip{ position:absolute; left:-999px; top:auto; }
.skip:focus{ left:8px; top:8px; background:#fff; border:2px solid #000; padding:8px; z-index:1000; }

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark){
  body{ background:#0f1115; color:#eaeaea; }
  .brand, .nav a{ color:#eaeaea; }
  .nav a:hover{ background:#151922; }
  .site-header, .site-footer{ border-color:#242938; }
  .card{ border-color:#242938; }
  .sub, .lead, figcaption, .post-meta{ color:#b9c0d0; }
}

/* === ヘッダーを最上部固定・横一列 === */
.site-header{
  position: sticky; /* ずっと上に貼り付く。完全固定なら fixed に */
  top: 0; z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.1) blur(2px); /* 対応ブラウザで少しリッチに */
}
.site-header .wrap{ padding: 10px var(--space); }

.nav.nav-top{
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: nowrap;           /* 一列 */
  overflow-x: auto; overscroll-behavior-x: contain; /* 幅が狭いときは横スクロール */
  scrollbar-width: none;                   /* Firefoxのスクロールバー非表示（任意） */
}
.nav.nav-top::-webkit-scrollbar{ display: none; } /* Safari/Chrome 非表示 */

.nav.nav-top a{
  white-space: nowrap;                     /* 折り返さない */
  text-decoration: none;
  color: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: .95rem;                       /* 既存より少し小さめ */
}
.nav.nav-top a:hover{ background: rgba(0,0,0,.05); }

/* ヒーロー（サイト名＋サブタイトル＋画像） */
.hero-site{
  padding: 28px 0 18px;
}
.hero-site h1{
  margin: 0;
  font-size: clamp(24px, 4.2vw, 40px);
  line-height: 1.25;
}
.hero-site .sub{
  margin-top: 6px;
}
.hero-site .hero-image{
  margin-top: 16px;
  border-radius: var(--radius);
  width: 100%; height: auto; display: block;
  object-fit: cover;
}

/* ヘッダーがstickyで上に重ならないよう、余白を少し上げる */
main.wrap, .wrap main{ padding-top: 6px; }

/* ダークモードでヘッダーの背景を少し濃く */
@media (prefers-color-scheme: dark){
  .site-header{ background: #0f1115e6; }
  .nav.nav-top a:hover{ background:#151922; }
}
/* --- Hero under header --- */
.hero-site{ padding: 28px 0 18px; }
.hero-site h1{ margin: 0; font-size: clamp(24px, 4.2vw, 40px); line-height: 1.25; }
.hero-site .sub{ margin-top: 6px; }

.hero-image{
  margin-top: 16px;
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
  /* 任意：一定のアスペクト比でトリミングしたい場合 */
  /* aspect-ratio: 16 / 9; height: auto; */
}

/* sticky header に飲み込まれないよう微調整 */
.site-header{ position: sticky; top: 0; z-index: 1000; background: var(--bg); border-bottom:1px solid var(--line); }
.site-header .wrap{ padding: 10px var(--space); }
.nav.nav-top{ display:flex; justify-content:center; gap:12px; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
.nav.nav-top::-webkit-scrollbar{ display:none; }
.nav.nav-top a{ white-space:nowrap; padding:6px 10px; border-radius:8px; font-size:.95rem; }
.nav.nav-top a:hover{ background:rgba(0,0,0,.05); }
@media (prefers-color-scheme: dark){
  .site-header{ background:#0f1115e6; }
  .nav.nav-top a:hover{ background:#151922; }
}
/* --- Hero central alignment --- */
.hero-site{
  padding: 28px 0 18px;
  text-align: center;       /* ←中央揃え */
}

.hero-site h1{
  margin: 0;
  font-size: clamp(24px, 4.2vw, 40px);
  line-height: 1.25;
}

.hero-site .sub{
  margin-top: 6px;
  display: block;           /* サブタイトルも改行して中央揃え */
}

.hero-site .hero-image{
  margin: 16px auto 0;      /* 画像を中央に */
  width: auto;              /* 横幅は自然サイズ */
  max-width: 100%;          /* 画面からはみ出さないように */
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
}
/* ===== Header / Nav ===== */
.site-header{
  display:flex;
  justify-content:center; /* ← スマホ中央寄せに */
  padding:14px 0;
  border-bottom:1px solid var(--line);
  overflow-x:auto;        /* ← 横スクロール許可 */
}

.nav{
  display:flex;
  gap:14px;
  flex-wrap:nowrap;       /* ← 折り返しなし */
}

.nav a{
  text-decoration:none;
  color:#333;
  padding:6px 8px;
  border-radius:8px;
  white-space:nowrap;     /* ← 改行せず横スクロールに */
}

.nav::-webkit-scrollbar{ display:none; } /* ← スクロールバー非表示（iOS/Chrome） */
/* ===== Header / Nav (responsive) ===== */
.nav a{
  text-decoration:none;
  color:#333;
  padding:6px 8px;
  border-radius:8px;
  white-space:nowrap;
  font-size: 0.95rem; /* ← 基本サイズ少し小さめ */
}

/* スマホ画面用 (幅600px以下) */
@media (max-width: 600px){
  .nav{
    gap:8px;              /* 間隔を狭める */
  }
  .nav a{
    font-size: 0.7rem;     /* ← スマホ時にさらに小さく */
    padding:3px 5px;       /* 余白も少し縮める */
  }
}
.hero-site {    /＊画像中央揃え＊/
  text-align: center;
  margin: 40px auto;
}

.hero-site .hero-image {
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
  border-radius: 12px;
}
/* 小さめの中央寄せポートレート */
.hero-portrait {
  margin-top: 20px;
  text-align: center;
}

.hero-portrait .hero-image-small {
  display: block;
  margin: 0 auto;
  max-width: 200px;   /* ←ここで大きさ調整（例: 200px） */
  height: auto;
  border-radius: 0%; /* 丸くしたい場合。０で四角、50で正円。 */
}

.hero-portrait figcaption {
  margin-top: 9px;
  font-size: 0.95rem;
  color: var(--muted);
}
.hero-portrait .hero-image-small {
  display: block;
  margin: 0 auto;
  max-width: 200px;
  height: auto;
  border-radius: 0%;
  background: var(--bg);   /* ↑ページの背景色で塗る */
}
/* ===== Profile page custom ===== */
.profile-title {
  font-size: 2.2rem;   /* 漢字を大きくする */
  font-weight: 700;    /* 太字 */
  line-height: 1.3;
}

.profile-title span {
  font-size: 1.4rem;   /* 英語部分は少し小さめ */
  font-weight: 400;
  margin-left: 0.5em;
  color: var(--muted); /* 薄めの色 */
}
/* ===== Header / Nav ===== */
.site-header{
  display:flex;
  align-items:center;       /* ← ロゴとナビを縦中央に揃える */
  justify-content:space-between;
  padding:0 20px;           /* ← 左右余白 */
  height:68px;              /* ← index と同じ高さに固定 */
  border-bottom:1px solid var(--line);
  background:var(--bg);
  position:sticky;
  top:0;
  z-index:1000;
}

.brand img{
  height:56px;              /* ← ロゴの高さを調整 */
  display:block;
}

.nav{
  display:flex;
  gap:14px;
  flex-wrap:nowrap;
}

.nav a{
  text-decoration:none;
  color:#333;
  padding:6px 8px;
  border-radius:8px;
  white-space:nowrap;
  font-size:.95rem;
}

.nav a:hover{
  background:rgba(0,0,0,.04);
}
