/* =========================
   Base
========================= */
:root {
  color-scheme: light;

  /* Sticky nav offset */
  --nav-pad-y: 0.75rem;
  --nav-line: 1.2rem;
  --nav-offset: calc(var(--nav-pad-y) + var(--nav-line) + var(--nav-pad-y));
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-offset);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #111;
}

/* global links */
a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* =========================
   Navigation
========================= */
.nav {
  position: sticky;
  top: 0;
  background: #111827;
  padding: var(--nav-pad-y) 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
}

.nav a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

/* =========================
   Layout
========================= */
.header {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #1f2937;
  color: #fff;
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.75;
}

.footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #666;
}

/* =========================
   Headings
========================= */
h1 {
  margin: 0 0 1rem 0;
}

h2 {
  margin: 1.25rem 0 0.6rem 0;
}

/* =========================
   Card
========================= */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: #d1d5db;
}

/* Card variants */
.card-tight {
  padding: 1rem;
}

.h2-tight {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: none;
  padding-bottom: 0;
}

/* sub text */
.sub {
  margin-top: 0.25rem;
  font-size: 0.9em;
  line-height: 1.4;
  color: #6b7280;
}

/* =========================
   CV list (timeline)
========================= */
.cv {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.cv li {
  display: grid;
  grid-template-columns: 14em 1fr;
  gap: 1rem;
  padding: 0.25rem 0;
}

.cv li + li {
  margin-top: 0.35rem;
}

.cv .year {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.cv .org {
  color: #111827;
}

/* =========================
   Simple list
========================= */
.simple {
  margin: 0.25rem 0 1.25rem 0;
  padding-left: 1.1rem;
}

.simple li {
  margin: 0.35rem 0;
}

/* =========================
   Publications
========================= */
.pub {
  padding-left: 1.2rem;
  margin: 0.25rem 0 0.75rem 0;
}

.pub li {
  margin-bottom: 1.2rem;
  line-height: 1.75;
  padding-bottom: 0.2rem;
}

.pub-authors {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.pub-title {
  margin-left: 0.75rem;
  margin-bottom: 0.15rem;
}

.pub-meta {
  margin-left: 0.75rem;
  font-size: 0.9em;
  color: #4b5563;
}

.pub .author.me {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pub-meta a {
  word-break: break-word;
}

/* =========================
   Blog (notes)
========================= */
.card h2 a {
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}

.card h2 a:hover {
  text-decoration: underline;
}

.post-item + .post-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.post-title {
  margin: 0;
  font-size: 1.05rem;
}

.post-title a {
  color: #111827;
  text-decoration: none;
}

.post-title a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.post-excerpt {
  margin: 0.25rem 0 0 0;
  line-height: 1.7;
}

/* =========================
   Table of Contents (TOC)
========================= */
.toc {
  list-style: none;
  padding-left: 0;
}

.toc li {
  margin: 0.4rem 0;
}

.toc a {
  display: inline-block;
  color: #111827;
  text-decoration: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.toc a:hover,
.toc a:focus-visible {
  color: #2563eb;
  transform: scale(1.05);
}

.toc a:focus-visible {
  outline: none;
}

/* =========================
   Figures / Images
========================= */
.fig {
  margin: 0.75rem 0 1rem 0;
}

.fig img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.figcaption {
  margin-top: 0.4rem;
}

/* utility */
.breadcrumb {
  margin-top: 0.75rem;
}
.h2-space {
  margin-top: 1rem;
}
.note {
  margin-top: 0.6rem;
}

/* =========================
   Notes page utilities
========================= */
.notes-controls {
  margin: 0.75rem 0 1rem 0;
}

.notes-search {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
}

.notes-status {
  margin: 0.5rem 0 0 0;
}

.notes-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem 0;
}

.tag-chip {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.tag-chip.active {
  background: #111827;
  color: #fff;
}

.notes-year {
  margin-top: 1.25rem;
}

.post-header {
  margin-bottom: 0.75rem;
}

.post-h1 {
  margin-bottom: 0.25rem;
}

.post-meta {
  margin: 0;
}

.sep {
  margin: 0 0.35rem;
}

/* =========================
   Image link card (Home etc.)
========================= */
.card-link-image {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card-link-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.card-link-image:hover img {
  opacity: 0.92;
}

.card-link-caption {
  line-height: 1.4;
}

.card-link-image.wepp-hero img {
  max-height: 280px;          /* ← ここが効く */
  object-fit: cover;          /* はみ出しをトリミング */
  object-position: center;    /* 中央基準 */
}

/* =========================
   Responsive (mobile)
========================= */
@media (max-width: 820px) {
  .header {
    padding: 2rem 1rem;
  }

  .container {
    margin: 1.25rem auto;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  h2 {
    margin-top: 1rem;
  }

  .cv li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .cv .year {
    white-space: normal;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
  }

  .cv .org {
    line-height: 1.6;
  }

  /* mobile nav tends to become taller if it wraps */
  :root {
    --nav-line: 1.4rem;
    --nav-offset: calc(var(--nav-pad-y) + var(--nav-line) + var(--nav-pad-y));
  }
}
